infcommand.lua
字号:
return _INFM('HelpStack') end; callback=function(state) genVarSet("show-stack", state.checked) end; feedback=function(state) if (state.checked) then return (string.format(_INFM('FrmtActEnable'), _INFM('ShowStack'))) else return (string.format(_INFM('FrmtActDisable'), _INFM('ShowStack'))) end end; check=true; default={checked=true}; disabled={checked=false}; dependencies={enabled={checked=true}}; difficulty=1; }; { id="show-usage"; type=K_TEXT; text=function() return _INFM('GuiInfoUsage') end; helptext=function() return _INFM('HelpUsage') end; callback=function(state) genVarSet("show-usage", state.checked) end; feedback=function(state) if (state.checked) then return (string.format(_INFM('FrmtActEnable'), _INFM('ShowUsage'))) else return (string.format(_INFM('FrmtActDisable'), _INFM('ShowUsage'))) end end; check=true; default={checked=true}; disabled={checked=false}; dependencies={enabled={checked=true}}; difficulty=1; }; { id="show-quest"; type=K_TEXT; text=function() return _INFM('GuiInfoQuest') end; helptext=function() return _INFM('HelpQuest') end; callback=function(state) genVarSet("show-quest", state.checked) end; feedback=function(state) if (state.checked) then return (string.format(_INFM('FrmtActEnable'), _INFM('ShowQuest'))) else return (string.format(_INFM('FrmtActDisable'), _INFM('ShowQuest'))) end end; check=true; default={checked=true}; disabled={checked=false}; dependencies={enabled={checked=true}}; difficulty=1; }; { id="show-merchant"; type=K_TEXT; text=function() return _INFM('GuiInfoMerchant') end; helptext=function() return _INFM('HelpMerchant') end; callback=function(state) genVarSet("show-merchant", state.checked) end; feedback=function(state) if (state.checked) then return (string.format(_INFM('FrmtActEnable'), _INFM('ShowMerchant'))) else return (string.format(_INFM('FrmtActDisable'), _INFM('ShowMerchant'))) end end; check=true; default={checked=true}; disabled={checked=false}; dependencies={enabled={checked=true}}; difficulty=1; }; { id="InformantVendorHeader"; type=K_HEADER; text=function() return _INFM('GuiVendorHeader') end; helptext=function() return _INFM('GuiVendorHelp') end; difficulty=1; }; { id="show-vendor"; type=K_TEXT; text=function() return _INFM('GuiVendor') end; helptext=function() return _INFM('HelpVendor') end; callback=function(state) genVarSet("show-vendor", state.checked) end; feedback=function(state) if (state.checked) then return (string.format(_INFM('FrmtActEnable'), _INFM('ShowVendor'))) else return (string.format(_INFM('FrmtActDisable'), _INFM('ShowVendor'))) end end; check=true; default={checked=true}; disabled={checked=false}; dependencies={enabled={checked=true}}; difficulty=1; }; { id="show-vendor-buy"; type=K_TEXT; text=function() return _INFM('GuiVendorBuy') end; helptext=function() return _INFM('HelpVendorBuy') end; callback=function(state) genVarSet("show-vendor-buy", state.checked) end; feedback=function(state) if (state.checked) then return (string.format(_INFM('FrmtActEnable'), _INFM('ShowVendorBuy'))) else return (string.format(_INFM('FrmtActDisable'), _INFM('ShowVendorBuy'))) end end; check=true; default={checked=true}; disabled={checked=false}; dependencies={["show-vendor"]={checked=true}; enabled={checked=true}}; difficulty=2; }; { id="show-vendor-sell"; type=K_TEXT; text=function() return _INFM('GuiVendorSell') end; helptext=function() return _INFM('HelpVendorSell') end; callback=function(state) genVarSet("show-vendor-sell", state.checked) end; feedback=function(state) if (state.checked) then return (string.format(_INFM('FrmtActEnable'), _INFM('ShowVendorSell'))) else return (string.format(_INFM('FrmtActDisable'), _INFM('ShowVendorSell'))) end end; check=true; default={checked=true}; disabled={checked=false}; dependencies={["show-vendor"]={checked=true}; enabled={checked=true}}; difficulty=2; }; { id="InformantEmbedHeader"; type=K_HEADER; text=function() return _INFM('GuiEmbedHeader') end; helptext=function() return _INFM('HelpEmbed') end; difficulty=1; }; { id="embed"; type=K_TEXT; text=function() return _INFM('GuiEmbed') end; helptext=function() return _INFM('HelpEmbed') end; callback=function(state) genVarSet("embed", state.checked) end; feedback=function(state) if (state.checked) then return (string.format(_INFM('FrmtActEnable'), _INFM('CmdEmbed'))) else return (string.format(_INFM('FrmtActDisable'), _INFM('CmdEmbed'))) end end; check=true; default={checked=false}; disabled={checked=false}; dependencies={enabled={checked=true}}; difficulty=1; }; { id="InformantOtherHeader"; type=K_HEADER; text=function() return _INFM('GuiOtherHeader') end; helptext=function() return _INFM('GuiOtherHelp') end; difficulty=1; }; { id="DefaultAll"; type=K_BUTTON; setup={ buttonText = function() return _INFM('GuiDefaultAllButton') end; }; text=function() return _INFM('GuiDefaultAll') end; helptext=function() return _INFM('GuiDefaultAllHelp') end; callback=function() restoreDefault(_INFM('CmdClearAll')) end; feedback=function() return _INFM('FrmtActDefaultall'); end; dependencies={enabled={checked=true}}; difficulty=1; }; { id="DefaultOption"; type=K_EDITBOX; setup = { callOn = {"tab", "escape", "enter"}; }; text=function() return _INFM('GuiDefaultOption') end; helptext=function() return _INFM('HelpDefault') end; callback = function(state) restoreDefault(state.value) end; feedback = function (state) if (state.value == _INFM('CmdClearAll')) then return _INFM('FrmtActDefaultall') else return string.format(_INFM('FrmtActDefault'), state.value) end end; default = { value = "" }; disabled = { value = "" }; dependencies={enabled={checked=true}}; difficulty=4; }; }; }; Khaos.registerOptionSet("tooltip",optionSet) Informant_Khaos_Registered = true Khaos.refresh(); return trueendfunction isValidLocale(param) return (InformantLocalizations and InformantLocalizations[param])endfunction setLocale(param, chatprint) param = delocalizeFilterVal(param); local validLocale = nil; if (param == 'default') or (param == 'off') then Babylonian.SetOrder(''); validLocale = true; elseif (isValidLocale(param)) then Babylonian.SetOrder(param); validLocale = true; else validLocale = false; end BINDING_HEADER_INFORMANT_HEADER = "Informant"; BINDING_NAME_INFORMANT_POPUPDOWN = _INFM('MesgToggleWindow'); if (chatprint) then if (validLocale) then chatPrint(string.format(_INFM('FrmtActSet'), _INFM('CmdLocale'), param)); setKhaosSetKeyValue('locale', param); else chatPrint(string.format(_INFM("FrmtUnknownLocale"), param)); local locales = " "; for locale, data in pairs(InformantLocalizations) do locales = locales .. " '" .. locale .. "' "; end chatPrint(locales); end end commandMap = nil; commandMapRev = nil;endfunction chatPrint(msg) if (DEFAULT_CHAT_FRAME) then DEFAULT_CHAT_FRAME:AddMessage(msg, 0.25, 0.55, 1.0); endend---------------------------------------- Localization functions ----------------------------------------function delocalizeFilterVal(value) if (value == _INFM('CmdOn')) then return 'on'; elseif (value == _INFM('CmdOff')) then return 'off'; elseif (value == _INFM('CmdDefault')) then return 'default'; elseif (value == _INFM('CmdToggle')) then return 'toggle'; else return value; endendfunction localizeFilterVal(value) local result if (value == 'on') then result = _INFM('CmdOn'); elseif (value == 'off') then result = _INFM('CmdOff'); elseif (value == 'default') then result = _INFM('CmdDefault'); elseif (value == 'toggle') then result = _INFM('CmdToggle'); end if (result) then return result; else return value; endendfunction getLocalizedFilterVal(key) return localizeFilterVal(Informant.GetFilterVal(key))end-- Turns a localized slash command into the generic English version of the commandfunction delocalizeCommand(cmd) if (not commandMap) then buildCommandMap(); end local result = commandMap[cmd]; if (result) then return result; else return cmd; endend-- Translate a generic English slash command to the localized version, if availablefunction localizeCommand(cmd) if (not commandMapRev) then buildCommandMap(); end local result = commandMapRev[cmd]; if (result) then return result; else return cmd; endend-- Globally accessible functionsInformant.SetLocale = setLocale;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -