Pack Making JSON Panels - DonBruce64/MinecraftTransportSimulator GitHub Wiki
Panels are simply things that show the instruments in vehicles, and allow interacting with those instruments. While not required, they do make standardizing vehicle instrument displays far easier. Panels go into the 'panels' folder located in the main pack folder.
JSON Parameters
Panels have those core JSON sections:
- texture – The texture sheet to use for this panel. Contains the background, buttons, switches, etc. Make sure to include a _lit variant otherwise things will look weird!
- textureWidth – The width of the texture, in pixels.
- textureHeight – The height of the texture, in pixels.
- backgroundWidth – The width of the background section on the texture, in pixels. The background must touch the left side!
- backgroundHeight – The height of the background section on the texture, in pixels. The background must touch the top!
- textColor – The color for the text in the panel that renders below components. If this is not included it will default to white.
- litTextColor – Same as textColor, but for the text when the vehicle's lights are on.
- components – A list of components that go onto this panel. These are things that can be seen and interacted with.
Components
- pos – The position of where to place this component on the panel, with the anchor at the top-left.
- width – The width of the texture area, and the component itself.
- height – The height of the texture area, and the component itself.
- textureStart – The top-left coordinate of where this panel's 0-state texture is located.
- text – Descriptive text to be rendered below this control.
- statusVariable – The variable used to choose the texture state. May be omitted if this component doesn't change textures.
- visibilityConditions – A list of conditions that determines if this component is visible (default is visible).
- specialComponent – The special component to make this component. May be null. If set, special logic will be applied that is per-component.
- clickAction – The action to perform when this control is clicked.
- variable – The variable to act on.
- action – The type of action to perform when clicked.
Actions:
- toggle – Toggles the value of the variable from 0 to 1 or 1 to 0.
- set – Sets the value of the variable to 'value'.
- increment – Increments the variable by 'value', subject to the bounds in clampMin and clampMax.
- clickActionLeft – The action to perform when this control is clicked on the left side. Actions are the same as on the regular clickAction.
- clickActionRight – The action to perform when this control is clicked on the right side. Actions are the same as on the regular clickAction.
Special Components
- car_light - Makes this a light switch, with animates based on running_light and headlight. Will not be visible if hasRunningLights and hasHeadlights are false.
- turn_signal - Makes this a turn signal switch, which animates based on left_turn_signal and right_turn_signal. Will not be visible if hasTurnSignals is false.
- navigation_light - Makes this a nav light switch, which animates based on the navigation_light variable. Will not be visible if hasNavLights is false.
- strobe_light - Makes this a strobe light switch, which animates based on the stobe_light variable. Will not be visible if hasStobeLights is false.
- taxi_light - Makes this a taxi light switch, which animates based on the taxi_light variable. Will not be visible if hasTaxiLights is false.
- landing_light - Makes this a landing light switch, which animates based on the landing_light variable. Will not be visible if hasLandingLights is false.
- engine_control - Makes this a engine switch, which animates based on the engine state and can turn the engine on and off, and engage the starter. The first switch present will be for the first engine, the second the second, unless hasSingleEngineControl is set, in which the switch will control all engines. Will not be visible if the vehicle has no engines placed in it.
- engine_on - Makes this a engine magneto switch, which animates based on the engine state and can turn the engine on and off. The first switch present will be for the first engine, the second the second, unless hasSingleEngineControl is set, in which the switch will control all engines. Will not be visible if the vehicle has no engines placed in it.
- engine_start - Makes this a engine starter switch, which animates based on the engine state and can engage the starter. The first switch present will be for the first engine, the second the second, unless hasSingleEngineControl is set, in which the switch will control all engines. Will not be visible if the vehicle has no engines placed in it.
- trailer - Makes this a trailer switch, which animates based on if a connection is made or not. The first switch present will be for the first connection, the second the second. Will not be visible if the vehicle has no possible connections.
- custom_variable -Makes this a custom variable switch, which animates based on the state of the custom variable. The first switch present will be for the first variable, the second the second. Will not be visible if the vehicle and all its parts have no customVariables.
- beacon_box - Makes this a beacon box, which allows changing the selected beacon. Will not be visible if hasRadioNav is false for the vehicle and allPlanesWithNav is false in the config.
- roll_trim - Makes this a roll trim button. Clicking the left and right will adjust the trim in the limits.
- pitch_trim - Makes this a pitch trim button. Clicking the left and right will adjust the trim in the limits.
- yaw_trim - Makes this a yaw trim button. Clicking the left and right will adjust the trim in the limits.