コード例 #1
0
        private void GenerateUI_Resources()
        {
            UI     mMenuUI = new UI();
            UIItem mMenuUII;

            mMenuUII = new UIItem(
                "imgGold",
                Toolbox.UIItemType.ImageText,
                ((GameMapScreen)ToT.screenManager.Screens[Toolbox.ScreenType.GameMap]).GameMap.player.Resources[Toolbox.ResourceType.Gold].ToString(),
                new UIAction(),
                Toolbox.Font.menuItem02,
                Toolbox.TextAlignment.TopLeft,
                "Resource_Gold_01"
                );
            mMenuUI.uiItems.Add(mMenuUII);
            mMenuUII = new UIItem(
                "imgWood",
                Toolbox.UIItemType.ImageText,
                ((GameMapScreen)ToT.screenManager.Screens[Toolbox.ScreenType.GameMap]).GameMap.player.Resources[Toolbox.ResourceType.Wood].ToString(),
                new UIAction(),
                Toolbox.Font.menuItem02,
                Toolbox.TextAlignment.TopLeft,
                "Resource_Wood_01"
                );
            mMenuUI.uiItems.Add(mMenuUII);
            mMenuUII = new UIItem(
                "imgRock",
                Toolbox.UIItemType.ImageText,
                ((GameMapScreen)ToT.screenManager.Screens[Toolbox.ScreenType.GameMap]).GameMap.player.Resources[Toolbox.ResourceType.Rock].ToString(),
                new UIAction(),
                Toolbox.Font.menuItem02,
                Toolbox.TextAlignment.TopLeft,
                "Resource_Rock_01"
                );
            mMenuUI.uiItems.Add(mMenuUII);
            mMenuUII = new UIItem(
                "imgCrystal",
                Toolbox.UIItemType.ImageText,
                ((GameMapScreen)ToT.screenManager.Screens[Toolbox.ScreenType.GameMap]).GameMap.player.Resources[Toolbox.ResourceType.Crystal].ToString(),
                new UIAction(),
                Toolbox.Font.menuItem02,
                Toolbox.TextAlignment.TopLeft,
                "Resource_Crystal_01"
                );
            mMenuUI.uiItems.Add(mMenuUII);
            mMenuUI.uIAlignment = Toolbox.UIAlignment.Horizontal;

            mMenuUI.RefreshUISize(false);
            mMenuUI.Position = new Vector2(5, 5);
            mMenuUI.RefreshUISize();

            UIs.Add("ResourcesMenu", mMenuUI);
            UIs["ResourcesMenu"].Visible = true;
        }
コード例 #2
0
ファイル: MainMenu.cs プロジェクト: lurked/ToT_Adventure
        private void GenerateUI_MMenuLogo()
        {
            UI     mMenuUI  = new UI();
            UIItem mMenuUII = new UIItem("logomainmenu", Toolbox.UIItemType.TextFix, "Tales of Tiles", new UIAction(), Toolbox.Font.logo01, Toolbox.TextAlignment.TopLeft);

            mMenuUI.uiItems.Add(mMenuUII);
            mMenuUI.Position = new Vector2((ToT.Settings.Resolution.X - ToT.Fonts[Toolbox.Font.logo01.ToString()].MeasureString(mMenuUII.DisplayText).X) / 2, ToT.Settings.Resolution.Y / 20);
            mMenuUI.RefreshUISize();

            UIs.Add("mMenuLogo", mMenuUI);
            UIs["mMenuLogo"].Visible = true;
        }
コード例 #3
0
ファイル: GameMapScreen.cs プロジェクト: lurked/ToT_Adventure
        private void GenerateUI_Adventure()
        {
            UI     mMenuUI = new UI();
            UIItem mMenuUII;

            mMenuUII = new UIItem("adventure", Toolbox.UIItemType.TextFix, "Adventure!", new UIAction(Toolbox.UIAction.GameMap_Adventure, ""), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter);
            mMenuUI.uiItems.Add(mMenuUII);

            mMenuUI.RefreshUISize(false);
            mMenuUI.Position = new Vector2(5, ToT.Settings.Resolution.Y - mMenuUI.Size.Y);
            mMenuUI.RefreshUISize();

            UIs.Add("AdventureMenu", mMenuUI);
            UIs["AdventureMenu"].Visible = true;
        }
コード例 #4
0
        private void GenerateUI_BackMenu()
        {
            UI     mMenuUI = new UI();
            UIItem mMenuUII;

            mMenuUII = new UIItem("backmainmenu", Toolbox.UIItemType.TextFix, "< Back", new UIAction(Toolbox.UIAction.MainMenu), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter);
            mMenuUI.uiItems.Add(mMenuUII);
            Vector2 uiiSize = ToT.Fonts[Toolbox.Font.menuItem02.ToString()].MeasureString(mMenuUII.DisplayText);

            mMenuUI.Position = new Vector2(10, ToT.Settings.Resolution.Y - (uiiSize.Y * mMenuUI.uiItems.Count()) - 5);
            mMenuUI.RefreshUISize();

            UIs.Add("BackMenu", mMenuUI);
            UIs["BackMenu"].Visible = true;
        }
コード例 #5
0
ファイル: MainMenu.cs プロジェクト: lurked/ToT_Adventure
        private void GenerateUI_MMenu()
        {
            UI     mMenuUI = new UI();
            UIItem mMenuUII;

            mMenuUII = new UIItem("newgame", Toolbox.UIItemType.TextFix, "New Game", new UIAction(Toolbox.UIAction.MainMenu_NewGame), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter);
            mMenuUI.uiItems.Add(mMenuUII);
            mMenuUII = new UIItem("loadgame", Toolbox.UIItemType.TextFix, "Load Game", new UIAction(Toolbox.UIAction.MainMenu_LoadGame), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter);
            mMenuUI.uiItems.Add(mMenuUII);
            mMenuUII = new UIItem("settings", Toolbox.UIItemType.TextFix, "Settings", new UIAction(Toolbox.UIAction.MainMenu_Settings), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter);
            mMenuUI.uiItems.Add(mMenuUII);
            mMenuUII = new UIItem("exit", Toolbox.UIItemType.TextFix, "Exit", new UIAction(Toolbox.UIAction.MainMenu_Exit), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter);
            mMenuUI.uiItems.Add(mMenuUII);
            Vector2 uiiSize = ToT.Fonts[Toolbox.Font.menuItem02.ToString()].MeasureString(mMenuUII.DisplayText);

            mMenuUI.Position = new Vector2(10, ToT.Settings.Resolution.Y - (uiiSize.Y * mMenuUI.uiItems.Count()) - 5);
            mMenuUI.RefreshUISize();

            UIs.Add("mMenu", mMenuUI);
            UIs["mMenu"].Visible = true;
        }
コード例 #6
0
        private void GenerateUI_LoadGames()
        {
            UI     mMenuUI = new UI();
            UIItem mMenuUII;

            string[] saves = FileManager.GetSaves();
            Array.Reverse(saves);
            float fLongest = 0f;

            foreach (string sFile in saves)
            {
                mMenuUII = new UIItem("savename", Toolbox.UIItemType.TextFix, sFile, new UIAction(Toolbox.UIAction.GameMap_LoadGame, sFile), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter);
                mMenuUI.uiItems.Add(mMenuUII);
                fLongest = ToT.Fonts[Toolbox.Font.menuItem02.ToString()].MeasureString(mMenuUII.DisplayText).X > fLongest ? ToT.Fonts[Toolbox.Font.menuItem02.ToString()].MeasureString(mMenuUII.DisplayText).X : fLongest;
            }
            mMenuUI.Position = new Vector2((ToT.Settings.Resolution.X - fLongest) / 2, ToT.Settings.Resolution.Y / 4);
            mMenuUI.RefreshUISize();

            UIs.Add("loadGames", mMenuUI);
            UIs["loadGames"].Visible = true;
        }