public override void Draw(int aID) { workingCharacter = Target != null ? Target as NPCDataControl : Controller.Instance.SelectedChapterDataControl.getNPCsList().getNPCs()[GameRources.GetInstance().selectedCharacterIndex]; // ------------- // Documentation // ------------- GUILayout.Label(TC.get("NPC.Documentation")); EditorGUI.BeginChangeCheck(); var fullItemDescription = GUILayout.TextArea(workingCharacter.getDocumentation() ?? string.Empty); if (EditorGUI.EndChangeCheck()) { workingCharacter.setDocumentation(fullItemDescription); } // ------------- // Descriptions // ------------- descriptionsEditor.Descriptions = workingCharacter.getDescriptionController(); descriptionsEditor.OnInspectorGUI(); GUILayout.Space(20); }
private Texture2D GetCharacterTexturePreview(NPCDataControl data, string animation) { var auxPath = data.getAnimationPathPreview(animation); if (!texturePaths.ContainsKey(animation) || texturePaths[animation] != auxPath) { textures[animation] = string.IsNullOrEmpty(auxPath) ? null : Controller.ResourceManager.getImage(auxPath); } return(textures[animation]); }
protected override void DrawInspector() { workingCharacter = Target != null ? Target as NPCDataControl : Controller.Instance.SelectedChapterDataControl.getNPCsList().getNPCs()[GameRources.GetInstance().selectedCharacterIndex]; GUILayout.Label(TC.get("Player.TextColor")); GUILayout.Space(20); // Use Bubbles EditorGUI.BeginChangeCheck(); shouldShowSpeechBubble = GUILayout.Toggle(shouldShowSpeechBubble, TC.get("Player.ShowsSpeechBubble")); if (EditorGUI.EndChangeCheck()) { workingCharacter.setShowsSpeechBubbles(shouldShowSpeechBubble); } // Font Color EditorGUI.BeginChangeCheck(); fontFrontColor = EditorGUILayout.ColorField(TC.get("Player.FrontColor"), workingCharacter.getTextFrontColor()); if (EditorGUI.EndChangeCheck()) { workingCharacter.setTextFrontColor(fontFrontColor); } // Font Border Color EditorGUI.BeginChangeCheck(); fontBorderColor = EditorGUILayout.ColorField(TC.get("Player.BorderColor"), workingCharacter.getTextBorderColor()); if (EditorGUI.EndChangeCheck()) { workingCharacter.setTextBorderColor(fontBorderColor); } using (new EditorGUI.DisabledScope(!shouldShowSpeechBubble)) { // Background color EditorGUI.BeginChangeCheck(); bubbleBcgColor = EditorGUILayout.ColorField(TC.get("Player.BubbleBkgColor"), workingCharacter.getBubbleBkgColor()); if (EditorGUI.EndChangeCheck()) { workingCharacter.setBubbleBkgColor(bubbleBcgColor); } // Border Color EditorGUI.BeginChangeCheck(); bubbleBorderColor = EditorGUILayout.ColorField(TC.get("Player.BubbleBorderColor"), workingCharacter.getBubbleBorderColor()); if (EditorGUI.EndChangeCheck()) { workingCharacter.setBubbleBorderColor(bubbleBorderColor); } } }
public override bool moveElementDown(DataControl dataControl) { bool elementMoved = false; int elementIndex = npcsList.IndexOf((NPC)dataControl.getContent()); if (elementIndex < npcsList.Count - 1) { NPC e = npcsList[elementIndex]; NPCDataControl c = npcsDataControlList[elementIndex]; npcsList.RemoveAt(elementIndex); npcsDataControlList.RemoveAt(elementIndex); npcsList.Insert(elementIndex + 1, e); npcsDataControlList.Insert(elementIndex + 1, c); controller.DataModified(); elementMoved = true; } return(elementMoved); }
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); } }
private Texture2D LoadCharacterTexturePreview(NPCDataControl data, string animation) { var auxPath = data.getAnimationPathPreview(animation); return(string.IsNullOrEmpty(auxPath) ? null : Controller.ResourceManager.getImage(auxPath)); }