void DisplaySaveCharacterGUI()
        {
            // Get character record
            List <SaveTreeBaseRecord> records = currentSaveTree.FindRecords(RecordTypes.Character);

            if (records.Count != 1)
            {
                return;
            }

            CharacterRecord characterRecord = (CharacterRecord)records[0];

            //CharacterSheet characterSheet = characterRecord.ToCharacterSheet();

            EditorGUILayout.Space();
            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("Name"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(characterRecord.ParsedData.characterName, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("Gender"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(((int)characterRecord.ParsedData.gender).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
        }
Пример #2
0
 void ShowForbiddenShieldsGUI()
 {
     EditorGUILayout.Space();
     showForbiddenShieldsFoldout = GUILayoutHelper.Foldout(showForbiddenShieldsFoldout, new GUIContent("Forbidden Shields"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Buckler");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsShieldForbidden(DFCareer.ShieldFlags.Buckler).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Round Shield");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsShieldForbidden(DFCareer.ShieldFlags.RoundShield).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Kite Shield");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsShieldForbidden(DFCareer.ShieldFlags.KiteShield).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Tower Shield");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsShieldForbidden(DFCareer.ShieldFlags.TowerShield).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
        private void DisplayAboutGUI()
        {
            EditorGUILayout.Space();
            ShowAboutGroundFoldout = GUILayoutHelper.Foldout(ShowAboutGroundFoldout, new GUIContent("About"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    if (dfGround.Summary.archive == 0)
                    {
                        EditorGUILayout.HelpBox("Ground planes must be created by script or imported using the DaggerfallUnity editor.", MessageType.Info);
                        return;
                    }

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Climate", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfGround.Summary.climate.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Season", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfGround.Summary.season.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                });
            });
        }
Пример #4
0
 private void DisplayAboutGUI()
 {
     EditorGUILayout.Space();
     ShowAboutDungeonFoldout = GUILayoutHelper.Foldout(ShowAboutDungeonFoldout, new GUIContent("About"), () =>
     {
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("ID", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfDungeon.Summary.ID.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Region Name", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfDungeon.Summary.RegionName, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Location Name", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfDungeon.Summary.LocationName, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Dungeon Type", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfDungeon.Summary.DungeonType.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
Пример #5
0
 void ShowForbiddenArmorGUI()
 {
     EditorGUILayout.Space();
     showForbiddenArmorFoldout = GUILayoutHelper.Foldout(showForbiddenArmorFoldout, new GUIContent("Forbidden Armors"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Leather");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsArmorForbidden(DFCareer.ArmorFlags.Leather).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Chain");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsArmorForbidden(DFCareer.ArmorFlags.Chain).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Plate");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsArmorForbidden(DFCareer.ArmorFlags.Plate).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
Пример #6
0
        private void DisplayAssetExporterGUI()
        {
            EditorGUILayout.Space();
            ShowAssetExportFoldout = GUILayoutHelper.Foldout(ShowAssetExportFoldout, new GUIContent("Asset Exporter (Beta)"), () =>
            {
                EditorGUILayout.HelpBox("Export pre-built assets to specified Resources folder and subfolder.", MessageType.Info);

                // Parent Resources path
                var propMyResourcesFolder         = Prop("Option_MyResourcesFolder");
                propMyResourcesFolder.stringValue = EditorGUILayout.TextField(new GUIContent("My Resources Folder", "Path to Resources folder for asset export."), propMyResourcesFolder.stringValue);

                // Terrain atlases
                GUILayoutHelper.Horizontal(() =>
                {
                    var propTerrainAtlasesSubFolder         = Prop("Option_TerrainAtlasesSubFolder");
                    propTerrainAtlasesSubFolder.stringValue = EditorGUILayout.TextField(new GUIContent("Terrain Atlas SubFolder", "Sub-folder for terrain atlas textures."), propTerrainAtlasesSubFolder.stringValue);
                    if (GUILayout.Button("Update"))
                    {
//#if UNITY_EDITOR && !UNITY_WEBPLAYER
//                        dfUnity.ExportTerrainTextureAtlases();
//#endif
                    }
                });
            });
        }
        void DisplaySaveStatsGUI()
        {
            if (currentSaveTree == null)
            {
                return;
            }

            EditorGUILayout.Space();
            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("Version"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(currentSaveTree.Header.Version.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            GUILayoutHelper.Horizontal(() =>
            {
                string positionText = string.Format("X={0}, Y={1}, Z={2}",
                                                    currentSaveTree.Header.CharacterPosition.Position.WorldX,
                                                    currentSaveTree.Header.CharacterPosition.Position.YOffset,
                                                    currentSaveTree.Header.CharacterPosition.Position.WorldZ);

                EditorGUILayout.LabelField(new GUIContent("Player Position", "Position of player in the world."), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(positionText, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            GUILayoutHelper.Horizontal(() =>
            {
                DFPosition mapPixel = MapsFile.WorldCoordToMapPixel(currentSaveTree.Header.CharacterPosition.Position.WorldX, currentSaveTree.Header.CharacterPosition.Position.WorldZ);
                string mapPixelText = string.Format("X={0}, Y={1}", mapPixel.X, mapPixel.Y);

                EditorGUILayout.LabelField(new GUIContent("Player Map Pixel", "Position of player on small map."), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(mapPixelText, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            GUILayoutHelper.Horizontal(() =>
            {
                DaggerfallDateTime time = new DaggerfallDateTime();
                time.FromClassicDaggerfallTime(currentSaveVars.GameTime);

                EditorGUILayout.LabelField(new GUIContent("Player Time", "World time of this save."), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(time.LongDateTimeString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("LocationDetail records"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(currentSaveTree.LocationDetail.RecordCount.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("RecordElement records"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(currentSaveTree.RecordDictionary.Count.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            //GUILayoutHelper.Horizontal(() =>
            //{
            //    EditorGUILayout.LabelField(new GUIContent("Header.Unknown"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
            //    EditorGUILayout.SelectableLabel(currentSaveTree.Header.Unknown.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            //});
            //GUILayoutHelper.Horizontal(() =>
            //{
            //    EditorGUILayout.LabelField(new GUIContent("CharacterPosition.Unknown"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
            //    EditorGUILayout.SelectableLabel(currentSaveTree.Header.CharacterPosition.Unknown.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            //});
        }
Пример #8
0
 private void DisplayAboutGUI()
 {
     EditorGUILayout.Space();
     ShowAboutBillboardFoldout = GUILayoutHelper.Foldout(ShowAboutBillboardFoldout, new GUIContent("About"), () =>
     {
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("File", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(TextureFile.IndexToFileName(dfBillboard.Summary.Archive), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Index", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.Record.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("In Dungeon", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.InDungeon.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Is Mobile", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.IsMobile.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             if (dfBillboard.Summary.InDungeon && dfBillboard.Summary.IsMobile)
             {
                 GUILayoutHelper.Horizontal(() =>
                 {
                     EditorGUILayout.LabelField("Gender", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                     EditorGUILayout.SelectableLabel(((DFBlock.RdbFlatGenders)(dfBillboard.Summary.Gender)).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                 });
                 GUILayoutHelper.Horizontal(() =>
                 {
                     EditorGUILayout.LabelField("Type", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                     EditorGUILayout.SelectableLabel(dfBillboard.Summary.FixedEnemyType.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                 });
             }
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Is Atlased", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.AtlasedMaterial.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Is Animated", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.AnimatedMaterial.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Current Frame", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.CurrentFrame.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
Пример #9
0
        public override void OnInspectorGUI()
        {
            // Update
            serializedObject.Update();

            // Get properties
            var propArena2Path = Prop("Arena2Path");

            // Browse for Arena2 path
            EditorGUILayout.Space();
            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("Arena2 Path", "The local Arena2 path used for development only."), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(dfUnity.Arena2Path, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                if (GUILayout.Button("Browse..."))
                {
                    string path = EditorUtility.OpenFolderPanel("Locate Arena2 Path", "", "");
                    if (!string.IsNullOrEmpty(path))
                    {
                        if (!DaggerfallUnity.ValidateArena2Path(path))
                        {
                            EditorUtility.DisplayDialog("Invalid Path", "The selected Arena2 path is invalid", "Close");
                        }
                        else
                        {
                            dfUnity.Arena2Path = path;
                            propArena2Path.stringValue = path;
                            dfUnity.EditorResetArena2Path();
                        }
                    }
                }
                if (GUILayout.Button("Clear"))
                {
                    dfUnity.EditorClearArena2Path();
                    EditorUtility.SetDirty(target);
                }
            });

            // Prompt user to set Arena2 path
            if (string.IsNullOrEmpty(dfUnity.Arena2Path))
            {
                EditorGUILayout.HelpBox("Please set the Arena2 path of your Daggerfall installation.", MessageType.Info);
                return;
            }

            // Display other GUI items
            DisplayOptionsGUI();
            DisplayImporterGUI();

            // Save modified properties
            serializedObject.ApplyModifiedProperties();
            if (GUI.changed)
                EditorUtility.SetDirty(target);
        }
        private void DisplayGUI()
        {
            DaggerfallUnity dfUnity = DaggerfallUnity.Instance;

            if (dfUnity == null || string.IsNullOrEmpty(dfUnity.Arena2Path))
            {
                EditorGUILayout.HelpBox("Requires DaggerfallUnity singleton with Arena2 path set.", MessageType.Info);
                return;
            }

            DrawTravelMap();
            DrawDefaultInspector();

            if (!streamingWorld.LocalPlayerGPS)
            {
                EditorGUILayout.HelpBox("Requires player object with PlayerGPS component.", MessageType.Info);
                var propLocalPlayerGPS = Prop("LocalPlayerGPS");
                propLocalPlayerGPS.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("", ""), propLocalPlayerGPS.objectReferenceValue, typeof(PlayerGPS), true);
                return;
            }

            EditorGUILayout.Space();
            var propFindLocationString = Prop("EditorFindLocationString");

            EditorGUILayout.LabelField(new GUIContent("Find Location", "Enter exact city name in format RegionName/CityName. Case-sensitive."));
            GUILayoutHelper.Horizontal(() =>
            {
                propFindLocationString.stringValue = EditorGUILayout.TextField(propFindLocationString.stringValue.Trim());
                if (GUILayout.Button("Find"))
                {
                    streamingWorld.__EditorFindLocation();
                }
            });

            EditorGUILayout.Space();
            GUILayoutHelper.Horizontal(() =>
            {
                if (GUILayout.Button("Get From PlayerGPS"))
                {
                    streamingWorld.__EditorGetFromPlayerGPS();
                    EditorUtility.SetDirty(streamingWorld.LocalPlayerGPS);
                }
                if (GUILayout.Button("Apply To PlayerGPS"))
                {
                    streamingWorld.__EditorApplyToPlayerGPS();
                    EditorUtility.SetDirty(streamingWorld.LocalPlayerGPS);
                }
            });

            //if (GUILayout.Button("Refresh Preview"))
            //{
            //    streamingWorld.__EditorRefreshPreview();
            //}
        }
Пример #11
0
 void ShowAttributesGUI()
 {
     EditorGUILayout.Space();
     showAttributesFoldout = GUILayoutHelper.Foldout(showAttributesFoldout, new GUIContent("Attributes"), () =>
     {
         GUILayoutHelper.Indent(() =>
         {
             EditorGUILayout.Space();
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Strength");
                 EditorGUILayout.SelectableLabel(selectedCareer.Strength.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Intelligence");
                 EditorGUILayout.SelectableLabel(selectedCareer.Intelligence.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Willpower");
                 EditorGUILayout.SelectableLabel(selectedCareer.Willpower.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Agility");
                 EditorGUILayout.SelectableLabel(selectedCareer.Agility.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Endurance");
                 EditorGUILayout.SelectableLabel(selectedCareer.Endurance.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Personality");
                 EditorGUILayout.SelectableLabel(selectedCareer.Personality.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Speed");
                 EditorGUILayout.SelectableLabel(selectedCareer.Speed.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Luck");
                 EditorGUILayout.SelectableLabel(selectedCareer.Luck.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
        public void DisplayGUI()
        {
            DrawDefaultInspector();

            GUILayoutHelper.Horizontal(() =>
            {
                if (GUILayout.Button("Clear"))
                {
                    dfBillboardBatch.__EditorClearBillboards();
                }
                if (GUILayout.Button("Random"))
                {
                    dfBillboardBatch.__EditorRandomLayout();
                }
            });
        }
Пример #13
0
 void ShowTolerancesGUI()
 {
     EditorGUILayout.Space();
     showTolerancesFoldout = GUILayoutHelper.Foldout(showTolerancesFoldout, new GUIContent("Tolerances"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Paralysis");
                 EditorGUILayout.SelectableLabel(selectedCareer.Paralysis.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Magic");
                 EditorGUILayout.SelectableLabel(selectedCareer.Magic.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Poison");
                 EditorGUILayout.SelectableLabel(selectedCareer.Poison.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Fire");
                 EditorGUILayout.SelectableLabel(selectedCareer.Fire.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Frost");
                 EditorGUILayout.SelectableLabel(selectedCareer.Frost.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Shock");
                 EditorGUILayout.SelectableLabel(selectedCareer.Shock.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Disease");
                 EditorGUILayout.SelectableLabel(selectedCareer.Disease.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
        private void DisplayEditorGUI()
        {
            var propPreset = Prop("Preset");

            EditorGUILayout.Space();
            propPreset.enumValueIndex = (int)(AudioPresets)EditorGUILayout.EnumPopup(new GUIContent("Preset"), (AudioPresets)propPreset.enumValueIndex);
            dfAudioSource.SoundIndex  = EditorGUILayout.IntField(new GUIContent("Index", "Index of sound to apply. Valid range is 0-458."), dfAudioSource.SoundIndex);

            //EditorGUILayout.Space();
            //if (GUILayout.Button("Apply"))
            //    dfAudioSource.Apply();

            EditorGUILayout.Space();
            ShowPreviewSoundFoldout = GUILayoutHelper.Foldout(ShowPreviewSoundFoldout, new GUIContent("Sound Finder"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    GUILayoutHelper.Horizontal(() =>
                    {
                        dfAudioSource.PreviewIndex = EditorGUILayout.IntField(new GUIContent("Preview Index", "Preview sound by index. Valid range is 0-458."), dfAudioSource.PreviewIndex);
                        if (GUILayout.Button("Preview"))
                        {
                            dfAudioSource.EditorPreviewByIndex();
                        }
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        dfAudioSource.PreviewID = EditorGUILayout.IntField(new GUIContent("Preview ID", "Preview sound by ID."), dfAudioSource.PreviewID);
                        if (GUILayout.Button("Preview"))
                        {
                            dfAudioSource.EditorPreviewByID();
                        }
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        dfAudioSource.PreviewClip = (SoundClips)EditorGUILayout.EnumPopup(new GUIContent("Preview Clip", "Preview sound by clip enum."), dfAudioSource.PreviewClip);
                        if (GUILayout.Button("Preview"))
                        {
                            dfAudioSource.EditorPreviewBySoundClip();
                        }
                    });
                });
            });
        }
Пример #15
0
        private void DisplayGUI()
        {
            DrawDefaultInspector();

            if (Application.isPlaying)
            {
                GUILayoutHelper.Horizontal(() =>
                {
                    if (GUILayout.Button("Play"))
                    {
                        dfSongPlayer.Play();
                    }
                    if (GUILayout.Button("Stop"))
                    {
                        dfSongPlayer.Stop();
                    }
                });
            }
        }
Пример #16
0
        void DisplayGUI()
        {
            DrawDefaultInspector();

            EditorGUILayout.Space();
            EditorGUILayout.LabelField(new GUIContent("String Importer", "Import classic text data into named String Table Collections.\nNOTE: You must create collections manually.\nWARNING: Existing collections will be cleared."), EditorStyles.boldLabel);
            GUILayoutHelper.Horizontal(() =>
            {
                var rscCollectionName = Prop("textRSCCollection");
                if (GUILayout.Button("Import All"))
                {
                    DaggerfallStringTableImporter.ImportTextRSCToStringTables(rscCollectionName.stringValue);
                }
                if (GUILayout.Button("Clear All"))
                {
                    DaggerfallStringTableImporter.ClearStringTables(rscCollectionName.stringValue);
                }
            });
        }
Пример #17
0
        private void DisplayDungeonTexturesGUI()
        {
            var propDungeonTextureUse = Prop("DungeonTextureUse");

            EditorGUILayout.Space();
            ShowDungeonTexturesFoldout = GUILayoutHelper.Foldout(ShowDungeonTexturesFoldout, new GUIContent("Dungeon Textures (Beta)"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    propDungeonTextureUse.enumValueIndex = (int)(DungeonTextureUse)EditorGUILayout.EnumPopup(new GUIContent("Usage"), (DungeonTextureUse)propDungeonTextureUse.enumValueIndex);
                    if (propDungeonTextureUse.enumValueIndex == (int)DungeonTextureUse.Disabled ||
                        propDungeonTextureUse.enumValueIndex == (int)DungeonTextureUse.UseLocation_PartiallyImplemented)
                    {
                        return;
                    }

                    dfDungeon.DungeonTextureTable[0] = EditorGUILayout.IntField("119 is ->", dfDungeon.DungeonTextureTable[0]);
                    dfDungeon.DungeonTextureTable[1] = EditorGUILayout.IntField("120 is ->", dfDungeon.DungeonTextureTable[1]);
                    dfDungeon.DungeonTextureTable[2] = EditorGUILayout.IntField("122 is ->", dfDungeon.DungeonTextureTable[2]);
                    dfDungeon.DungeonTextureTable[3] = EditorGUILayout.IntField("123 is ->", dfDungeon.DungeonTextureTable[3]);
                    dfDungeon.DungeonTextureTable[4] = EditorGUILayout.IntField("124 is ->", dfDungeon.DungeonTextureTable[4]);
                    dfDungeon.DungeonTextureTable[5] = EditorGUILayout.IntField("168 is ->", dfDungeon.DungeonTextureTable[5]);

                    GUILayoutHelper.Horizontal(() =>
                    {
                        if (GUILayout.Button("Reset"))
                        {
                            dfDungeon.ResetDungeonTextureTable();
                        }
                        if (GUILayout.Button("Random"))
                        {
                            dfDungeon.RandomiseDungeonTextureTable();
                        }
                        if (GUILayout.Button("Apply"))
                        {
                            dfDungeon.ApplyDungeonTextureTable();
                        }
                    });
                });
            });
        }
Пример #18
0
 void ShowProficienciesGUI()
 {
     EditorGUILayout.Space();
     showProficienciesFoldout = GUILayoutHelper.Foldout(showProficienciesFoldout, new GUIContent("Proficiencies"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Short Blades");
                 EditorGUILayout.SelectableLabel(selectedCareer.ShortBlades.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Long Blades");
                 EditorGUILayout.SelectableLabel(selectedCareer.LongBlades.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Hand To Hand");
                 EditorGUILayout.SelectableLabel(selectedCareer.HandToHand.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Axes");
                 EditorGUILayout.SelectableLabel(selectedCareer.Axes.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Blunt Weapons");
                 EditorGUILayout.SelectableLabel(selectedCareer.BluntWeapons.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Missile Weapons");
                 EditorGUILayout.SelectableLabel(selectedCareer.MissileWeapons.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
Пример #19
0
 void ShowAdvancementGUI()
 {
     EditorGUILayout.Space();
     showAdvancementFoldout = GUILayoutHelper.Foldout(showAdvancementFoldout, new GUIContent("Advancement"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Max HP Per Class Level / Number of Monster HP Die Rolls");
                 EditorGUILayout.SelectableLabel(selectedCareer.HitPointsPerLevel.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Difficulty Multiplier");
                 EditorGUILayout.SelectableLabel(selectedCareer.AdvancementMultiplier.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
        void DisplaySaveStatsGUI()
        {
            EditorGUILayout.Space();
            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("Version"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(currentSaveTree.Header.Version.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            GUILayoutHelper.Horizontal(() =>
            {
                string positionText = string.Format("X={0}, Y={1}, Z={2}",
                                                    currentSaveTree.Header.CharacterPosition.Position.WorldX,
                                                    currentSaveTree.Header.CharacterPosition.Position.YBase - currentSaveTree.Header.CharacterPosition.Position.YOffset,
                                                    currentSaveTree.Header.CharacterPosition.Position.YBase,
                                                    currentSaveTree.Header.CharacterPosition.Position.WorldZ);

                EditorGUILayout.LabelField(new GUIContent("Player Position", "Position of player in the world."), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(positionText, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("LocationDetail records"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(currentSaveTree.LocationDetail.RecordCount.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("RecordElement records"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(currentSaveTree.RecordDictionary.Count.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            });
            //GUILayoutHelper.Horizontal(() =>
            //{
            //    EditorGUILayout.LabelField(new GUIContent("Header.Unknown"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
            //    EditorGUILayout.SelectableLabel(currentSaveTree.Header.Unknown.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            //});
            //GUILayoutHelper.Horizontal(() =>
            //{
            //    EditorGUILayout.LabelField(new GUIContent("CharacterPosition.Unknown"), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
            //    EditorGUILayout.SelectableLabel(currentSaveTree.Header.CharacterPosition.Unknown.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            //});
        }
Пример #21
0
        public void DisplayGUI()
        {
            if (dfBillboardBatch.IsCustom)
            {
                EditorGUILayout.HelpBox("Cannot set properties of a custom batch material from editor at this time.", MessageType.Info);
                return;
            }

            DrawDefaultInspector();

            GUILayoutHelper.Horizontal(() =>
            {
                if (GUILayout.Button("Clear"))
                {
                    dfBillboardBatch.__EditorClearBillboards();
                }
                if (GUILayout.Button("Random"))
                {
                    dfBillboardBatch.__EditorRandomLayout();
                }
            });
        }
Пример #22
0
 void ShowMagickaGUI()
 {
     EditorGUILayout.Space();
     showMagickaFoldout = GUILayoutHelper.Foldout(showMagickaFoldout, new GUIContent("Magicka"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Increased Magery");
                 EditorGUILayout.SelectableLabel(selectedCareer.SpellPointMultiplierValue.ToString("0.00 * INT"), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Darkness Powered Magery");
                 EditorGUILayout.SelectableLabel(selectedCareer.DarknessPoweredMagery.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Light Powered Magery");
                 EditorGUILayout.SelectableLabel(selectedCareer.LightPoweredMagery.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Spell Absorption");
                 EditorGUILayout.SelectableLabel(selectedCareer.SpellAbsorption.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Unable to regenerate spell points");
                 EditorGUILayout.SelectableLabel(selectedCareer.NoRegenSpellPoints.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
        void OnGUI()
        {
            if (!IsReady())
            {
                EditorGUILayout.HelpBox("DaggerfallUnity instance not ready. Have you set your Arena2 path?", MessageType.Info);
                return;
            }

            EditorGUILayout.Space();
            selectedRegion = EditorGUILayout.Popup(selectedRegion, regionNames);
            if (selectedRegion != lastSelectedRegion)
            {
                locationNames.Clear();
                ReloadCurrentRegion();
            }

            // Search bar
            GUILayout.BeginHorizontal(GUI.skin.FindStyle("Toolbar"));
            searchString = GUILayout.TextField(searchString, GUI.skin.FindStyle("ToolbarSeachTextField"));
            if (GUILayout.Button("", GUI.skin.FindStyle("ToolbarSeachCancelButton")))
            {
                // Remove focus if cleared
                searchString = "";
                GUI.FocusControl(null);
            }
            GUILayout.EndHorizontal();

            bool search = false;

            if (string.IsNullOrEmpty(searchString))
            {
                if (locationNames.Count == regionData.LocationCount)
                {
                    locationNames.Clear();
                }

                GUILayoutHelper.Horizontal(() =>
                {
                    if (GUILayout.Button("Cities"))
                    {
                        EnumerateLocationsByType(SearchPatterns.Cities);
                    }
                    if (GUILayout.Button("Dungeons"))
                    {
                        EnumerateLocationsByType(SearchPatterns.Dungeons);
                    }
                    if (GUILayout.Button("Graveyards"))
                    {
                        EnumerateLocationsByType(SearchPatterns.Graveyards);
                    }
                    if (GUILayout.Button("Homes"))
                    {
                        EnumerateLocationsByType(SearchPatterns.Homes);
                    }
                    if (GUILayout.Button("Taverns"))
                    {
                        EnumerateLocationsByType(SearchPatterns.Taverns);
                    }
                    if (GUILayout.Button("Temples"))
                    {
                        EnumerateLocationsByType(SearchPatterns.Temples);
                    }
                });
            }
            else
            {
                if (locationNames.Count != regionData.LocationCount)
                {
                    EnumerateLocationsByType(SearchPatterns.All);
                }
                search = true;
            }

            int    totalLocations = 0;
            string regionSlash    = regionNames[selectedRegion] + "/";

            scrollPos = GUILayoutHelper.ScrollView(scrollPos, () =>
            {
                for (int i = 0; i < locationNames.Count; i++)
                {
                    string multiName = regionSlash + locationNames[i];
                    if (search)
                    {
                        int index = locationNames[i].IndexOf(searchString, StringComparison.InvariantCultureIgnoreCase);
                        if (index != -1)
                        {
                            ShowLocationItem(multiName);
                            totalLocations++;
                        }
                    }
                    else
                    {
                        ShowLocationItem(multiName);
                        totalLocations++;
                    }
                }
            });

            EditorGUILayout.LabelField("Total locations found: " + totalLocations);
        }
 private void DisplayAboutGUI()
 {
     EditorGUILayout.Space();
     ShowAboutLocationFoldout = GUILayoutHelper.Foldout(ShowAboutLocationFoldout, new GUIContent("About"), () =>
     {
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("ID", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.ID.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Longitude", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.Longitude.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Latitude", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.Latitude.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Map Pixel X", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.MapPixelX.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Map Pixel Y", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.MapPixelY.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("World Coord X", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.WorldCoordX.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("World Coord Z", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.WorldCoordZ.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("World Climate", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.WorldClimate.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Sky Base", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.SkyBase.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Region Name", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.RegionName, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Location Name", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.LocationName, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Has Dungeon", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.HasDungeon.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Climate Base", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.Climate.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Nature Flats", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.Nature.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
Пример #25
0
        public override void OnInspectorGUI()
        {
            // Update
            serializedObject.Update();

#if UNITY_EDITOR_LINUX
            string message = string.Empty;
            message += "Linux users please set your Daggerfall installation path (i.e. parent folder of complete Daggerfall install) in Resources/fallback.ini then click 'Update Path' below.";
            message += " This is a temporary limitation to work around Inspector bugs in experimental Linux build.";
            EditorGUILayout.HelpBox(message, MessageType.Info);
            EditorGUILayout.SelectableLabel(dfUnity.Arena2Path, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
            if (GUILayout.Button("Update Path"))
            {
                dfUnity.Arena2Path = string.Empty;
                dfUnity.EditorResetArena2Path();
            }
#else
            // Get properties
            var propArena2Path = Prop("Arena2Path");

            // Browse for Arena2 path
            EditorGUILayout.Space();
            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("Arena2 Path", "The local Arena2 path used for development only."), GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                EditorGUILayout.SelectableLabel(dfUnity.Arena2Path, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                if (GUILayout.Button("Browse..."))
                {
                    string path = EditorUtility.OpenFolderPanel("Locate Arena2 Path", "", "");
                    if (!string.IsNullOrEmpty(path))
                    {
                        if (!DaggerfallUnity.ValidateArena2Path(path))
                        {
                            EditorUtility.DisplayDialog("Invalid Path", "The selected Arena2 path is invalid", "Close");
                        }
                        else
                        {
                            dfUnity.Arena2Path         = path;
                            propArena2Path.stringValue = path;
                            dfUnity.EditorResetArena2Path();
                        }
                    }
                }
                if (GUILayout.Button("Clear"))
                {
                    dfUnity.EditorClearArena2Path();
                    EditorUtility.SetDirty(target);
                }
            });

            // Prompt user to set Arena2 path
            if (string.IsNullOrEmpty(dfUnity.Arena2Path))
            {
                EditorGUILayout.HelpBox("Please set the Arena2 path of your Daggerfall installation.", MessageType.Info);
                return;
            }
#endif

            // Display other GUI items
            DisplayOptionsGUI();
            DisplayImporterGUI();

            // Save modified properties
            serializedObject.ApplyModifiedProperties();
            if (GUI.changed)
            {
                EditorUtility.SetDirty(target);
            }
        }
Пример #26
0
        private void DisplayImporterGUI()
        {
            // Hide importer GUI when not active in hierarchy
            if (!dfUnity.gameObject.activeInHierarchy)
            {
                return;
            }

            EditorGUILayout.Space();
            ShowImportFoldout = GUILayoutHelper.Foldout(ShowImportFoldout, new GUIContent("Importer"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    EditorGUILayout.Space();
                    var propModelID = Prop("ModelImporter_ModelID");
                    EditorGUILayout.LabelField(new GUIContent("ModelID", "Enter numeric ID of model."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propModelID.intValue = EditorGUILayout.IntField(propModelID.intValue);
                        if (GUILayout.Button("Import"))
                        {
                            GameObjectHelper.CreateDaggerfallMeshGameObject((uint)propModelID.intValue, null);
                        }
                    });

                    EditorGUILayout.Space();
                    var propBlockName = Prop("BlockImporter_BlockName");
                    EditorGUILayout.LabelField(new GUIContent("Block Name", "Enter name of block. Accepts .RMB and .RDB blocks."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propBlockName.stringValue = EditorGUILayout.TextField(propBlockName.stringValue.Trim().ToUpper());
                        if (GUILayout.Button("Import"))
                        {
                            // Create block
                            if (propBlockName.stringValue.EndsWith(".RMB"))
                            {
                                GameObjectHelper.CreateRMBBlockGameObject(propBlockName.stringValue, dfUnity.Option_RMBGroundPlane, dfUnity.Option_CityBlockPrefab);
                            }
                            else if (propBlockName.stringValue.EndsWith(".RDB"))
                            {
                                GameObjectHelper.CreateRDBBlockGameObject(
                                    propBlockName.stringValue,
                                    null,
                                    true,
                                    DFRegion.DungeonTypes.HumanStronghold,
                                    0.5f,
                                    4,
                                    (int)DateTime.Now.Ticks,
                                    dfUnity.Option_DungeonBlockPrefab);
                            }
                        }
                    });

                    EditorGUILayout.Space();
                    var propCityName = Prop("CityImporter_CityName");
                    EditorGUILayout.LabelField(new GUIContent("City Name", "Enter exact city name in format RegionName/CityName. Case-sensitive."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propCityName.stringValue = EditorGUILayout.TextField(propCityName.stringValue.Trim());
                        if (GUILayout.Button("Import"))
                        {
                            GameObjectHelper.CreateDaggerfallLocationGameObject(propCityName.stringValue, null);
                        }
                    });

                    EditorGUILayout.Space();
                    var propDungeonName = Prop("DungeonImporter_DungeonName");
                    EditorGUILayout.LabelField(new GUIContent("Dungeon Name", "Enter exact dungeon name in format RegionName/DungeonName. Case-sensitive."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propDungeonName.stringValue = EditorGUILayout.TextField(propDungeonName.stringValue.Trim());
                        if (GUILayout.Button("Import"))
                        {
                            GameObjectHelper.CreateDaggerfallDungeonGameObject(propDungeonName.stringValue, null);
                        }
                    });
                });
            });
        }
Пример #27
0
 void ShowSecondaryAttributesGUI()
 {
     EditorGUILayout.Space();
     showSecondaryAttributesFoldout = GUILayoutHelper.Foldout(showSecondaryAttributesFoldout, new GUIContent("Secondary Attributes"), () =>
     {
         GUILayoutHelper.Indent(() =>
         {
             EditorGUILayout.Space();
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Damage Modifier");
                 EditorGUILayout.SelectableLabel(FormulaHelper.DamageModifier(selectedCareer.Strength).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Max Encumbrance");
                 EditorGUILayout.SelectableLabel(FormulaHelper.MaxEncumbrance(selectedCareer.Strength).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Spell Points");
                 EditorGUILayout.SelectableLabel(FormulaHelper.SpellPoints(selectedCareer.Intelligence, selectedCareer.SpellPointMultiplierValue).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Magic Resist");
                 EditorGUILayout.SelectableLabel(FormulaHelper.MagicResist(selectedCareer.Willpower).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("To Hit Modifier");
                 EditorGUILayout.SelectableLabel(FormulaHelper.ToHitModifier(selectedCareer.Agility).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Hit Points Modifier");
                 EditorGUILayout.SelectableLabel(FormulaHelper.HitPointsModifier(selectedCareer.Endurance).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Healing Rate Modifier");
                 EditorGUILayout.SelectableLabel(FormulaHelper.HealingRateModifier(selectedCareer.Endurance).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             if (careerSource == CareerSource.Monsters)
             {
                 MobileEnemy enemy;
                 if (EnemyBasics.GetEnemy(selectedCareer.Name, out enemy))
                 {
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string monsterHealth = string.Format("{0}-{1}", enemy.MinHealth, enemy.MaxHealth);
                         EditorGUILayout.LabelField("Monster Health");
                         EditorGUILayout.SelectableLabel(monsterHealth, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string monsterDamage = string.Format("{0}-{1}", enemy.MinDamage, enemy.MaxDamage);
                         EditorGUILayout.LabelField("Monster Damage 1");
                         EditorGUILayout.SelectableLabel(monsterDamage, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string monsterDamage2 = string.Format("{0}-{1}", enemy.MinDamage2, enemy.MaxDamage2);
                         EditorGUILayout.LabelField("Monster Damage 2");
                         EditorGUILayout.SelectableLabel(monsterDamage2, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string monsterDamage3 = string.Format("{0}-{1}", enemy.MinDamage3, enemy.MaxDamage3);
                         EditorGUILayout.LabelField("Monster Damage 3");
                         EditorGUILayout.SelectableLabel(monsterDamage3, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         EditorGUILayout.LabelField("Required Metal");
                         EditorGUILayout.SelectableLabel(enemy.MinMetalToHit.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string level = string.Format("{0}", enemy.Level);
                         EditorGUILayout.LabelField("Level");
                         EditorGUILayout.SelectableLabel(level, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string armorValue = string.Format("{0}", enemy.ArmorValue);
                         EditorGUILayout.LabelField("Armor Value");
                         EditorGUILayout.SelectableLabel(armorValue, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                 }
             }
         });
     });
 }
Пример #28
0
 void ShowForbiddenMaterialsGUI()
 {
     EditorGUILayout.Space();
     showForbiddenMaterialFoldout = GUILayoutHelper.Foldout(showForbiddenMaterialFoldout, new GUIContent("Forbidden Materials"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Iron");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Iron).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Steel");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Steel).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Silver");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Silver).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Elven");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Elven).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Dwarven");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Dwarven).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Mithril");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Mithril).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Adamantium");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Adamantium).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Ebony");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Ebony).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Orcish");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Orcish).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Daedric");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Daedric).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
Пример #29
0
        private void DisplayAboutGUI()
        {
            EditorGUILayout.Space();
            ShowCustomBillboardFoldout = GUILayoutHelper.Foldout(ShowCustomBillboardFoldout, new GUIContent("Custom"), () =>
            {
                var propCustomArchive = Prop("customArchive");
                var propCustomRecord  = Prop("customRecord");
                GUILayoutHelper.Indent(() =>
                {
                    propCustomArchive.intValue = EditorGUILayout.IntField(new GUIContent("Archive", "Set texture archive index (e.g. TEXTURE.210 is 210)"), propCustomArchive.intValue);
                    propCustomRecord.intValue  = EditorGUILayout.IntField(new GUIContent("Record", "Set texture record index (between 0-n)"), propCustomRecord.intValue);
                    if (GUILayout.Button("Set Billboard Texture"))
                    {
                        try
                        {
                            dfBillboard.SetMaterial(propCustomArchive.intValue, propCustomRecord.intValue);
                        }
                        catch (Exception ex)
                        {
                            Debug.Log("Failed to set custom billboard texture. Exception: " + ex.Message);
                        }
                    }
                    if (GUILayout.Button("Align To Surface"))
                    {
                        GameObjectHelper.AlignBillboardToGround(dfBillboard.gameObject, dfBillboard.Summary.Size, 4);
                    }
                });
            });

            EditorGUILayout.Space();
            ShowAboutBillboardFoldout = GUILayoutHelper.Foldout(ShowAboutBillboardFoldout, new GUIContent("About"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("File", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(TextureFile.IndexToFileName(dfBillboard.Summary.Archive), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Index", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfBillboard.Summary.Record.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    //GUILayoutHelper.Horizontal(() =>
                    //{
                    //    EditorGUILayout.LabelField("In Dungeon", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                    //    EditorGUILayout.SelectableLabel(dfBillboard.Summary.InDungeon.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    //});
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Is Mobile", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfBillboard.Summary.IsMobile.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    if (dfBillboard.Summary.IsMobile)
                    {
                        GUILayoutHelper.Horizontal(() =>
                        {
                            EditorGUILayout.LabelField("Flags", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                            EditorGUILayout.SelectableLabel(dfBillboard.Summary.Flags.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                        });
                        GUILayoutHelper.Horizontal(() =>
                        {
                            EditorGUILayout.LabelField("Type", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                            EditorGUILayout.SelectableLabel(dfBillboard.Summary.FixedEnemyType.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                        });
                    }
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Is Atlased", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfBillboard.Summary.AtlasedMaterial.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Is Animated", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfBillboard.Summary.AnimatedMaterial.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Current Frame", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfBillboard.Summary.CurrentFrame.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                });
            });
        }
Пример #30
0
        void ShowMiscellaneousGUI()
        {
            EditorGUILayout.Space();
            showMiscellaneousFoldout = GUILayoutHelper.Foldout(showMiscellaneousFoldout, new GUIContent("Miscellaneous"), () =>
            {
                EditorGUILayout.Space();
                GUILayoutHelper.Indent(() =>
                {
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Acute Hearing");
                        EditorGUILayout.SelectableLabel(selectedCareer.AcuteHearing.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Athleticism");
                        EditorGUILayout.SelectableLabel(selectedCareer.Athleticism.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Adrenaline Rush");
                        EditorGUILayout.SelectableLabel(selectedCareer.AdrenalineRush.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });

                    EditorGUILayout.Space();
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Regeneration");
                        EditorGUILayout.SelectableLabel(selectedCareer.Regeneration.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Rapid Healing");
                        EditorGUILayout.SelectableLabel(selectedCareer.RapidHealing.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });

                    EditorGUILayout.Space();
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Damage From Sunlight");
                        EditorGUILayout.SelectableLabel(selectedCareer.DamageFromSunlight.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Damage From Holy Places");
                        EditorGUILayout.SelectableLabel(selectedCareer.DamageFromHolyPlaces.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });

                    EditorGUILayout.Space();
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Undead Attack Modifier");
                        EditorGUILayout.SelectableLabel(selectedCareer.UndeadAttackModifier.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Daedra Attack Modifier");
                        EditorGUILayout.SelectableLabel(selectedCareer.DaedraAttackModifier.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Humanoid Attack Modifier");
                        EditorGUILayout.SelectableLabel(selectedCareer.HumanoidAttackModifier.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Animals Attack Modifier");
                        EditorGUILayout.SelectableLabel(selectedCareer.AnimalsAttackModifier.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                });
            });
        }