Skip to content

Commit

Permalink
8.3.01.2
Browse files Browse the repository at this point in the history
Collapsable setting categories
  • Loading branch information
LanceDH committed Jan 6, 2020
1 parent f700dc8 commit bef0246
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 118 deletions.
74 changes: 39 additions & 35 deletions Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -431,87 +431,93 @@ _V["SETTING_TYPES"] = {
-- isDisabled (boolean|function()): Boolean or dunction returning if the setting should be disabled
-- getValueFunc (function()): Function returning the current value of the setting

_V["SETTING_CATEGORIES"] = {
{["id"]="GENERAL", ["label"] = GENERAL}
,{["id"]="QUESTLIST", ["label"] = _L["QUEST_LIST"]}
,{["id"]="MAPPINS", ["label"] = _L["MAP_PINS"]}
,{["id"]="WQTU", ["label"] = "Utilities"}
,{["id"]="TOMTOM", ["label"] = "TomTom"}
}

_V["SETTING_LIST"] = {
-- General settings
{["type"] = _V["SETTING_TYPES"].category, ["label"] = GENERAL}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["DEFAULT_TAB"], ["tooltip"] = _L["DEFAULT_TAB_TT"]
{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "GENERAL", ["label"] = _L["DEFAULT_TAB"], ["tooltip"] = _L["DEFAULT_TAB_TT"]
, ["func"] = function(value)
WQT.settings.general.defaultTab = value;
end
,["getValueFunc"] = function() return WQT.settings.general.defaultTab end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["SAVE_SETTINGS"], ["tooltip"] = _L["SAVE_SETTINGS_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "GENERAL", ["label"] = _L["SAVE_SETTINGS"], ["tooltip"] = _L["SAVE_SETTINGS_TT"]
, ["func"] = function(value)
WQT.settings.general.saveFilters = value;
end
,["getValueFunc"] = function() return WQT.settings.general.saveFilters end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["LFG_BUTTONS"], ["tooltip"] = _L["LFG_BUTTONS_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "GENERAL", ["label"] = _L["LFG_BUTTONS"], ["tooltip"] = _L["LFG_BUTTONS_TT"]
, ["func"] = function(value)
WQT.settings.general.useLFGButtons = value;
end
,["getValueFunc"] = function() return WQT.settings.general.useLFGButtons end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["AUTO_EMISARRY"], ["tooltip"] = _L["AUTO_EMISARRY_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "GENERAL", ["label"] = _L["AUTO_EMISARRY"], ["tooltip"] = _L["AUTO_EMISARRY_TT"]
, ["func"] = function(value)
WQT.settings.general.autoEmisarry = value;
end
,["getValueFunc"] = function() return WQT.settings.general.autoEmisarry end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["QUEST_COUNTER"], ["tooltip"] = _L["QUEST_COUNTER_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "GENERAL", ["label"] = _L["QUEST_COUNTER"], ["tooltip"] = _L["QUEST_COUNTER_TT"]
, ["func"] = function(value)
WQT.settings.general.questCounter = value;
WQT_QuestLogFiller:UpdateVisibility();
end
,["getValueFunc"] = function() return WQT.settings.general.questCounter; end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["EMISSARY_COUNTER"], ["tooltip"] = _L["EMISSARY_COUNTER_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "GENERAL", ["label"] = _L["EMISSARY_COUNTER"], ["tooltip"] = _L["EMISSARY_COUNTER_TT"]
, ["func"] = function(value)
WQT.settings.general.bountyCounter = value;
WQT_WorldQuestFrame:UpdateBountyCounters();
WQT_WorldQuestFrame:RepositionBountyTabs();
end
,["getValueFunc"] = function() return WQT.settings.general.bountyCounter end
}

-- Quest List
,{["type"] = _V["SETTING_TYPES"].category, ["label"] = _L["QUEST_LIST"]}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["SHOW_TYPE"], ["tooltip"] = _L["SHOW_TYPE_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "QUESTLIST", ["label"] = _L["SHOW_TYPE"], ["tooltip"] = _L["SHOW_TYPE_TT"]
, ["func"] = function(value)
WQT.settings.list.typeIcon = value;
WQT_QuestScrollFrame:DisplayQuestList();
end
,["getValueFunc"] = function() return WQT.settings.list.typeIcon end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["SHOW_FACTION"], ["tooltip"] = _L["SHOW_FACTION_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "QUESTLIST", ["label"] = _L["SHOW_FACTION"], ["tooltip"] = _L["SHOW_FACTION_TT"]
, ["func"] = function(value)
WQT.settings.list.factionIcon = value;
WQT_QuestScrollFrame:DisplayQuestList();
end
,["getValueFunc"] = function() return WQT.settings.list.factionIcon end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["SHOW_ZONE"], ["tooltip"] = _L["SHOW_ZONE_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "QUESTLIST", ["label"] = _L["SHOW_ZONE"], ["tooltip"] = _L["SHOW_ZONE_TT"]
, ["func"] = function(value)
WQT.settings.list.showZone = value;
WQT_QuestScrollFrame:DisplayQuestList();
end
,["getValueFunc"] = function() return WQT.settings.list.showZone end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["AMOUNT_COLORS"], ["tooltip"] = _L["AMOUNT_COLORS_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "QUESTLIST", ["label"] = _L["AMOUNT_COLORS"], ["tooltip"] = _L["AMOUNT_COLORS_TT"]
, ["func"] = function(value)
WQT.settings.list.amountColors = value;
WQT_QuestScrollFrame:DisplayQuestList();
end
,["getValueFunc"] = function() return WQT.settings.list.amountColors end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["LIST_FULL_TIME"], ["tooltip"] = _L["LIST_FULL_TIME_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "QUESTLIST", ["label"] = _L["LIST_FULL_TIME"], ["tooltip"] = _L["LIST_FULL_TIME_TT"]
, ["func"] = function(value)
WQT.settings.list.fullTime = value;
WQT_QuestScrollFrame:DisplayQuestList();
end
,["getValueFunc"] = function() return WQT.settings.list.fullTime end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["ALWAYS_ALL"], ["tooltip"] = _L["ALWAYS_ALL_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "QUESTLIST", ["label"] = _L["ALWAYS_ALL"], ["tooltip"] = _L["ALWAYS_ALL_TT"]
, ["func"] = function(value)
WQT.settings.list.alwaysAllQuests = value;
local mapAreaID = WorldMapFrame.mapID;
Expand All @@ -523,8 +529,7 @@ _V["SETTING_LIST"] = {


-- Map Pin
,{["type"] = _V["SETTING_TYPES"].category, ["label"] = _L["MAP_PINS"]}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["PIN_DISABLE"], ["tooltip"] = _L["PIN_DISABLE_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_DISABLE"], ["tooltip"] = _L["PIN_DISABLE_TT"]
, ["func"] = function(value)
WQT.settings.pin.disablePoI = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData()
Expand All @@ -534,15 +539,15 @@ _V["SETTING_LIST"] = {
end
,["getValueFunc"] = function() return WQT.settings.pin.disablePoI end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["FILTER_PINS"], ["tooltip"] = _L["FILTER_PINS_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "MAPPINS", ["label"] = _L["FILTER_PINS"], ["tooltip"] = _L["FILTER_PINS_TT"]
, ["func"] = function(value)
WQT.settings.pin.filterPoI = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData();
end
,["getValueFunc"] = function() return WQT.settings.pin.filterPoI end
,["isDisabled"] = function() return WQT.settings.pin.disablePoI end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["PIN_SHOW_CONTINENT"], ["tooltip"] = _L["PIN_SHOW_CONTINENT_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_SHOW_CONTINENT"], ["tooltip"] = _L["PIN_SHOW_CONTINENT_TT"]
, ["func"] = function(value)
WQT.settings.pin.continentPins = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData();
Expand All @@ -551,85 +556,84 @@ _V["SETTING_LIST"] = {
,["isDisabled"] = function() return WQT.settings.pin.disablePoI end
}
-- Pin appearance
,{["type"] = _V["SETTING_TYPES"].subTitle, ["label"] = APPEARANCE_LABEL}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["PIN_FADE_ON_PING"], ["tooltip"] = _L["PIN_FADE_ON_PING_TT"]
,{["type"] = _V["SETTING_TYPES"].subTitle, ["categoryID"] = "MAPPINS", ["label"] = APPEARANCE_LABEL}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_FADE_ON_PING"], ["tooltip"] = _L["PIN_FADE_ON_PING_TT"]
, ["func"] = function(value)
WQT.settings.pin.fadeOnPing = value;
end
,["getValueFunc"] = function() return WQT.settings.pin.fadeOnPing end
,["isDisabled"] = function() return WQT.settings.pin.disablePoI end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["PIN_TIME"], ["tooltip"] = _L["PIN_TIME_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_TIME"], ["tooltip"] = _L["PIN_TIME_TT"]
, ["func"] = function(value)
WQT.settings.pin.timeLabel = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData();
end
,["getValueFunc"] = function() return WQT.settings.pin.timeLabel end
,["isDisabled"] = function() return WQT.settings.pin.disablePoI end
}
,{["type"] = _V["SETTING_TYPES"].slider, ["label"] = _L["PIN_SCALE"], ["tooltip"] = _L["PIN_SCALE_TT"], ["min"] = 0.8, ["max"] = 1.5, ["valueStep"] = 0.01
,{["type"] = _V["SETTING_TYPES"].slider, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_SCALE"], ["tooltip"] = _L["PIN_SCALE_TT"], ["min"] = 0.8, ["max"] = 1.5, ["valueStep"] = 0.01
, ["func"] = function(value)
WQT.settings.pin.scale = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData();
end
,["getValueFunc"] = function() return WQT.settings.pin.scale end
,["isDisabled"] = function() return WQT.settings.pin.disablePoI end
}
,{["type"] = _V["SETTING_TYPES"].dropDown, ["label"] = _L["PIN_CENTER"], ["tooltip"] = _L["PIN_CENTER_TT"], ["options"] = _pinCenterDropDownInfo
,{["type"] = _V["SETTING_TYPES"].dropDown, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_CENTER"], ["tooltip"] = _L["PIN_CENTER_TT"], ["options"] = _pinCenterDropDownInfo
, ["func"] = function(value)
WQT.settings.pin.centerType = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData();
end
,["getValueFunc"] = function() return WQT.settings.pin.centerType end
,["isDisabled"] = function() return WQT.settings.pin.disablePoI end
}
,{["type"] = _V["SETTING_TYPES"].dropDown, ["label"] = _L["PIN_RING_TITLE"], ["tooltip"] = _L["PIN_RING_TT"], ["options"] = _ringTypeDropDownInfo
,{["type"] = _V["SETTING_TYPES"].dropDown, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_RING_TITLE"], ["tooltip"] = _L["PIN_RING_TT"], ["options"] = _ringTypeDropDownInfo
, ["func"] = function(value)
WQT.settings.pin.ringType = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData();
end
,["getValueFunc"] = function() return WQT.settings.pin.ringType end
,["isDisabled"] = function() return WQT.settings.pin.disablePoI end
}
-- Pin icons
,{["type"] = _V["SETTING_TYPES"].subTitle, ["label"] = _L["ICONS"]}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["PIN_TYPE"], ["tooltip"] = _L["PIN_TYPE_TT"]
,{["type"] = _V["SETTING_TYPES"].subTitle, ["categoryID"] = "MAPPINS", ["label"] = _L["ICONS"]}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_TYPE"], ["tooltip"] = _L["PIN_TYPE_TT"]
, ["func"] = function(value)
WQT.settings.pin.typeIcon = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData()
end
,["getValueFunc"] = function() return WQT.settings.pin.typeIcon; end
,["isDisabled"] = function() return WQT.settings.pin.disablePoI; end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["PIN_RARITY_ICON"], ["tooltip"] = _L["PIN_RARITY_ICON_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_RARITY_ICON"], ["tooltip"] = _L["PIN_RARITY_ICON_TT"]
, ["func"] = function(value)
WQT.settings.pin.rarityIcon = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData()
end
,["getValueFunc"] = function() return WQT.settings.pin.rarityIcon; end
,["isDisabled"] = function() return WQT.settings.pin.disablePoI; end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["PIN_TIME_ICON"], ["tooltip"] = _L["PIN_TIME_ICON_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_TIME_ICON"], ["tooltip"] = _L["PIN_TIME_ICON_TT"]
, ["func"] = function(value)
WQT.settings.pin.timeIcon = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData()
end
,["getValueFunc"] = function() return WQT.settings.pin.timeIcon; end
,["isDisabled"] = function() return WQT.settings.pin.disablePoI; end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["PIN_REWARD_TYPE"], ["tooltip"] = _L["PIN_REWARD_TYPE_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "MAPPINS", ["label"] = _L["PIN_REWARD_TYPE"], ["tooltip"] = _L["PIN_REWARD_TYPE_TT"]
, ["func"] = function(value)
WQT.settings.pin.rewardTypeIcon = value;
WQT_WorldQuestFrame.pinDataProvider:RefreshAllData()
end
,["getValueFunc"] = function() return WQT.settings.pin.rewardTypeIcon; end
,["isDisabled"] = function() return WQT.settings.pin.disablePoI; end
}


}

_V["SETTING_UTILITIES_LIST"] = {
{["type"] = _V["SETTING_TYPES"].category, ["label"] = "Utilities"}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["LOAD_UTILITIES"], ["tooltip"] = _L["LOAD_UTILITIES_TT"]
{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "WQTU", ["label"] = _L["LOAD_UTILITIES"], ["tooltip"] = _L["LOAD_UTILITIES_TT"]
, ["func"] = function(value)
WQT.settings.general.loadUtilities = value;
if (value and not IsAddOnLoaded("WorldQuestTabUtilities")) then
Expand All @@ -638,7 +642,7 @@ _V["SETTING_UTILITIES_LIST"] = {
end
end
,["isCheckedFunc"] = function() return WQTU.settings.general.loadUtilities end;
}
}
}


Expand Down
8 changes: 3 additions & 5 deletions External/TomTom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@ local _V = addon.variables;
local WQT_Utils = addon.WQT_Utils;

local _settings = {
{["type"] = _V["SETTING_TYPES"].category, ["label"] = "TomTom"}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["USE_TOMTOM"], ["tooltip"] = _L["USE_TOMTOM_TT"]
{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "TOMTOM", ["label"] = _L["USE_TOMTOM"], ["tooltip"] = _L["USE_TOMTOM_TT"]
, ["func"] = function(value)
WQT.settings.general.useTomTom = value;
end
,["getValueFunc"] = function() return WQT.settings.general.useTomTom; end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["TOMTOM_AUTO_ARROW"], ["tooltip"] = _L["TOMTOM_AUTO_ARROW_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "TOMTOM", ["label"] = _L["TOMTOM_AUTO_ARROW"], ["tooltip"] = _L["TOMTOM_AUTO_ARROW_TT"]
, ["func"] = function(value)
WQT.settings.general.TomTomAutoArrow = value;
end
,["getValueFunc"] = function() return WQT.settings.general.TomTomAutoArrow; end
,["isDisabled"] = function() return not WQT.settings.general.useTomTom; end
}
,{["type"] = _V["SETTING_TYPES"].checkBox, ["label"] = _L["TOMTOM_CLICK_ARROW"], ["tooltip"] = _L["TOMTOM_CLICK_ARROW_TT"]
,{["type"] = _V["SETTING_TYPES"].checkBox, ["categoryID"] = "TOMTOM", ["label"] = _L["TOMTOM_CLICK_ARROW"], ["tooltip"] = _L["TOMTOM_CLICK_ARROW_TT"]
, ["func"] = function(value)
WQT.settings.general.TomTomArrowOnClick = value;

Expand All @@ -37,7 +36,6 @@ local function AddTomTomSettings()
for k, setting in ipairs(_settings) do
tinsert(_V["SETTING_LIST"], setting);
end
WQT_SettingsFrame:CreateList();
end

local WorldFlightMapExternal = CreateFromMixins(WQT_ExternalMixin);
Expand Down
Loading

0 comments on commit bef0246

Please sign in to comment.