static public void MonsterUI_BT(UIs uis) { switch (uis) { case UIs.Info_UI_bt: MonsterUI_btReset(); UIlist[16].SetActive(false); UIlist[(int)UIs.Info_UI_bt].SetActive(true); UIlist[(int)UIs.Info_UI].SetActive(true); UIlist[(int)UIs.UNClick_Info_bt].SetActive(true); break; case UIs.Skill_UI_bt: MonsterUI_btReset(); UIlist[16].SetActive(false); UIlist[(int)UIs.Skill_UI_bt].SetActive(true); UIlist[(int)UIs.Skill_UI].SetActive(true); UIlist[(int)UIs.UNClick_Skill_bt].SetActive(true); break; case UIs.Loon_UI_bt: MonsterUI_btReset(); UIlist[(int)UIs.Loon_UI_bt].SetActive(true); UIlist[(int)UIs.Loon_UI].SetActive(true); UIlist[(int)UIs.UNClick_Loon_bt].SetActive(true); break; } }
/// <summary> /// UIの生成 /// </summary> /// <param name="instance">生成物</param> /// <param name="position">座標</param> /// <param name="index">親UI</param> /// <returns></returns> public GameObject CreateUI(GameObject instance, Vector2 position, UIs index) { GameObject instanceUI = Instantiate(instance, position, Quaternion.identity) as GameObject; instanceUI.transform.parent = SearchUI(index).transform; return(instance); }
protected override void Start() { base.Start(); if (m_ApplyInitSelf) { IUIStack stack = CreateModular(); if (stack != default) { UIs.Open <UIStack>(stack.Name, () => { UIs.BindResourcesUIToStack(stack, gameObject, ActiveSelfControlHide); return(stack); }); } else { } ParamNotice <MonoBehaviour> notice = Pooling <ParamNotice <MonoBehaviour> > .From(); int noticeName = GetInstanceID(); noticeName.Broadcast(notice); notice.ToPool(); } else { } }
private void GenerateUI_SaveMenu() { UI mMenuUI = new UI(); UIItem mMenuUII; mMenuUII = new UIItem("game", Toolbox.UIItemType.ImageFix, "Game", new UIAction(Toolbox.UIAction.Toggle_UII, "savegame,leavegame,exit"), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter, "gear_24"); mMenuUI.uiItems.Add(mMenuUII); mMenuUII = new UIItem("savegame", Toolbox.UIItemType.TextFix, "Save Game", new UIAction(Toolbox.UIAction.GameMap_SaveGame), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter) { Visible = false }; mMenuUI.uiItems.Add(mMenuUII); mMenuUII = new UIItem("leavegame", Toolbox.UIItemType.TextFix, "Leave Game", new UIAction(Toolbox.UIAction.GameMap_MainMenu), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter) { Visible = false }; mMenuUI.uiItems.Add(mMenuUII); mMenuUII = new UIItem("exit", Toolbox.UIItemType.TextFix, "Exit to Desktop", new UIAction(Toolbox.UIAction.GameMap_Exit), Toolbox.Font.menuItem02, Toolbox.TextAlignment.MiddleCenter) { Visible = false }; mMenuUI.uiItems.Add(mMenuUII); //Vector2 uiiSize = ToT.Fonts[Toolbox.Font.menuItem02.ToString()].MeasureString(mMenuUII.DisplayText); mMenuUI.RefreshUISize(false); mMenuUI.Position = new Vector2(ToT.Settings.Resolution.X - mMenuUI.Size.X, 0); mMenuUI.RefreshUISize(); UIs.Add("GameMenu", mMenuUI); UIs["GameMenu"].Visible = true; }
public void GetAssignedUIs(UIs Target_UI) { switch (Target_UI) { case UIs.Start: { UI_Start = new Window_Start(); break; } case UIs.Game: { UI_Game = new Window_Game(); break; } case UIs.None: { break; } default: { break; } } }
public void Initialize(Vector2?playerPosition = null) { this.UIs = new List <IUI>() { new Label( rectangle: new Rectangle(260, 10, 230, 30), spriteFont: WK.Font.font_7, "PunchHole", Label.TextAlignment.Midle_Center, "" ), new Button( rectangle: new Rectangle(0, 470, 230, 30), text: "<- Others", defaultTexture: WK.Texture.LightGray, mouseOverTexture: WK.Texture.Gray, spriteFont: WK.Font.font_7, tag: "goToOthers", OnClickAction: () => Game1.ChangeToScene(WK.Scene.Others) ), }; this.entities = new List <IEntity>() { //new Light(new Point(30, 30)), new Player(new Point(100, 100)) }; Point[] points = entities.Select(x => x.rigidbody.centerPosition.ToPoint()).ToArray(); UIs.Add(new Shadow(points)); }
static public void SelecteUIs(UIs uis) { switch (uis) { case UIs.Main_bt: UIlist[(int)UIs.Main_bt].SetActive(true); UIlist[(int)UIs.User_info].SetActive(true); break; case UIs.Dungeon_UI: UIlist[(int)uis].SetActive(true); break; case UIs.ChooseStage: UIlist[(int)uis].SetActive(true); UIlist[(int)UIs.GE].SetActive(true); break; case UIs.Drop_info: UIlist[(int)uis].SetActive(true); break; case UIs.Dungeon_Enter: UIlist[(int)uis].SetActive(true); break; case UIs.Rune1_case: UIlist[(int)uis].SetActive(true); break; case UIs.Rune2_case: UIlist[(int)uis].SetActive(true); break; case UIs.Rune3_case: UIlist[(int)uis].SetActive(true); break; case UIs.Quest: UIlist[(int)uis].SetActive(true); gameManager.Quest(); break; case UIs.Quest_Info: UIlist[(int)uis].SetActive(true); break; case UIs.Monster_UI: UIlist[(int)uis].SetActive(true); break; case UIs.LM_1: UIlist[(int)uis].SetActive(true); break; case UIs.LM_2: UIlist[(int)uis].SetActive(true); break; case UIs.LM_3: UIlist[(int)uis].SetActive(true); break; case UIs.R1: UIlist[(int)uis].SetActive(true); break; case UIs.R2: UIlist[(int)uis].SetActive(true); break; case UIs.R3: UIlist[(int)uis].SetActive(true); break; } }
static public void Closer(UIs uis) { switch (uis) { case UIs.Dungeon_UI: UIlist[(int)uis].SetActive(false); break; case UIs.ChooseStage: UIlist[(int)uis].SetActive(false); UIlist[(int)UIs.GE].SetActive(false); break; case UIs.Drop_info: UIlist[(int)uis].SetActive(false); break; case UIs.Dungeon_Enter: UIlist[(int)uis].SetActive(false); break; case UIs.Monster_UI: UIlist[(int)uis].SetActive(false); break; case UIs.Rune1_case: UIlist[(int)uis].SetActive(false); break; case UIs.Rune2_case: UIlist[(int)uis].SetActive(false); break; case UIs.Rune3_case: UIlist[(int)uis].SetActive(false); break; case UIs.Quest: UIlist[(int)uis].SetActive(false); break; case UIs.Quest_Info: UIlist[(int)uis].SetActive(false); break; case UIs.LM_1: UIlist[(int)uis].SetActive(false); break; case UIs.LM_2: UIlist[(int)uis].SetActive(false); break; case UIs.LM_3: UIlist[(int)uis].SetActive(false); break; case UIs.R1: UIlist[(int)uis].SetActive(false); break; case UIs.R2: UIlist[(int)uis].SetActive(false); break; case UIs.R3: UIlist[(int)uis].SetActive(false); break; } }
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; }
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; }
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; }
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; }
public void Change_UI(UIs Change_To) { switch (Change_To) { case UIs.None: { break; } case UIs.Start: { if (Type_Window != UIs.Start) { GetAssignedUIs(UIs.Start); UI_Start.Visibility = Visibility.Visible; Current_Window.Visibility = Visibility.Hidden; Current_Window = UI_Start; Type_Window = UIs.Start; } else { } break; } case UIs.Game: { if (Type_Window != UIs.Game) { GetAssignedUIs(UIs.Game); UI_Game.Show(); UI_Game.Visibility = Visibility.Visible; Current_Window.Visibility = Visibility.Hidden; Current_Window = UI_Game; Type_Window = UIs.Game; } else { } break; } default: { break; } } }
public void Update(InputState lastInputState, InputState inputState) { List <HealthBar> healthBars = UIs.OfType <HealthBar>().ToList(); foreach (var healthBar in healthBars) { if (healthBar.value > 0) { healthBar.value--; } else { healthBar.value = 100; } } }
// Runs the population code for the mod, // registering all objects and populating // them internal static void PopulateMod() { // Register extra modules for registration foreach (Assembly ass in AppDomain.CurrentDomain.GetAssemblies()) { if (ass.GetName().Name.StartsWith("VikDisk.")) { RegistryUtils.extraModules.Add(ass); } } // Registers the all game content Others.RegisterAll(); Identifiables.RegisterAll(); SpawnResources.RegisterAll(); Gadgets.RegisterAll(); Upgrades.RegisterAll(); UIs.RegisterAll(); Plots.RegisterAll(); //GordoRegistry.Setup(); // Adds new commands to the game Console.RegisterCommand(new DumperCommand()); Console.RegisterCommand(new UnlockAllCommand()); Console.RegisterCommand(new TPCommand()); Console.RegisterCommand(new DebugModeCommand()); if (TESTING) { Console.RegisterCommand(new TestModeCommand()); } // Registers the remaining callback CallbackHandler.LateSetup(); // Runs fixing methods GameFixer.FixAtGameLoad(); // Run Injectors foreach (Injector inject in injectors) { inject.PopulateMod(); } }
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; }
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; }
public void ShowUI(UIs enum_UI) { Vector3 showPos = new Vector3(0, 0, 0); Vector3 hidePos = new Vector3(500, 0, 0); RectTransform trRect_Lobby = lobbyManager.GetComponent <RectTransform>(); RectTransform trRect_Play = playManager.GetComponent <RectTransform>(); RectTransform trRect_Result = resultManager.GetComponent <RectTransform>(); if (enum_UI == UIs.lobby) { trRect_Lobby.localPosition = showPos; trRect_Play.localPosition = hidePos; trRect_Result.localPosition = hidePos; } else if (enum_UI == UIs.play) { trRect_Lobby.localPosition = hidePos; trRect_Play.localPosition = showPos; trRect_Result.localPosition = hidePos; playManager.GetComponent <PlayManager>().Init(); } else if (enum_UI == UIs.result) { trRect_Lobby.localPosition = hidePos; trRect_Play.localPosition = hidePos; trRect_Result.localPosition = showPos; resultManager.GetComponent <ResultManager>().Init(); } lobbyManager.gameObject.SetActive(enum_UI == UIs.lobby); playManager.gameObject.SetActive(enum_UI == UIs.play); resultManager.gameObject.SetActive(enum_UI == UIs.result); }
public void Update(InputState lastInputState, InputState inputState) { Label label = UIs.OfType<Label>().First(); label.UpdateText($"Score: {Game1.gameData.score}"); }
/// <summary> /// UIの検索 /// </summary> /// <param name="index">listのindex</param> /// <returns></returns> public GameObject SearchUI(UIs index) { return(mUISet[(int)index]); }