From 0ea73b9b4e36a813a73e1e01d8a24ed323286841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 17 Oct 2024 13:16:37 +0200 Subject: [PATCH] [3D city builder] Use a custom object for the tool bar --- .../3d-tile-based-city-builder.json | 1801 +++++++++-------- 1 file changed, 965 insertions(+), 836 deletions(-) diff --git a/examples/3d-tile-based-city-builder/3d-tile-based-city-builder.json b/examples/3d-tile-based-city-builder/3d-tile-based-city-builder.json index 61d378918..6dd1b47bf 100644 --- a/examples/3d-tile-based-city-builder/3d-tile-based-city-builder.json +++ b/examples/3d-tile-based-city-builder/3d-tile-based-city-builder.json @@ -1,9 +1,9 @@ { "firstLayout": "GameScene", "gdVersion": { - "build": 99, - "major": 4, - "minor": 0, + "build": 216, + "major": 5, + "minor": 4, "revision": 0 }, "properties": { @@ -16,7 +16,7 @@ "pixelsRounding": false, "projectUuid": "fb136f57-9ece-4de4-875a-833c07a0a9e3", "scaleMode": "linear", - "sizeOnStartupMode": "", + "sizeOnStartupMode": "adaptWidth", "templateSlug": "tile-based-city-builder", "useExternalSourceFiles": false, "version": "1.0.0", @@ -502,7 +502,7 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": true, - "zoomFactor": 0.399494700575115, + "zoomFactor": 0.41296579374381426, "windowMask": false }, "objectsGroups": [ @@ -519,20 +519,6 @@ "name": "HouseObject" } ] - }, - { - "name": "Button", - "objects": [ - { - "name": "HouseButton" - }, - { - "name": "MineButton" - }, - { - "name": "LumberButton" - } - ] } ], "variables": [ @@ -628,51 +614,6 @@ "stringProperties": [], "initialVariables": [] }, - { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "UI", - "name": "HouseButton", - "persistentUuid": "c9a51a77-e7ef-444c-9542-813aecdcd5df", - "width": 0, - "x": 1140, - "y": 35, - "zOrder": 11, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "UI", - "name": "MineButton", - "persistentUuid": "868341c1-bca6-45e9-99a7-76a9e8329743", - "width": 0, - "x": 1140, - "y": 210, - "zOrder": 12, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 0, - "layer": "UI", - "name": "LumberButton", - "persistentUuid": "39301992-4684-46e4-94aa-8473450ebed3", - "width": 0, - "x": 1140, - "y": 385, - "zOrder": 13, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, { "angle": 0, "customSize": true, @@ -704,9 +645,45 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "UI", + "name": "Toolbar", + "persistentUuid": "14b63ad2-b1f4-402a-9c28-7b51f45b87d2", + "width": 0, + "x": 1140, + "y": 35, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ + { + "assetStoreId": "", + "name": "Toolbar", + "type": "Toolbar::Toolbar", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": {} + }, { "assetStoreId": "", "bold": false, @@ -744,6 +721,7 @@ "text": "Gold: 0", "font": "4edb48c0d41fb226b138458d9186d2a903e8a36d3014d4fb0ca4e9b8caff372b_Goldman-Bold.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -785,6 +763,7 @@ "text": "Lumber: 0", "font": "4edb48c0d41fb226b138458d9186d2a903e8a36d3014d4fb0ca4e9b8caff372b_Goldman-Bold.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -826,6 +805,7 @@ "text": "Stone: 0", "font": "4edb48c0d41fb226b138458d9186d2a903e8a36d3014d4fb0ca4e9b8caff372b_Goldman-Bold.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -838,7 +818,18 @@ "updateIfNotVisible": false, "variables": [], "effects": [], - "behaviors": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], "animations": [ { "name": "", @@ -920,337 +911,11 @@ "text": "+", "font": "4edb48c0d41fb226b138458d9186d2a903e8a36d3014d4fb0ca4e9b8caff372b_Goldman-Bold.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 25, "color": "255;231;0" } }, - { - "assetStoreId": "", - "name": "HouseButton", - "type": "SpriteToggleSwitch::SpriteToggleSwitch", - "variables": [ - { - "folded": true, - "name": "BuildingName", - "type": "string", - "value": "House" - } - ], - "effects": [ - { - "effectType": "Outline", - "name": "Black", - "doubleParameters": { - "padding": 5, - "thickness": 5 - }, - "stringParameters": { - "color": "19;87;48" - }, - "booleanParameters": {} - }, - { - "effectType": "Outline", - "name": "White", - "doubleParameters": { - "padding": 5, - "thickness": 5 - }, - "stringParameters": { - "color": "58;255;140" - }, - "booleanParameters": {} - } - ], - "behaviors": [], - "content": { - "IsChecked": false - }, - "childrenContent": { - "State": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Unchecked", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\House.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - }, - { - "name": "Checked", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\HouseSelected.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } - }, - { - "assetStoreId": "", - "name": "MineButton", - "type": "SpriteToggleSwitch::SpriteToggleSwitch", - "variables": [ - { - "folded": true, - "name": "BuildingName", - "type": "string", - "value": "Mine" - } - ], - "effects": [ - { - "effectType": "Outline", - "name": "Black", - "doubleParameters": { - "padding": 5, - "thickness": 5 - }, - "stringParameters": { - "color": "92;63;33" - }, - "booleanParameters": {} - }, - { - "effectType": "Outline", - "name": "White", - "doubleParameters": { - "padding": 5, - "thickness": 5 - }, - "stringParameters": { - "color": "255;174;93" - }, - "booleanParameters": {} - } - ], - "behaviors": [], - "content": { - "IsChecked": false - }, - "childrenContent": { - "State": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Unchecked", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\Mine.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - }, - { - "name": "Checked", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\MineSelected.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } - }, - { - "assetStoreId": "", - "name": "LumberButton", - "type": "SpriteToggleSwitch::SpriteToggleSwitch", - "variables": [ - { - "folded": true, - "name": "BuildingName", - "type": "string", - "value": "Lumber" - } - ], - "effects": [ - { - "effectType": "Outline", - "name": "Black", - "doubleParameters": { - "padding": 5, - "thickness": 5 - }, - "stringParameters": { - "color": "92;63;33" - }, - "booleanParameters": {} - }, - { - "effectType": "Outline", - "name": "White", - "doubleParameters": { - "padding": 5, - "thickness": 5 - }, - "stringParameters": { - "color": "255;174;93" - }, - "booleanParameters": {} - } - ], - "behaviors": [], - "content": { - "IsChecked": false - }, - "childrenContent": { - "State": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Unchecked", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\Lumber.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - }, - { - "name": "Checked", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "assets\\LumberSelected.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } - }, { "assetStoreId": "", "name": "FloorGrid", @@ -1379,28 +1044,27 @@ "folderName": "__ROOT", "children": [ { - "objectName": "GoldText" - }, - { - "objectName": "StoneText" - }, - { - "objectName": "WoodText" - }, - { - "objectName": "Vignette" + "folderName": "UI", + "children": [ + { + "objectName": "GoldText" + }, + { + "objectName": "StoneText" + }, + { + "objectName": "WoodText" + }, + { + "objectName": "Toolbar" + } + ] }, { "objectName": "IncomeText" }, { - "objectName": "HouseButton" - }, - { - "objectName": "MineButton" - }, - { - "objectName": "LumberButton" + "objectName": "Vignette" }, { "objectName": "FloorGrid" @@ -1480,32 +1144,15 @@ "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Toolbar::UpdateToolSelection" - }, - "parameters": [ - "", - "Button", - "Effect", - "" - ] - } - ] - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Toolbar::SelectedTool" + "value": "Toolbar::Toolbar::SelectedTool" }, "parameters": [ - "", + "Toolbar", "=", "\"None\"", "" @@ -1528,10 +1175,10 @@ "conditions": [ { "type": { - "value": "Toolbar::SelectedTool" + "value": "Toolbar::Toolbar::SelectedTool" }, "parameters": [ - "", + "Toolbar", "!=", "\"None\"", "" @@ -1590,10 +1237,10 @@ "conditions": [ { "type": { - "value": "Toolbar::SelectedTool" + "value": "Toolbar::Toolbar::SelectedTool" }, "parameters": [ - "", + "Toolbar", "!=", "\"None\"", "" @@ -1648,21 +1295,14 @@ }, { "type": { - "value": "BuiltinCommonInstructions::Not" + "inverted": true, + "value": "SourisSurObjet" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "SourisSurObjet" - }, - "parameters": [ - "Button", - "", - "", - "" - ] - } + "parameters": [ + "Toolbar", + "", + "", + "" ] }, { @@ -1701,10 +1341,10 @@ "conditions": [ { "type": { - "value": "Toolbar::SelectedTool" + "value": "Toolbar::Toolbar::SelectedTool" }, "parameters": [ - "", + "Toolbar", "=", "\"House\"", "" @@ -1771,10 +1411,10 @@ "conditions": [ { "type": { - "value": "Toolbar::SelectedTool" + "value": "Toolbar::Toolbar::SelectedTool" }, "parameters": [ - "", + "Toolbar", "=", "\"Mine\"", "" @@ -1821,10 +1461,10 @@ "conditions": [ { "type": { - "value": "Toolbar::SelectedTool" + "value": "Toolbar::Toolbar::SelectedTool" }, "parameters": [ - "", + "Toolbar", "=", "\"Lumber\"", "" @@ -1884,11 +1524,11 @@ "actions": [ { "type": { - "value": "Toolbar::SetTool" + "value": "Toolbar::Toolbar::SetSelectedTool" }, "parameters": [ - "", - "Button", + "Toolbar", + "=", "\"None\"", "" ] @@ -2125,10 +1765,10 @@ "conditions": [ { "type": { - "value": "Toolbar::SelectedTool" + "value": "Toolbar::Toolbar::SelectedTool" }, "parameters": [ - "", + "Toolbar", "=", "\"None\"", "" @@ -2214,7 +1854,7 @@ "parameters": [ "CameraElevationAngle", "=", - "clamp(Variable(CameraElevationAngle) + MousePointerLock::MovementY() / 5, 15, 89)" + "clamp(CameraElevationAngle + MousePointerLock::MovementY() / 5, 15, 89)" ] }, { @@ -2237,7 +1877,7 @@ "SceneWindowHeight() / 2", "800", "CameraRotationAngle", - "Variable(CameraElevationAngle)", + "CameraElevationAngle", "", "" ] @@ -2353,10 +1993,46 @@ } ], "behaviorsSharedData": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior" + }, + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, { "name": "FloatingObject", "type": "FloatingObject::FloatingObject" }, + { + "name": "Object3D", + "type": "Scene3D::Base3DBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" + }, { "name": "Tween", "type": "Tween::TweenBehavior" @@ -6250,9 +5926,16 @@ ], "eventsBasedObjects": [ { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, "defaultName": "ToggleSwitch", "description": "A toggle switch that users can click or touch.", "fullName": "Toggle switch", + "isUsingLegacyInstancesRenderer": true, "name": "SpriteToggleSwitch", "eventsFunctions": [ { @@ -7372,7 +7055,39 @@ "objectName": "State" } ] - } + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] } ] }, @@ -7734,215 +7449,149 @@ "dependencies": [], "globalVariables": [], "sceneVariables": [], - "eventsFunctions": [ + "eventsFunctions": [], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ { + "areaMaxX": 120, + "areaMaxY": 500, + "areaMaxZ": 48, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "", + "description": "", "fullName": "", - "functionType": "Action", - "name": "onSceneLoaded", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarSceneTxt" - }, - "parameters": [ - "_ToolBar.SelectedToolName", - "=", - "\"None\"" - ] - } - ] - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Update tool selection accordind to user inputs.", - "fullName": "Update tool selection", - "functionType": "Action", - "name": "UpdateToolSelection", - "sentence": "Update tool selection among _PARAM1_ according to user inputs", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteToggleSwitch::SpriteToggleSwitch::HasJustBeenUnchecked" - }, - "parameters": [ - "Button", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarSceneTxt" - }, - "parameters": [ - "_ToolBar.SelectedToolName", - "=", - "\"None\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Make buttons act as radio buttons." - }, + "isUsingLegacyInstancesRenderer": false, + "name": "Toolbar", + "eventsFunctions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteToggleSwitch::SpriteToggleSwitch::HasJustBeenChecked" - }, - "parameters": [ - "Button", - "" - ] - } - ], - "actions": [], + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "AjoutObjConcern" + "value": "SpriteToggleSwitch::SpriteToggleSwitch::HasJustBeenUnchecked" }, "parameters": [ - "", - "Button" + "Button", + "" ] } ], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SpriteToggleSwitch::SpriteToggleSwitch::HasJustBeenChecked" - }, - "parameters": [ - "Button", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked" - }, - "parameters": [ - "Button", - "no", - "" - ] - } + "type": { + "value": "Toolbar::Toolbar::SetPropertySelectedTool" + }, + "parameters": [ + "Object", + "=", + "\"None\"" ] } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Handle dragging" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "MouseButtonPressed" - }, - "parameters": [ - "", - "Left" - ] }, { - "type": { - "value": "BuiltinCommonInstructions::Once" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [] - } - ], - "actions": [], - "events": [ + "comment": "Make buttons act as radio buttons." + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SourisSurObjet" + "value": "SpriteToggleSwitch::SpriteToggleSwitch::HasJustBeenChecked" }, "parameters": [ "Button", - "", - "", "" ] - } - ], - "actions": [ + }, { "type": { - "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked" + "value": "AjoutObjConcern" }, "parameters": [ - "Button", "", - "" + "Button" ] }, { "type": { - "value": "AjoutObjConcern" + "inverted": true, + "value": "SpriteToggleSwitch::SpriteToggleSwitch::HasJustBeenChecked" }, "parameters": [ - "", - "Button" + "Button", + "" ] } ], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", + "type": { + "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked" + }, + "parameters": [ + "Button", + "no", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Handle dragging" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "MouseButtonPressed" + }, + "parameters": [ + "", + "Left" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": true, "value": "SourisSurObjet" }, "parameters": [ @@ -7953,304 +7602,784 @@ ] } ], - "actions": [ + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "Button" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked" + }, + "parameters": [ + "Button", + "no", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked" + }, + "parameters": [ + "Button", + "", + "" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Select a tool" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsChecked" + }, + "parameters": [ + "Button", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Toolbar::Toolbar::SetPropertySelectedTool" + }, + "parameters": [ + "Object", + "=", + "Button.BuildingName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Hover effect" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ { "type": { - "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked" + "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsHovered" + }, + "parameters": [ + "Button", + "" + ] + }, + { + "type": { + "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsChecked" }, "parameters": [ "Button", - "no", "" ] } ] } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Button", + "Effect", + "\"Black\"", + "" + ] + }, + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Button", + "Effect", + "\"White\"", + "yes" + ] + } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Select a tool" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsChecked" - }, - "parameters": [ - "Button", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsHovered" + }, + "parameters": [ + "Button", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsChecked" + }, + "parameters": [ + "Button", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Button", + "Effect", + "\"Black\"", + "yes" + ] + }, + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Button", + "Effect", + "\"White\"", + "no" + ] + } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "ModVarSceneTxt" - }, - "parameters": [ - "_ToolBar.SelectedToolName", - "=", - "Button.VariableString(BuildingName)" - ] + "description": "Object", + "name": "Object", + "supplementaryInformation": "Toolbar::Toolbar", + "type": "object" } - ] + ], + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "description": "the selected tool of the object.", + "fullName": "Selected tool", + "functionType": "ExpressionAndCondition", + "group": "Toolbar configuration", + "name": "SelectedTool", + "sentence": "the selected tool", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "SelectedTool" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"House\",\"Mine\",\"Lumber\"]", + "type": "stringWithSelector" }, - "comment": "Hover effect" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Toolbar::Toolbar", + "type": "object" + } + ], + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "SelectedTool", + "name": "SetSelectedTool", + "sentence": "", + "events": [ { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Toolbar::Toolbar::SetPropertySelectedTool" + }, + "parameters": [ + "Object", + "=", + "Value" + ] + }, { "type": { - "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsHovered" + "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked" }, "parameters": [ "Button", + "no", "" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsChecked" + "value": "VarObjetTxt" + }, + "parameters": [ + "Button", + "BuildingName", + "=", + "Value" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked" }, "parameters": [ "Button", + "yes", "" ] } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "EffectCapability::EffectBehavior::EnableEffect" + "description": "Object", + "name": "Object", + "supplementaryInformation": "Toolbar::Toolbar", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "None", + "type": "Choice", + "label": "Selected tool", + "description": "", + "group": "", + "extraInformation": [ + "None", + "House", + "Mine", + "Lumber" + ], + "hidden": true, + "name": "SelectedTool" + } + ], + "objects": [ + { + "assetStoreId": "", + "name": "LumberButton", + "type": "SpriteToggleSwitch::SpriteToggleSwitch", + "variables": [ + { + "folded": true, + "name": "BuildingName", + "type": "string", + "value": "Lumber" + } + ], + "effects": [ + { + "effectType": "Outline", + "name": "Black", + "doubleParameters": { + "padding": 5, + "thickness": 5 }, - "parameters": [ - "Button", - "Effect", - "\"Black\"", - "" - ] + "stringParameters": { + "color": "92;63;33" + }, + "booleanParameters": {} }, { - "type": { - "value": "EffectCapability::EffectBehavior::EnableEffect" + "effectType": "Outline", + "name": "White", + "doubleParameters": { + "padding": 5, + "thickness": 5 }, - "parameters": [ - "Button", - "Effect", - "\"White\"", - "yes" + "stringParameters": { + "color": "255;174;93" + }, + "booleanParameters": {} + } + ], + "behaviors": [], + "content": { + "IsChecked": false + }, + "childrenContent": { + "State": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Unchecked", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\Lumber.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "Checked", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\LumberSelected.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } ] } - ] + } }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsHovered" - }, - "parameters": [ - "Button", - "" - ] - }, + "assetStoreId": "", + "name": "MineButton", + "type": "SpriteToggleSwitch::SpriteToggleSwitch", + "variables": [ { - "type": { - "inverted": true, - "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsChecked" - }, - "parameters": [ - "Button", - "" - ] + "folded": true, + "name": "BuildingName", + "type": "string", + "value": "Mine" } ], - "actions": [ + "effects": [ { - "type": { - "value": "EffectCapability::EffectBehavior::EnableEffect" + "effectType": "Outline", + "name": "Black", + "doubleParameters": { + "padding": 5, + "thickness": 5 }, - "parameters": [ - "Button", - "Effect", - "\"Black\"", - "yes" - ] + "stringParameters": { + "color": "92;63;33" + }, + "booleanParameters": {} }, { - "type": { - "value": "EffectCapability::EffectBehavior::EnableEffect" + "effectType": "Outline", + "name": "White", + "doubleParameters": { + "padding": 5, + "thickness": 5 }, - "parameters": [ - "Button", - "Effect", - "\"White\"", - "no" + "stringParameters": { + "color": "255;174;93" + }, + "booleanParameters": {} + } + ], + "behaviors": [], + "content": { + "IsChecked": false + }, + "childrenContent": { + "State": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Unchecked", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\Mine.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "Checked", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\MineSelected.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } ] } - ] - } - ], - "parameters": [ - { - "description": "Tool bar button", - "name": "Button", - "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch", - "type": "objectList" + } }, { - "description": "Effect capacity", - "name": "Effect", - "supplementaryInformation": "EffectCapability::EffectBehavior", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the selected tool name.", - "fullName": "Selected Tool", - "functionType": "ExpressionAndCondition", - "name": "SelectedTool", - "sentence": "the selected tool", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "assetStoreId": "", + "name": "HouseButton", + "type": "SpriteToggleSwitch::SpriteToggleSwitch", + "variables": [ { - "type": { - "value": "SetReturnString" + "folded": true, + "name": "BuildingName", + "type": "string", + "value": "House" + } + ], + "effects": [ + { + "effectType": "Outline", + "name": "Black", + "doubleParameters": { + "padding": 5, + "thickness": 5 }, - "parameters": [ - "VariableString(_ToolBar.SelectedToolName)" + "stringParameters": { + "color": "19;87;48" + }, + "booleanParameters": {} + }, + { + "effectType": "Outline", + "name": "White", + "doubleParameters": { + "padding": 5, + "thickness": 5 + }, + "stringParameters": { + "color": "58;255;140" + }, + "booleanParameters": {} + } + ], + "behaviors": [], + "content": { + "IsChecked": false + }, + "childrenContent": { + "State": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Unchecked", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\House.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "Checked", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "assets\\HouseSelected.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } ] } - ] + } } ], - "expressionType": { - "supplementaryInformation": "[\"None\",\"House\",\"Mine\",\"Lumber\"]", - "type": "stringWithSelector" + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "HouseButton" + }, + { + "objectName": "MineButton" + }, + { + "objectName": "LumberButton" + } + ] }, - "parameters": [], - "objectGroups": [] - }, - { - "description": "Change the selected tool.", - "fullName": "Selected Tool", - "functionType": "Action", - "name": "SetTool", - "sentence": "Change the current tool to _PARAM2_ among _PARAM1_", - "events": [ + "objectsGroups": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "name": "Button", + "objects": [ { - "type": { - "value": "ModVarSceneTxt" - }, - "parameters": [ - "_ToolBar.SelectedToolName", - "=", - "GetArgumentAsString(\"Tool\")" - ] + "name": "LumberButton" }, { - "type": { - "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked" - }, - "parameters": [ - "Button", - "no", - "" - ] + "name": "MineButton" + }, + { + "name": "HouseButton" } ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ { - "type": { - "value": "VarObjetTxt" - }, - "parameters": [ - "Button", - "BuildingName", - "=", - "GetArgumentAsString(\"Tool\")" - ] + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 } ], - "actions": [ - { - "type": { - "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked" - }, - "parameters": [ - "Button", - "yes", - "" - ] - } - ] + "effects": [] } ], - "parameters": [ - { - "description": "Button", - "name": "Button", - "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch", - "type": "objectList" - }, + "instances": [ { - "description": "", - "name": "Tool", - "supplementaryInformation": "[\"None\",\"House\",\"Mine\",\"Lumber\"]", - "type": "stringWithSelector" + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "HouseButton", + "persistentUuid": "491a9ff9-f45d-41a7-a90c-afd1d015b80d", + "width": 0, + "x": 0, + "y": 0, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "MineButton", + "persistentUuid": "4b26eb6b-f110-4cd3-901e-8eb67cb8aa8b", + "width": 0, + "x": 0, + "y": 180, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "LumberButton", + "persistentUuid": "e33efc5b-2344-4f63-b20e-183c17ca6fa7", + "width": 0, + "x": 0, + "y": 360, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } - ], - "objectGroups": [] + ] } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] + ] }, { "author": "",