comparison gui.lua @ 94:db1d5d09e5f5

Do not register '/loot' as a synonym any longer, as it becomes a builtin command in MoP.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Tue, 24 Jul 2012 23:04:51 +0000
parents ea20a28327b5
children 3546c7b55986
comparison
equal deleted inserted replaced
93:ea20a28327b5 94:db1d5d09e5f5
2124 2124
2125 -- the nubtoggle! 2125 -- the nubtoggle!
2126 w = mkoption('gui_noob', [[Show UI Tips]], 0.85, 2126 w = mkoption('gui_noob', [[Show UI Tips]], 0.85,
2127 [[Toggles display of the "helpful tips" box on the right side. Useful if you've just installed/upgraded.]]) 2127 [[Toggles display of the "helpful tips" box on the right side. Useful if you've just installed/upgraded.]])
2128 grp:AddChild(w) 2128 grp:AddChild(w)
2129 w = GUI:Create("Spacer") w:SetFullWidth(true) w:SetHeight(10) grp:AddChild(w)
2130 2129
2131 -- reminder popup 2130 -- reminder popup
2132 w = mkoption ('popup_on_join', "Show reminder popup on new raid", 0.49, 2131 w = mkoption ('popup_on_join', "Show reminder popup on new raid", 0.49,
2133 [[When joining a raid and not already tracking, display a dialog asking for instructions.]]) 2132 [[When joining a raid and not already tracking, display a dialog asking for instructions.]])
2134 grp:AddChild(w) 2133 grp:AddChild(w)
2135 2134
2136 -- toggle scroll-to-bottom on first tab 2135 -- toggle scroll-to-bottom on first tab
2137 w = mkoption('scroll_to_bottom', "Scroll to bottom when opening display", 0.49, 2136 w = mkoption('scroll_to_bottom', "Scroll to bottom when opening display", 0.49,
2138 [[Scroll to the bottom of the loot window (most recent entries) when displaying the GUI.]]) 2137 [[Scroll to the bottom of the loot window (most recent entries) when displaying the GUI.]])
2139 grp:AddChild(w)
2140
2141 -- /loot option
2142 w = mkoption('register_slashloot', "Register /loot slash command on login", 0.49,
2143 [[Register "/loot" as a slash command in addition to the normal "/ouroloot". Relog to take effect.]])
2144 grp:AddChild(w) 2138 grp:AddChild(w)
2145 2139
2146 -- chatty boss mode 2140 -- chatty boss mode
2147 w = mkoption('chatty_on_kill', "Be chatty on boss kill", 0.49, 2141 w = mkoption('chatty_on_kill', "Be chatty on boss kill", 0.49,
2148 [[Print something to chat output when the boss mod tells Ouro Loot about a successful boss kill.]]) 2142 [[Print something to chat output when the boss mod tells Ouro Loot about a successful boss kill.]])
2175 -- prefilling g_uniques with history 2169 -- prefilling g_uniques with history
2176 w = mkoption('precache_history_uniques', "Prescan for faster handling", 0.49, 2170 w = mkoption('precache_history_uniques', "Prescan for faster handling", 0.49,
2177 [[See description under +Help -- Handy Tips -- Prescanning> for instructions.]]) 2171 [[See description under +Help -- Handy Tips -- Prescanning> for instructions.]])
2178 grp:AddChild(w) 2172 grp:AddChild(w)
2179 2173
2180 w = GUI:Create("Spacer") w:SetFullWidth(true) w:SetHeight(1) grp:AddChild(w) 2174 w = GUI:Create("Spacer") w:SetFullWidth(true) w:SetHeight(5) grp:AddChild(w)
2181 2175
2182 -- possible keybindings 2176 -- possible keybindings
2183 do 2177 do
2184 local pair = GUI:Create("InlineGroup") 2178 local pair = GUI:Create("InlineGroup")
2185 pair:SetLayout("List") 2179 pair:SetLayout("List")
2197 checkbox = mkoption('keybinding', "Register keybinding", 1, 2191 checkbox = mkoption('keybinding', "Register keybinding", 1,
2198 [[Register a keybinding to toggle the loot display. Relog to take effect.]], 2192 [[Register a keybinding to toggle the loot display. Relog to take effect.]],
2199 function (_w,_,value) 2193 function (_w,_,value)
2200 opts.keybinding = value 2194 opts.keybinding = value
2201 editbox:SetDisabled(not opts.keybinding) 2195 editbox:SetDisabled(not opts.keybinding)
2196 end)
2197 checkbox:SetFullWidth(true)
2198 pair:AddChild(checkbox)
2199 pair:AddChild(editbox)
2200 grp:AddChild(pair)
2201 end
2202
2203 -- replacement for slashloot
2204 do
2205 local pair = GUI:Create("InlineGroup")
2206 pair:SetLayout("List")
2207 pair:SetRelativeWidth(0.49)
2208 pair:SetTitle('Synonyms for "/ouroloot"')
2209 local editbox, checkbox
2210 editbox = mkbutton("EditBox", nil, opts.slash_synonyms,
2211 [[Separate multiple synonyms with a comma. Relog to take effect.]])
2212 editbox:SetFullWidth(true)
2213 editbox:SetLabel("Slash commands")
2214 editbox:SetCallback("OnEnterPressed", function(_e,event,value)
2215 -- Do the sanity checking here rather than at each login.
2216 -- This is not foolproof. That's okay.
2217 local t = { strsplit(',', tostring(value)) }
2218 for k,v in ipairs(t) do
2219 v = v:trim()
2220 if v:sub(1,1) ~= "/" then
2221 v = "/" .. v
2222 end
2223 t[k] = v
2224 end
2225 value = table.concat(t,',')
2226 _e:SetText(value)
2227 opts.slash_synonyms = value
2228 end)
2229 editbox:SetDisabled(not opts.register_slash_synonyms)
2230 checkbox = mkoption('register_slash_synonyms', "Register slash commands", 1,
2231 [[Register these slash commands as synonyms for "/ouroloot". Relog to take effect.]],
2232 function (_w,_,value)
2233 opts.register_slash_synonyms = value
2234 editbox:SetDisabled(not opts.register_slash_synonyms)
2202 end) 2235 end)
2203 checkbox:SetFullWidth(true) 2236 checkbox:SetFullWidth(true)
2204 pair:AddChild(checkbox) 2237 pair:AddChild(checkbox)
2205 pair:AddChild(editbox) 2238 pair:AddChild(editbox)
2206 grp:AddChild(pair) 2239 grp:AddChild(pair)
2257 chatgroup:AddChild(w) 2290 chatgroup:AddChild(w)
2258 grp:AddChild(chatgroup) 2291 grp:AddChild(chatgroup)
2259 end 2292 end
2260 2293
2261 -- boss mod selection 2294 -- boss mod selection
2262 w = GUI:Create("Spacer") 2295 w = GUI:Create("Spacer") w:SetFullWidth(true) w:SetHeight(2) grp:AddChild(w)
2263 w:SetFullWidth(true)
2264 w:SetHeight(2)
2265 grp:AddChild(w)
2266 do 2296 do
2267 local list = {} 2297 local list = {}
2268 local current 2298 local current
2269 for k,v in ipairs(addon.bossmods) do 2299 for k,v in ipairs(addon.bossmods) do
2270 list[k] = v.n 2300 list[k] = v.n
2282 end) 2312 end)
2283 grp:AddChild(w) 2313 grp:AddChild(w)
2284 end 2314 end
2285 2315
2286 -- item filters 2316 -- item filters
2287 w = GUI:Create("Spacer") 2317 w = GUI:Create("Spacer") w:SetFullWidth(true) w:SetHeight(2) grp:AddChild(w)
2288 w:SetFullWidth(true)
2289 w:SetHeight(2)
2290 grp:AddChild(w)
2291 do 2318 do
2292 local warntext = "At least one of the items in the filter list was not in your game client's cache. This is okay. Just wait a few seconds, display some other Ouro Loot tab, and then display Options again." 2319 local warntext = "At least one of the items in the filter list was not in your game client's cache. This is okay. Just wait a few seconds, display some other Ouro Loot tab, and then display Options again."
2293 local cache_warn, cache_warned = false, false 2320 local cache_warn, cache_warned = false, false
2294 local function do_warning() 2321 local function do_warning()
2295 if cache_warn and not cache_warned then 2322 if cache_warn and not cache_warned then