private void SecondaryForm_Load(object sender, EventArgs e) { var stats = new StatsPanel(this); Controls.Add(stats); stats.Dock = DockStyle.Fill; }
private void LayoutScreen() { var levelBlockHeight = (int)(screen.Height * 0.8); var levelBlockWidth = (int)(screen.Width * 0.6); var statsBlockHeight = (int)(levelBlockHeight * 0.6); levelViewportPanel = new LevelViewportPanel(new ScreenZone(-1, -1, levelBlockWidth, levelBlockHeight), screen, () => level); messagesPanel = new MessagesPanel( new ScreenZone(-1, levelBlockHeight - 2, screen.Width + 2, screen.Height - levelBlockHeight + 2), screen); statsPanel = new StatsPanel( new ScreenZone(levelBlockWidth - 2, -1, screen.Width - levelBlockWidth + 2, statsBlockHeight), screen, () => level?.Player); infoPanel = new InfoPanel( new ScreenZone(levelBlockWidth - 2, statsBlockHeight - 2, screen.Width - levelBlockWidth + 2, levelBlockHeight - statsBlockHeight + 1), screen, () => level, () => levelViewportPanel.TranslateCoords(cursorLeft - levelViewportPanel.ClientZone.Left, cursorTop - levelViewportPanel.ClientZone.Top)); }
public void Init() { this.statsPanel = GetComponent <StatsPanel>(); columnsList = Enum.GetValues(typeof(Columns)).Cast <Columns>().ToList(); rowsList = Enum.GetValues(typeof(Rows)).Cast <Rows>().ToList(); statsPanel.PopulateTable(columnsList.Count, rowsList.Count, 240, 240); //NOTE(Brian): Top-left cell, unused. statsPanel.SetCellText(0, 0, ""); //NOTE(Brian): Row stuff (left vertical header) statsPanel.SetCellText(0, (int)Rows.SHARED_OBJECTS_COUNT, SHARED_OBJECTS_COUNT_TEXT); statsPanel.SetCellText(0, (int)Rows.COMPONENT_OBJECTS_COUNT, COMPONENT_OBJECTS_COUNT_TEXT); statsPanel.SetCellText(0, (int)Rows.ENTITY_OBJECTS_COUNT, ENTITY_OBJECTS_COUNT_TEXT); statsPanel.SetCellText(0, (int)Rows.BREAK_0, BREAK_0_TEXT); statsPanel.SetCellText(0, (int)Rows.MATERIAL_COUNT, MATERIAL_COUNT_TEXT); statsPanel.SetCellText(0, (int)Rows.MESHES_COUNT, MESHES_COUNT_TEXT); statsPanel.SetCellText(0, (int)Rows.BREAK_1, BREAK_1_TEXT); statsPanel.SetCellText(0, (int)Rows.GLTF_BEING_LOADED, GLTF_BEING_LOADED_TEXT); statsPanel.SetCellText(0, (int)Rows.AB_BEING_LOADED, AB_BEING_LOADED_TEXT); statsPanel.SetCellText(0, (int)Rows.MESSAGES_PER_SECOND_REAL, MESSAGES_PER_SECOND_REAL_TEXT); statsPanel.SetCellText(0, (int)Rows.RENDERER_UNLOCK_SEGS, RENDERER_UNLOCK_TEXT); statsPanel.SetCellText(0, (int)Rows.MESSAGE_BUSES, MESSAGES_BUSES_TEXT); }
void Start() { UIManager = GameObject.Find("UIManager"); unequippedItems = UIManager.GetComponent <JsonLoadItem>().unequippedItems; equippedItems = UIManager.GetComponent <JsonLoadItem>().equippedItems; // characterStat = UIManager.GetComponent<JsonLoadItem>().characterStat; characterStats = UIManager.GetComponent <JsonLoadItem>().characterStats; print("character awake"); equippedItemStat = new EquippableItem(); GameObject Stat_Panel = GameObject.FindWithTag("StatsPanel"); statsPanel = Stat_Panel.GetComponent <StatsPanel>(); statModifier = Stat_Panel.GetComponent <StatModifier>(); GameObject Character_Level = GameObject.FindWithTag("CharacterLevel"); characterLevel = Character_Level.GetComponent <CharacterLevel>(); allEquippedItems = UIManager.GetComponent <JsonLoadItem>().allEquippedItems; charID = UIManager.GetComponent <JsonLoadItem>().charID; charImage.sprite = Resources.Load <Sprite>("CharacterDB/" + charID); statsPanel.setCharacterStatValuesUI(characterStats[charID]); statModifier.setInitialItemStatUI(allEquippedItems[charID], characterStats[charID]); characterLevel.setCharacterLevelUI(characterStats[charID]); // loadCharacterUI(); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); console = new Texture2D(GraphicsDevice, 1, 1); infoPanel = new InfoPanel(console); keysPanel = new KeysPanel(console); statsPanel = new StatsPanel(console); Textures.LoadTextures(Content); Point visibleTiles = new Point( (SCREEN_HEIGHT - 170) / Map.TILE_SIZE, (SCREEN_WIDTH - 320) / Map.TILE_SIZE); this.map = new Map( Tools.GenerateMap(40, 40, Textures.MapFloor, Textures.MapWall), visibleTiles); this.fieldOfView = new FieldOfView <ITile>(this.map.Tiles); // Creates a new unit with flag IsPlayerControl, and spawns it at map/point. this.player = new Player(Textures.Player, this.map, Point.Zero); unitList.Add(player as GameUnit); Tools.GenerateEnemy(this.map); Tools.GenerateItems(this.map); }
private void Awake() { if (statsPanel == null) { statsPanel = FindObjectOfType <StatsPanel> (); } if (inventory == null) { inventory = FindObjectOfType <Inventory> (); } if (equipmentPanel == null) { equipmentPanel = FindObjectOfType <EquipmentPanel> (); } if (activeItemSlot == null) { activeItemSlot = FindObjectOfType <ActiveItemSlot> (); } statsPanel.SetStats(Power, Defanse, Range); statsPanel.UpdateStatValues(); statsPanel.UpdateStatNames(); SetStats(); inventory.OnItemClickEvent += EquipFromInventory; equipmentPanel.OnItemClickEnvet += UnequipFromEquipPanel; }
private void buttonStats_Click(object sender, EventArgs e) { StatsPanel panel = new StatsPanel(); panelMain.Controls.Clear(); panelMain.Controls.Add(panel); }
private void ShowStatsPanel(IStatistic Statistic, Competitor[] tabsToShow) { StatsPanel panel = new StatsPanel(base.AssociatedForm, Statistic, tabsToShow); AddContentPanel(panel); panel.AddToolStrip(); FinishedAdding(); }
public void Init() { this.statsPanel = GetComponent <StatsPanel>(); columnsList = Enum.GetValues(typeof(Columns)).Cast <Columns>().ToList(); rowsList = Enum.GetValues(typeof(Rows)).Cast <Rows>().ToList(); statsPanel.PopulateTable(columnsList.Count, rowsList.Count, 240, 240); statsPanel.SetCellText((int)Columns.LABEL, (int)Columns.LABEL, ""); //Init Labels statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.PROCESSED_MESSAGES, PROCESSED_MESSAGES_TEXT); statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.PENDING_MESSAGES, PENDING_MESSAGES_TEXT); statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.BREAK_0, BREAK_0_TEXT); statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.CURRENT_SCENE, CURRENT_SCENE_TEST); statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.POLYGONS_VS_LIMIT, POLYGON_VS_LIMIT_TEXT); statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.TEXTURES_VS_LIMIT, TEXTURES_VS_LIMIT_TEXT); statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.MATERIALS_VS_LIMIT, MATERIALS_VS_LIMIT_TEXT); statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.ENTITIES_VS_LIMIT, ENTITIES_VS_LIMIT_TEXT); statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.MESHES_VS_LIMIT, MESHES_VS_LIMIT_TEXT); statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.BODIES_VS_LIMIT, BODIES_VS_LIMIT_TEXT); statsPanel.SetCellText((int)Columns.LABEL, (int)Rows.COMPONENT_OBJECTS_COUNT, COMPONENT_OBJECTS_COUNT_TEXT); //Init Values statsPanel.SetCellText((int)Columns.VALUE, (int)Rows.PROCESSED_MESSAGES, "=/="); statsPanel.SetCellText((int)Columns.VALUE, (int)Rows.PENDING_MESSAGES, "=/="); statsPanel.SetCellText((int)Columns.VALUE, (int)Rows.CURRENT_SCENE, "=/="); statsPanel.SetCellText((int)Columns.VALUE, (int)Rows.POLYGONS_VS_LIMIT, "=/="); statsPanel.SetCellText((int)Columns.VALUE, (int)Rows.TEXTURES_VS_LIMIT, "=/="); statsPanel.SetCellText((int)Columns.VALUE, (int)Rows.MATERIALS_VS_LIMIT, "=/="); statsPanel.SetCellText((int)Columns.VALUE, (int)Rows.ENTITIES_VS_LIMIT, "=/="); statsPanel.SetCellText((int)Columns.VALUE, (int)Rows.MESHES_VS_LIMIT, "=/="); statsPanel.SetCellText((int)Columns.VALUE, (int)Rows.BODIES_VS_LIMIT, "=/="); statsPanel.SetCellText((int)Columns.VALUE, (int)Rows.COMPONENT_OBJECTS_COUNT, "=/="); Canvas.ForceUpdateCanvases(); }
private void Start() { if (equipmentSlotsParent == null) { equipmentSlotsParent = FindObjectOfType <EquipmentPanel> (); } if (statsPanel == null) { statsPanel = FindObjectOfType <StatsPanel> (); } // OnItemClickEvent += for (int i = 0; i < inventorySlot.Length; i++) { inventorySlot[i].OnClickEvent += OnItemClickEvent; } RefreshUI(); InventoryOpen(); }
public void Fill(StatsPanel statsPanel) { statsPanel.formActiveFormText.Text = Form.ActiveForm.Text; if (Application.MainPage != null) { statsPanel.mainPageText.Text = Application.MainPage.Text; statsPanel.mainPageControlsCount.Text = Application.MainPage.Controls.Count.ToString(); if (Application.MainPage.Controls.Count == 3) { statsPanel.mainPageControlsCount.Text = Application.MainPage.Controls.Count + @" (1 label + 2 buttons)"; } else { statsPanel.mainPageControlsCount.Text = Application.MainPage.Controls.Count.ToString(); } if (Application.MainPage.ActiveControl != null) { statsPanel.mainPageActiveControlText.Text = Application.MainPage.ActiveControl.Text + @" (ActiveControl is per page)"; } else { statsPanel.mainPageActiveControlText.Text = @"NULL (ActiveControl is per page)"; } } else { statsPanel.mainPageText.Text = @"NULL"; statsPanel.mainPageControlsCount.Text = @"NULL"; statsPanel.mainPageActiveControlText.Text = @"NULL"; } if (Application.Desktop != null) { statsPanel.desktopText.Text = Application.Desktop.Text; if (Application.Desktop.Controls.Count == 4) { statsPanel.desktopControlsCount.Text = Application.Desktop.Controls.Count + @" (1 label + 1 clock + 2 buttons)"; } else { statsPanel.desktopControlsCount.Text = Application.Desktop.Controls.Count.ToString(); } if (Application.Desktop.ActiveControl != null) { statsPanel.desktopActiveControlText.Text = Application.Desktop.ActiveControl.Text + @" (ActiveControl is per desktop)"; } else { statsPanel.desktopActiveControlText.Text = @"NULL (ActiveControl is per desktop)"; } } else { statsPanel.desktopText.Text = @"NULL"; statsPanel.desktopControlsCount.Text = @"NULL"; statsPanel.desktopActiveControlText.Text = @"NULL"; } statsPanel.applicationOpenForms.Text = Application.OpenForms.Count.ToString(); statsPanel.applicationOpenPages.Text = Application.OpenPages.Count.ToString(); }
void InitScene(Scene from, Scene to) { instance.loadingScreen.SetActive(false); UIController.Instance.ToggleBackButton(to.name != "Overworld"); if (to.name == "Overworld" && from.name != "TitleScreen") { //first, increase emissions according to worker placement in tropics // If they have never visited the tropics // Unless you are at title screen //for (int i = 0; i < 20; i++) { //FOR DEBUGGING ONLY if (!hasPlacedWorkers) { forcingIncrease = 0.6; // originally 0.6 } EBM.F = EBM.F + forcingIncrease; World.ChangeAverageTemp(); //} } if (to.name == "Overworld") { // Cap the values for money and public opinion if (World.money > 100f) { World.money = 100f; } if (World.money < 0f) { World.money = 0f; } if (World.publicOpinion > 100f) { World.publicOpinion = 100f; } if (World.publicOpinion < 0f) { World.publicOpinion = 0f; } Canvas navBarCanvas = UIController.Instance.GetComponent <Canvas>(); navBarCanvas.worldCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>() as Camera; inOverworld = true; Transform nodes = GameObject.FindWithTag("Nodes").GetComponent <Transform>(); Transform nodesHot = GameObject.FindWithTag("NodesHot").GetComponent <Transform>(); var tempDifference = World.averageTemp - World.globalStartingTemp; // Set the alternate art for regions if it is too hot if (tempDifference < 7) { foreach (Transform node in nodes) { node.gameObject.SetActive(true); } foreach (Transform node in nodesHot) { node.gameObject.SetActive(false); } } else { foreach (Transform node in nodes) { node.gameObject.SetActive(false); } foreach (Transform node in nodesHot) { node.gameObject.SetActive(true); } } //add alternate art for planet if world is too hot GameObject world = GameObject.Find("world"); if (tempDifference > 3 && tempDifference < 5) { world.GetComponent <SpriteRenderer>().sprite = planet2; } else if (tempDifference >= 5 && tempDifference < 7) { world.GetComponent <SpriteRenderer>().sprite = planet3; } else if (tempDifference >= 7) { world.GetComponent <SpriteRenderer>().sprite = planet4; } else { world.GetComponent <SpriteRenderer>().sprite = planet1; } statsPanel = stats.GetComponent(typeof(StatsPanel)) as StatsPanel; // Save the previous stats previousPublicOpinion = statsPanel.previousPublicOpinion; previousEmissions = statsPanel.previousEmissions; previousEconomy = statsPanel.previousEconomy; previousLandUse = statsPanel.previousLandUse; var currentMoney = previousEconomy * 100; if (World.money <= 0f && World.money < currentMoney) { UIController.Instance.ChangeOutOfMoneyPrompt(true); } // turn on stats panel // check to see if something in the stats panel changed thermometer = GameObject.FindGameObjectWithTag("Slider").GetComponent <Slider>(); thermometerFill = GameObject.FindGameObjectWithTag("ThermometerFill").GetComponent <Image>(); thermometerBottom = GameObject.FindGameObjectWithTag("ThermometerBottom").GetComponent <Image>(); AudioManager.Instance.Play("BGM_Menu"); // TODO: sound name variable class thermometer.value = previousTempValue; if (from.name != "TitleScreen" && from.name != "Overworld") { StartCoroutine(UpdateOverworldValues()); } } else if (to.name != "TitleScreen") { AudioManager.Instance.Play("BGM_" + to.name); // TODO: sound name variable class } if (to.name != "Overworld") { inOverworld = false; FindCurrentRegion(to); } }
//------------------------------------ MONOBEHAVIOR ------------------------------------------// void Start() { if (actionGameOnject != null) { actionStats = actionGameOnject.GetComponent<ActionStats>(); } if (actionStats == null) { Debug.LogWarning("ActionControl: actionStats component is null!"); } GameObject playerObj = GameObject.FindGameObjectWithTag("Player"); if (playerObj != null) { playerStats = playerObj.GetComponent<PlayerStats>(); } else { Debug.LogWarning("ActionControl: Player object is not found"); } GameObject enemyObj = GameObject.FindGameObjectWithTag("Enemy"); if (enemyObj != null) { enemyStats = enemyObj.GetComponent<CharacterStats>(); } else { Debug.LogWarning("ActionControl: Enemy object is not found"); } if (actionStats == null) { actionStats = gameObject.GetComponent<ActionStats>(); } GameObject statsPanelObj = GameObject.FindGameObjectWithTag("StatsPanel"); if (statsPanelObj != null) { statsPanel = statsPanelObj.GetComponent<StatsPanel>(); actionPressedEvent += statsPanel.onActionPresssed; } else { Debug.LogWarning("ActionControl: StatsPanel object is not found"); } }
void Start() { statsPanel = transform.parent.GetComponent <StatsPanel>(); }
private void Init() { closeButton.onClick.AddListener(this.Close); statsPanel = GetComponentInChildren<StatsPanel>(); statsPanel.Init(); crewPanel = GetComponentInChildren<CrewPanel>(); crewPanel.Init(); equipmentPanel = GetComponentInChildren<EquipmentPanel>(); equipmentPanel.Init(); itemInfoPanel = GetComponentInChildren<ItemInfoPanel>(); inventoryPanel = GetComponentInChildren<InventoryPanel>(); popupPanel = GetComponentInChildren<PopupPanel>(); crewPanel.SelectDefaultCrewMember(); }
protected override void InitPanels() { base.InitPanels(); #region Auto_Generated_Code_Placement_Init MenuPanel = new MenuPanel(dataPanelDict["MenuPanel"], dataMenuPanel, PanelTypes.Main); ChildrenPanel = new ChildrenPanel(dataPanelDict["ChildrenPanel"], dataChildrenPanel, PanelTypes.Main); AddChildPanel = new AddChildPanel(dataPanelDict["AddChildPanel"], dataAddChildPanel, PanelTypes.Secondary); InfoPanel = new InfoPanel(dataPanelDict["InfoPanel"], DataInfoPanel, PanelTypes.Secondary); Panel statsPanel = new StatsPanel(dataPanelDict["StatsPanel"], dataStatsPanel, PanelTypes.Main); Panel levelsPanel = new LevelsPanel(dataPanelDict["LevelsPanel"], dataSetLevelsPanel, PanelTypes.Main); Panel sectionsPanel = new SectionsPanel(dataPanelDict["SectionsPanel"], dataSectionsPanel, PanelTypes.Main); Panel missionsPanel = new MissionsPanel(dataPanelDict["MissionsPanel"], dataSetMissionsPanel, PanelTypes.Main); Panel settingsPanel = new SettingsPanel(dataPanelDict["SettingsPanel"], dataSettingsPanel, PanelTypes.Secondary); Panel exitPanel = new ExitPanel(dataPanelDict["ExitPanel"], dataExitPanel, PanelTypes.Secondary); UiTransitionDict = new Dictionary <Panel, Dictionary <Panel, TransitionTypes> > { { MenuPanel, new Dictionary <Panel, TransitionTypes> { { statsPanel, TransitionTypes.Hard }, { ChildrenPanel, TransitionTypes.Hard }, { sectionsPanel, TransitionTypes.Hard }, { exitPanel, TransitionTypes.Soft }, { settingsPanel, TransitionTypes.Soft } } }, { statsPanel, new Dictionary <Panel, TransitionTypes> { { MenuPanel, TransitionTypes.Hard }, } }, { ChildrenPanel, new Dictionary <Panel, TransitionTypes> { { MenuPanel, TransitionTypes.Hard }, { AddChildPanel, TransitionTypes.Soft } } }, { AddChildPanel, new Dictionary <Panel, TransitionTypes> { } }, { settingsPanel, new Dictionary <Panel, TransitionTypes> { { MenuPanel, TransitionTypes.Normal }, } }, { InfoPanel, new Dictionary <Panel, TransitionTypes> { { missionsPanel, TransitionTypes.Normal }, { levelsPanel, TransitionTypes.Normal } } }, { exitPanel, new Dictionary <Panel, TransitionTypes> { { MenuPanel, TransitionTypes.Hard }, } }, { sectionsPanel, new Dictionary <Panel, TransitionTypes> { { MenuPanel, TransitionTypes.Hard }, { missionsPanel, TransitionTypes.Hard } } }, { missionsPanel, new Dictionary <Panel, TransitionTypes> { { sectionsPanel, TransitionTypes.Hard }, { levelsPanel, TransitionTypes.Hard }, { InfoPanel, TransitionTypes.Soft } } }, { levelsPanel, new Dictionary <Panel, TransitionTypes> { { missionsPanel, TransitionTypes.Hard }, { InfoPanel, TransitionTypes.Soft } } }, }; #endregion }
public void InitStats() { statsPanel = stats.GetComponent(typeof(StatsPanel)) as StatsPanel; statsPanel.InitializeValues(); }