From 0e384160c3d90ecd1af36c2be7464ff0e904e17c Mon Sep 17 00:00:00 2001 From: Roy Falk Date: Sun, 14 Jan 2024 11:51:29 +0200 Subject: [PATCH] Add controls.json to hold the widget information for the base computer widgets instead of hard coding it in the code. --- CMakeLists.txt | 1 + controls.json | 234 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+) create mode 100644 controls.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e2db375..6265221e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,6 +130,7 @@ INSTALL(FILES master_part_list.json DESTINATION share/vegastrike) INSTALL(FILES master_asteroid_list.json DESTINATION share/vegastrike) INSTALL(FILES master_component_list.json DESTINATION share/vegastrike) INSTALL(FILES master_ship_list.json DESTINATION share/vegastrike) +INSTALL(FILES controls.json DESTINATION share/vegastrike) INSTALL(FILES py27_modules.7z DESTINATION share/vegastrike) diff --git a/controls.json b/controls.json new file mode 100644 index 00000000..ae863527 --- /dev/null +++ b/controls.json @@ -0,0 +1,234 @@ +[ + { + "type": "staticDisplay", + "name": "baseTitle", + "text": "ERROR", + "textColor": "0.1,0.8,0.1,1.0", + "rect": "-.96, .76, 1.9, .08", + "color": "0.0,0.0,0.0,0.0", + "font": "0.07,1.75", + "id": "BaseInfoTitle" + }, + { + "type": "staticDisplay", + "name": "playerTitle", + "text": "ERROR", + "textColor": "0.7,0.7,0.9,1.0", + "rect": "-.96, .69, 1.9, .07", + "color": "0.0,0.0,0.0,0.0", + "font": "0.06,1.5", + "id": "PlayerInfoTitle" + }, + { + "type": "button", + "name": "saveLoad", + "label": "Save/Load", + "command": "ShowOptionsMenu", + "rect": ".64, .85, .32, .1", + "textColor": "1,1,1,1", + "color": "0.75,0,0,0.25", + "downTextColor": "0,0,0,0", + "downColor": "0.75,0,0,0.6", + "highlightColor": "0,0,1,0.4", + "font": "0.08,1.0" + }, + { + "type": "button", + "name": "done", + "label": "Done", + "command": "DoneComputer", + "rect": ".74, .71, .22, .1", + "textColor": "1,1,1,1", + "color": "0.75,0,0,0.25", + "downTextColor": "0,0,0,0", + "downColor": "0.75,0,0,0.6", + "highlightColor": "0,0,1,0.4", + "font": "0.08,1.5" + }, + { + "type": "button", + "name": "mode", + "label": "ERROR", + "rect": "-.96, .86, .24, .09", + "textColor": "1,1,1,1", + "color": "0,0.5,0,0.25", + "downTextColor": "0,0,0,0", + "downColor": "0,0.5,0,0.5", + "highlightColor": "0,0.5,0,0.4", + "font": "0.07,1.5", + "id": "ModeButton" + }, + { + "type": "staticDisplay", + "name": "seller", + "text": "Seller", + "textColor": "1,1,1,1", + "rect": "-.96, .56, .81, .1", + "color": "0.0,0.0,0.0,0.0", + "font": "0.08,1.5", + "justification": "center", + "id": "PlayerInfoTitle" + }, + { + "type": "staticDisplay", + "name": "totalPrice", + "textColor": "1,1,1,1", + "rect": "-.2, .56, .4, .07", + "color": "0.0,0.0,0.0,0.0", + "font": "0.06", + "justification": "center", + "id": "TotalPrice" + }, + { + "type": "staticDisplay", + "name": "maxQuantity", + "textColor": "1,1,1,1", + "rect": "-.14, .49, .28, .07", + "color": "0.0,0.0,0.0,0.0", + "font": "0.06", + "justification": "center", + "id": "MaxQuantity" + }, + { + "type": "scroller", + "name": "sellerScroller", + "textColor": "1,1,1,1", + "rect": "-.20, -.4, .05, .95", + "color": "0.375,0.375,0.75,.1", + "thumbColor": "0.375,0.375,0.75,.4", + "buttonColor": "0.375,0.375,0.75,.4", + "outlineColor": "0.5,0.5,0.5,1" + }, + { + "type": "picker", + "name": "sellerPicker", + "textColor": "1,1,1,1", + "rect": "-.96, -.4, .76, .95", + "color": "0.375,0.375,0.75,.1", + "selectionColor": "0, .6, 0, .8", + "highlightColor": "0, .6, 0, .35", + "highlightTextColor": "1,1,1,1", + "outlineColor": "0.5,0.5,0.5,1", + "font": ".07", + "textMargins": "0.02, 0.01", + "id": "BaseCargo" + }, + { + "type": "scroller", + "name": "inventoryScroller", + "textColor": "1,1,1,1", + "rect": ".91, -.4, .05, .95", + "color": "0.375,0.375,0.75,.1", + "thumbColor": "0.375,0.375,0.75,.4", + "buttonColor": "0.375,0.375,0.75,.4", + "outlineColor": "0.5,0.5,0.5,1" + }, + { + "type": "picker", + "name": "inventoryPicker", + "textColor": "1,1,1,1", + "rect": ".15, -.4, .76, .95", + "color": "0.375,0.375,0.75,.1", + "selectionColor": "0, .6, 0, .8", + "highlightColor": "0, .6, 0, .35", + "highlightTextColor": "1,1,1,1", + "outlineColor": "0.5,0.5,0.5,1", + "font": ".07", + "textMargins": "0.02, 0.01", + "id": "PlayerCargo" + }, + { + "type": "button", + "name": "buy", + "rect": "-.11, .3, .22, .13", + "textColor": "1,1,1,1", + "color": "0,1,1,.1", + "downTextColor": ".2,.2,.2", + "downColor": "0,1,1,.4", + "borderColor": ".2,.2,.2", + "endBorderColor": ".4,.4,.4", + "shadowWidth": "2", + "cycleTime": "1.0", + "font": "0.1,1.5", + "id": "CommitAll" + }, + { + "type": "button", + "name": "buy10", + "rect": "-.11, .1, .22, .1", + "textColor": "1,1,1,1", + "color": "0,1,1,.1", + "downTextColor": ".2,.2,.2", + "downColor": "0,1,1,.4", + "borderColor": ".2,.2,.2", + "endBorderColor": ".4,.4,.4", + "shadowWidth": "2", + "cycleTime": "1.0", + "font": "0.08,1.5", + "id": "Commit10" + }, + { + "type": "button", + "name": "buy1", + "rect": "-.11, -.1, .22, .1", + "textColor": "1,1,1,1", + "color": "0,1,1,.1", + "downTextColor": ".2,.2,.2", + "downColor": "0,1,1,.4", + "borderColor": ".2,.2,.2", + "endBorderColor": ".4,.4,.4", + "shadowWidth": "2", + "cycleTime": "1.0", + "font": "0.08,1.5", + "id": "Commit" + }, + { + "type": "scroller", + "name": "descriptionScroller", + "textColor": "1,1,1,1", + "rect": ".91, -.95, .05, .5", + "color": "0.375,0.375,0.75,.1", + "thumbColor": "0.15,0.15,0.3", + "buttonColor": "0.15,0.15,0.3", + "outlineColor": "0.5,0.5,0.5,1" + }, + { + "type": "staticImageDisplay", + "name": "picture", + "texture": "blackclear.png", + "rect": "-.96, -.45, .345, -.47", + "id": "DescriptionImage" + }, + { + "type": "staticDisplay", + "name": "description", + "textColor": "1,1,1,1", + "rect": "-.6, -.95, 1.51, .5", + "color": "0.375,0.375,0.75,.1", + "outlineColor": "0.5,0.5,0.5,1", + "font": "0.06", + "textMargins": "0.02, 0.01", + "multiline": true, + "id": "Description" + }, + { + "type": "staticDisplay", + "name": "sellLabel", + "text": "Available Upgrades", + "textColor": "1,1,1,1", + "rect": "-.96, .55, .81, .1", + "color": "0,0,0,0", + "font": "0.07, 1.5", + "justification": "center" + }, + { + "type": "scroller", + "name": "sellerScroller", + "textColor": "1,1,1,1", + "rect": "-.20, -.4, .05, .95", + "color": "0.375,0.375,0.75,.1", + "thumbColor": "0.15,0.15,0.3", + "buttonColor": "0.15,0.15,0.3", + "outlineColor": "0.5,0.5,0.5,1" + } +]