예제 #1
0
        public static void SyncTitleBar(App game, string panelId, BudgetPiechart piechart)
        {
            PlayerInfo playerInfo        = game.GameDatabase.GetPlayerInfo(game.LocalPlayer.ID);
            Vector3    primaryColor      = playerInfo.PrimaryColor;
            string     withoutExtension1 = Path.GetFileNameWithoutExtension(playerInfo.BadgeAssetPath);
            string     withoutExtension2 = Path.GetFileNameWithoutExtension(playerInfo.AvatarAssetPath);

            game.UI.SetPropertyString(panelId, "avatar", withoutExtension2);
            game.UI.SetPropertyString(panelId, "badge", withoutExtension1);
            game.UI.SetPropertyString(panelId, "name", playerInfo.Name.ToUpper());
            game.UI.SetPropertyColorNormalized(panelId, "empire_color", primaryColor);
            string propertyValue = string.Format("{0} {1}", (object)App.Localize("@UI_GENERAL_TURN"), (object)game.GameDatabase.GetTurnCount());

            game.UI.SetPropertyString("turn_count", "text", propertyValue);
            long savings          = (long)playerInfo.Savings;
            long psionicPotential = (long)playerInfo.PsionicPotential;

            game.UI.SetPropertyString("gameEmpireSavings", "text", savings.ToString("N0"));
            game.UI.SetVisible("pnlPsiLevel", game.GameDatabase.PlayerHasTech(game.LocalPlayer.ID, "PSI_Clairvoyance") | game.GameDatabase.PlayerHasTech(game.LocalPlayer.ID, "PSI_Empathy") | game.GameDatabase.PlayerHasTech(game.LocalPlayer.ID, "PSI_Telekinesis") && game.LocalPlayer.Faction.Name != "loa");
            game.UI.SetPropertyString("lblPsiValue", "text", psionicPotential.ToString("N0"));
            EmpireHistoryData historyForPlayer = game.GameDatabase.GetLastEmpireHistoryForPlayer(game.LocalPlayer.ID);
            Vector3           vector3_1        = new Vector3((float)byte.MaxValue, (float)byte.MaxValue, (float)byte.MaxValue);
            Vector3           vector3_2        = new Vector3(0.0f, (float)byte.MaxValue, 0.0f);
            Vector3           vector3_3        = new Vector3((float)byte.MaxValue, 0.0f, 0.0f);

            if (historyForPlayer != null)
            {
                if (psionicPotential > (long)historyForPlayer.psi_potential)
                {
                    game.UI.SetPropertyColor("lblPsiValue", "color", vector3_2);
                }
                else if (psionicPotential < (long)historyForPlayer.psi_potential)
                {
                    game.UI.SetPropertyColor("lblPsiValue", "color", vector3_3);
                }
                else
                {
                    game.UI.SetPropertyColor("lblPsiValue", "color", vector3_1);
                }
            }
            EmpireBarUI.SyncResearchSlider(game, "gameEmpireResearchSlider", playerInfo, piechart);
        }
예제 #2
0
        public static void SyncResearchSlider(App game, string sliderId, BudgetPiechart piechart)
        {
            PlayerInfo playerInfo = game.GameDatabase.GetPlayerInfo(game.LocalPlayer.ID);

            EmpireBarUI.SyncResearchSlider(game, sliderId, playerInfo, piechart);
        }