public void DisplayInfo(InfoPanel infoPanel, int health) { infoPanel.AddText($"Armor Rating: {armorRating}"); infoPanel.AddText($"Condition: {health}/{maxHealth}"); infoPanel.AddText($"Weight: {weight} ({ArmorType})"); infoPanel.AddText($"Value: {value}"); }
public override void Awake() { infoPanel = GetComponent <InfoPanel>(); requestCode = RequestCode.Info; actionCode = ActionCode.TaskInfo; base.Awake(); }
public void Zapis() { objekt = GameObject.Find("Infopanel"); // načíta infopanel do objektu inf = objekt.GetComponent(typeof(InfoPanel)) as InfoPanel; // pretipuje objekt na infopanel string conn = "URI=file:" + Application.dataPath + "/Databaza.db"; //Premenna na nacitanie miesta databazy IDbConnection dbconn; // premenna na nadviazanie spojenia s databazou dbconn = (IDbConnection) new SqliteConnection(conn); dbconn.Open(); //otvorenie komunikacie s databazou string sqlQuery; IDbCommand dbcmd = dbconn.CreateCommand(); // vytvorenie ulohy dbcmd.CommandType = System.Data.CommandType.Text; dbcmd.CommandText = "CREATE TABLE IF NOT EXISTS 'Highscore' ( " + " 'Name' TEXT NOT NULL, " + " 'Body' INTEGER NOT NULL" + ");"; dbcmd.ExecuteNonQuery(); sqlQuery = "INSERT INTO Highscore " + "Values ('" + meno + "'," + inf.body + ")"; //vloz udaje do tabulky dbcmd.CommandText = sqlQuery; dbcmd.ExecuteNonQuery(); //vykonaj ulohu //Debug.Log(" name =" + meno + " body =" + inf.body); dbcmd.Dispose(); //ukoncenie komunikacie a vyprazdnenie premennych dbcmd = null; dbconn.Close(); dbconn = null; }
private void Start() { outline = GetComponent <EPOOutline.Outlinable>(); controller = BoidsController.Instance; infoPanel = InfoPanel.Instance; SetUniqueData(); }
private void Awake() { panel = GameObject.FindObjectOfType<InfoPanel>(); StartCoroutine(SceneFader.Instance.FadeIn(1f)); StartCoroutine(Twinkle()); }
public void Start() { scriptManager = GameObject.Find("ScriptManager").GetComponent<ScriptManager>(); guiController = scriptManager.guiController; turnController = scriptManager.turnController; infopanel = scriptManager.infopanel; }
public void StartGame(int Mode) { StartGameMenu.SetActive(false); GameUIPanel.SetActive(true); WinnerPanel.SetActive(false); InfoPanel.SetActive(true); Main.HideBackgroundElements(); switch (Mode) { case 1: Player2CtrlPanel.SetActive(false); break; case 2: Player2CtrlPanel.SetActive(true); break; case 3: Player2CtrlPanel.SetActive(false); break; } MenuCam.CameraMode = 2; GameMode = Mode; GameStartBtnPressed = true; }
// Use this for initialization void Start() { inventory = GameObject.FindGameObjectWithTag("Inventory"); info = GameObject.FindGameObjectWithTag("InfoPanel").GetComponent<InfoPanel>(); inv = inventory.GetComponent<Inventory>(); inventory.SetActive(false); }
public void HandleGameplayRenderer_Render(Player ply, Level currentLevel, InfoPanel infoPanel) { if (birdy == null && currentLevel != null && settings.EnableInfoPanel) { NewBirdy(ply, currentLevel, infoPanel); } else if (birdy != null && settings.EnableInfoPanel) { if (!settings.MirrorEnabled) { birdy.Sprite.Effects = Microsoft.Xna.Framework.Graphics.SpriteEffects.FlipHorizontally; birdy.Position = currentLevel.Camera.Position + new Vector2(infoPanel.uiPos.X, infoPanel.uiPos.Y - 182f); } else { birdy.Sprite.Effects = Microsoft.Xna.Framework.Graphics.SpriteEffects.None; birdy.Position = currentLevel.Camera.Position + new Vector2(-infoPanel.uiPos.X + 320f, infoPanel.uiPos.Y - 182f); } birdy.Sprite.Color = birdColor; birdy.Depth = -10000; if (currentLevel.Entities.AmountOf <BirdNPC>() < 2) { currentLevel.Add(birdy); } } }
void Start() { InfoPanel enemyPanel = GetComponentInParent <InfoPanel>(); infoTextImage = enemyPanel.infoTextHolder; infoName = enemyPanel.infoName; infoText = enemyPanel.infoText; }
/** * PaperInfo Button EventHandler. * Activates/Deactivates InfoPanel. */ public void PaperInfoHandler() { // Resets the InfoPanel to page 1, if it is being currently deactivated. if (InfoPanel.activeSelf) { InfoPanel.GetComponent <IInfoPanel>().reset(); } InfoPanel.SetActive(!InfoPanel.activeSelf); }
public override void onClick() { InfoPanel.setTextPanel("SOIL_INTRO"); LeftController.instance.infoPanel.enableExitButton(); GameObject.Find("OVRCameraRig").transform.position = new Vector3(631f, 100f, 359f); GameObject.Find("Soil Animation - 120516").GetComponent <Animation>().Rewind(); GameObject.Find("Soil Animation - 120516").GetComponent <Animation>().Play(); }
void Awake() { if (instance != null) { Debug.LogError("More than one InfoPanel in scene !"); return; } instance = this; }
public void SetTrainYardInfoTest1() { InfoPanel target = new InfoPanel(); // TODO: Initialize to an appropriate value TrackBlock b = null; // TODO: Initialize to an appropriate value target.SetTrainYardInfo(b); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public override void CreateInfo() { InfoPanel infoPanel = GameManager.instance.ui.infoPanel; infoPanel.Clear(); infoPanel.AddTitle("Island"); infoPanel.AddResources(res); }
public static void Init() { infoPanel = new InfoPanel(); AssignVariables(); CreatePhraseToGuess(); CreateIndividuals(Config.nIndividuals); }
private void Start() { instance = this; optionPanel = GameObject.Find("OptionsPane").GetComponent <OptionPanel>(); mapPanel = GameObject.Find("MapPane").GetComponent <MapPanel>(); infoPanel = GameObject.Find("InfoPane").GetComponent <InfoPanel>(); camera = GameObject.Find("OVRCameraRig"); }
public override void CreateInfo() { InfoPanel infoPanel = GameManager.instance.ui.infoPanel; infoPanel.Clear(); infoPanel.AddTitle("Dock"); infoPanel.AddResources(res); infoPanel.AddHealthBar(health); }
public InfoPanel(InfoPanel Base) : this((UIElement)Base) { IsExpanded = Base?.IsExpanded; HeaderButtonExpand = Base?.HeaderButtonExpand; HeaderLabel = Base?.HeaderLabel; ExpandedContentLabel = Base?.ExpandedContentLabel; }
public void CreateBall() { Ball ball = Instantiate(ballPrefab); InfoPanel infoPanel = Instantiate(infoPanelPrefab); infoPanel.transform.parent = canvas.transform; ball.InfoPanel = infoPanel; ball.transform.position = new Vector3(Random.Range(-20, 10), 0, Random.Range(-20, 10)); }
public override void OnPointerEnter(PointerEventData data) { // TODO: Delete this: Debug.Log("id is: " + id.ToString()); Selected = true; // TODO: Configure output based on id? InfoPanel.SetInfoTarget(this); InfoPanel.Show(); }
public void UpdateDisplayTest1() { InfoPanel target = new InfoPanel(); // TODO: Initialize to an appropriate value List <TrackBlock> blocks = null; // TODO: Initialize to an appropriate value List <ITrain> trains = null; // TODO: Initialize to an appropriate value target.UpdateDisplay(blocks, trains); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
// Use this for initialization void Awake() { gameOptions = GameObject.FindGameObjectWithTag("Player").GetComponent <GameOptions>(); inventory = GameObject.FindGameObjectWithTag("Inventory").GetComponent <Inventory>(); database = GameObject.FindGameObjectWithTag("ItemDatabase").GetComponent <ItemDatabase>(); infoPanel = GameObject.FindGameObjectWithTag("InfoPanel").GetComponent <InfoPanel>(); textPanel = GameObject.FindGameObjectWithTag("TextPanel").GetComponent <TextPanel>(); this.gameObject.SetActive(false); }
public void DisplayInfo(InfoPanel infoPanel, int health) { infoPanel.AddText($"Type: {type}"); infoPanel.AddText($"Chop: {chopMin} - {chopMax}"); infoPanel.AddText($"Slash: {slashMin} - {slashMax}"); infoPanel.AddText($"Thrust: {thrustMin} - {thrustMax}"); infoPanel.AddText($"Condition: {health}/{maxHealth}"); base.DisplayInfo(infoPanel); }
public void SetInfoTest1() { InfoPanel target = new InfoPanel(); // TODO: Initialize to an appropriate value string name = string.Empty; // TODO: Initialize to an appropriate value Dictionary <string, string> information = null; // TODO: Initialize to an appropriate value target.SetInfo(name, information); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
private void HideAll() { InfoPanel.Hide(); DashboardPanel_DeliveryCodeLabel.Hide(); DashboardPanel_DeliveryCodeTextBox.Hide(); DashboardPanel_ValidateDeliveryButton.Hide(); DashboardPanel_ValidateContributionButton.Hide(); DashboardPanel_ApproveVolunteerButton.Hide(); }
void Start() { activeCamera = worldCameras[worldCameraIndex]; infoPanel = GameObject.Find("NPC_Info_Panel").GetComponent <InfoPanel>(); infoPanel.gameObject.SetActive(false); cameraDropdown.onValueChanged.AddListener(delegate { worldCameraIndex = cameraDropdown.value; }); }
public void SetInfo() { GameObject go = GameObject.Find("InfoPanel"); if (go != null) { InfoPanel info_pnel = go.GetComponent <InfoPanel>(); info_pnel.SetInvetoryInfo(this); } }
public void CloseInfo() { if (infoPanel == null) { return; } Destroy(infoPanel.gameObject); infoPanel = null; }
void RpcInitiateFight() { //Debug.Log("RpcInititating fight with: " + this.gameObject); gameManager.fightingMonsters.Add(this.gameObject); ClientSetActiveCardButtons(false); PlayerInGame.localPlayerInGame.progressButton.ActivateButton(); HelpButton.Activate(); LevelCounter.OnStartFight(); InfoPanel.Alert("Fight with " + cardValues.name + " starts!"); }
public void ChangePanelPosition() { Vector3 screenPos = Manager.StaticManager.ActiveCamera.WorldToScreenPoint(transform.position); Vector3 rect = new Vector3(InfoPanel.GetComponent <RectTransform>().rect.width, InfoPanel.GetComponent <RectTransform>().rect.height, 0); Manager.PrintToPanel("pos", screenPos); Manager.PrintToPanel("rect", rect); InfoPanel.GetComponent <RectTransform>().position = new Vector2(screenPos.x + rect.x / 2, screenPos.y + rect.y / 2); }
protected void RefreshInfo() { Info = new InfoPanel( new Dictionary <Text, Text>() { { new Text(Vector2.One, "Name: ", Color.White), new Text(Vector2.One, data.Name, Color.White) }, { new Text(Vector2.One, "Health: ", Color.White), new Text(Vector2.One, data.Health.ToString(), Color.White) }, { new Text(Vector2.One, "Descr: ", Color.White), new Text(Vector2.One, data.Descr.ToString(), Color.White) } }, type.Texture, Vector2.Zero); }
public void ShowInfoPanel(string info) { InfoPanel ip = infoPanel.GetComponent <InfoPanel>(); ip.SetInfo(info); //string txt = infoPanel.GetComponent<Text>().text; infoPanel.SetActive(true); testTxt.text = info; //infoPanel.GetComponent<Text>().text = info; }
public override void Refresh() { base.Refresh(); if (null == m_game) return; PlayPanel panel = null; InfoPanel info = null; int padX = 20, padY = 20; int i = 0; foreach (Player player in m_game.Players.Values) { info = player.InfoPanel; if (null != info) { info.Show(i * (info.Width + padX) + padX, padY + 20); } panel = player.PlayFiled; if (null != panel) { panel.Show(i * (panel.Width + padX) + padX, info.Bottom + padY); } i++; } if (m_game.GameType == EnumGameType.Client || m_game.GameType == EnumGameType.Host) { if (m_networkGameInfoPanel == null) m_networkGameInfoPanel = new InfoPanel(m_gameContainer); // adjust NetworkGameInfoPanel size depends on last panel info = m_networkGameInfoPanel; info.Width = panel.Right - padX; info.Height = 100; info.Show(padX, panel.Bottom + padY); this.Height = info.Bottom + padY + 20; this.Width = info.Right + padX + 10; } else if (null != panel) { if (null != m_networkGameInfoPanel) { m_networkGameInfoPanel.Dispose(); m_networkGameInfoPanel = null; } // adjust form size depends on last panel. this.Height = panel.Bottom + padY + 40; this.Width = panel.Right + padX + 10; } this.ShowGameInfo(); this.Invalidate(); }
/// <summary> /// Constructor /// </summary> public Generator() { GeneratedDescription = string.Empty; strategyBest = Data.Strategy.Clone(); bestValue = isOOS ? Backtester.Balance(barOOS) : Backtester.NetBalance; isGenerating = false; isStartegyChanged = false; indicatorBlackList = new List<string>(); colorText = LayoutColors.ColorControlText; toolStrip = new ToolStrip(); strategyField = new StrategyLayout(strategyBest); pnlCommon = new FancyPanel(Language.T("Common")); pnlCriteriaBase = new FancyPanel(Language.T("Acceptance Criteria")); criteriaPanel = new ScrollFlowPanel(); criteriaControls = new CriteriaControls(); pnlSettings = new FancyPanel(Language.T("Settings")); pnlSorting = new FancyPanel(Language.T("Custom Sorting")); pnlTop10 = new FancyPanel(Language.T("Top 10")); pnlIndicators = new FancyPanel(Language.T("Indicators")); balanceChart = new SmallBalanceChart(); infpnlAccountStatistics = new InfoPanel(); progressBar = new ProgressBar(); lblCalcStrInfo = new Label(); lblCalcStrNumb = new Label(); lblBenchmarkInfo = new Label(); lblBenchmarkNumb = new Label(); btnAccept = new Button(); btnGenerate = new Button(); btnCancel = new Button(); chbGenerateNewStrategy = new CheckBox(); chbPreserveSameDirAction = new CheckBox(); chbPreserveOppDirAction = new CheckBox(); chbPreservePermSL = new CheckBox(); chbPreservePermTP = new CheckBox(); chbPreserveBreakEven = new CheckBox(); chbInitialOptimization = new CheckBox(); nudWorkingMinutes = new NumericUpDown(); chbWorkingMinutes = new CheckBox(); MaximizeBox = false; Icon = Data.Icon; FormBorderStyle = FormBorderStyle.FixedDialog; BackColor = LayoutColors.ColorFormBack; AcceptButton = btnGenerate; Text = Language.T("Strategy Generator") + " - " + Data.Symbol + " " + Data.PeriodString + ", " + Data.Bars + " " + Language.T("bars"); FormClosing += GeneratorFormClosing; // Tool Strip toolStrip.Parent = this; toolStrip.Dock = DockStyle.Top; toolStrip.AutoSize = true; // Creates a Strategy Layout strategyField.Parent = this; strategyField.ShowAddSlotButtons = false; strategyField.ShowRemoveSlotButtons = false; strategyField.ShowPadlockImg = true; strategyField.SlotPropertiesTipText = Language.T("Lock or unlock the slot."); strategyField.SlotToolTipText = Language.T("Lock, link, or unlock the slot."); pnlCommon.Parent = this; pnlCriteriaBase.Parent = this; pnlSettings.Parent = this; pnlSorting.Parent = this; pnlTop10.Parent = this; pnlIndicators.Parent = this; // Small Balance Chart balanceChart.Parent = this; balanceChart.BackColor = LayoutColors.ColorControlBack; balanceChart.Visible = true; balanceChart.Cursor = Cursors.Hand; balanceChart.IsContextButtonVisible = true; balanceChart.PopUpContextMenu.Items.AddRange(GetBalanceChartContextMenuItems()); balanceChart.Click += AccountOutputClick; balanceChart.DoubleClick += AccountOutputClick; toolTip.SetToolTip(balanceChart, Language.T("Show account statistics.")); balanceChart.SetChartData(); // Info Panel Account Statistics infpnlAccountStatistics.Parent = this; infpnlAccountStatistics.Visible = false; infpnlAccountStatistics.Cursor = Cursors.Hand; infpnlAccountStatistics.IsContextButtonVisible = true; infpnlAccountStatistics.PopUpContextMenu.Items.AddRange(GetInfoPanelContextMenuItems()); infpnlAccountStatistics.Click += AccountOutputClick; infpnlAccountStatistics.DoubleClick += AccountOutputClick; toolTip.SetToolTip(infpnlAccountStatistics, Language.T("Show account chart.")); // ProgressBar progressBar.Parent = this; progressBar.Minimum = 1; progressBar.Maximum = 100; progressBar.Step = 1; //Button Generate btnGenerate.Parent = this; btnGenerate.Name = "Generate"; btnGenerate.Text = Language.T("Generate"); btnGenerate.Click += BtnGenerateClick; btnGenerate.UseVisualStyleBackColor = true; //Button Accept btnAccept.Parent = this; btnAccept.Name = "Accept"; btnAccept.Text = Language.T("Accept"); btnAccept.Enabled = false; btnAccept.DialogResult = DialogResult.OK; btnAccept.UseVisualStyleBackColor = true; //Button Cancel btnCancel.Parent = this; btnCancel.Text = Language.T("Cancel"); btnCancel.DialogResult = DialogResult.Cancel; btnCancel.UseVisualStyleBackColor = true; // BackgroundWorker bgWorker = new BackgroundWorker {WorkerReportsProgress = true, WorkerSupportsCancellation = true}; bgWorker.DoWork += BgWorkerDoWork; bgWorker.ProgressChanged += BgWorkerProgressChanged; bgWorker.RunWorkerCompleted += BgWorkerRunWorkerCompleted; // Apply a Cryptographic Random Seed var rng = new RNGCryptoServiceProvider(); var rndBytes = new byte[4]; rng.GetBytes(rndBytes); int rand = BitConverter.ToInt32(rndBytes, 0); random = new Random(rand); SetButtonsStrategy(); SetButtonsGenerator(); SetPanelCommon(); SetCriteriaPanel(); SetPanelSettings(); SetPanelSorting(); SetPanelTop10(); SetPanelIndicators(); LoadOptions(); SetCustomSortingUI(); SetStrategyDescriptionButton(); chbHideFsb.CheckedChanged += HideFSBClick; if (Data.AutostartGenerator) BtnGenerateClick(this, new EventArgs()); }
/// <summary> /// Constructor /// </summary> public Generator() { GeneratedDescription = string.Empty; _strategyBest = Data.Strategy.Clone(); _bestBalance = _isOOS ? Backtester.Balance(_barOOS) : Backtester.NetBalance; _isGenerating = false; _isStartegyChanged = false; _indicatorBlackList = new List<string>(); ColorText = LayoutColors.ColorControlText; TsStrategy = new ToolStrip(); TsGenerator = new ToolStrip(); StrategyField = new StrategyLayout(_strategyBest); PnlCommon = new FancyPanel(Language.T("Common")); PnlLimitations = new FancyPanel(Language.T("Limitations")); PnlSettings = new FancyPanel(Language.T("Settings")); PnlTop10 = new FancyPanel(Language.T("Top 10")); PnlIndicators = new FancyPanel(Language.T("Indicators")); BalanceChart = new SmallBalanceChart(); InfpnlAccountStatistics = new InfoPanel(); ProgressBar = new ProgressBar(); LblCalcStrInfo = new Label(); LblCalcStrNumb = new Label(); BtnAccept = new Button(); BtnGenerate = new Button(); BtnCancel = new Button(); ChbGenerateNewStrategy = new CheckBox(); ChbPreservePermSL = new CheckBox(); ChbPreservePermTP = new CheckBox(); ChbPreserveBreakEven = new CheckBox(); ChbInitialOptimization = new CheckBox(); NudWorkingMinutes = new NumericUpDown(); LblWorkingMinutes = new Label(); MaximizeBox = false; Icon = Data.Icon; FormBorderStyle = FormBorderStyle.FixedDialog; BackColor = LayoutColors.ColorFormBack; AcceptButton = BtnGenerate; Text = Language.T("Strategy Generator") + " - " + Data.Symbol + " " + Data.PeriodString + ", " + Data.Bars + " " + Language.T("bars"); FormClosing += GeneratorFormClosing; // Tool Strip Strategy TsStrategy.Parent = this; TsStrategy.Dock = DockStyle.None; TsStrategy.AutoSize = false; // Tool Strip Generator TsGenerator.Parent = this; TsGenerator.Dock = DockStyle.None; TsGenerator.AutoSize = false; // Creates a Strategy Layout StrategyField.Parent = this; StrategyField.ShowAddSlotButtons = false; StrategyField.ShowRemoveSlotButtons = false; StrategyField.ShowPadlockImg = true; StrategyField.SlotPropertiesTipText = Language.T("Lock or unlock the slot."); StrategyField.SlotToolTipText = Language.T("Lock, link, or unlock the slot."); PnlCommon.Parent = this; PnlLimitations.Parent = this; PnlSettings.Parent = this; PnlTop10.Parent = this; PnlIndicators.Parent = this; // Small Balance Chart BalanceChart.Parent = this; BalanceChart.BackColor = LayoutColors.ColorControlBack; BalanceChart.Visible = true; BalanceChart.Cursor = Cursors.Hand; BalanceChart.IsContextButtonVisible = true; BalanceChart.PopUpContextMenu.Items.AddRange(GetBalanceChartContextMenuItems()); BalanceChart.Click += AccountAutputClick; BalanceChart.DoubleClick += AccountAutputClick; toolTip.SetToolTip(BalanceChart, Language.T("Show account statistics.")); BalanceChart.SetChartData(); // Info Panel Account Statistics InfpnlAccountStatistics.Parent = this; InfpnlAccountStatistics.Visible = false; InfpnlAccountStatistics.Cursor = Cursors.Hand; InfpnlAccountStatistics.IsContextButtonVisible = true; InfpnlAccountStatistics.PopUpContextMenu.Items.AddRange(GetInfoPanelContextMenuItems()); InfpnlAccountStatistics.Click += AccountAutputClick; InfpnlAccountStatistics.DoubleClick += AccountAutputClick; toolTip.SetToolTip(InfpnlAccountStatistics, Language.T("Show account chart.")); // ProgressBar ProgressBar.Parent = this; ProgressBar.Minimum = 1; ProgressBar.Maximum = 100; ProgressBar.Step = 1; //Button Generate BtnGenerate.Parent = this; BtnGenerate.Name = "Generate"; BtnGenerate.Text = Language.T("Generate"); BtnGenerate.Click += BtnGenerateClick; BtnGenerate.UseVisualStyleBackColor = true; //Button Accept BtnAccept.Parent = this; BtnAccept.Name = "Accept"; BtnAccept.Text = Language.T("Accept"); BtnAccept.Enabled = false; BtnAccept.DialogResult = DialogResult.OK; BtnAccept.UseVisualStyleBackColor = true; //Button Cancel BtnCancel.Parent = this; BtnCancel.Text = Language.T("Cancel"); BtnCancel.DialogResult = DialogResult.Cancel; BtnCancel.UseVisualStyleBackColor = true; // BackgroundWorker BgWorker = new BackgroundWorker {WorkerReportsProgress = true, WorkerSupportsCancellation = true}; BgWorker.DoWork += BgWorkerDoWork; BgWorker.ProgressChanged += BgWorkerProgressChanged; BgWorker.RunWorkerCompleted += BgWorkerRunWorkerCompleted; SetButtonsStrategy(); SetButtonsGenerator(); SetPanelCommon(); SetPanelLimitations(); SetPanelSettings(); SetPanelTop10(); SetPanelIndicators(); LoadOptions(); SetStrategyDescriptionButton(); ChbHideFsb.CheckedChanged += HideFSBClick; }