Exemplo n.º 1
0
 private void DrawTab(MainTabId tabId)
 {
     GUI.enabled = _mainTabSelected != tabId;
     if (GUILayout.Button(tabId.ToString(), GUILayout.Width(110f)))
     {
         GUI.FocusControl(null);
         _mainTabSelected = tabId;
         DatabaseEditorPrefs.SetMainTab((int)_mainTabSelected);
     }
     GUI.enabled = true;
 }
Exemplo n.º 2
0
 private void DrawContent(MainTabId mainTabId, bool hasEffectsSection = false)
 {
     if (mainTabId == MainTabId.Actors)
     {
         DrawContent <ActorData>(_actorListSection, _actorDataList, hasEffectsSection);
     }
     else if (mainTabId == MainTabId.Classes)
     {
         DrawContent <ActorClassData>(_classListSection, _classDataList, hasEffectsSection);
     }
     else if (mainTabId == MainTabId.Items)
     {
         DrawContent <ItemData>(_itemListSection, _itemDataList, hasEffectsSection);
     }
     else if (mainTabId == MainTabId.Skills)
     {
         DrawContent <SkillData>(_skillListSection, _skillDataList, hasEffectsSection);
     }
     else if (mainTabId == MainTabId.Weapons)
     {
         DrawContent <WeaponData>(_weaponListSection, _weaponDataList, hasEffectsSection);
     }
 }
Exemplo n.º 3
0
        private void OnEnable()
        {
            _database = new RPGDatabaseManager();
            _database.Load();
            if (_database.TotalEntries == 0)
            {
                DatabaseFolderHandler.ValidateAllFolders();
                DatabaseFactory.CreateDatabase();
                _database.Load();
            }

            _actorDataList          = _database.FetchEntry <ActorDataList>();
            _classDataList          = _database.FetchEntry <ActorClassDataList>();
            _skillDataList          = _database.FetchEntry <SkillDataList>();
            _itemDataList           = _database.FetchEntry <ItemDataList>();
            _weaponDataList         = _database.FetchEntry <WeaponDataList>();
            _weaponTypeDataList     = _database.FetchEntry <WeaponTypeDataList>();
            _attributeSpectDataList = _database.FetchEntry <AttributeSpecDataList>();

            _actorListSection      = new ListSection <ActorData>(_actorDataList, "Actors");
            _classListSection      = new ListSection <ActorClassData>(_classDataList, "Classes");
            _skillListSection      = new ListSection <SkillData>(_skillDataList, "Skills");
            _itemListSection       = new ListSection <ItemData>(_itemDataList, "Items");
            _weaponListSection     = new ListSection <WeaponData>(_weaponDataList, "Weapons");
            _weaponTypeListSection = new ListSection <WeaponTypeData>(_weaponTypeDataList, "Weapon Types");
            var flags = ReorderableListFlags.ShowIndices | ReorderableListFlags.HideAddButton | ReorderableListFlags.DisableReordering | ReorderableListFlags.HideRemoveButtons;

            _attributeSpecListSection = new ListSection <AttributeSpecData>(_attributeSpectDataList, "Attribute Specs", flags);

            _infoSection    = new InfoSection();
            _effectsSection = new EffectsSection();

            _coreTabSelected   = (CoreTabId)DatabaseEditorPrefs.CoreTab;
            _mainTabSelected   = (MainTabId)DatabaseEditorPrefs.MainTab;
            _configTabSelected = (ConfigTabId)DatabaseEditorPrefs.ConfigTab;
        }