public ChapterPreview(Rect rect, GUIContent content, GUIStyle style, params GUILayoutOption[] options) : base(rect, content, style, options) { ProjectConfigData.addConsumer(this); PreviewTitle = "Chapter.Preview".Traslate(); noBackground = Controller.ResourceManager.getImage(SpecialAssetPaths.ASSET_EMPTY_BACKGROUND); sceneColors = new Dictionary <string, Color>(); positions = new Dictionary <string, Vector2>(); images = new Dictionary <string, Texture2D>(); sizes = new Dictionary <string, Vector2>(); // SceneList sceneList = new DataControlList() { RequestRepaint = Repaint, footerHeight = 10, elementHeight = 20, Columns = new List <ColumnList.Column>() { new ColumnList.Column() { Text = TC.get("Element.Name1"), SizeOptions = new GUILayoutOption[] { GUILayout.ExpandWidth(true) } }, new ColumnList.Column() { Text = "Open", SizeOptions = new GUILayoutOption[] { GUILayout.Width(250) } } }, drawCell = (cellRect, row, column, isActive, isFocused) => { var scene = ((ScenesListDataControl)sceneList.DataControl).getScenes()[row]; switch (column) { case 0: GUI.Label(cellRect, scene.getId()); break; case 1: if (GUI.Button(cellRect, TC.get("GeneralText.Edit"))) { GameRources.GetInstance().selectedSceneIndex = row; } break; } } }; }
public ScenesWindowPlayerMovement(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, aOptions) { if (GameRources.GetInstance().selectedSceneIndex >= 0) { backgroundPath = Controller.getInstance().getSelectedChapterDataControl().getScenesList().getScenes()[ GameRources.GetInstance().selectedSceneIndex].getPreviewBackground(); } if (backgroundPath != null && !backgroundPath.Equals("")) { backgroundPreviewTex = AssetsController.getImage(backgroundPath).texture; } }
private void RefreshPathInformation() { Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].setSelectedResources(selectedAppearance); imagePath = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getPreviewImage(); inventoryIconPath = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getIconImage(); imageWhenOverPath = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getMouseOverImage(); }
private void OnActionSelectionChange(int i) { selectedAction = i; // Refresh docs string doc = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getActionsList().getActions()[selectedAction] .getDocumentation(); if (!string.IsNullOrEmpty(doc)) { documentation = documentationLast = doc; } else { documentation = documentationLast = ""; } // Refresh target info string targetID = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getActionsList().getActions()[selectedAction].getIdTarget(); selectedTarget = selectedTargetLast = Controller.getInstance() .getSelectedChapterDataControl() .getItemsList() .getItemIndexByID(targetID); // if target is not an item, but a npc... if (selectedTarget == -1) { selectedTarget = selectedTargetLast = Controller.getInstance() .getSelectedChapterDataControl() .getNPCsList() .getNPCIndexByID(targetID); if (selectedTarget == -1) { selectedTarget = selectedTargetLast = 0; } else { selectedTarget = selectedTargetLast += itemsNames.Length; } } }
private void ChangeSelectedNextScene(int i) { selectedSceneNextLast = i; // Scene was choosed if (i < scenesNextNames.Length) { Controller.getInstance().getSelectedChapterDataControl().getCutscenesList().getCutscenes()[ GameRources.GetInstance().selectedCutsceneIndex].setNextSceneId(scenesNextNames[i]); } else { Controller.getInstance().getSelectedChapterDataControl().getCutscenesList().getCutscenes()[ GameRources.GetInstance().selectedCutsceneIndex].setNextSceneId(cutscenesNextNames[i - scenesNextNames.Length]); } Debug.Log("ChangeSelectedNextScene"); }
public void OnDialogOk(string message, object workingObject = null, object workingObjectSecond = null) { if (workingObject is BaseFileOpenDialog.FileType) { switch ((BaseFileOpenDialog.FileType)workingObject) { case BaseFileOpenDialog.FileType.BOOK_IMAGE_PARAGRAPH: Controller.getInstance() .addTool( new ChangeParagraphContentTool( Controller.getInstance().getSelectedChapterDataControl().getBooksList().getBooks()[ GameRources.GetInstance().selectedBookIndex].getBookParagraphsList() .getBookParagraphsList()[selectedElement], message)); break; } } }
public override void Draw(int aID) { var windowWidth = m_Rect.width; var windowHeight = m_Rect.height; previewRect = new Rect(0f, 0.3f * windowHeight, windowWidth, windowHeight * 0.65f); // Show preview dialog if (GUILayout.Button(TC.get("GeneralText.Edit"))) { PlayerMovementEditor window = (PlayerMovementEditor)ScriptableObject.CreateInstance(typeof(PlayerMovementEditor)); window.Init(this, Controller.getInstance().getSelectedChapterDataControl().getScenesList().getScenes()[ GameRources.GetInstance().selectedSceneIndex]); } GUI.DrawTexture(previewRect, backgroundPreviewTex, ScaleMode.ScaleToFit); }
protected override void OnTargetChanged() { if (Target != null || GameRources.GetInstance().selectedBookIndex >= 0) { var workingBook = Target as BookDataControl ?? Controller.Instance.SelectedChapterDataControl .getBooksList().getBooks()[GameRources.GetInstance().selectedBookIndex]; bookDrawer.Book = workingBook.getContent() as Book; bookContentsList.SetData(workingBook.getBookParagraphsList(), (content) => content != null ? (content as BookParagraphsListDataControl).getBookParagraphs().Cast <DataControl>().ToList() : new List <DataControl>()); } else { bookDrawer.Book = null; bookContentsList.SetData(null, _ => new List <DataControl>()); } }
protected override void OnSelect(ReorderableList r) { if (GameRources.GetInstance().selectedCutsceneIndex == r.index || r.index == -1) { r.index = -1; this.Options = new List <string>() { "Video", "Slides" }; } else { this.Options = new List <string>(); } ShowItemWindowView(r.index); }
private void ChangeActionTarget(int i) { selectedTargetLast = i; // Scene was choosed if (i < itemsNames.Length) { Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getActionsList().getActions()[selectedAction].setIdTarget( itemsNames[i]); } else { Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getActionsList().getActions()[selectedAction].setIdTarget( charactersNames[i - itemsNames.Length]); } }
public void Init(DialogReceiverInterface e, SceneDataControl scene) { sceneRef = scene; string backgroundPath = Controller.getInstance().getSelectedChapterDataControl().getScenesList().getScenes()[ GameRources.GetInstance().selectedSceneIndex].getPreviewBackground(); backgroundPreviewTex = (Texture2D)Resources.Load(backgroundPath.Substring(0, backgroundPath.LastIndexOf(".")), typeof(Texture2D)); string playerPath = Controller.getInstance().getSelectedChapterDataControl().getPlayer().getPreviewImage(); playerTex = (Texture2D)Resources.Load(playerPath.Substring(0, playerPath.LastIndexOf(".")), typeof(Texture2D)); selectedPlayerTex = (Texture2D)Resources.Load("Editor/SelectedArea", typeof(Texture2D)); editNodeTex = (Texture2D)Resources.Load("EAdventureData/img/icons/nodeEdit", typeof(Texture2D)); editSideTex = (Texture2D)Resources.Load("EAdventureData/img/icons/sideEdit", typeof(Texture2D)); setInitialNodeTex = (Texture2D)Resources.Load("EAdventureData/img/icons/selectStartNode", typeof(Texture2D)); deleteTex = (Texture2D)Resources.Load("EAdventureData/img/icons/deleteTool", typeof(Texture2D)); deleteTex = (Texture2D)Resources.Load("EAdventureData/img/icons/ScaleArea", typeof(Texture2D)); initialNodeTex = (Texture2D)Resources.Load("EAdventureData/img/icons/selectStartNode", typeof(Texture2D)); lineTex = (Texture2D)Resources.Load("Editor/LineTex", typeof(Texture2D)); selectedAreaSkin = (GUISkin)Resources.Load("Editor/ButtonSelected", typeof(GUISkin)); imageBackgroundRect = new Rect(0f, 0f, backgroundPreviewTex.width, backgroundPreviewTex.height); playerRect = new Rect(0f, 0f, playerTex.width, playerTex.height); useTrajectory = sceneRef.getTrajectory().hasTrajectory(); useInitialPosition = useInitialPositionLast = !useTrajectory; trajectory = sceneRef.getTrajectory().GetTrajectory(); x = sceneRef.getDefaultInitialPositionX(); y = sceneRef.getDefaultInitialPositionY(); playerRect = new Rect(x, y, playerTex.width, playerTex.height); base.Init(e, backgroundPreviewTex.width, backgroundPreviewTex.height); }
public SetItemsWindowApperance(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, aOptions) { clearImg = (Texture2D)Resources.Load("EAdventureData/img/icons/deleteContent", typeof(Texture2D)); if (GameRources.GetInstance().selectedSetItemIndex >= 0) { pathToImg = Controller.getInstance().getSelectedChapterDataControl().getAtrezzoList().getAtrezzoList()[ GameRources.GetInstance().selectedSetItemIndex].getPreviewImage(); } if (pathToImg != null && !pathToImg.Equals("")) { atrezzoImg = AssetsController.getImage(pathToImg).texture; } }
private void RefreshDescriptionInformation() { Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getDescriptionController() .setSelectedDescription(selectedDescription); descriptionName = descriptionNameLast = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getDescriptionController() .getSelectedDescriptionController() .getDescriptionData() .getName(); descriptionSound = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getDescriptionController() .getSelectedDescriptionController() .getDescriptionData().getNameSoundPath(); briefDescription = briefDescriptionLast = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getDescriptionController() .getSelectedDescriptionController() .getDescriptionData() .getDescription(); briefDescriptionSound = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getDescriptionController() .getSelectedDescriptionController() .getDescriptionData().getDescriptionSoundPath(); detailedDescription = detailedDescriptionLast = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getDescriptionController() .getSelectedDescriptionController() .getDescriptionData() .getDetailedDescription(); detailedDescriptionSound = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getDescriptionController() .getSelectedDescriptionController() .getDescriptionData().getDetailedDescriptionSoundPath(); }
public override void Draw(int aID) { dataControlList.index = GameRources.GetInstance().selectedSceneIndex; // SceneEditor population if (GameRources.GetInstance().selectedSceneIndex != -1) { var scene = Controller.Instance.SelectedChapterDataControl.getScenesList().getScenes()[GameRources.GetInstance().selectedSceneIndex]; sceneEditor.Components = EditorWindowBase.Components; var allElements = new List <DataControl>(); allElements.AddRange(scene .getReferencesList() .getAllReferencesDataControl() .FindAll(elem => elem.getErdc() != null) .ConvertAll(elem => elem.getErdc() as DataControl)); allElements.AddRange(scene.getActiveAreasList().getActiveAreas().Cast <DataControl>()); allElements.AddRange(scene.getExitsList().getExits().Cast <DataControl>()); var playerMode = ScenesWindowPlayerMovement.PlayerMode.NoPlayer; if (Controller.Instance.PlayerMode == Controller.FILE_ADVENTURE_3RDPERSON_PLAYER) { allElements.AddRange(scene.getBarriersList().getBarriers().Cast <DataControl>()); playerMode = ScenesWindowPlayerMovement.GetScenePlayerMode(scene); } switch (playerMode) { case ScenesWindowPlayerMovement.PlayerMode.InitialPosition: allElements.Add(Controller.Instance.SelectedChapterDataControl.getPlayer()); break; case ScenesWindowPlayerMovement.PlayerMode.Trajectory: allElements.AddRange(scene.getTrajectory().getNodes().Cast <DataControl>()); allElements.AddRange(scene.getTrajectory().getSides().Cast <DataControl>()); allElements.Add(scene.getTrajectory()); break; } sceneEditor.Elements = allElements; } // Send the callback back base.Draw(aID); }
public ItemsWindowDescription(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, aOptions) { clearTex = (Texture2D)Resources.Load("EAdventureData/img/icons/deleteContent", typeof(Texture2D)); addTex = (Texture2D)Resources.Load("EAdventureData/img/icons/addNode", typeof(Texture2D)); duplicateTex = (Texture2D)Resources.Load("EAdventureData/img/icons/duplicateNode", typeof(Texture2D)); conditionsTex = (Texture2D)Resources.Load("EAdventureData/img/icons/conditions-24x24", typeof(Texture2D)); noConditionsTex = (Texture2D)Resources.Load("EAdventureData/img/icons/no-conditions-24x24", typeof(Texture2D)); noBackgroundSkin = (GUISkin)Resources.Load("Editor/EditorNoBackgroundSkin", typeof(GUISkin)); selectedAreaSkin = (GUISkin)Resources.Load("Editor/EditorLeftMenuItemSkinConcreteOptions", typeof(GUISkin)); noAudioTexture = (Texture2D)Resources.Load("EAdventureData/img/icons/noAudio", typeof(Texture2D)); audioTexture = (Texture2D)Resources.Load("EAdventureData/img/icons/audio", typeof(Texture2D)); if (GameRources.GetInstance().selectedItemIndex >= 0) { fullItemDescription = fullItemDescriptionLast = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getDocumentation(); if (fullItemDescription == null) { fullItemDescription = fullItemDescriptionLast = ""; } dragdropToogle = dragdropToogleLast = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].isReturnsWhenDragged(); selectedBehaviourType = selectedBehaviourTypeLast = (int)Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getBehaviour(); transitionTime = transitionTimeLast = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItems()[ GameRources.GetInstance().selectedItemIndex].getResourcesTransitionTime().ToString(); } selectedDescription = -1; }
public override void Draw(int aID) { if (Target is PlayerDataControl) { var workingScene = Controller.Instance.SelectedChapterDataControl.getScenesList().getScenes()[ GameRources.GetInstance().selectedSceneIndex]; EditorGUI.BeginChangeCheck(); var newPos = EditorGUILayout.Vector2Field("Position", new Vector2(workingScene.getDefaultInitialPositionX(), workingScene.getDefaultInitialPositionY())); if (EditorGUI.EndChangeCheck()) { workingScene.setDefaultInitialPosition(Mathf.RoundToInt(newPos.x), Mathf.RoundToInt(newPos.y)); } EditorGUI.BeginChangeCheck(); var newScale = EditorGUILayout.FloatField("Scale", workingScene.getPlayerScale()); if (EditorGUI.EndChangeCheck()) { workingScene.setPlayerScale(newScale); } } else if (Target is NodeDataControl) { var target = Target as NodeDataControl; EditorGUI.BeginChangeCheck(); var newPos = EditorGUILayout.Vector2Field("Position", new Vector2(target.getX(), target.getY())); if (EditorGUI.EndChangeCheck()) { target.setNode(Mathf.RoundToInt(newPos.x), Mathf.RoundToInt(newPos.y), target.getScale()); } EditorGUI.BeginChangeCheck(); var newScale = EditorGUILayout.FloatField("Scale", target.getScale()); if (EditorGUI.EndChangeCheck()) { target.setNode(target.getX(), target.getY(), newScale); } } }
public ScenesWindowExits(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, aOptions) { clearImg = (Texture2D)Resources.Load("EAdventureData/img/icons/deleteContent", typeof(Texture2D)); addTexture = (Texture2D)Resources.Load("EAdventureData/img/icons/addNode", typeof(Texture2D)); moveUp = (Texture2D)Resources.Load("EAdventureData/img/icons/moveNodeUp", typeof(Texture2D)); moveDown = (Texture2D)Resources.Load("EAdventureData/img/icons/moveNodeDown", typeof(Texture2D)); duplicateImg = (Texture2D)Resources.Load("EAdventureData/img/icons/duplicateNode", typeof(Texture2D)); transitionTypes = new string[] { TC.get("Exit.NoTransition"), TC.get("Exit.TopToBottom"), TC.get("Exit.BottomToTop"), TC.get("Exit.LeftToRight"), TC.get("Exit.RightToLeft"), TC.get("Exit.FadeIn") }; transitionTimeInt = 0; transitionTimeString = transitionTimeStringLast = transitionTimeInt.ToString(); if (GameRources.GetInstance().selectedSceneIndex >= 0) { backgroundPath = Controller.getInstance().getSelectedChapterDataControl().getScenesList().getScenes()[ GameRources.GetInstance().selectedSceneIndex].getPreviewBackground(); } if (backgroundPath != null && !backgroundPath.Equals("")) { backgroundPreviewTex = AssetsController.getImage(backgroundPath).texture; } //TODO: do new skin? selectedAreaSkin = (GUISkin)Resources.Load("Editor/EditorLeftMenuItemSkinConcreteOptions", typeof(GUISkin)); noBackgroundSkin = (GUISkin)Resources.Load("Editor/EditorNoBackgroundSkin", typeof(GUISkin)); selectedExit = 0; }
public void ShowItemWindowView(int s) { if (GameRources.GetInstance().selectedSceneIndex != s) { var selectedScene = s >= 0 && s < dataControlList.list.Count ? dataControlList.list[s] as SceneDataControl : null; foreach (var sceneEditorWindow in Childs.Values .Where(w => w is SceneEditorWindow) .Cast <SceneEditorWindow>()) { try { sceneEditorWindow.OnSceneSelected(selectedScene); } catch (Exception ex) { Debug.LogError(ex.ToString()); } } GameRources.GetInstance().selectedSceneIndex = s; } }
public void Init(DialogReceiverInterface e, SceneDataControl scene, int areaIndex) { sceneRef = scene; calledBarrierIndexRef = areaIndex; string backgroundPath = Controller.getInstance().getSelectedChapterDataControl().getScenesList().getScenes()[ GameRources.GetInstance().selectedSceneIndex].getPreviewBackground(); backgroundPreviewTex = (Texture2D)Resources.Load(backgroundPath.Substring(0, backgroundPath.LastIndexOf(".")), typeof(Texture2D)); barrierTex = (Texture2D)Resources.Load("Editor/BarrierArea", typeof(Texture2D)); selectedBarrierTex = (Texture2D)Resources.Load("Editor/SelectedArea", typeof(Texture2D)); imageBackgroundRect = new Rect(0f, 0f, backgroundPreviewTex.width, backgroundPreviewTex.height); x = sceneRef.getBarriersList().getBarriersList()[areaIndex].getX(); y = sceneRef.getBarriersList().getBarriersList()[areaIndex].getY(); width = sceneRef.getBarriersList().getBarriersList()[areaIndex].getWidth(); heigth = sceneRef.getBarriersList().getBarriersList()[areaIndex].getHeight(); base.Init(e, backgroundPreviewTex.width, backgroundPreviewTex.height); }
public CutscenesWindowAppearance(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, aOptions) { clearImg = (Texture2D)Resources.Load("EAdventureData/img/icons/deleteContent", typeof(Texture2D)); if (GameRources.GetInstance().selectedCutsceneIndex >= 0) { slidesPath = Controller.getInstance().getSelectedChapterDataControl().getCutscenesList().getCutscenes()[ GameRources.GetInstance().selectedCutsceneIndex].getPathToSlides(); slidesPathPreview = Controller.getInstance().getSelectedChapterDataControl().getCutscenesList().getCutscenes()[ GameRources.GetInstance().selectedCutsceneIndex].getPreviewImage(); canSkipVideo = canSkipVideoLast = Controller.getInstance().getSelectedChapterDataControl().getCutscenesList().getCutscenes()[ GameRources.GetInstance().selectedCutsceneIndex].getCanSkip(); // Get videopath videoscenePath = Controller.getInstance().getSelectedChapterDataControl().getCutscenesList().getCutscenes()[ GameRources.GetInstance().selectedCutsceneIndex].getPathToVideo(); } //musicPath = // Controller.getInstance().getSelectedChapterDataControl().getCutscenesList().getCutscenes()[ // GameRources.GetInstance().selectedCutsceneIndex].music(); if (slidesPath != null && !slidesPath.Equals("")) { slidesPreview = AssetsController.getImage(slidesPathPreview).texture; } slidePreviewMovie = (Texture2D)Resources.Load("EAdventureData/img/icons/video", typeof(Texture2D)); }
public override void Draw(int aID) { var windowWidth = m_Rect.width; var editor = GetConversationEditor(GameRources.GetInstance().selectedConversationIndex, false); //if (editor == null) { GUILayout.Space(30); for (int i = 0; i < Controller.getInstance().getCharapterList().getSelectedChapterDataControl().getConversationsList().getConversations().Count; i++) { GUILayout.BeginHorizontal(); GUILayout.Box(Controller.getInstance().getCharapterList().getSelectedChapterDataControl().getConversationsList().getConversations() [i].getId(), GUILayout.Width(windowWidth * 0.65f)); if (GUILayout.Button("Edit conversation", GUILayout.MaxWidth(windowWidth * 0.3f))) { GameRources.GetInstance().selectedConversationIndex = i; GetConversationEditor(GameRources.GetInstance().selectedConversationIndex, true); } GUILayout.EndHorizontal(); } //} else { //editor.OnGUI (); //} }
protected override void DrawInspector() { workingScene = Controller.Instance.SelectedChapterDataControl.getScenesList().getScenes()[GameRources.GetInstance().selectedSceneIndex]; // Appearance table appearanceEditor.Data = workingScene; appearanceEditor.OnInspectorGUI(); GUILayout.Space(10); EditorGUI.BeginChangeCheck(); background.Path = workingScene.getPreviewBackground(); background.DoLayout(); if (EditorGUI.EndChangeCheck()) { workingScene.setPreviewBackground(background.Path); componentBasedEditor.RefreshSceneResources(workingScene); } EditorGUI.BeginChangeCheck(); foreground.Path = workingScene.getPreviewForeground(); foreground.DoLayout(); if (EditorGUI.EndChangeCheck()) { workingScene.setPreviewForeground(foreground.Path); componentBasedEditor.RefreshSceneResources(workingScene); } EditorGUI.BeginChangeCheck(); music.Path = workingScene.getPreviewMusic(); music.DoLayout(); if (EditorGUI.EndChangeCheck()) { workingScene.setPreviewMusic(music.Path); } }
public override void Draw(int aID) { var workingBook = Controller.Instance.ChapterList.getSelectedChapterData().getBooks()[GameRources.GetInstance().selectedBookIndex]; GUILayout.Label(TC.get("Book.Documentation")); EditorGUI.BeginChangeCheck(); var documentation = GUILayout.TextArea(workingBook.getDocumentation(), GUILayout.ExpandHeight(true)); if (EditorGUI.EndChangeCheck()) { workingBook.setDocumentation(documentation); } }
protected CutsceneDataControl GetCurrentCutscene() { var cutscene = Target as CutsceneDataControl; if (cutscene == null) { cutscene = Controller.Instance.SelectedChapterDataControl.getCutscenesList().getCutscenes()[GameRources.GetInstance().selectedCutsceneIndex]; } return(cutscene); }
public override void Draw(int aID) { var workingScene = Controller.Instance.SelectedChapterDataControl.getScenesList().getScenes()[GameRources.GetInstance().selectedSceneIndex]; var xAPIConfigurable = workingScene as IxAPIConfigurable; //XApi class EditorGUI.BeginChangeCheck(); var classes = xAPIConfigurable.getxAPIValidClasses(); if (!classes.Contains(xAPIConfigurable.getxAPIClass())) { xAPIConfigurable.setxAPIClass(classes[0]); } var newClass = classes[EditorGUILayout.Popup("xAPI Class", classes.IndexOf(xAPIConfigurable.getxAPIClass()), classes.ToArray())]; if (EditorGUI.EndChangeCheck()) { xAPIConfigurable.setxAPIClass(newClass); } // Xapi Type EditorGUI.BeginChangeCheck(); var types = xAPIConfigurable.getxAPIValidTypes(xAPIConfigurable.getxAPIClass()); if (!types.Contains(xAPIConfigurable.getxAPIType())) { xAPIConfigurable.setxAPIType(types[0]); } var newType = types[EditorGUILayout.Popup("xAPI type", types.IndexOf(xAPIConfigurable.getxAPIType()), types.ToArray())]; if (EditorGUI.EndChangeCheck()) { xAPIConfigurable.setxAPIType(newType); } // Name EditorGUI.BeginChangeCheck(); var allowsSaving = EditorGUILayout.Toggle(TC.get("Scene.AllowsSaving"), workingScene.allowsSavingGame()); if (EditorGUI.EndChangeCheck()) { workingScene.setAllowsSavingGame(allowsSaving); } // Name EditorGUI.BeginChangeCheck(); var newName = EditorGUILayout.TextField(TC.get("Scene.Name"), workingScene.getName()); if (EditorGUI.EndChangeCheck()) { workingScene.setName(newName); } // Documentation EditorGUI.BeginChangeCheck(); EditorGUILayout.LabelField(TC.get("Scene.Documentation")); var newDescription = EditorGUILayout.TextArea(workingScene.getDocumentation(), GUILayout.ExpandHeight(true)); if (EditorGUI.EndChangeCheck()) { workingScene.setDocumentation(newDescription); } }
protected override void DrawInspector() { workingBook = Controller.Instance.SelectedChapterDataControl.getBooksList().getBooks()[GameRources.GetInstance().selectedBookIndex]; // Appearance table appearanceEditor.Data = workingBook; appearanceEditor.OnInspectorGUI(); GUILayout.Space(10); // Background EditorGUI.BeginChangeCheck(); background.Path = workingBook.getPreviewImage(); background.DoLayout(); if (EditorGUI.EndChangeCheck()) { workingBook.setPreviewImage(background.Path); } // Arrows GUILayout.BeginHorizontal(); DoArrowField(left, BookDataControl.ARROW_LEFT, BookDataControl.ARROW_NORMAL); DoArrowField(right, BookDataControl.ARROW_RIGHT, BookDataControl.ARROW_NORMAL); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); DoArrowField(left_over, BookDataControl.ARROW_LEFT, BookDataControl.ARROW_OVER); DoArrowField(right_over, BookDataControl.ARROW_RIGHT, BookDataControl.ARROW_OVER); GUILayout.EndHorizontal(); }
// Two methods responsible for showing right window content // - concrete item info or base window view public void ShowBaseWindowView() { GameRources.GetInstance().selectedSceneIndex = -1; }
protected override void DrawInspector() { var prevWorkingChar = workingCharacter; var player = Controller.Instance.SelectedChapterDataControl.getPlayer(); if (Target is NodeDataControl || IsPlayer) { workingCharacter = player; } else if (Target is NPCDataControl) { workingCharacter = Target as NPCDataControl; } else { workingCharacter = Controller.Instance.SelectedChapterDataControl.getNPCsList().getNPCs()[GameRources.GetInstance().selectedCharacterIndex]; } if (workingCharacter != prevWorkingChar) { RefreshPathInformation(workingCharacter); } // Appearance table appearanceEditor.Data = workingCharacter; appearanceEditor.OnInspectorGUI(); GUILayout.Label(TC.get("Resources.ResourcesGroup")); selectedAnimationGroup = groups[EditorGUILayout.Popup((int)selectedAnimationGroup, groupNames.Select(kv => TC.get(kv.Value)).ToArray())]; // Draw the animation selector for each animation in the selected resource group foreach (var resourceTypeGroup in resourceTypeGroups[selectedAnimationGroup]) { DoAnimationSelector(fields[resourceTypeGroup.Key], resourceTypeGroup.Value); } }
public void ShowItemWindowView(int o) { GameRources.GetInstance().selectedCutsceneIndex = o; }
public override void Draw(int aID) { var allTargets = GetSceneNames(); current = Controller.Instance.ChapterList.getSelectedChapterDataControl().getCutscenesList().getCutscenes()[GameRources.GetInstance().selectedCutsceneIndex]; GUILayout.Label(TC.get("Cutscene.CutsceneEndReached")); GUILayout.Space(20); // Selected option using (new EditorGUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); EditorGUI.BeginChangeCheck(); var selectedOption = GUILayout.Toolbar(current.getNext(), possibleOptions, GUILayout.Width(m_Rect.width * 0.8f)); if (EditorGUI.EndChangeCheck()) { current.setNext(selectedOption); } GUILayout.FlexibleSpace(); } if (current.getNext() != 2) { return; } GUILayout.Space(20); using (new EditorGUI.IndentLevelScope()) { // Next target var nextSceneIndex = Mathf.Max(0, allTargets.IndexOf(current.getNextSceneId())); EditorGUI.BeginChangeCheck(); nextSceneIndex = EditorGUILayout.Popup(TC.get("NextScene.Title"), nextSceneIndex, allTargets.ToArray()); if (EditorGUI.EndChangeCheck() && nextSceneIndex.InRange(0, allTargets.Count - 1)) { current.setNextSceneId(allTargets[nextSceneIndex]); } // Effects if (GUILayout.Button(TC.get("GeneralText.EditEffects"))) { var window = ScriptableObject.CreateInstance <EffectEditorWindow>(); window.Init(Controller.Instance.SelectedChapterDataControl.getCutscenesList().getCutscenes()[ GameRources.GetInstance().selectedCutsceneIndex].getEffects()); } // Transition Type EditorGUI.BeginChangeCheck(); var newType = EditorGUILayout.Popup(TC.get("NextScene.Transition"), (int)current.getTransitionType(), transitionTypes); if (EditorGUI.EndChangeCheck()) { current.setTransitionType((TransitionType)newType); } // Transition Time EditorGUI.BeginChangeCheck(); var time = Mathf.Clamp(EditorGUILayout.IntField(TC.get("NextScene.TransitionTime"), current.getTransitionTime()), 0, 5000); if (EditorGUI.EndChangeCheck()) { current.setTransitionTime(time); } } }