public ItemsWindowAppearance(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, aOptions) { appearanceEditor = ScriptableObject.CreateInstance <ResourcesList>(); appearanceEditor.Height = 160; appearanceEditor.onResourceSelected = RefreshResources; PreviewTitle = "Item.Preview".Traslate(); // File selectors image = new FileChooser() { Label = TC.get("Resources.DescriptionItemImage"), FileType = FileType.ITEM_IMAGE, Empty = SpecialAssetPaths.ASSET_EMPTY_IMAGE }; icon = new FileChooser() { Label = TC.get("Resources.DescriptionItemIcon"), FileType = FileType.ITEM_ICON, Empty = SpecialAssetPaths.ASSET_EMPTY_ICON }; image_over = new FileChooser() { Label = TC.get("Resources.DescriptionItemImageOver"), FileType = FileType.ITEM_IMAGE_OVER }; }
public CutscenesWindowAppearance(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, aOptions) { appearanceEditor = ScriptableObject.CreateInstance <AppearanceEditor>(); appearanceEditor.height = 160; video = new FileChooser() { Label = TC.get("Resources.DescriptionVideoscenes"), FileType = FileType.CUTSCENE_VIDEO }; slides = new AnimationField() { Label = TC.get("Resources.DescriptionSlidesceneSlides"), FileType = FileType.CUTSCENE_SLIDES }; music = new FileChooser() { Label = TC.get("Resources.DescriptionSceneMusic"), FileType = FileType.CUTSCENE_MUSIC }; }
public void Init(DialogReceiverInterface e, string cutsceneFilePath) { parent = e; windowWidth = 800; windowHeight = 1000; cutscenePath = cutsceneFilePath; clearImg = Resources.Load <Texture2D>("EAdventureData/img/icons/deleteContent"); addTexture = Resources.Load <Texture2D>("EAdventureData/img/icons/addNode"); moveLeft = Resources.Load <Texture2D>("EAdventureData/img/icons/moveNodeLeft"); moveRight = Resources.Load <Texture2D>("EAdventureData/img/icons/moveNodeRight"); duplicateImg = Resources.Load <Texture2D>("EAdventureData/img/icons/duplicateNode"); noBackgroundSkin = Resources.Load <GUISkin>("EAdventureData/skin/EditorNoBackgroundSkin"); selectedFrameSkin = Resources.Load <GUISkin>("EAdventureData/skin/EditorLeftMenuItemSkinConcreteOptions"); transitionTypeName = new string[] { TC.get("NextScene.NoTransition"), TC.get("NextScene.TopToBottom"), TC.get("NextScene.BottomToTop"), TC.get("NextScene.LeftToRight"), TC.get("NextScene.RightToLeft"), TC.get("NextScene.FadeIn") }; transitionTypeTexture = new Texture2D[] { Resources.Load <Texture2D>("EAdventureData/img/icons/transitionNone"), Resources.Load <Texture2D>("EAdventureData/img/icons/transitionVertical"), Resources.Load <Texture2D>("EAdventureData/img/icons/transitionReverseVertical"), Resources.Load <Texture2D>("EAdventureData/img/icons/transitionHorizontal"), Resources.Load <Texture2D>("EAdventureData/img/icons/transitionReverseHorizontal"), Resources.Load <Texture2D>("EAdventureData/img/icons/transitionFadein"), }; Debug.Log(cutsceneFilePath); var incidences = new List <Incidence>(); workingAnimation = Loader.LoadAnimation(cutsceneFilePath, Controller.ResourceManager, incidences) ?? new Animation(cutsceneFilePath, 40); imageChooser = new FileChooser { Empty = SpecialAssetPaths.ASSET_EMPTY_IMAGE, FileType = FileType.FRAME_IMAGE, Label = TC.get("Animation.Image") }; soundChooser = new FileChooser { FileType = FileType.FRAME_MUSIC, Label = TC.get("Animation.Sound") }; // Initalize selectedFrame = -1; base.Init(e); }
public ScenesWindowAppearance(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, SceneEditor sceneEditor, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, sceneEditor, aOptions) { appearanceEditor = ScriptableObject.CreateInstance <AppearanceEditor>(); appearanceEditor.height = 160; appearanceEditor.onAppearanceSelected = sceneEditor.RefreshSceneResources; PreviewTitle = "Scene.Preview".Traslate(); // Fields background = new FileChooser() { Label = TC.get("Resources.DescriptionSceneBackground"), FileType = FileType.SCENE_BACKGROUND, Empty = SpecialAssetPaths.ASSET_EMPTY_BACKGROUND }; foreground = new FileChooser() { Label = TC.get("Resources.DescriptionSceneForeground"), FileType = FileType.SCENE_FOREGROUND }; music = new FileChooser() { Label = TC.get("Resources.DescriptionSceneMusic"), FileType = FileType.SCENE_MUSIC }; }
public SpeakPlayerEffectEditor() { audioField = new FileChooser() { FileType = FileType.PLAY_SOUND_EFFECT }; this.effect = new SpeakPlayerEffect(""); }
public PlaySoundEffectEditor() { musicField = new FileChooser() { FileType = FileType.PLAY_SOUND_EFFECT }; this.effect = new PlaySoundEffect(false, ""); }
public CursorInfo(string identifier) { this.identifier = identifier; camelCaseIdentifier = identifier.Split('-').Select(w => w.Substring(0, 1).ToUpper() + w.Substring(1)).Aggregate((w1, w2) => w1 + w2); chooser = new FileChooser { Label = "Normal", FileType = FileType.CURSOR, Path = Controller.Instance.AdventureData.getCursorPath(identifier), Empty = Controller.Instance.AdventureData.getAdventureData().getDefaultCursorPath(identifier) }; }
public ResourcesEditor() { resourcesList = ScriptableObject.CreateInstance <ResourcesList>(); file = new FileChooser() { FileType = FileType.BUTTON, }; animation = new AnimationField() { FileType = FileType.CHARACTER_ANIM, }; }
public SpeakCharEffectEditor() { audioField = new FileChooser() { FileType = FileType.PLAY_SOUND_EFFECT }; var npcs = Controller.Instance.IdentifierSummary.getIds <NPC>(); if (npcs != null && npcs.Length > 0) { this.effect = new SpeakCharEffect(npcs[0], ""); } }
public ExitAppearanceComponent(Rect rect, GUIContent content, GUIStyle style, params GUILayoutOption[] options) : base(rect, content, style, options) { displayField = new TextWithSoundField() { Label = TC.get("Exit.ExitText"), FileType = FileType.EXIT_MUSIC }; cursorField = new FileChooser() { Label = TC.get("Cursor.exit.Description"), FileType = FileType.EXIT_ICON, Empty = SpecialAssetPaths.ASSET_EMPTY_ICON }; }
public SetItemsWindowApperance(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, aOptions) { appearanceEditor = ScriptableObject.CreateInstance <AppearanceEditor>(); appearanceEditor.height = 160; PreviewTitle = "Atrezzo.Preview".Traslate(); // File selectors image = new FileChooser() { Label = TC.get("Resources.DescriptionItemImage"), FileType = FileType.SET_ITEM_IMAGE }; }
private void DoArrowField(FileChooser arrow, int arrowOrientation, int arrowState) { EditorGUI.BeginChangeCheck(); arrow.Path = workingBook.getArrowImagePath(arrowOrientation, arrowState); if (string.IsNullOrEmpty(arrow.Path)) { arrow.Path = arrow.Empty; workingBook.setArrowImagePath(arrowOrientation, arrowState, arrow.Path); RefreshPathInformation(workingBook); } arrow.DoLayout(GUILayout.ExpandWidth(true)); if (EditorGUI.EndChangeCheck()) { workingBook.setArrowImagePath(arrowOrientation, arrowState, arrow.Path); RefreshPathInformation(workingBook); } }
public BooksWindowAppearance(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, aOptions) { appearanceEditor = ScriptableObject.CreateInstance <ResourcesList>(); appearanceEditor.Height = 160; appearanceEditor.onResourceSelected = RefreshPathInformation; PreviewTitle = "BackgroundAssets.Preview".Traslate(); background = new FileChooser() { Label = TC.get("Resources.DescriptionBookBackground"), FileType = FileType.SCENE_BACKGROUND, Empty = SpecialAssetPaths.ASSET_EMPTY_IMAGE }; left = new FileChooser() { Label = TC.get("Resources.ArrowLeftNormal"), FileType = FileType.BOOK_ARROW_LEFT_NORMAL, Empty = SpecialAssetPaths.ASSET_DEFAULT_ARROW_NORMAL }; left_over = new FileChooser() { Label = TC.get("Resources.ArrowLeftOver"), FileType = FileType.BOOK_ARROW_LEFT_OVER, Empty = SpecialAssetPaths.ASSET_DEFAULT_ARROW_OVER }; right = new FileChooser() { Label = TC.get("Resources.ArrowRightNormal"), FileType = FileType.BOOK_ARROW_RIGHT_NORMAL, Empty = SpecialAssetPaths.ASSET_DEFAULT_ARROW_NORMAL_RIGHT }; right_over = new FileChooser() { Label = TC.get("Resources.ArrowRightOver"), FileType = FileType.BOOK_ARROW_RIGHT_OVER, Empty = SpecialAssetPaths.ASSET_DEFAULT_ARROW_OVER_RIGHT }; }
public ButtonInfo(string identifier) { this.identifier = identifier; camelCaseIdentifier = identifier.Split('-').Select(w => w.Substring(0, 1).ToUpper() + w.Substring(1)).Aggregate((w1, w2) => w1 + w2); normalButton = new FileChooser { Label = "Normal", FileType = FileType.BUTTON, Path = Controller.Instance.AdventureData.getButtonPath(identifier, DescriptorData.NORMAL_BUTTON), Empty = Controller.Instance.AdventureData.getAdventureData().getDefaultButtonPath(identifier, DescriptorData.NORMAL_BUTTON) }; highlightedButton = new FileChooser { Label = "Highlighted", FileType = FileType.BUTTON, Path = Controller.Instance.AdventureData.getButtonPath(identifier, DescriptorData.HIGHLIGHTED_BUTTON), Empty = Controller.Instance.AdventureData.getAdventureData().getDefaultButtonPath(identifier, DescriptorData.HIGHLIGHTED_BUTTON) }; }
public InventoryPreview(Rect rect, GUIContent content, GUIStyle style, params GUILayoutOption[] options) : base(rect, content, style, options) { iconChooser = new FileChooser { FileType = FileType.BUTTON, Empty = SpecialAssetPaths.ASSET_DEFAULT_INVENTORY, Label = TC.get("Inventory.Image") }; var adventureData = Controller.Instance.AdventureData; iconChooser.Path = string.IsNullOrEmpty(adventureData.getInventoryImage()) ? iconChooser.Empty : adventureData.getInventoryImage(); defaultBackground = Controller.ResourceManager.getImage(SpecialAssetPaths.ASSET_EMPTY_BACKGROUND); ReloadIcon(); EditorApplication.update += () => { if (growing) { if (scale > 0) { progressTop += (speed / 100f) * Time.deltaTime; progressBottom -= (speed / 100f) * Time.deltaTime; } else { progressTop -= (speed / 100f) * Time.deltaTime; progressBottom += (speed / 100f) * Time.deltaTime; } } else { progressTop -= (speed / 100f) * Time.deltaTime; progressBottom -= (speed / 100f) * Time.deltaTime; } Repaint(); }; }
public BooksWindowContents(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions) : base(aStartPos, aContent, aStyle, aOptions) { PreviewTitle = "Book.Preview".Traslate(); elementTitles = new Dictionary <int, string> { { Controller.BOOK_TITLE_PARAGRAPH, "Element.Name14" }, { Controller.BOOK_TEXT_PARAGRAPH, "Element.Name15" }, { Controller.BOOK_BULLET_PARAGRAPH, "Element.Name16" }, { Controller.BOOK_IMAGE_PARAGRAPH, "Element.Name17" } }; elementIcons = new Dictionary <int, Texture2D> { { Controller.BOOK_TITLE_PARAGRAPH, Resources.Load <Texture2D>("EAdventureData/img/icons/titleBookParagraph") }, { Controller.BOOK_TEXT_PARAGRAPH, Resources.Load <Texture2D>("EAdventureData/img/icons/textBookParagraph") }, { Controller.BOOK_BULLET_PARAGRAPH, Resources.Load <Texture2D>("EAdventureData/img/icons/bulletBookParagraph") }, { Controller.BOOK_IMAGE_PARAGRAPH, Resources.Load <Texture2D>("EAdventureData/img/icons/imageBookParagraph") } }; imageChooser = new FileChooser { Label = "", FileType = FileType.BOOK_IMAGE_PARAGRAPH }; bookContentsList = new DataControlList { Columns = { new ColumnList.Column { Text = "BookParagraphsList.ParagraphType", SizeOptions = new GUILayoutOption[]{ GUILayout.Width(150) } }, new ColumnList.Column { Text = "BookParagraphsList.Content", SizeOptions = new GUILayoutOption[]{ GUILayout.ExpandWidth(true) } } }, drawCell = (rect, row, column, isActive, isFocused) => { var content = bookContentsList.list[row] as BookParagraphDataControl; switch (column) { default: Debug.LogError("Column number out of bounds"); break; case 0: { var height = rect.height; var icon = elementIcons[content.getType()]; var text = elementTitles[content.getType()].Traslate(); var imageRect = new Rect(1, 1, icon.width, icon.height).GUIAdapt(rect); var titleRect = new Rect(height, 0, rect.width - height, height).GUIAdapt(rect); GUI.DrawTexture(imageRect, icon, ScaleMode.ScaleAndCrop); GUI.Label(titleRect, text); } break; case 1: { if (isActive) { var isImage = content.getType() == Controller.BOOK_IMAGE_PARAGRAPH; if (isImage) { EditorGUI.BeginChangeCheck(); imageChooser.Path = content.getParagraphContent(); imageChooser.Do(rect); if (EditorGUI.EndChangeCheck()) { content.setParagraphImagePath(imageChooser.Path); } } else { EditorGUI.BeginChangeCheck(); var newContent = GUI.TextArea(rect, content.getParagraphContent()); if (EditorGUI.EndChangeCheck()) { content.setParagraphTextContent(newContent); } } } else { GUI.Label(rect, content.getParagraphContent()); } } break; } } }; bookDrawer = new BookDrawer(Controller.ResourceManager); }
protected void OnEnable() { textureField = new FileChooser { FileType = FileType.SET_ITEM_IMAGE }; }