diff --git a/.gitignore b/.gitignore index 8c4c629..43e1e86 100644 --- a/.gitignore +++ b/.gitignore @@ -171,3 +171,4 @@ $RECYCLE.BIN/ # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) +/export \ No newline at end of file diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..2aba8ad --- /dev/null +++ b/TODO.md @@ -0,0 +1,6 @@ +# To-do + +- Make zones upgradeable, similar to SimCity BuildIt +- Add Casey Universe buildings + - Central Tower + - Pawprint Press \ No newline at end of file diff --git a/dialog/ticker.json b/dialog/ticker.json new file mode 100644 index 0000000..de3b89e --- /dev/null +++ b/dialog/ticker.json @@ -0,0 +1,44 @@ +{ + "1": { + "text": "50 Car Pile-Up Results In New City Sculpture." + }, + "2": { + "text": "After 36 Years Of Marriage, Man Discovers Wife Is Actually A Rare Yucca Plant." + }, + "3": { + "text": "All Raccoons Cheat At Poker, Animal Researchers Say." + }, + "4": { + "text": "Pawprint News. Always there." + }, + "5": { + "text": "Cat Hijacks Municipal Bus; Riders Applaud Good Timing At Stops And Courteous Meows." + }, + "6": { + "text": "From The Desk Of Wise Guy Sammy: Check Your Facts Before Making A Fool Of Yourself." + }, + "7": { + "text": "Rumor Of Kitty Kibble Shortage Causes Futures To Drop; Consumers Stockpile." + }, + "8": { + "text": "From The Desk Of Wise Guy Sammy: The Insides Of Golf Balls Are Mostly Rubber Bands." + }, + "9": { + "text": "Tommy B. Saif Sez: No Left Turn, Except Buses." + }, + "10": { + "text": "Truckload Of Apples Overturns, [city] Diner Offers Applesauce Special." + }, + "11": { + "text": "Ordinary Days In [city] Become Common." + }, + "12": { + "text": "Semicolon Declared Sexier Than Comma At Grammarian's Fete." + }, + "13": { + "text": "Spotted Owl Spotted." + }, + "14": { + "text": "This Space For Rent." + } +} \ No newline at end of file diff --git a/dialog/ticker_alerts.json b/dialog/ticker_alerts.json new file mode 100644 index 0000000..5809c45 --- /dev/null +++ b/dialog/ticker_alerts.json @@ -0,0 +1,5 @@ +{ + "1": { + "text": "" + } +} \ No newline at end of file diff --git a/scenes/advisors/CityPlanner.tscn b/scenes/Advisor.tscn similarity index 74% rename from scenes/advisors/CityPlanner.tscn rename to scenes/Advisor.tscn index 0115a95..ea07f46 100644 --- a/scenes/advisors/CityPlanner.tscn +++ b/scenes/Advisor.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=2 format=2] -[ext_resource path="res://scripts/city_planner.gd" type="Script" id=1] -[ext_resource path="res://sprites/avatars/zc.png" type="Texture" id=2] +[ext_resource path="res://scripts/advisor_window.gd" type="Script" id=1] -[node name="CityPlanner" type="AcceptDialog"] +[node name="Advisor" type="AcceptDialog"] anchor_left = 0.293945 anchor_top = 0.303333 anchor_right = 0.706055 @@ -12,10 +11,6 @@ script = ExtResource( 1 ) __meta__ = { "_edit_use_anchors_": true } -dialogue_file = "res://dialog/cityplanner.json" -character = "Zack Casey" -rank = "City Planner" -avatar = ExtResource( 2 ) [node name="Container" type="HSplitContainer" parent="."] anchor_right = 1.0 diff --git a/scenes/Credits.tscn b/scenes/Credits.tscn index 9799fde..20c037b 100644 --- a/scenes/Credits.tscn +++ b/scenes/Credits.tscn @@ -1,6 +1,7 @@ [gd_scene format=2] [node name="Credits" type="WindowDialog"] +visible = true anchor_left = 0.394043 anchor_top = 0.293333 anchor_right = 0.605957 @@ -21,6 +22,9 @@ Tony Bark Assets by Maxis +Interface Icons by +Font Awesome + Powered by Godot Engine @@ -34,6 +38,9 @@ Tony Bark Assets by Maxis +Interface Icons by +Font Awesome + Powered by Godot Engine diff --git a/scenes/HintDialog.tscn b/scenes/HintDialog.tscn deleted file mode 100644 index ebfc3a1..0000000 --- a/scenes/HintDialog.tscn +++ /dev/null @@ -1,46 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[sub_resource type="GDScript" id=1] -script/source = "extends WindowDialog - -onready var avatar_texture = $Avatar -onready var desc_text = $Description - -func hint_message(description: String, avatar: Texture, hint_title: String): - avatar_texture.texture = avatar - desc_text.text = description -" - -[node name="HintDialog" type="WindowDialog"] -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -margin_left = -196.5 -margin_top = -75.0 -margin_right = 196.5 -margin_bottom = 75.0 -script = SubResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Avatar" type="TextureRect" parent="."] -anchor_left = 0.0305344 -anchor_top = 0.0866667 -anchor_right = 0.284987 -anchor_bottom = 0.793333 -rect_min_size = Vector2( 100, 106 ) -stretch_mode = 5 -__meta__ = { -"_edit_use_anchors_": true -} - -[node name="Description" type="RichTextLabel" parent="."] -anchor_left = 0.310433 -anchor_top = 0.126667 -anchor_right = 0.964377 -anchor_bottom = 0.753333 -__meta__ = { -"_edit_use_anchors_": true -} diff --git a/scenes/AdvisorMeet.tscn b/scenes/Meet.tscn similarity index 100% rename from scenes/AdvisorMeet.tscn rename to scenes/Meet.tscn diff --git a/scenes/Menu.tscn b/scenes/Menu.tscn new file mode 100644 index 0000000..2ec398f --- /dev/null +++ b/scenes/Menu.tscn @@ -0,0 +1,76 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://scripts/city_status.gd" type="Script" id=1] + +[node name="Menu" type="Panel"] +anchor_right = 1.0 +margin_bottom = 32.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="StatCtr" type="HBoxContainer" parent="."] +anchor_left = 0.0136054 +anchor_top = 0.257143 +anchor_right = 0.312925 +anchor_bottom = 0.817143 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="CityNameLbl" type="Label" parent="StatCtr"] +margin_top = 1.0 +margin_right = 66.0 +margin_bottom = 15.0 +text = "City Name" +align = 1 + +[node name="YearLbl" type="Label" parent="StatCtr"] +margin_left = 70.0 +margin_top = 1.0 +margin_right = 109.0 +margin_bottom = 15.0 +text = "Y1980" +align = 1 + +[node name="BudgetLbl" type="Label" parent="StatCtr"] +margin_left = 113.0 +margin_top = 1.0 +margin_right = 128.0 +margin_bottom = 15.0 +text = "§0" +align = 1 + +[node name="ButtonCtr" type="HBoxContainer" parent="."] +anchor_left = 0.733722 +anchor_top = 0.212291 +anchor_right = 0.987366 +anchor_bottom = 0.818005 +margin_top = -0.906677 +margin_bottom = 3.95047 +alignment = 2 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="TaxBtn" type="Button" parent="ButtonCtr"] +margin_left = 105.0 +margin_right = 138.0 +margin_bottom = 24.0 +text = "RCI" +flat = true + +[node name="AdvsiorBtn" type="Button" parent="ButtonCtr"] +margin_left = 142.0 +margin_right = 209.0 +margin_bottom = 24.0 +text = "Advisors" +flat = true + +[node name="ToolsBtn" type="Button" parent="ButtonCtr"] +margin_left = 213.0 +margin_right = 259.0 +margin_bottom = 24.0 +text = "Tools" +flat = true diff --git a/scenes/Start.tscn b/scenes/Start.tscn index 25ed1c8..e9cedaf 100644 --- a/scenes/Start.tscn +++ b/scenes/Start.tscn @@ -10,17 +10,13 @@ [node name="Controls" type="CanvasLayer" parent="."] [node name="Start" type="Panel" parent="Controls"] -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -margin_left = -142.0 -margin_top = -76.0 -margin_right = 130.0 -margin_bottom = 70.0 +anchor_left = 0.367188 +anchor_top = 0.378333 +anchor_right = 0.632812 +anchor_bottom = 0.646667 script = ExtResource( 1 ) __meta__ = { -"_edit_use_anchors_": false +"_edit_use_anchors_": true } [node name="Container" type="VBoxContainer" parent="Controls/Start"] @@ -44,7 +40,17 @@ align = 1 margin_top = 18.0 margin_right = 219.0 margin_bottom = 42.0 -text = "Furtropolis" +align = 1 +caret_blink = true +caret_blink_speed = 0.5 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="MayorNameEdit" type="LineEdit" parent="Controls/Start/Container"] +margin_top = 46.0 +margin_right = 219.0 +margin_bottom = 70.0 align = 1 caret_blink = true caret_blink_speed = 0.5 @@ -53,9 +59,9 @@ __meta__ = { } [node name="BudgetMenu" type="MenuButton" parent="Controls/Start/Container"] -margin_top = 46.0 +margin_top = 74.0 margin_right = 219.0 -margin_bottom = 66.0 +margin_bottom = 94.0 text = "Starting Budget" items = [ "20000", null, 0, false, false, 0, 0, null, "", false, "10000", null, 0, false, false, 1, 0, null, "", false, "500", null, 0, false, false, 2, 0, null, "", false ] __meta__ = { @@ -63,9 +69,9 @@ __meta__ = { } [node name="CreateBtn" type="Button" parent="Controls/Start/Container"] -margin_top = 70.0 +margin_top = 98.0 margin_right = 219.0 -margin_bottom = 90.0 +margin_bottom = 118.0 text = "Create" [connection signal="pressed" from="Controls/Start/Container/CreateBtn" to="Controls/Start" method="_on_CreateBtn_pressed"] diff --git a/scenes/ToolsWindow.tscn b/scenes/ToolsWindow.tscn new file mode 100644 index 0000000..513ed88 --- /dev/null +++ b/scenes/ToolsWindow.tscn @@ -0,0 +1,163 @@ +[gd_scene load_steps=24 format=2] + +[ext_resource path="res://sprites/ui/iccom.png" type="Texture" id=1] +[ext_resource path="res://sprites/ui/icpolhi.png" type="Texture" id=2] +[ext_resource path="res://sprites/ui/iccomhi.png" type="Texture" id=3] +[ext_resource path="res://sprites/ui/icres.png" type="Texture" id=4] +[ext_resource path="res://sprites/ui/icreshi.png" type="Texture" id=5] +[ext_resource path="res://sprites/ui/icfire.png" type="Texture" id=6] +[ext_resource path="res://sprites/ui/icindhi.png" type="Texture" id=7] +[ext_resource path="res://sprites/ui/icind.png" type="Texture" id=8] +[ext_resource path="res://sprites/ui/icqry.png" type="Texture" id=9] +[ext_resource path="res://sprites/ui/icpol.png" type="Texture" id=10] +[ext_resource path="res://sprites/ui/icnuc.png" type="Texture" id=11] +[ext_resource path="res://sprites/ui/icpark.png" type="Texture" id=12] +[ext_resource path="res://sprites/ui/icseap.png" type="Texture" id=13] +[ext_resource path="res://sprites/ui/icseaphi.png" type="Texture" id=14] +[ext_resource path="res://sprites/ui/icstad.png" type="Texture" id=15] +[ext_resource path="res://sprites/ui/icdozrhi.png" type="Texture" id=16] +[ext_resource path="res://sprites/ui/icfirehi.png" type="Texture" id=17] +[ext_resource path="res://sprites/ui/iccoal.png" type="Texture" id=18] +[ext_resource path="res://sprites/ui/icqryhi.png" type="Texture" id=19] +[ext_resource path="res://sprites/ui/icparkhi.png" type="Texture" id=20] +[ext_resource path="res://sprites/ui/icdozr.png" type="Texture" id=21] +[ext_resource path="res://sprites/ui/iccoalhi.png" type="Texture" id=22] +[ext_resource path="res://sprites/ui/icnuchi.png" type="Texture" id=23] + +[node name="ToolsWindow" type="WindowDialog"] +anchor_left = 0.40332 +anchor_top = 0.315 +anchor_right = 0.544922 +anchor_bottom = 0.683333 +window_title = "Tools" +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="CenterCtr" type="CenterContainer" parent="."] +anchor_left = 0.5 +anchor_right = 0.5 +anchor_bottom = 1.0 +margin_left = -90.0 +margin_right = 90.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VertCtr" type="VBoxContainer" parent="CenterCtr"] +margin_top = 24.0 +margin_right = 180.0 +margin_bottom = 196.0 + +[node name="LargeCtr" type="HBoxContainer" parent="CenterCtr/VertCtr"] +margin_right = 180.0 +margin_bottom = 42.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TextureButton" type="TextureButton" parent="CenterCtr/VertCtr/LargeCtr"] +margin_right = 42.0 +margin_bottom = 42.0 +texture_normal = ExtResource( 15 ) + +[node name="TextureButton2" type="TextureButton" parent="CenterCtr/VertCtr/LargeCtr"] +margin_left = 46.0 +margin_right = 88.0 +margin_bottom = 42.0 +texture_normal = ExtResource( 13 ) +texture_pressed = ExtResource( 14 ) + +[node name="NuclearBtn" type="TextureButton" parent="CenterCtr/VertCtr/LargeCtr"] +margin_left = 92.0 +margin_right = 134.0 +margin_bottom = 42.0 +texture_normal = ExtResource( 11 ) +texture_pressed = ExtResource( 23 ) + +[node name="CoalBtn" type="TextureButton" parent="CenterCtr/VertCtr/LargeCtr"] +margin_left = 138.0 +margin_right = 180.0 +margin_bottom = 42.0 +texture_normal = ExtResource( 18 ) +texture_pressed = ExtResource( 22 ) + +[node name="SmallCtr" type="HBoxContainer" parent="CenterCtr/VertCtr"] +margin_top = 46.0 +margin_right = 180.0 +margin_bottom = 80.0 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="PoliceBtn" type="TextureButton" parent="CenterCtr/VertCtr/SmallCtr"] +margin_right = 34.0 +margin_bottom = 34.0 +texture_normal = ExtResource( 2 ) +texture_pressed = ExtResource( 10 ) + +[node name="FireBtn" type="TextureButton" parent="CenterCtr/VertCtr/SmallCtr"] +margin_left = 38.0 +margin_right = 72.0 +margin_bottom = 34.0 +texture_normal = ExtResource( 17 ) +texture_pressed = ExtResource( 6 ) + +[node name="ParkBtn" type="TextureButton" parent="CenterCtr/VertCtr/SmallCtr"] +margin_left = 76.0 +margin_right = 110.0 +margin_bottom = 34.0 +texture_normal = ExtResource( 12 ) +texture_pressed = ExtResource( 20 ) + +[node name="ToolsCtr" type="HBoxContainer" parent="CenterCtr/VertCtr"] +margin_top = 84.0 +margin_right = 180.0 +margin_bottom = 118.0 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="InfoBtn" type="TextureButton" parent="CenterCtr/VertCtr/ToolsCtr"] +margin_right = 34.0 +margin_bottom = 34.0 +texture_normal = ExtResource( 9 ) +texture_pressed = ExtResource( 19 ) + +[node name="BulldozeBtn" type="TextureButton" parent="CenterCtr/VertCtr/ToolsCtr"] +margin_left = 38.0 +margin_right = 72.0 +margin_bottom = 34.0 +texture_normal = ExtResource( 21 ) +texture_pressed = ExtResource( 16 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ZonesCtr" type="HBoxContainer" parent="CenterCtr/VertCtr"] +margin_top = 122.0 +margin_right = 180.0 +margin_bottom = 172.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ResBtn" type="TextureButton" parent="CenterCtr/VertCtr/ZonesCtr"] +margin_right = 34.0 +margin_bottom = 50.0 +texture_normal = ExtResource( 4 ) +texture_pressed = ExtResource( 5 ) + +[node name="ComBtn" type="TextureButton" parent="CenterCtr/VertCtr/ZonesCtr"] +margin_left = 38.0 +margin_right = 72.0 +margin_bottom = 50.0 +texture_normal = ExtResource( 1 ) +texture_pressed = ExtResource( 3 ) + +[node name="IndBtn" type="TextureButton" parent="CenterCtr/VertCtr/ZonesCtr"] +margin_left = 76.0 +margin_right = 110.0 +margin_bottom = 50.0 +texture_normal = ExtResource( 8 ) +texture_pressed = ExtResource( 7 ) diff --git a/scenes/Windows.tscn b/scenes/Windows.tscn deleted file mode 100644 index 75a3da7..0000000 --- a/scenes/Windows.tscn +++ /dev/null @@ -1,49 +0,0 @@ -[gd_scene load_steps=7 format=2] - -[ext_resource path="res://scenes/advisors/CityPlanner.tscn" type="PackedScene" id=5] -[ext_resource path="res://scenes/DebugConsole.tscn" type="PackedScene" id=7] -[ext_resource path="res://scenes/AdvisorMeet.tscn" type="PackedScene" id=8] -[ext_resource path="res://scenes/advisors/FinanceAdvisor.tscn" type="PackedScene" id=9] -[ext_resource path="res://scripts/windows.gd" type="Script" id=10] -[ext_resource path="res://scenes/TaxWindow.tscn" type="PackedScene" id=11] - -[node name="Windows" type="Control"] -anchor_right = 1.0 -anchor_bottom = 1.0 -script = ExtResource( 10 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Console" parent="." instance=ExtResource( 7 )] -anchor_left = 0.594727 -anchor_top = 0.05 -anchor_right = 0.985352 -anchor_bottom = 0.3 -margin_right = 0.0 -margin_bottom = 0.0 -rect_min_size = Vector2( 400, 150 ) -resizable = true - -[node name="TaxWindow" parent="." instance=ExtResource( 11 )] -anchor_left = 0.297863 -anchor_top = 0.409167 -anchor_right = 0.702137 -anchor_bottom = 0.590833 -margin_left = 0.0 -margin_right = 0.0 -margin_bottom = 3.05176e-05 - -[node name="AdvisorMeet" parent="." instance=ExtResource( 8 )] -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -margin_left = -234.609 -margin_top = -138.5 -margin_right = 234.609 -margin_bottom = 138.5 - -[node name="CityPlanner" parent="." instance=ExtResource( 5 )] - -[node name="FinancialAdvisor" parent="." instance=ExtResource( 9 )] diff --git a/scenes/advisors/FinanceAdvisor.tscn b/scenes/advisors/FinanceAdvisor.tscn deleted file mode 100644 index 7be0d1c..0000000 --- a/scenes/advisors/FinanceAdvisor.tscn +++ /dev/null @@ -1,54 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://sprites/avatars/kit.png" type="Texture" id=1] -[ext_resource path="res://scripts/finance_advisor.gd" type="Script" id=2] - -[node name="FinancialAdvisor" type="AcceptDialog"] -anchor_left = 0.293945 -anchor_top = 0.303333 -anchor_right = 0.706055 -anchor_bottom = 0.696667 -script = ExtResource( 2 ) -__meta__ = { -"_edit_use_anchors_": true -} -dialogue_file = "res://dialog/finacial.json" -character = "Kit Welsh" -rank = "Financial" -avatar = ExtResource( 1 ) - -[node name="Container" type="HSplitContainer" parent="."] -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 8.0 -margin_top = 8.0 -margin_right = -8.0 -margin_bottom = -36.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Advisor" type="VBoxContainer" parent="Container"] -margin_right = 100.0 -margin_bottom = 192.0 - -[node name="Avatar" type="TextureRect" parent="Container/Advisor"] -margin_right = 100.0 -rect_min_size = Vector2( 100, 0 ) - -[node name="RankLbl" type="Label" parent="Container/Advisor"] -margin_top = 4.0 -margin_right = 100.0 -margin_bottom = 18.0 -align = 1 - -[node name="NameLbl" type="Label" parent="Container/Advisor"] -margin_top = 22.0 -margin_right = 100.0 -margin_bottom = 36.0 -align = 1 - -[node name="DescriptionLbl" type="RichTextLabel" parent="Container"] -margin_left = 112.0 -margin_right = 406.001 -margin_bottom = 192.0 diff --git a/scenes/game.tscn b/scenes/game.tscn index be7afb1..7800980 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,13 +1,13 @@ -[gd_scene load_steps=28 format=2] +[gd_scene load_steps=38 format=2] [ext_resource path="res://scenes/Map.tscn" type="PackedScene" id=1] -[ext_resource path="res://scenes/Windows.tscn" type="PackedScene" id=2] +[ext_resource path="res://sprites/symbols/population.svg" type="Texture" id=2] [ext_resource path="res://scripts/city_status.gd" type="Script" id=3] -[ext_resource path="res://sprites/ui/icpolhi.png" type="Texture" id=4] +[ext_resource path="res://scenes/Advisor.tscn" type="PackedScene" id=4] [ext_resource path="res://sprites/ui/iccom.png" type="Texture" id=5] -[ext_resource path="res://sprites/ui/icfirehi.png" type="Texture" id=6] -[ext_resource path="res://sprites/ui/icdozrhi.png" type="Texture" id=7] -[ext_resource path="res://sprites/ui/iccomhi.png" type="Texture" id=8] +[ext_resource path="res://scenes/DebugConsole.tscn" type="PackedScene" id=6] +[ext_resource path="res://sprites/symbols/graph.svg" type="Texture" id=7] +[ext_resource path="res://sprites/symbols/calendar.svg" type="Texture" id=8] [ext_resource path="res://sprites/ui/icres.png" type="Texture" id=9] [ext_resource path="res://sprites/ui/icreshi.png" type="Texture" id=10] [ext_resource path="res://sprites/ui/icfire.png" type="Texture" id=11] @@ -20,6 +20,7 @@ [ext_resource path="res://sprites/ui/iccoalhi.png" type="Texture" id=18] [ext_resource path="res://sprites/ui/iccoal.png" type="Texture" id=19] [ext_resource path="res://scripts/game.gd" type="Script" id=20] +[ext_resource path="res://scenes/Meet.tscn" type="PackedScene" id=21] [ext_resource path="res://sprites/ui/icparkhi.png" type="Texture" id=22] [ext_resource path="res://sprites/ui/icnuc.png" type="Texture" id=23] [ext_resource path="res://sprites/ui/icpark.png" type="Texture" id=24] @@ -27,291 +28,365 @@ [ext_resource path="res://sprites/ui/icseap.png" type="Texture" id=26] [ext_resource path="res://sprites/ui/icseaphi.png" type="Texture" id=27] [ext_resource path="res://sprites/ui/icstad.png" type="Texture" id=28] +[ext_resource path="res://sprites/ui/icpolhi.png" type="Texture" id=29] +[ext_resource path="res://sprites/ui/iccomhi.png" type="Texture" id=30] +[ext_resource path="res://sprites/ui/icdozrhi.png" type="Texture" id=31] +[ext_resource path="res://scenes/TaxWindow.tscn" type="PackedScene" id=32] +[ext_resource path="res://sprites/ui/icfirehi.png" type="Texture" id=33] +[ext_resource path="res://scenes/Credits.tscn" type="PackedScene" id=34] +[ext_resource path="res://scripts/ticker.gd" type="Script" id=35] +[ext_resource path="res://sprites/symbols/building.svg" type="Texture" id=36] +[ext_resource path="res://scripts/windows.gd" type="Script" id=37] [node name="Game" type="Node2D"] script = ExtResource( 20 ) [node name="Quarters" type="Timer" parent="."] -wait_time = 15.0 +wait_time = 150.0 +autostart = true + +[node name="RotateNews" type="Timer" parent="."] +wait_time = 5.0 autostart = true [node name="Map" parent="." instance=ExtResource( 1 )] [node name="Controls" type="CanvasLayer" parent="."] -[node name="Core" type="Control" parent="Controls"] -anchor_left = -0.00268195 -anchor_top = -0.000954026 -anchor_right = 0.997318 -anchor_bottom = 0.999044 -margin_left = -0.172424 -margin_top = 2.77234 -margin_right = -0.172424 -margin_bottom = 2.77234 +[node name="Windows" type="Control" parent="Controls"] +anchor_right = 0.938477 +anchor_bottom = 0.935 +script = ExtResource( 37 ) __meta__ = { -"_edit_use_anchors_": false +"_edit_lock_": true, +"_edit_use_anchors_": true } -[node name="Windows" parent="Controls/Core" instance=ExtResource( 2 )] -anchor_bottom = 0.835002 -margin_bottom = -3.05176e-05 +[node name="Console" parent="Controls/Windows" instance=ExtResource( 6 )] +anchor_left = 0.594727 +anchor_top = 0.05 +anchor_right = 0.985352 +anchor_bottom = 0.3 +rect_min_size = Vector2( 400, 150 ) +resizable = true -[node name="ControlPanel" type="Panel" parent="Controls/Core"] -anchor_left = 0.00195312 -anchor_top = 0.828335 -anchor_right = 1.00684 -anchor_bottom = 1.00834 -margin_bottom = -2.0 +[node name="CityPlanner" parent="Controls/Windows" instance=ExtResource( 4 )] + +[node name="TaxWindow" parent="Controls/Windows" instance=ExtResource( 32 )] +anchor_left = 0.297863 +anchor_top = 0.409167 +anchor_right = 0.702137 +anchor_bottom = 0.590833 +margin_bottom = 3.05176e-05 + +[node name="AdvisorMeet" parent="Controls/Windows" instance=ExtResource( 21 )] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -234.609 +margin_top = -138.5 +margin_right = 234.609 +margin_bottom = 138.5 + +[node name="ToolsWindow" type="WindowDialog" parent="Controls/Windows"] +anchor_left = 0.402435 +anchor_top = 0.315697 +anchor_right = 0.60263 +anchor_bottom = 0.684303 +window_title = "Tools" __meta__ = { "_edit_use_anchors_": true } -[node name="Tabs" type="TabContainer" parent="Controls/Core/ControlPanel"] -anchor_left = 0.00485909 -anchor_top = 0.0471698 -anchor_right = 0.995141 -anchor_bottom = 0.971698 -__meta__ = { -"_edit_use_anchors_": true -} - -[node name="Zones" type="Tabs" parent="Controls/Core/ControlPanel/Tabs"] -visible = false -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 4.0 -margin_top = 32.0 -margin_right = -4.0 -margin_bottom = -4.0 - -[node name="CenterZones" type="CenterContainer" parent="Controls/Core/ControlPanel/Tabs/Zones"] +[node name="CenterCtr" type="CenterContainer" parent="Controls/Windows/ToolsWindow"] anchor_right = 1.0 anchor_bottom = 1.0 __meta__ = { "_edit_use_anchors_": false } -[node name="ZonesCtr" type="HBoxContainer" parent="Controls/Core/ControlPanel/Tabs/Zones/CenterZones"] -margin_left = 450.0 -margin_top = 5.0 -margin_right = 560.0 -margin_bottom = 55.0 +[node name="VertCtr" type="VBoxContainer" parent="Controls/Windows/ToolsWindow/CenterCtr"] +margin_left = 6.0 +margin_top = 17.0 +margin_right = 186.0 +margin_bottom = 189.0 + +[node name="LargeCtr" type="HBoxContainer" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr"] +margin_right = 180.0 +margin_bottom = 42.0 __meta__ = { "_edit_use_anchors_": false } -[node name="ResBtn" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Zones/CenterZones/ZonesCtr"] -margin_right = 34.0 -margin_bottom = 50.0 -texture_normal = ExtResource( 9 ) -texture_pressed = ExtResource( 10 ) - -[node name="ComBtn" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Zones/CenterZones/ZonesCtr"] -margin_left = 38.0 -margin_right = 72.0 -margin_bottom = 50.0 -texture_normal = ExtResource( 5 ) -texture_pressed = ExtResource( 8 ) - -[node name="IndBtn" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Zones/CenterZones/ZonesCtr"] -margin_left = 76.0 -margin_right = 110.0 -margin_bottom = 50.0 -texture_normal = ExtResource( 13 ) -texture_pressed = ExtResource( 12 ) - -[node name="Small" type="Tabs" parent="Controls/Core/ControlPanel/Tabs"] -visible = false -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 4.0 -margin_top = 32.0 -margin_right = -4.0 -margin_bottom = -4.0 - -[node name="CenterSmall" type="CenterContainer" parent="Controls/Core/ControlPanel/Tabs/Small"] -anchor_right = 1.0 -anchor_bottom = 1.0 - -[node name="SmallCtr" type="HBoxContainer" parent="Controls/Core/ControlPanel/Tabs/Small/CenterSmall"] -margin_left = 450.0 -margin_top = 13.0 -margin_right = 560.0 -margin_bottom = 47.0 -__meta__ = { -"_edit_use_anchors_": true -} - -[node name="PoliceBtn" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Small/CenterSmall/SmallCtr"] -margin_right = 34.0 -margin_bottom = 34.0 -texture_normal = ExtResource( 4 ) -texture_pressed = ExtResource( 16 ) - -[node name="FireBtn" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Small/CenterSmall/SmallCtr"] -margin_left = 38.0 -margin_right = 72.0 -margin_bottom = 34.0 -texture_normal = ExtResource( 6 ) -texture_pressed = ExtResource( 11 ) - -[node name="ParkBtn" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Small/CenterSmall/SmallCtr"] -margin_left = 76.0 -margin_right = 110.0 -margin_bottom = 34.0 -texture_normal = ExtResource( 24 ) -texture_pressed = ExtResource( 22 ) - -[node name="Large" type="Tabs" parent="Controls/Core/ControlPanel/Tabs"] -visible = false -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 4.0 -margin_top = 32.0 -margin_right = -4.0 -margin_bottom = -4.0 - -[node name="CenterLarge" type="CenterContainer" parent="Controls/Core/ControlPanel/Tabs/Large"] -anchor_right = 1.0 -anchor_bottom = 1.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="LargeCtr" type="HBoxContainer" parent="Controls/Core/ControlPanel/Tabs/Large/CenterLarge"] -margin_left = 415.0 -margin_top = 9.0 -margin_right = 595.0 -margin_bottom = 51.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="TextureButton" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Large/CenterLarge/LargeCtr"] +[node name="TextureButton" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/LargeCtr"] margin_right = 42.0 margin_bottom = 42.0 texture_normal = ExtResource( 28 ) -[node name="TextureButton2" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Large/CenterLarge/LargeCtr"] +[node name="TextureButton2" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/LargeCtr"] margin_left = 46.0 margin_right = 88.0 margin_bottom = 42.0 texture_normal = ExtResource( 26 ) texture_pressed = ExtResource( 27 ) -[node name="NuclearBtn" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Large/CenterLarge/LargeCtr"] +[node name="NuclearBtn" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/LargeCtr"] margin_left = 92.0 margin_right = 134.0 margin_bottom = 42.0 texture_normal = ExtResource( 23 ) texture_pressed = ExtResource( 25 ) -[node name="CoalBtn" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Large/CenterLarge/LargeCtr"] +[node name="CoalBtn" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/LargeCtr"] margin_left = 138.0 margin_right = 180.0 margin_bottom = 42.0 texture_normal = ExtResource( 19 ) texture_pressed = ExtResource( 18 ) -[node name="Tools" type="Tabs" parent="Controls/Core/ControlPanel/Tabs"] -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 4.0 -margin_top = 32.0 -margin_right = -4.0 -margin_bottom = -4.0 - -[node name="CenterTools" type="CenterContainer" parent="Controls/Core/ControlPanel/Tabs/Tools"] -anchor_right = 1.0 -anchor_bottom = 1.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="ToolsCtr" type="HBoxContainer" parent="Controls/Core/ControlPanel/Tabs/Tools/CenterTools"] -margin_left = 469.0 -margin_top = 13.0 -margin_right = 541.0 -margin_bottom = 47.0 +[node name="SmallCtr" type="HBoxContainer" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr"] +margin_top = 46.0 +margin_right = 180.0 +margin_bottom = 80.0 __meta__ = { "_edit_use_anchors_": true } -[node name="InfoBtn" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Tools/CenterTools/ToolsCtr"] +[node name="PoliceBtn" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/SmallCtr"] +margin_right = 34.0 +margin_bottom = 34.0 +texture_normal = ExtResource( 29 ) +texture_pressed = ExtResource( 16 ) + +[node name="FireBtn" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/SmallCtr"] +margin_left = 38.0 +margin_right = 72.0 +margin_bottom = 34.0 +texture_normal = ExtResource( 33 ) +texture_pressed = ExtResource( 11 ) + +[node name="ParkBtn" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/SmallCtr"] +margin_left = 76.0 +margin_right = 110.0 +margin_bottom = 34.0 +texture_normal = ExtResource( 24 ) +texture_pressed = ExtResource( 22 ) + +[node name="ToolsCtr" type="HBoxContainer" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr"] +margin_top = 84.0 +margin_right = 180.0 +margin_bottom = 118.0 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="InfoBtn" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/ToolsCtr"] margin_right = 34.0 margin_bottom = 34.0 texture_normal = ExtResource( 15 ) texture_pressed = ExtResource( 14 ) -[node name="BulldozeBtn" type="TextureButton" parent="Controls/Core/ControlPanel/Tabs/Tools/CenterTools/ToolsCtr"] +[node name="BulldozeBtn" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/ToolsCtr"] margin_left = 38.0 margin_right = 72.0 margin_bottom = 34.0 texture_normal = ExtResource( 17 ) -texture_pressed = ExtResource( 7 ) +texture_pressed = ExtResource( 31 ) __meta__ = { "_edit_use_anchors_": false } -[node name="StatCtr" type="HBoxContainer" parent="Controls/Core/ControlPanel"] -anchor_left = 0.0136054 -anchor_top = 0.0571429 -anchor_right = 0.312925 -anchor_bottom = 0.214286 +[node name="ZonesCtr" type="HBoxContainer" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr"] +margin_top = 122.0 +margin_right = 180.0 +margin_bottom = 172.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ResBtn" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/ZonesCtr"] +margin_right = 34.0 +margin_bottom = 50.0 +texture_normal = ExtResource( 9 ) +texture_pressed = ExtResource( 10 ) + +[node name="ComBtn" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/ZonesCtr"] +margin_left = 38.0 +margin_right = 72.0 +margin_bottom = 50.0 +texture_normal = ExtResource( 5 ) +texture_pressed = ExtResource( 30 ) + +[node name="IndBtn" type="TextureButton" parent="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/ZonesCtr"] +margin_left = 76.0 +margin_right = 110.0 +margin_bottom = 50.0 +texture_normal = ExtResource( 13 ) +texture_pressed = ExtResource( 12 ) + +[node name="Credits" parent="Controls/Windows" instance=ExtResource( 34 )] +visible = false + +[node name="Menu" type="Panel" parent="Controls"] +anchor_left = 0.919922 +anchor_top = -0.02 +anchor_right = 1.0 +anchor_bottom = 0.963333 +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": true +} + +[node name="ButtonCtr" type="VBoxContainer" parent="Controls/Menu"] +anchor_top = 0.0305085 +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_right = 7.62939e-06 +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="TaxBtn" type="Button" parent="Controls/Menu/ButtonCtr"] +margin_left = 10.0 +margin_right = 72.0 +margin_bottom = 56.0 +size_flags_horizontal = 4 +icon = ExtResource( 7 ) + +[node name="ToolsBtn" type="Button" parent="Controls/Menu/ButtonCtr"] +margin_left = 13.0 +margin_top = 60.0 +margin_right = 68.0 +margin_bottom = 121.0 +size_flags_horizontal = 4 +icon = ExtResource( 36 ) + +[node name="AdvsiorBtn" type="Button" parent="Controls/Menu/ButtonCtr"] +margin_left = 7.0 +margin_top = 125.0 +margin_right = 74.0 +margin_bottom = 145.0 +size_flags_horizontal = 4 +text = "Advisors" + +[node name="Status" type="Panel" parent="Controls"] +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_top = -55.0 +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": false +} + +[node name="StatCtr" type="HBoxContainer" parent="Controls/Status"] +anchor_left = 0.00878906 +anchor_top = 0.527273 +anchor_right = 1.0 +anchor_bottom = 0.963636 +custom_constants/separation = 100 +alignment = 1 script = ExtResource( 3 ) __meta__ = { "_edit_use_anchors_": true } -[node name="CityNameLbl" type="Label" parent="Controls/Core/ControlPanel/StatCtr"] -margin_top = 1.0 -margin_right = 66.0 -margin_bottom = 15.0 +[node name="CityNameLbl" type="Label" parent="Controls/Status/StatCtr"] +margin_left = 123.0 +margin_top = 4.0 +margin_right = 189.0 +margin_bottom = 18.0 text = "City Name" -align = 1 -[node name="YearLbl" type="Label" parent="Controls/Core/ControlPanel/StatCtr"] -margin_left = 70.0 -margin_top = 1.0 -margin_right = 109.0 -margin_bottom = 15.0 -text = "Y1980" -align = 1 +[node name="CityYearSep" type="VSeparator" parent="Controls/Status/StatCtr"] +margin_left = 289.0 +margin_right = 293.0 +margin_bottom = 23.0 -[node name="BudgetLbl" type="Label" parent="Controls/Core/ControlPanel/StatCtr"] -margin_left = 113.0 -margin_top = 1.0 -margin_right = 128.0 -margin_bottom = 15.0 +[node name="YearCtr" type="HBoxContainer" parent="Controls/Status/StatCtr"] +margin_left = 393.0 +margin_right = 443.0 +margin_bottom = 23.0 + +[node name="CalIcon" type="TextureRect" parent="Controls/Status/StatCtr/YearCtr"] +margin_right = 14.0 +margin_bottom = 23.0 +texture = ExtResource( 8 ) +stretch_mode = 4 + +[node name="YearLbl" type="Label" parent="Controls/Status/StatCtr/YearCtr"] +margin_left = 18.0 +margin_top = 4.0 +margin_right = 50.0 +margin_bottom = 18.0 +text = "1980" + +[node name="YearBudgetSep" type="VSeparator" parent="Controls/Status/StatCtr"] +margin_left = 543.0 +margin_right = 547.0 +margin_bottom = 23.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="BudgetLbl" type="Label" parent="Controls/Status/StatCtr"] +margin_left = 647.0 +margin_top = 4.0 +margin_right = 662.0 +margin_bottom = 18.0 text = "§0" -align = 1 -[node name="ButtonCtr" type="HBoxContainer" parent="Controls/Core/ControlPanel"] -anchor_left = 0.733722 -anchor_top = 0.0522911 -anchor_right = 0.987366 -anchor_bottom = 0.195148 -margin_top = -0.906677 -margin_bottom = 3.95047 -alignment = 2 +[node name="BudgetPopSep" type="VSeparator" parent="Controls/Status/StatCtr"] +margin_left = 762.0 +margin_right = 766.0 +margin_bottom = 23.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="PopCtr" type="HBoxContainer" parent="Controls/Status/StatCtr"] +margin_left = 866.0 +margin_right = 892.0 +margin_bottom = 23.0 + +[node name="PopIcon" type="TextureRect" parent="Controls/Status/StatCtr/PopCtr"] +margin_right = 14.0 +margin_bottom = 23.0 +texture = ExtResource( 2 ) +stretch_mode = 4 + +[node name="PopLbl" type="Label" parent="Controls/Status/StatCtr/PopCtr"] +margin_left = 18.0 +margin_top = 4.0 +margin_right = 26.0 +margin_bottom = 18.0 +text = "0" + +[node name="TickerBg" type="ColorRect" parent="Controls/Status"] +anchor_left = 0.00976562 +anchor_top = 0.0909091 +anchor_right = 0.987305 +anchor_bottom = 0.490909 +color = Color( 0, 0, 0, 1 ) +script = ExtResource( 35 ) __meta__ = { "_edit_use_anchors_": true } -[node name="TaxBtn" type="Button" parent="Controls/Core/ControlPanel/ButtonCtr"] -margin_left = 157.0 -margin_right = 190.0 -margin_bottom = 20.0 -text = "RCI" - -[node name="AdvsiorBtn" type="Button" parent="Controls/Core/ControlPanel/ButtonCtr"] -margin_left = 194.0 -margin_right = 261.0 -margin_bottom = 20.0 -text = "Advisors" +[node name="TickerTxt" type="RichTextLabel" parent="Controls/Status/TickerBg"] +anchor_left = 0.00601721 +anchor_top = 0.181818 +anchor_right = 0.994298 +anchor_bottom = 0.954545 +__meta__ = { +"_edit_use_anchors_": true +} [connection signal="timeout" from="Quarters" to="." method="_on_Quarters_timeout"] -[connection signal="pressed" from="Controls/Core/ControlPanel/Tabs/Zones/CenterZones/ZonesCtr/ResBtn" to="Map" method="_on_ResBtn_pressed"] -[connection signal="pressed" from="Controls/Core/ControlPanel/Tabs/Large/CenterLarge/LargeCtr/CoalBtn" to="Map" method="_on_CoalBtn_pressed"] -[connection signal="pressed" from="Controls/Core/ControlPanel/ButtonCtr/TaxBtn" to="Controls/Core/Windows" method="_on_TaxBtn_pressed"] -[connection signal="pressed" from="Controls/Core/ControlPanel/ButtonCtr/AdvsiorBtn" to="Controls/Core/Windows" method="_on_AdvsiorBtn_pressed"] +[connection signal="timeout" from="RotateNews" to="Controls/Status/TickerBg" method="_on_RotateNews_timeout"] +[connection signal="pressed" from="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/LargeCtr/CoalBtn" to="Map" method="_on_CoalBtn_pressed"] +[connection signal="pressed" from="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/ZonesCtr/ResBtn" to="Map" method="_on_ResBtn_pressed"] +[connection signal="pressed" from="Controls/Menu/ButtonCtr/TaxBtn" to="Controls/Windows" method="_on_TaxBtn_pressed"] +[connection signal="pressed" from="Controls/Menu/ButtonCtr/ToolsBtn" to="Controls/Windows" method="_on_ToolsBtn_pressed"] +[connection signal="pressed" from="Controls/Menu/ButtonCtr/AdvsiorBtn" to="Controls/Windows" method="_on_AdvsiorBtn_pressed"] diff --git a/scripts/advisor_window.gd b/scripts/advisor_window.gd index 533c5cd..eadc87b 100644 --- a/scripts/advisor_window.gd +++ b/scripts/advisor_window.gd @@ -1,10 +1,10 @@ extends AcceptDialog -export(String, FILE, "*.json") var dialogue_file +var dialogue_file # "character" would be "name" but it's already used by the base class -export var character: String -export var rank: String -export(Texture) var avatar +var character +var rank +var avatar var dialogue_keys = [] var dialogue_name = "" @@ -15,27 +15,37 @@ onready var rank_label = $Container/Advisor/RankLbl onready var name_label = $Container/Advisor/NameLbl onready var description_label = $Container/DescriptionLbl -func _start_dialogue(message): - _load_dialogue(dialogue_file) +func _start_dialogue(advisor, message): + if advisor == SimData.Advisors.CITY_PLANNER: + dialogue_file = "res://dialog/cityplanner.json" + _load_dialogue() + avatar_texture.texture = preload("res://sprites/avatars/zc.png") + name_label.text = "Zack Casey" + rank_label.text = "City Planner" + elif advisor == SimData.Advisors.FINANCIAL: + dialogue_file = "res://dialog/finacial.json" + _load_dialogue() + avatar_texture.texture = preload("res://sprites/avatars/kit.png") + name_label.text = "Kit Welsh" + rank_label.text = "Financial Advisor" + _index_dialogue() description_label.text = dialogue_keys[message].text window_title = dialogue_keys[message].name show() func _index_dialogue(): - var dialogue = _load_dialogue(dialogue_file) + var dialogue = _load_dialogue() dialogue_keys.clear() for key in dialogue: dialogue_keys.append(dialogue[key]) -func _load_dialogue(file_path): +func _load_dialogue(): var file = File.new() - if file.file_exists(file_path): - file.open(file_path, file.READ) + if file.file_exists(dialogue_file): + file.open(dialogue_file, file.READ) var dialogue = parse_json(file.get_as_text()) return dialogue func _ready(): - avatar_texture.texture = avatar - name_label.text = character - rank_label.text = rank + SimEvents.connect("advisor_message", self, "_start_dialogue") diff --git a/scripts/autoload/sim_data.gd b/scripts/autoload/sim_data.gd index 8b31901..8faf872 100644 --- a/scripts/autoload/sim_data.gd +++ b/scripts/autoload/sim_data.gd @@ -1,13 +1,14 @@ extends Node var city_name: String = "Furtropolis" # Hard-coded, for now +var mayor_name: String = "Defecto" var year: int = 1980 var prev_quarter: int var quarter: int = 1 var population: int = 0 -var news_ticker: String var budget: int = 20000 var expenses: int +var is_alert: bool = false const currency: String = "§" @@ -29,7 +30,16 @@ var fire_tax: int var police_tax: int var power_tax: int -enum GameSpeed {SLOW, MEDIUM, FAST} +enum GameSpeed { + SLOW, + MEDIUM, + FAST +} + +enum Advisors { + CITY_PLANNER, + FINANCIAL +} func starting_budget(lev: int): diff --git a/scripts/autoload/sim_events.gd b/scripts/autoload/sim_events.gd index 3c4f6d4..62b9750 100644 --- a/scripts/autoload/sim_events.gd +++ b/scripts/autoload/sim_events.gd @@ -3,5 +3,8 @@ extends Node signal has_power signal budget signal game_speed -signal city_planner(message) -signal financial_advisor(message) +signal advisor_message(advisor, message) + +# News +signal send_alert(message) +signal resume_news diff --git a/scripts/city_planner.gd b/scripts/city_planner.gd deleted file mode 100644 index 133dfb2..0000000 --- a/scripts/city_planner.gd +++ /dev/null @@ -1,4 +0,0 @@ -extends "res://scripts/advisor_window.gd" - -func _ready(): - SimEvents.connect("city_planner", self, "_start_dialogue") diff --git a/scripts/city_status.gd b/scripts/city_status.gd index 26d0245..a99a239 100644 --- a/scripts/city_status.gd +++ b/scripts/city_status.gd @@ -2,9 +2,9 @@ extends HBoxContainer onready var city_name = $CityNameLbl onready var budget = $BudgetLbl -onready var year = $YearLbl +onready var year = $YearCtr/YearLbl func _process(delta): city_name.text = SimData.city_name budget.text = SimData.currency + str(SimData.budget) - year.text = "Y" + str(SimData.year) + year.text = str(SimData.year) diff --git a/scripts/finance_advisor.gd b/scripts/finance_advisor.gd deleted file mode 100644 index 1373b32..0000000 --- a/scripts/finance_advisor.gd +++ /dev/null @@ -1,4 +0,0 @@ -extends "res://scripts/advisor_window.gd" - -func _ready(): - SimEvents.connect("financial_advisor", self, "_start_dialogue") diff --git a/scripts/game.gd b/scripts/game.gd index d5cd699..00d2009 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -1,10 +1,20 @@ extends Node2D +onready var rotate_news = $RotateNews onready var quarters = $Quarters +func _ready(): + SimEvents.connect("resume_news", self, "_resume_rotation") + SimEvents.connect("send_alert", self, "_stop_news") + func _on_Quarters_timeout(): SimData.year += 1 SimData.prev_quarter = SimData.quarter - SimEvents.emit_signal("budget") - quarters.start() + SimEvents.emit_signal("budget") + +func _stop_news(): + rotate_news.stop() + +func _resume_rotation(): + rotate_news.start() diff --git a/scripts/start_game.gd b/scripts/start_game.gd index 56eeeb3..4d6c14e 100644 --- a/scripts/start_game.gd +++ b/scripts/start_game.gd @@ -1,9 +1,15 @@ extends Panel -onready var city_name = $Container/CityNameEdit.text +onready var city_name = $Container/CityNameEdit +onready var mayor_name = $Container/MayorNameEdit onready var budget = $Container/BudgetMenu +func _ready(): + city_name.text = SimData.city_name + mayor_name.text = SimData.mayor_name + func _on_CreateBtn_pressed(): - SimData.city_name = city_name + SimData.city_name = city_name.text + SimData.mayor_name = mayor_name.text get_tree().change_scene("res://scenes/Game.tscn") diff --git a/scripts/ticker.gd b/scripts/ticker.gd new file mode 100644 index 0000000..26b8d4a --- /dev/null +++ b/scripts/ticker.gd @@ -0,0 +1,57 @@ +extends ColorRect + +onready var ticker_text = $TickerTxt + +var news_file = "" +var rng = RandomNumberGenerator.new() +var news_keys = [] + +func _index_news(): + var news = _load_news() + news_keys.clear() + for key in news: + news_keys.append(news[key]) + +func _load_news(): + var file = File.new() + if file.file_exists(news_file): + file.open(news_file, file.READ) + var dialogue = parse_json(file.get_as_text()) + return dialogue + +func _ready(): + SimEvents.connect("send_alert", self, "_start_alert") + SimEvents.connect("resume_news", self, "_resume_ticker") + _random_news("res://dialog/ticker.json") + +func _process(delta): + if get_tree().paused: + ticker_text.text = "Simulation Paused" + +func _start_alert(message): + SimData.is_alert = true + news_file = "res://dialog/ticker_alerts.json" + ticker_text.text = news_keys[message].text + +func _random_news(file): + news_file = file + _load_news() + _index_news() + rng.randomize() + var max_mange = news_keys.size() - 1 + var ticker_range = rng.randi_range(0, max_mange) + var news = news_keys[ticker_range].text + + if "[city]" in news: + news = news.replace("[city]", SimData.city_name) + + if "[mayor]" in news: + news = news.replace("[mayor]", SimData.mayor_name) + + ticker_text.text = news + +func _resume_ticker(): + _random_news("res://dialog/ticker.json") + +func _on_RotateNews_timeout(): + _random_news("res://dialog/ticker.json") diff --git a/scripts/windows.gd b/scripts/windows.gd index 32154e3..a756034 100644 --- a/scripts/windows.gd +++ b/scripts/windows.gd @@ -3,9 +3,11 @@ extends Control onready var debug_console = $Console onready var tax_window = $TaxWindow onready var advsior_meet_window = $AdvisorMeet +onready var tools_window = $ToolsWindow +# onready var news_ticker = $ func _ready(): - SimEvents.emit_signal("city_planner", 0) + SimEvents.emit_signal("advisor_message", SimData.Advisors.CITY_PLANNER, 0) func _process(delta): if Input.is_action_pressed("ui_cheats"): @@ -16,3 +18,6 @@ func _on_TaxBtn_pressed(): func _on_AdvsiorBtn_pressed(): advsior_meet_window.show() + +func _on_ToolsBtn_pressed(): + tools_window.show() diff --git a/sprites/symbols/building.svg b/sprites/symbols/building.svg new file mode 100644 index 0000000..cb03f59 --- /dev/null +++ b/sprites/symbols/building.svg @@ -0,0 +1,193 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprites/symbols/building.svg.import b/sprites/symbols/building.svg.import new file mode 100644 index 0000000..7cc2ef9 --- /dev/null +++ b/sprites/symbols/building.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/building.svg-565a4a6da30528637c52860f03f9ac31.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/symbols/building.svg" +dest_files=[ "res://.import/building.svg-565a4a6da30528637c52860f03f9ac31.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/sprites/symbols/calendar.svg b/sprites/symbols/calendar.svg new file mode 100644 index 0000000..519eb9d --- /dev/null +++ b/sprites/symbols/calendar.svg @@ -0,0 +1,117 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprites/symbols/calendar.svg.import b/sprites/symbols/calendar.svg.import new file mode 100644 index 0000000..bf5be5c --- /dev/null +++ b/sprites/symbols/calendar.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/calendar.svg-4fbe4e8ff7750f8c6b821d1ab5f5b51e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/symbols/calendar.svg" +dest_files=[ "res://.import/calendar.svg-4fbe4e8ff7750f8c6b821d1ab5f5b51e.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/sprites/symbols/fast.svg b/sprites/symbols/fast.svg new file mode 100644 index 0000000..6467cab --- /dev/null +++ b/sprites/symbols/fast.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprites/symbols/fast.svg.import b/sprites/symbols/fast.svg.import new file mode 100644 index 0000000..d667997 --- /dev/null +++ b/sprites/symbols/fast.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/fast.svg-ed2ede9e5f07eaa54eda00268034b8f2.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/symbols/fast.svg" +dest_files=[ "res://.import/fast.svg-ed2ede9e5f07eaa54eda00268034b8f2.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/sprites/symbols/github-sign.svg b/sprites/symbols/github-sign.svg new file mode 100644 index 0000000..b7ddd7d --- /dev/null +++ b/sprites/symbols/github-sign.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprites/symbols/github-sign.svg.import b/sprites/symbols/github-sign.svg.import new file mode 100644 index 0000000..de9bd96 --- /dev/null +++ b/sprites/symbols/github-sign.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/github-sign.svg-206b3863570889f5db50a3777e9d6707.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/symbols/github-sign.svg" +dest_files=[ "res://.import/github-sign.svg-206b3863570889f5db50a3777e9d6707.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/sprites/symbols/graph.svg b/sprites/symbols/graph.svg new file mode 100644 index 0000000..66128a9 --- /dev/null +++ b/sprites/symbols/graph.svg @@ -0,0 +1,149 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprites/symbols/graph.svg.import b/sprites/symbols/graph.svg.import new file mode 100644 index 0000000..7c14d76 --- /dev/null +++ b/sprites/symbols/graph.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/graph.svg-a3897e2373c1268fce188530eba003b4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/symbols/graph.svg" +dest_files=[ "res://.import/graph.svg-a3897e2373c1268fce188530eba003b4.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/sprites/symbols/population.svg b/sprites/symbols/population.svg new file mode 100644 index 0000000..fcd7476 --- /dev/null +++ b/sprites/symbols/population.svg @@ -0,0 +1,141 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprites/symbols/population.svg.import b/sprites/symbols/population.svg.import new file mode 100644 index 0000000..46efca1 --- /dev/null +++ b/sprites/symbols/population.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/population.svg-3d56f4f7e17f6028aa5b7980dc8fdf72.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/symbols/population.svg" +dest_files=[ "res://.import/population.svg-3d56f4f7e17f6028aa5b7980dc8fdf72.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/sprites/symbols/slow.svg b/sprites/symbols/slow.svg new file mode 100644 index 0000000..4f96719 --- /dev/null +++ b/sprites/symbols/slow.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprites/symbols/slow.svg.import b/sprites/symbols/slow.svg.import new file mode 100644 index 0000000..bb39d2c --- /dev/null +++ b/sprites/symbols/slow.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/slow.svg-1edfad60d84ce0c376f5c18d7946a2da.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/symbols/slow.svg" +dest_files=[ "res://.import/slow.svg-1edfad60d84ce0c376f5c18d7946a2da.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0