public override void Draw(int aID) { GUILayout.Space(30); for (int i = 0; i < Controller.getInstance().getCharapterList().getSelectedChapterData().getConversations().Count; i++) { GUILayout.BeginHorizontal(); GUILayout.Box(Controller.getInstance().getCharapterList().getSelectedChapterData().getConversations()[i].getId(), GUILayout.Width(windowWidth * 0.65f)); if (GUILayout.Button("Edit conversation", GUILayout.MaxWidth(windowWidth * 0.3f))) { ConversationEditorWindow window = (ConversationEditorWindow)ScriptableObject.CreateInstance(typeof(ConversationEditorWindow)); window.Init((GraphConversation)Controller.getInstance().getCharapterList().getSelectedChapterData().getConversations()[i]); } GUILayout.EndHorizontal(); } }
void OnGUI() { /** * UPPER MENU */ GUILayout.BeginArea(buttonMenuRect); GUILayout.BeginHorizontal(); if (GUILayout.Button(TC.get("MenuFile.Title"))) { fileMenu.menu.ShowAsContext(); } //if (GUILayout.Button(Language.GetText("GeneralText.Edit"))) //{ // editMenu.menu.ShowAsContext(); //} //if (GUILayout.Button(Language.GetText("ADVENTURE"))) //{ // adventureMenu.menu.ShowAsContext(); //} if (GUILayout.Button(TC.get("MenuChapters.Title"))) { chaptersMenu.menu.ShowAsContext(); } //if (GUILayout.Button(Language.GetText("RUN"))) //{ // runMenu.menu.ShowAsContext(); //} if (GUILayout.Button(TC.get("MenuConfiguration.Title"))) { configurationMenu.menu.ShowAsContext(); } if (GUILayout.Button(TC.get("About"))) { aboutMenu.menu.ShowAsContext(); } GUILayout.EndHorizontal(); GUILayout.EndArea(); /** * LEFT MENU */ GUILayout.BeginArea(leftMenuRect); GUILayout.BeginVertical(); //GUILayout.BeginHorizontal(GUILayout.MaxWidth(25), GUILayout.MaxHeight(25)); //if (GUILayout.Button(undoTexture, GUILayout.MaxWidth(25), GUILayout.MaxHeight(25))) //{ // UndoAction(); //} //GUILayout.Space(5); //if (GUILayout.Button(redoTexture, GUILayout.MaxWidth(25), GUILayout.MaxHeight(25))) //{ // RedoAction(); //} //GUILayout.EndHorizontal(); //GUILayout.Space(25); scrollPosition = GUILayout.BeginScrollView(scrollPosition); // Button event chapter if (GUILayout.Button(TC.get("Element.Name0"))) { chapterWindow = new ChapterWindow(windowRect, new GUIContent(TC.get("Element.Name0")), "Window"); OnWindowTypeChanged(EditorWindowType.Chapter); } // Button event scene GUILayout.BeginHorizontal(); if (GUILayout.Button(leftMenuContentScene)) { OnWindowTypeChanged(EditorWindowType.Scenes); scenesWindow.ShowBaseWindowView(); } //Add button scene if (openedWindow == EditorWindowType.Scenes) { if (GUILayout.Button(addTexture)) { ChapterElementNameInputPopup window = (ChapterElementNameInputPopup) ScriptableObject.CreateInstance(typeof(ChapterElementNameInputPopup)); window.Init(this, "Scene", EditorWindowType.Scenes); } } GUILayout.EndHorizontal(); // Item sublist scene if (openedWindow == EditorWindowType.Scenes) { GUI.skin = leftSubMenuSkin; for (int i = 0; i < Controller.getInstance().getCharapterList().getSelectedChapterData().getScenes().Count; i++) { if (i == GameRources.GetInstance().selectedSceneIndex) { GUI.skin = leftSubMenuConcreteItemSkin; } if ( GUILayout.Button( Controller.getInstance().getCharapterList().getSelectedChapterData().getScenes()[i].getId())) { scenesWindow.ShowItemWindowView(i); } if (i == GameRources.GetInstance().selectedSceneIndex) { GUILayout.BeginHorizontal(); if (GUILayout.Button("Rename")) { Debug.Log("Rename"); } if (GUILayout.Button(duplicateImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getScenesList() .duplicateElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getScenesList() .getScenes()[i]); } if (GUILayout.Button(deleteImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getScenesList() .deleteElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getScenesList() .getScenes()[i], false); scenesWindow.ShowBaseWindowView(); } GUILayout.EndHorizontal(); GUI.skin = leftSubMenuSkin; } } GUI.skin = defaultGUISkin; } // Button event cutscene GUILayout.BeginHorizontal(); if (GUILayout.Button(leftMenuContentCutscene)) { OnWindowTypeChanged(EditorWindowType.Cutscenes); cutscenesWindow.ShowBaseWindowView(); } //Add button cutscene if (openedWindow == EditorWindowType.Cutscenes) { if (GUILayout.Button(addTexture)) { ChapterElementNewCutsceneInputPopup window = (ChapterElementNewCutsceneInputPopup) ScriptableObject.CreateInstance(typeof(ChapterElementNewCutsceneInputPopup)); window.Init(this, "Cutscene", EditorWindowType.Cutscenes); } } GUILayout.EndHorizontal(); // Item sublist cutscene if (openedWindow == EditorWindowType.Cutscenes) { GUI.skin = leftSubMenuSkin; for (int i = 0; i < Controller.getInstance().getCharapterList().getSelectedChapterData().getCutscenes().Count; i++) { if (i == GameRources.GetInstance().selectedCutsceneIndex) { GUI.skin = leftSubMenuConcreteItemSkin; } if ( GUILayout.Button( Controller.getInstance().getCharapterList().getSelectedChapterData().getCutscenes()[i].getId())) { cutscenesWindow.ShowItemWindowView(i); } if (i == GameRources.GetInstance().selectedCutsceneIndex) { GUILayout.BeginHorizontal(); if (GUILayout.Button("Rename")) { Debug.Log("Rename"); } if (GUILayout.Button(deleteImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getCutscenesList() .deleteElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getCutscenesList() .getCutscenes()[i], false); scenesWindow.ShowBaseWindowView(); } GUILayout.EndHorizontal(); GUI.skin = leftSubMenuSkin; } } GUI.skin = defaultGUISkin; } // Button event book GUILayout.BeginHorizontal(); if (GUILayout.Button(leftMenuContentBook)) { OnWindowTypeChanged(EditorWindowType.Books); booksWindow.ShowBaseWindowView(); } //Add button book if (openedWindow == EditorWindowType.Books) { if (GUILayout.Button(addTexture)) { ChapterElementNameInputPopup window = (ChapterElementNameInputPopup) ScriptableObject.CreateInstance(typeof(ChapterElementNameInputPopup)); window.Init(this, "Book", EditorWindowType.Books); } } GUILayout.EndHorizontal(); // Item sublist book if (openedWindow == EditorWindowType.Books) { GUI.skin = leftSubMenuSkin; for (int i = 0; i < Controller.getInstance().getCharapterList().getSelectedChapterData().getBooks().Count; i++) { if (i == GameRources.GetInstance().selectedBookIndex) { GUI.skin = leftSubMenuConcreteItemSkin; } if ( GUILayout.Button( Controller.getInstance().getCharapterList().getSelectedChapterData().getBooks()[i].getId())) { booksWindow.ShowItemWindowView(i); } if (i == GameRources.GetInstance().selectedBookIndex) { GUILayout.BeginHorizontal(); if (GUILayout.Button("Rename")) { Debug.Log("Rename"); } if (GUILayout.Button(duplicateImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getBooksList() .duplicateElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getBooksList() .getBooks()[i]); } if (GUILayout.Button(deleteImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getBooksList() .deleteElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getBooksList() .getBooks()[i], false); scenesWindow.ShowBaseWindowView(); } GUILayout.EndHorizontal(); GUI.skin = leftSubMenuSkin; } } GUI.skin = defaultGUISkin; } // Button event item GUILayout.BeginHorizontal(); if (GUILayout.Button(leftMenuContentItem)) { OnWindowTypeChanged(EditorWindowType.Items); itemsWindow.ShowBaseWindowView(); } //Add button item if (openedWindow == EditorWindowType.Items) { if (GUILayout.Button(addTexture)) { ChapterElementNameInputPopup window = (ChapterElementNameInputPopup) ScriptableObject.CreateInstance(typeof(ChapterElementNameInputPopup)); window.Init(this, "Item", EditorWindowType.Items); } } GUILayout.EndHorizontal(); // Item sublist item if (openedWindow == EditorWindowType.Items) { GUI.skin = leftSubMenuSkin; for (int i = 0; i < Controller.getInstance().getCharapterList().getSelectedChapterData().getItems().Count; i++) { if (i == GameRources.GetInstance().selectedItemIndex) { GUI.skin = leftSubMenuConcreteItemSkin; } if ( GUILayout.Button( Controller.getInstance().getCharapterList().getSelectedChapterData().getItems()[i].getId())) { itemsWindow.ShowItemWindowView(i); } if (i == GameRources.GetInstance().selectedItemIndex) { GUILayout.BeginHorizontal(); if (GUILayout.Button("Rename")) { Debug.Log("Rename"); } if (GUILayout.Button(duplicateImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getItemsList() .duplicateElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getItemsList() .getItems()[i]); } if (GUILayout.Button(deleteImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getItemsList() .deleteElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getItemsList() .getItems()[i], false); scenesWindow.ShowBaseWindowView(); } GUILayout.EndHorizontal(); GUI.skin = leftSubMenuSkin; } } GUI.skin = defaultGUISkin; } // Button event item GUILayout.BeginHorizontal(); if (GUILayout.Button(leftMenuContentSetItem)) { OnWindowTypeChanged(EditorWindowType.SetItems); setItemsWindow.ShowBaseWindowView(); } //Add button item if (openedWindow == EditorWindowType.SetItems) { if (GUILayout.Button(addTexture)) { ChapterElementNameInputPopup window = (ChapterElementNameInputPopup) ScriptableObject.CreateInstance(typeof(ChapterElementNameInputPopup)); window.Init(this, "Atrezzo", EditorWindowType.SetItems); } } GUILayout.EndHorizontal(); // Item sublist item if (openedWindow == EditorWindowType.SetItems) { GUI.skin = leftSubMenuSkin; for (int i = 0; i < Controller.getInstance().getCharapterList().getSelectedChapterData().getAtrezzo().Count; i++) { if (i == GameRources.GetInstance().selectedSetItemIndex) { GUI.skin = leftSubMenuConcreteItemSkin; } if ( GUILayout.Button( Controller.getInstance().getCharapterList().getSelectedChapterData().getAtrezzo()[i].getId())) { setItemsWindow.ShowItemWindowView(i); } if (i == GameRources.GetInstance().selectedSetItemIndex) { GUILayout.BeginHorizontal(); if (GUILayout.Button("Rename")) { Debug.Log("Rename"); } if (GUILayout.Button(duplicateImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getAtrezzoList() .duplicateElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getAtrezzoList() .getAtrezzoList()[i]); } if (GUILayout.Button(deleteImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getAtrezzoList() .deleteElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getAtrezzoList() .getAtrezzoList()[i], false); scenesWindow.ShowBaseWindowView(); } GUILayout.EndHorizontal(); GUI.skin = leftSubMenuSkin; } } GUI.skin = defaultGUISkin; } // Button event player if (GUILayout.Button(leftMenuContentPlayer)) { OnWindowTypeChanged(EditorWindowType.Player); } // Button event NPC GUILayout.BeginHorizontal(); if (GUILayout.Button(leftMenuContentCharacter)) { OnWindowTypeChanged(EditorWindowType.Characters); characterWindow.ShowBaseWindowView(); } //Add button NPC if (openedWindow == EditorWindowType.Characters) { if (GUILayout.Button(addTexture)) { ChapterElementNameInputPopup window = (ChapterElementNameInputPopup) ScriptableObject.CreateInstance(typeof(ChapterElementNameInputPopup)); window.Init(this, "Character", EditorWindowType.Characters); } } GUILayout.EndHorizontal(); // Item sublist NPC if (openedWindow == EditorWindowType.Characters) { GUI.skin = leftSubMenuSkin; for (int i = 0; i < Controller.getInstance().getCharapterList().getSelectedChapterData().getCharacters().Count; i++) { if (i == GameRources.GetInstance().selectedCharacterIndex) { GUI.skin = leftSubMenuConcreteItemSkin; } if ( GUILayout.Button( Controller.getInstance().getCharapterList().getSelectedChapterData().getCharacters()[i].getId())) { characterWindow.ShowItemWindowView(i); } if (i == GameRources.GetInstance().selectedCharacterIndex) { GUILayout.BeginHorizontal(); if (GUILayout.Button("Rename")) { Debug.Log("Rename"); } if (GUILayout.Button(duplicateImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getNPCsList() .duplicateElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getNPCsList() .getNPCs()[i]); } if (GUILayout.Button(deleteImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getNPCsList() .deleteElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getNPCsList() .getNPCs()[i], false); scenesWindow.ShowBaseWindowView(); } GUILayout.EndHorizontal(); GUI.skin = leftSubMenuSkin; } } GUI.skin = defaultGUISkin; } // Button event Conversation GUILayout.BeginHorizontal(); if (GUILayout.Button(leftMenuContentConversation)) { OnWindowTypeChanged(EditorWindowType.Conversations); } //Add button Conversation if (openedWindow == EditorWindowType.Conversations) { if (GUILayout.Button(addTexture)) { ChapterElementNameInputPopup window = (ChapterElementNameInputPopup) ScriptableObject.CreateInstance(typeof(ChapterElementNameInputPopup)); window.Init(this, "Conversation", EditorWindowType.Conversations); } } GUILayout.EndHorizontal(); // Item sublist book if (openedWindow == EditorWindowType.Conversations) { GUI.skin = leftSubMenuSkin; for (int i = 0; i < Controller.getInstance().getCharapterList().getSelectedChapterData().getConversations().Count; i++) { if (i == GameRources.GetInstance().selectedConversationIndex) { GUI.skin = leftSubMenuConcreteItemSkin; if (GUILayout.Button( Controller.getInstance().getCharapterList().getSelectedChapterData().getConversations()[i] .getId())) { ConversationEditorWindow window = (ConversationEditorWindow) ScriptableObject.CreateInstance(typeof(ConversationEditorWindow)); window.Init( (GraphConversation) Controller.getInstance().getCharapterList().getSelectedChapterData().getConversations()[ i]); } GUILayout.BeginHorizontal(); if (GUILayout.Button(duplicateImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getConversationsList() .duplicateElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getConversationsList() .getConversations()[i]); } if (GUILayout.Button(deleteImg)) { Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getConversationsList() .deleteElement( Controller.getInstance() .getCharapterList() .getSelectedChapterDataControl() .getConversationsList() .getConversations()[i], false); } GUILayout.EndHorizontal(); GUI.skin = leftSubMenuSkin; } else { if (GUILayout.Button( Controller.getInstance().getCharapterList().getSelectedChapterData().getConversations()[i] .getId())) { GameRources.GetInstance().selectedConversationIndex = i; } } } GUI.skin = defaultGUISkin; } // Button event player if (GUILayout.Button(leftMenuContentAdvanced)) { OnWindowTypeChanged(EditorWindowType.AdvancedFeatures); } GUILayout.EndScrollView(); GUILayout.EndVertical(); GUILayout.EndArea(); /** * WINDOWS */ BeginWindows(); switch (openedWindow) { case EditorWindowType.Chapter: m_Window1 = chapterWindow; break; case EditorWindowType.Scenes: m_Window1 = scenesWindow; break; case EditorWindowType.Cutscenes: m_Window1 = cutscenesWindow; break; case EditorWindowType.Books: m_Window1 = booksWindow; break; case EditorWindowType.Items: m_Window1 = itemsWindow; break; case EditorWindowType.SetItems: m_Window1 = setItemsWindow; break; case EditorWindowType.Player: m_Window1 = playerWindow; break; case EditorWindowType.Characters: m_Window1 = characterWindow; break; case EditorWindowType.Conversations: m_Window1 = conversationWindow; break; case EditorWindowType.AdvancedFeatures: m_Window1 = advencedFeaturesWindow; break; } if (m_Window1 != null) { m_Window1.OnGUI(); } EndWindows(); }