"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[8851],{4048:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>s,default:()=>d,frontMatter:()=>c,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"XXTLanControl.lua/core/get_ui_config","title":"Read Script UI Configuration (LCC.get_ui_config)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/core/get_ui_config.md","sourceDirName":"XXTLanControl.lua/core","slug":"/XXTLanControl.lua/core/get_ui_config","permalink":"/docs/en/XXTLanControl.lua/core/get_ui_config","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":50,"frontMatter":{"sidebar_position":50},"sidebar":"tutorialSidebar","previous":{"title":"Connect To The Controller (LCC.connect)","permalink":"/docs/en/XXTLanControl.lua/core/connect"},"next":{"title":"Capture UI State (LCC.capture_ui_state)","permalink":"/docs/en/XXTLanControl.lua/core/capture_ui_state"}}');var r=t(4848),i=t(8453);const c={sidebar_position:50},s="Read Script UI Configuration (LCC.get_ui_config)",a={},l=[{value:"Signature",id:"signature",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Notes",id:"notes",level:2},{value:"Example",id:"example",level:2}];function u(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"read-script-ui-configuration-lccget_ui_config",children:"Read Script UI Configuration (LCC.get_ui_config)"})}),"\n",(0,r.jsx)(n.h2,{id:"signature",children:"Signature"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-lua",children:"config = LCC.get_ui_config()\n"})}),"\n",(0,r.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"none"}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["config",(0,r.jsx)(n.br,{}),"\n","Table containing the ",(0,r.jsx)(n.code,{children:"Config"})," section of ",(0,r.jsx)(n.code,{children:"main.json"})," together with default values of UI controls."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:["Flat scripts read ",(0,r.jsx)(n.code,{children:'XXT_SCRIPTS_PATH .. "/main.json"'}),"; XPP packages read the package file returned by ",(0,r.jsx)(n.code,{children:'xpp.resource_path("main.json")'}),". The ",(0,r.jsx)(n.code,{children:"Config"})," block is then merged with control defaults to build the final configuration table.\nComboBox/RadioGroup values return the selected label; CheckBoxGroup returns mappings such as ",(0,r.jsx)(n.code,{children:"{ ['Option A'] = true }"}),".",(0,r.jsx)(n.br,{}),"\n","Returns an empty table when ",(0,r.jsx)(n.code,{children:"main.json"})," is missing or malformed."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-lua",children:'local conf = LCC.get_ui_config()\nif conf["Target Group"] then\n    print("Running against group: " .. conf["Target Group"])\nend\n'})})]})}function d(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>c,x:()=>s});var o=t(6540);const r={},i=o.createContext(r);function c(e){const n=o.useContext(i);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]);