PageSourceSearch

https://youthful-varahamihira-d6b430.netlify.app/assets/js/60cfe977.4327dc49.js

js youthful-varahamihira-d6b430.netlify.app collected 2026-10-03 11:39:20 UTC 22,953 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkgb_studio_docs=self.webpackChunkgb_studio_docs||[]).push([[6148],{3218:(e,t,l)=>{l.r(t),l.d(t,{assets:()=>o,contentTitle:()=>r,default:()=>p,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var s=l(5893),n=l(1151),i=l(237);const a={sidebar_position:2},r="Input",c={id:"scripting/script-glossary/input",title:"Input",description:"Attach Script To Button",source:"@site/docs/scripting/script-glossary/input.md",sourceDirName:"scripting/script-glossary",slug:"/scripting/script-glossary/input",permalink:"/docs/scripting/script-glossary/input",draft:!1,unlisted:!1,editUrl:"https://github.com/chrismaltby/gb-studio-docs/tree/main/docs/scripting/script-glossary/input.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Engine Fields",permalink:"/docs/scripting/script-glossary/engine-fields"},next:{title:"Joypad Input",permalink:"/docs/scripting/script-glossary/joypad-input"}},o={},d=[{value:"Attach Script To Button",id:"attach-script-to-button",level:3},{value:"Pause Script Until Input Pressed",id:"pause-script-until-input-pressed",level:3},{value:"Remove Button Script",id:"remove-button-script",level:3},{value:"Control Flow",id:"control-flow",level:2},{value:"If Joypad Input Held",id:"if-joypad-input-held",level:3}];function u(e){const t={a:"a",br:"br",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,n.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"input",children:"Input"}),"\n",(0,s.jsx)(t.h3,{id:"attach-script-to-button",children:"Attach Script To Button"}),"\n",(0,s.jsx)(t.p,{children:"Run the specified script any time a joypad button is pressed."}),"\n",(0,s.jsx)(i.ZP,{title:"Attach Script To Button",fields:[{key:"input",label:"Button",description:"The joypad button to check.",type:"input",defaultValue:["b"]},{key:"override",type:"checkbox",label:"Override default button action",description:"Set if the script should replace the default game action for the specified button.",defaultValue:!0},{key:"__scriptTabs",type:"tabs",defaultValue:"press",values:{press:"On Press"}},{key:"true",label:"On Press",description:"The script to run when the button is pressed.",type:"events",allowedContexts:["global","entity"],conditions:[{key:"__scriptTabs",in:[null,"press"]}]}]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Button"}),": The joypad button to check."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Override default button action"}),": Set if the script should replace the default game action for the specified button."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"On Press"}),": The script to run when the button is pressed."]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"pause-script-until-input-pressed",children:"Pause Script Until Input Pressed"}),"\n",(0,s.jsx)(t.p,{children:"Pauses the script until one of the specified joypad buttons are pressed."}),"\n",(0,s.jsx)(i.ZP,{title:"Pause Script Until Input Pressed",fields:[{key:"input",label:"Any of",description:"The input buttons to check.",type:"input",defaultValue:["a","b"]}]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Any of"}),": The input buttons to check."]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"remove-button-script",children:"Remove Button Script"}),"\n",(0,s.jsx)(t.p,{children:"Remove an attached script from a joypad button restoring the default functionality of the button."}),"\n",(0,s.jsx)(i.ZP,{title:"Remove Button Script",fields:[{key:"input",label:"Remove script attached to input",description:"The joypad button to remove the attached script from.",type:"input",defaultValue:["b"]}]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Remove script attached to input"}),": The joypad button to remove the attached script from."]}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"control-flow",children:"Control Flow"}),"\n",(0,s.jsx)(t.h3,{id:"if-joypad-input-held",children:"If Joypad Input Held"}),"\n",(0,s.jsx)(t.p,{children:"Conditionally run part of the script if the specified joypad button is currently pressed. Will not wait for user input and will only execute once, if you wish to run a script every time a button is pressed use Attach Script To Button instead."}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"References"}),(0,s.jsx)(t.br,{}),"\n",(0,s.jsx)(t.a,{href:"/docs/scripting/script-glossary/input#attach-script-to-button",children:"/docs/scripting/script-glossary/input#attach-script-to-button"})]}),"\n",(0,s.jsx)(i.ZP,{title:"If Joypad Input Held",fields:[{key:"input",label:"Any of",description:"The input buttons to check.",type:"input",defaultValue:["a","b"]},{key:"true",label:"True",description:"The script to run if the condition is true.",type:"events"},{key:"__collapseElse",label:"Else",type:"collapsable",defaultValue:!0,conditions:[{key:"__disableElse",ne:!0}]},{key:"false",label:"False",description:"The script to run if the condition is false.",conditions:[{key:"__collapseElse",ne:!0},{key:"__disableElse",ne:!0}],type:"events"}]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Any of"}),": The input buttons to check."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"True"}),": The script to run if the condition is true."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"False"}),": The script to run if the condition is false."]}),"\n"]})]})}function p(e={}){const{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},237:(e,t,l)=>{l.d(t,{jx:()=>p,ZP:()=>k});l(7294);var s=l(512);const n={wrapper:"wrapper_Ipv2",header:"header_uY2Y",collapsableHeader:"collapsableHeader_Wady",form:"form_gV8o",field:"field_znmN",group:"group_Pakl",fieldHalf:"fieldHalf_mvGz",fieldInput:"fieldInput_DJtc",flexGrow:"flexGrow_dGNp",select:"select_piNM",selectIcon:"selectIcon_MlvR",input:"input_Tp_3",textarea:"textarea_tAAu",code:"code_VhHR",checkbox:"checkbox_kfbl",checkboxInput:"checkboxInput_aYfD",checkboxInputChecked:"checkboxInputChecked_mYiI",toggleButtons:"toggleButtons_NXwh",toggleButtonsRow:"toggleButtonsRow__YdE",toggleButtonsOption:"toggleButtonsOption_LK3C",toggleButtonsOptionSelected:"toggleButtonsOptionSelected_L_DP",conditional:"conditional_NY1W",conditionalLabel:"conditionalLabel_bY4O",eventsWrapper:"eventsWrapper_kJsX",button:"button_yKMz",buttonSmall:"buttonSmall_hjQK",eventButton:"eventButton_WDUY",unionSelect:"unionSelect_Jb_2",tabs:"tabs_nij8",tabsEventSection:"tabsEventSection_TZ3p",tab:"tab_tomX",tabSelected:"tabSelected_B_9X",break:"break_GXKR",unknown:"unknown_nmto",paletteSwatch:"paletteSwatch_SD8s",valueAtomInput:"valueAtomInput_H9XF",valueAtomInputButton:"valueAtomInputButton_pCsL",valueInputBrackets:"valueInputBrackets_RoeW",valueInputOperationButton:"valueInputOperationButton_pexu"};var i=l(5893);const a=["number","direction","variable","indirect","property","expression","true","false"],r=["add","sub","mul","div","mod","min","max","eq","ne","gt","gte","lt","lte","and","or","atan2","shl","shr","bAND","bOR","bXOR"],c=e=>!!e&&r.includes(e.type),o=e=>!!e&&a.includes(e.type);function d(){return(0,i.jsx)("div",{className:n.unionSelect,children:(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)("ellipse",{ry:"10",id:"svg_1",cy:"12",cx:"12",strokeWidth:"3",stroke:"#ccc",fill:"transparent"}),(0,i.jsx)("circle",{cx:"12",cy:"12",r:"2"})]})})}function u(e){let{children:t}=e;return(0,i.jsx)("div",{className:n.input,children:t})}function p(e){let{children:t}=e;if(o(t))return(0,i.jsx)(h,{type:t.type,value:t.defaultValue});if(c(t)){let e=t.type;return e="eq"===e?"==":"lt"===e?"<":"==",(0,i.jsxs)("div",{className:n.valueInputBrackets,children:[(0,i.jsx)(p,{children:t.valueA}),(0,i.jsx)("div",{className:n.valueInputOperationButton,children:e}),(0,i.jsx)(p,{children:t.valueB})]})}return(0,i.jsx)(h,{type:"variable"})}function h(e){let{type:t,value:l}=e,s=l??0;return"true"===t?s="True":"false"===t?s="False":"expression"===t?s="6 * $health":"variable"===t&&(s="$Variable0"),(0,i.jsxs)("div",{className:n.valueAtomInput,children:[(0,i.jsxs)("div",{className:n.valueAtomInputButton,children:["number"===t&&(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M22.548 9l.452-2h-5.364l1.364-6h-2l-1.364 6h-5l1.364-6h-2l-1.364 6h-6.184l-.452 2h6.182l-1.364 6h-5.36l-.458 2h
15.364l-1.364 6h2l1.364-6h5l-1.364 6h2l1.364-6h6.185l.451-2h-6.182l1.364-6h5.366zm-8.73 6h-5l1.364-6h5l-1.364 6z"})}),"direction"===t&&(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M14.145 8.633l-2.145-8.633-2.148 8.636c-.572.366-1.034.877-1.358 1.477l-8.494 1.887 8.494 1.887c.324.6.786 1.111 1.358 1.477l2.148 8.636 2.157-8.64c.571-.367 1.03-.879 1.353-1.479l8.49-1.881-8.492-1.884c-.324-.603-.788-1.116-1.363-1.483zm-2.145 5.367c-1.104 0-2-.896-2-2s.896-2 2-2 2 .896 2 2-.896 2-2 2zm7 5l-3.43-2.186c.474-.352.893-.771 1.245-1.245l2.185 3.431zm-3.521-11.882l3.521-2.117-2.119 3.519c-.386-.542-.86-1.015-1.402-1.402zm-6.955 9.767l-3.524 2.115 2.118-3.521c.387.543.862 1.018 1.406 1.406zm-1.34-8.453l-2.184-3.431 3.431 2.184c-.474.352-.894.772-1.247 1.247z"})}),"true"===t&&(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M21.5 2H2.5V7H9V22H15V7H21.5V2Z"})}),"false"===t&&(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M18.5 2H6V22H12V14.5H17V10.5H12V6.5H18.5V2Z"})}),"variable"===t&&(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M12.7148438,22.1757812 L12.714,20.229 L12.7800926,20.2258391 C13.6949267,20.1603492 14.530599,19.9802517 15.2871094,19.6855469 C16.2597656,19.3066406 17.0253906,18.7519531 17.5839844,18.0214844 C18.1425781,17.2910156 18.421875,16.40625 18.421875,15.3671875 L18.421875,15.34375 C18.421875,14.0625 18.0097656,13.0683594 17.1855469,12.3613281 C16.3613281,11.6542969 15.1484375,11.1210938 13.546875,10.7617188 L12.714,10.579 L12.714,6.513 L12.8085938,6.52539062 C13.0585938,6.56835938 13.2929688,6.6328125 13.5117188,6.71875 C13.9492188,6.890625 14.3046875,7.14257812 14.578125,7.47460938 C14.8515625,7.80664062 15.015625,8.21875 15.0703125,8.7109375 L15.0820312,8.734375 L18.1875,8.72265625 L18.1992188,8.7109375 C18.1601562,7.71875 17.8769531,6.85742188 17.3496094,6.12695312 C16.8222656,5.39648438 16.0996094,4.83203125 15.1816406,4.43359375 C14.5390625,4.1546875 13.8208789,3.97339844 13.0270898,3.88972656 L12.714,3.863 L12.7148438,1.890625 L11.3671875,1.890625 L11.367,3.856 L11.2021123,3.86429398 C10.3338638,3.9304591 9.54123264,4.11241319 8.82421875,4.41015625 C7.90234375,4.79296875 7.17578125,5.33984375 6.64453125,6.05078125 C6.11328125,6.76171875 5.84765625,7.609375 5.84765625,8.59375 L5.84765625,8.6171875 C5.84765625,9.875 6.25390625,10.8671875 7.06640625,11.59375 C7.87890625,12.3203125 9.05078125,12.859375 10.5820312,13.2109375 L11.367,13.384 L11.367,17.597 L11.2177136,17.5815529 C10.8854432,17.5394611 10.5876116,17.469308 10.3242188,17.3710938 C9.86328125,17.1992188 9.50195312,16.9511719 9.24023438,16.6269531 C8.97851562,16.3027344 8.80859375,15.921875 8.73046875,15.484375 L8.73046875,15.4609375 L5.6015625,15.4609375 L5.58984375,15.484375 C5.62890625,16.5078125 5.92773438,17.375 6.48632812,18.0859375 C7.04492188,18.796875 7.79882812,19.3359375 8.74804688,19.703125 C9.48632812,19.9887153 10.3014082,20.1632427 11.193287,20.2267072 L11.367,20.236 L11.3671875,22.1757812 L12.7148438,22.1757812 Z M11.367,10.268 L11.2575,10.2376563 C10.59,10.0464062 10.0875,9.82265625 9.75,9.56640625 C9.328125,9.24609375 9.1171875,8.84375 9.1171875,8.359375 L9.1171875,8.3359375 C9.1171875,7.9765625 9.2265625,7.65625 9.4453125,7.375 C9.6640625,7.09375 9.98828125,6.87109375 10.4179688,6.70703125 C10.6635045,6.61328125 10.9422034,6.54631696 11.2540657,6.50613839 L11.367,6.495 L11.367,10.268 Z M12.714,17.6 L12.714,13.69 L12.8831676,13.7330514 C13.6502131,13.9410834 14.201527,14.1713423 14.5371094,14.4238281 C14.9472656,14.7324219 15.1523438,15.15625 15.1523438,15.6953125 L15.1523438,15.71875 C15.1523438,16.109375 15.0371094,16.4492188 14.8066406,16.7382812 C14.5761719,17.0273438 14.2304688,17.2480469 13.7695312,17.4003906 C13.5061384,17.4874442 13.2032047,17.5496253 12.8607302,17.586934 L12.714,17.6 Z",fillRule:"nonzero"})}),"expression"===t&&(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M0.445923 0H23.5541V5.65642H19.4566V4.09756H9.22323L15.8426 12L9.22323 19.9024H19.4567V18.3436H23.5543V24H0.445923L10.4974 12L0.445923 0Z"})})]}),(0,i.jsx)("div",{className:n.input,children:s})]})}function x(e){let{children:t}=e;return(0,i.jsx)("div",{className:n.textarea,children:t})}function v(e){let{children:t}=e;return(0,i.jsx)("div",{className:(0,s.Z)(n.textarea,n.code),children:t})}function f(e){let{children:t}=e;return(0,i.jsxs)("div",{className:n.select,children:[t,(0,i.jsx)("div",{className:n.flexGrow}),(0,i.jsx)("svg",{height:"20",width:"20",viewBox:"0 0 20 20",ariaHidden:"true",focusable:"false",children:(0,i.jsx)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})})]})}function j(){return(0,i.jsxs)("div",{className:n.paletteSwatch,children:[(0,i.jsx)("div",{style:{backgroundColor:"rgb(232, 248, 224)"}}),(0,i.jsx)("div",{style:{backgroundColor:"rgb(176, 240, 136)"}}),(0,i.jsx)("div",{style:{backgroundColor:"rgb(80, 152, 120)"}}),(0,i.jsx)("div",{style:{backgroundColor:"rgb(32, 40, 80)"}})]})}function b(e){let{options:t,moreOptions:l,value:a}=e;return(0,i.jsxs)("div",{className:n.toggleButtons,children:[(0,i.jsx)("div",{className:n.toggleButtonsRow,children:t.map((e=>(0,i.jsx)("div",{className:(0,s.Z)(n.toggleButtonsOption,{[n.toggleButtonsOptionSelected]:Array.isArray(a)?a.includes(e.value):a===e.value}),children:e.label})))}),l&&(0,i.jsx)("div",{className:n.toggleButtonsRow,children:l.map((e=>(0,i.jsx)("div",{className:(0,s.Z)(n.toggleButtonsOption,{[n.toggleButtonsOptionSelected]:Array.isArray(a)?a.includes(e.value):a===e.value}),children:e.label})))})]})}const g=e=>{let{angle:t}=e;return(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",style:{transform:`rotate(${t}deg)`},children:(0,i.jsx)("path",{d:"M24 22h-24l12-20z"})})};function y(e){let{field:t}=e;return"actor"===t.type?(0,i.jsxs)(f,{children:[(0,i.jsx)("img",{className:n.selectIcon,src:"/img/script-glossary/actor.png"}),"player"===t.defaultValue?"Player":"Actor 1"]}):"emote"===t.type?(0,i.jsxs)(f,{children:[(0,i.jsx)("img",{className:n.selectIcon,src:"/img/script-glossary/emote.png"}),"Love"]}):"avatar"===t.type?(0,i.jsxs)(f,{children:[(0,i.jsx)("img",{className:n.selectIcon,src:"/img/script-glossary/actor.png"}),"Avatar 1"]}):"scene"===t.type?(0,i.jsx)(f,{children:"Scene 1"}):"animationstate"===t.type?(0,i.jsx)(f,{children:"Default"}):"overlayColor"===t.type?(0,i.jsx)(f,{children:"Black"}):"cameraSpeed"===t.type||"overlaySpeed"===t.type?(0,i.jsx)(f,{children:"Speed 1"}):"moveSpeed"===t.type?(0,i.jsx)(f,{children:"Speed 2"}):"animSpeed"===t.type?(0,i.jsx)(f,{children:"Speed 4"}):"fadeSpeed"===t.type?(0,i.jsx)(f,{children:"Speed 1"}):"customEvent"===t.type?(0,i.jsx)(f,{children:"My Custom Script"}):"engineField"===t.type?(0,i.jsx)(f,{children:"Jump Velocity"}):"music"===t.type||"music"===t.type?(0,i.jsx)(f,{children:"My Track 1"}):"soundEffect"===t.type?(0,i.jsx)(f,{children:"Beep"}):"engineFieldValue"===t.type?(0,i.jsx)(p,{children:"0"}):"number"===t.type||"text"===t.type||"matharea"===t.type||"textarea"===t.type&&t.singleLine?(0,i.jsx)(u,{children:t.placeholder||t.defaultValue}):"textarea"!==t.type||t.singleLine?"code"===t.type?(0,i.jsx)(v,{children:t.placeholder||t.defaultValue}):"references"===t.type?(0,i.jsx)("div",{className:(0,s.Z)(n.button,n.buttonSmall),children:"Add Reference"}):"moveType"===t.type?(0,i.jsx)("div",{className:n.button,children:(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M6 11v-4l-6 5 6 5v-4h12v4l6-5-6-5v4z"})})}):"priority"===t.type?(0,i.jsx)("div",{className:n.button,children:(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)("path",{d:"M 8.17 6.493 C 8.09 5.692 8.72 5 9.521 5 C 10.322 5 10.952 5.692 10.872 6.493 L 10.071 14.503 C 10.042 14.785 9.805 15 9.521 15 C 9.237 15 9 14.785 8.971 14.502 L 8.17 6.493 Z M 9.521 19.25 C 8.831 19.25 8.271 18.69 8.271 18 C 8.271 17.31 8.831 16.75 9.521 16.75 C 10.211 16.75 10.771 17.31 10.771 18 C 10.771 18.69 10.211 19.25 9.521 19.25 Z"}),(0,i.jsx)("path",{d:"M 13.128 6.493 C 13.048 5.692 13.678 5 14.479 5 C 15.28 5 15.91 5.692 15.83 6.493 L 15.029 14.503 C 15 14.785 14.763 15 14.479 15 C 14.195 15 13.958 14.785 13.929 14.502 L 13.128 6.493 Z M 14.479 19.25 C 13.789 19.25 13.229 18.69 13.229 18 C 13.229 17.31 13.789 16.75 14.479 16.75 C 15.169 16.75 15.729 17.31 15.729 18 C 15.729 18.69 15.169 19.25 14.479 19.25 Z"})]})}):"operator"===t.type||"mathOperator"===t.type?(0,i.jsx)(f,{children:t.defaultValue}):"direction"===t.type?(0,i.jsx)(b,{options:[{label:(0,i.jsx)(g,{angle:-90}),value:"left"},{label:(0,i.jsx)(g,{angle:0}),value:"up"},{label:(0,i.jsx)(g,{angle:180}),value:"down"},{label:(0,i.jsx)(g,{angle:90}),value:"right"}]}):"input"===t.type?(0,i.jsx)(b,{options:[{label:(0,i.jsx)(g,{angle:-90}),value:"left"},{label:(0,i.jsx)(g,{angle:0}),value:"up"},{label:(0,i.jsx)(g,{angle:180}),value:"down"},{label:(0,i.jsx)(g,{angle:90}),value:"right"}],moreOptions:[{label:"A",value:"a"},{label:"B",value:"b"},{label:"Start",value:"start"},{label:"Select",value:"select"}]}):"select"===t.type?(0,i.jsx)(f,{children:(t.options.find((e=>e[0]===t.defaultValue))||t.options[0])[1]}):"sprite"===t.type?(0,i.jsxs)(f,{children:[(0,i.jsx)("img",{className:n.selectIcon,src:"/img/script-glossary/actor.png"}),(0,i.jsx)("div",{className:n.flexGrow,children:"cat"})]}):"tileset"===t.type?(0,i.jsxs)(f,{children:[(0,i.jsx)("img",{className:n.selectIcon,src:"/img/script-glossary/tileset.png"}),(0,i.jsx)("div",{className:n.flexGrow,children:"flowers"})]}):"variable"===t.type?(0,i.jsx)(f,{children:"$Variable0"}):"selectFlags"===t.type?(0,i.jsx)(f,{children:"Flag 1"}):"palette"===t.type?(0,i.jsxs)(f,{children:[(0,i.jsx)(j,{}),void 0!==t.paletteIndex?`${t.paletteIndex}: `:""," ","Palette ",t.paletteIndex]}):"collisionMask"===t.type?(0,i.jsx)(b,{value:t.defaultValue,options:[].concat(t.includePlayer?{label:"Player",value:"player",selected:"player"===t.defaultValue}:[],[{label:"1",value:"1",selected:"1"===t.defaultValue},{label:"2",value:"2",selected:"2"===t.defaultValue},{label:"3",value:"3",selected:"3"===t.defaultValue}])}):"selectbutton"===t.type?(0,i.jsx)(d,{}):"togglebuttons"===t.type?(0,i.jsx)(b,{options:t.options.map((e=>({label:e[1],value:e[0]}))),value:t.defaultValue}):"tabs"===t.type?(0,i.jsx)("div",{className:(0,s.Z)(n.tabs,{[n.tabsEventSection]:"eventSection"===t.variant}),children:Object.keys(t.values).map((e=>(0,i.jsx)("div",{className:(0,s.Z)(n.tab,{[n.tabSelected]:e===t.defaultValue}),children:t.values[e]},e)))}):"value"===t.type||"constvalue"===t.type?(0,i.jsx)(p,{children:t.defaultValue}):(0,i.jsxs)("div",{className:n.unknown,children:["Unknown Type ",t.type]}):(0,i.jsx)(x,{children:t.placeholder||t.defaultValue})}function m(e){let{field:t,args:l}=e;if(t.type||t.label){if(t.conditions){if(!t.conditions.reduce(((e,t)=>{const s=l?.[t.key];return e&&(!t.eq||s===t.eq)&&(!t.ne||s!==t.ne)&&(!t.gt||Number(s)>Number(t.gt))&&(!t.gte||Number(s)>=Number(t.gte))&&(!t.lt||Number(s)>Number(t.lt))&&(!t.lte||Number(s)>=Number(t.lte))&&(!t.in||t.in.indexOf(s)>
1=0)&&!t.sceneType}),!0))return null}if("group"===t.type)return(0,i.jsx)("div",{className:n.group,children:t.fields.map(((e,t)=>(0,i.jsx)(m,{field:e,args:l},t)))});if("checkbox"===t.type)return(0,i.jsx)("div",{className:(0,s.Z)(n.field,{[n.fieldHalf]:"50%"===t.width}),style:{flexBasis:t.flexBasis,flexGrow:t.flexGrow,flexShrink:t.flexShrink},children:(0,i.jsxs)("div",{className:n.checkbox,children:[(0,i.jsx)("div",{className:(0,s.Z)(n.checkboxInput,{[n.checkboxInputChecked]:t.defaultValue}),children:(0,i.jsx)("svg",{viewBox:"0 0 24 24",children:(0,i.jsx)("polyline",{points:"20 6 9 17 4 12"})})})," ",t.label]})});if("flag"===t.type)return(0,i.jsx)("div",{className:(0,s.Z)(n.field,{[n.fieldHalf]:"50%"===t.width}),style:{flexBasis:t.flexBasis,flexGrow:t.flexGrow,flexShrink:t.flexShrink},children:(0,i.jsxs)("div",{className:n.checkbox,children:[(0,i.jsx)("input",{className:n.checkboxInput,checked:t.defaultValue})," ",t.label]})});if("collapsable"===t.type)return(0,i.jsx)("div",{className:(0,s.Z)(n.collapsableHeader),children:t.label});if("events"===t.type)return(0,i.jsxs)("div",{title:t.label,className:n.conditional,children:[(0,i.jsx)("div",{className:n.conditionalLabel,children:t.label}),(0,i.jsx)("div",{className:n.eventsWrapper,children:(0,i.jsx)("div",{class:"sc-JsfGe eFPlT","data-handler-id":"T48",children:(0,i.jsx)("div",{class:"sc-eiQXzm cklbLv",children:(0,i.jsxs)("div",{className:(0,s.Z)(n.button,n.eventButton),children:[(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M24 9h-9v-9h-6v9h-9v6h9v9h6v-9h9z"})}),"Add Event"]})})})})]});if("union"===t.type){const e={...t,type:t.defaultType,union:!0,defaultValue:t.defaultValue[t.defaultType]};return(0,i.jsx)(m,{field:e,args:l})}return"break"===t.type?(0,i.jsx)("div",{className:n.break}):(0,i.jsxs)("div",{className:(0,s.Z)(n.field,{[n.fieldHalf]:"50%"===t.width}),style:{flexBasis:t.flexBasis,flexGrow:t.flexGrow,flexShrink:t.flexShrink},children:[!t.hideLabel&&t.label,(0,i.jsxs)("div",{className:n.fieldInput,children:[t.type&&(0,i.jsx)(y,{field:t}),t.union&&(0,i.jsx)(d,{})]})]})}}const w=(e,t)=>{t||(t={});for(const l of e)l.key&&void 0!==l.defaultValue&&(t[l.key]=l.defaultValue),"group"===l.type&&w(l.fields,t);return t};function k(e){let{title:t,fields:l}=e;const a=w(l);return(0,i.jsxs)("div",{className:(0,s.Z)(n.wrapper),children:[(0,i.jsx)("div",{className:(0,s.Z)(n.header),children:t}),(0,i.jsx)("div",{className:(0,s.Z)(n.form),children:l.map(((e,t)=>(0,i.jsx)(m,{field:e,args:a},t)))})]})}},1151:(e,t,l)=>{l.d(t,{Z:()=>r,a:()=>a});var s=l(7294);const n={},i=s.createContext(n);function a(e){const t=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:a(e.components),s.createElement(i.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.