跳至主要內容

取得腳本 UI 設定 (LCC.get_ui_config)

聲明​

config = LCC.get_ui_config()

參數​

  • 無

回傳值​

  • config
    表格型,包含 main.json 中 Config 節點以及介面控制項的預設值

說明​

平鋪腳本讀取 XXT_SCRIPTS_PATH .. "/main.json";XPP 腳本套件讀取 xpp.resource_path("main.json") 傳回的包內檔案。讀取後會將 Config 節點與 UI 控制項預設值合併為最終設定表。 ComboBox / RadioGroup 會傳回被選取的文字;CheckBoxGroup 傳回形如 { ['選項A'] = true } 的對應表。
當 main.json 缺失或結構非法時傳回空表。

範例​

local conf = LCC.get_ui_config()
if conf["目標群組"] then
print("執行目標群組: " .. conf["目標群組"])
end