mirror of
https://github.com/tonytins/citylimits
synced 2025-06-25 09:24:44 -04:00
Redid interface
- Redid the interface with everything now at the bottom. - Advisors can now address the mayor and city - Updated tax window with red and green arrow icons - Tweaked income algorithm
This commit is contained in:
parent
7a4619f874
commit
d3350dd8a6
18 changed files with 529 additions and 186 deletions
|
@ -61,7 +61,15 @@ func _init_advisor(file, advisor):
|
|||
|
||||
func _launch_advisor_window(key):
|
||||
_index_dialogue()
|
||||
description_label.text = dialogue_keys[key].text
|
||||
var message: String = dialogue_keys[key].text
|
||||
|
||||
if "[name]" in message:
|
||||
message = message.replace("[name]", SimData.mayor_name)
|
||||
|
||||
if "[city]" in message:
|
||||
message = message.replace("[city]", SimData.city_name)
|
||||
|
||||
description_label.text = message
|
||||
window_title = dialogue_keys[key].name
|
||||
show()
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ signal has_power
|
|||
signal budget
|
||||
signal game_speed
|
||||
|
||||
# Policies and Advisors
|
||||
signal policy_message(policy)
|
||||
signal policy_analysis(advisor, policy)
|
||||
signal advisor_message(advisor, message)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
extends HBoxContainer
|
||||
|
||||
onready var city_name = $CityNameLbl
|
||||
onready var budget = $BudgetCtr/BudgetLbl
|
||||
onready var calendar = $YearCtr/CalendarLbl
|
||||
onready var city_name = $NameDate/CityNameLbl
|
||||
onready var budget = $PopBudget/BudgetCtr/BudgetLbl
|
||||
onready var calendar = $NameDate/YearCtr/CalendarLbl
|
||||
|
||||
func _process(delta):
|
||||
city_name.text = SimData.city_name
|
||||
|
|
|
@ -2,8 +2,8 @@ extends Node2D
|
|||
|
||||
onready var rotate_news = $RotateNews
|
||||
onready var day_cycle = $DayCycle
|
||||
onready var turtle_btn = $Controls/Status/SpeedCtr/TurtleBtn
|
||||
onready var cheeta_btn = $Controls/Status/SpeedCtr/CheetaBtn
|
||||
onready var turtle_btn = $Controls/Status/StatCtr/ButtonCtr/TurtleBtn
|
||||
onready var cheeta_btn = $Controls/Status/StatCtr/ButtonCtr/CheetaBtn
|
||||
|
||||
func _ready():
|
||||
SimEvents.connect("resume_news", self, "_resume_rotation")
|
||||
|
@ -45,3 +45,4 @@ func _on_CheetaBtn_toggled(button_pressed):
|
|||
if button_pressed:
|
||||
day_cycle.wait_time = 2
|
||||
turtle_btn.pressed = false
|
||||
|
||||
|
|
|
@ -1,38 +1,39 @@
|
|||
extends WindowDialog
|
||||
|
||||
var dialogue_file = "res://dialog/policies/policies.json"
|
||||
var dialogue_file = "res://dialog/policies/proposels.json"
|
||||
|
||||
var dialogue_keys = []
|
||||
var dialogue_name = ""
|
||||
var dialogue_text = ""
|
||||
var policy: int
|
||||
var policy_id
|
||||
|
||||
onready var ordinance_label = $OrdinanceLbl
|
||||
onready var description_label = $DescPanel/DescriptionLbl
|
||||
|
||||
func _start_dialogue(ordinance):
|
||||
|
||||
func _start_dialogue(policy):
|
||||
match policy:
|
||||
[SimData.Ordinances.ENERGY_CONSERVATION, 1]:
|
||||
policy_id = 1
|
||||
_launch_policy_window(1)
|
||||
[SimData.Ordinances.CLEAN_AIR_ACT, 3]:
|
||||
policy_id = 2
|
||||
_launch_policy_window(2)
|
||||
[SimData.Ordinances.TIRE_RECYCLE, 3]:
|
||||
policy_id = 3
|
||||
_launch_policy_window(3)
|
||||
|
||||
func _launch_policy_window(key):
|
||||
_index_dialogue()
|
||||
var message: String = dialogue_keys[key].text
|
||||
|
||||
match ordinance:
|
||||
1:
|
||||
policy = 1
|
||||
2:
|
||||
policy = 2
|
||||
3:
|
||||
policy = 3
|
||||
if "[name]" in message:
|
||||
message = message.replace("[name]", SimData.mayor_name)
|
||||
|
||||
var proposel: String = dialogue_keys[policy].text
|
||||
|
||||
if "[name]" in proposel:
|
||||
proposel = proposel.replace("[name]", SimData.mayor_name)
|
||||
|
||||
if "[city]" in proposel:
|
||||
proposel = proposel.replace("[city]", SimData.city_name)
|
||||
|
||||
description_label.text = proposel
|
||||
ordinance_label.text = dialogue_keys[policy].name
|
||||
if "[city]" in message:
|
||||
message = message.replace("[city]", SimData.city_name)
|
||||
|
||||
description_label.text = message
|
||||
window_title = dialogue_keys[key].name
|
||||
show()
|
||||
|
||||
func _index_dialogue():
|
||||
|
@ -52,18 +53,18 @@ func _ready():
|
|||
SimEvents.connect("policy_message", self, "_start_dialogue")
|
||||
|
||||
func _on_IgnoreBtn_pressed():
|
||||
policy = 0
|
||||
policy_id = 0
|
||||
description_label.text = ""
|
||||
ordinance_label.text = ""
|
||||
hide()
|
||||
|
||||
func _on_EnectBtn_pressed():
|
||||
match policy:
|
||||
match policy_id:
|
||||
1: SimEvents.emit_signal("energy_saving")
|
||||
2: SimEvents.emit_signal("clean_air_act")
|
||||
|
||||
func _on_AnalysisBtn_pressed():
|
||||
match policy:
|
||||
1: SimEvents.emit_signal("policy_analysis", SimData.Advisors.CITY_PLANNER, policy)
|
||||
2: SimEvents.emit_signal("policy_analysis", SimData.Advisors.CITY_PLANNER, policy)
|
||||
3: SimEvents.emit_signal("policy_analysis", SimData.Advisors.CITY_PLANNER, policy)
|
||||
match policy_id:
|
||||
1: SimEvents.emit_signal("policy_analysis", SimData.Advisors.CITY_PLANNER, policy_id)
|
||||
2: SimEvents.emit_signal("policy_analysis", SimData.Advisors.CITY_PLANNER, policy_id)
|
||||
3: SimEvents.emit_signal("policy_analysis", SimData.Advisors.CITY_PLANNER, policy_id)
|
||||
|
|
|
@ -26,9 +26,8 @@ func _ready():
|
|||
func _process(delta):
|
||||
var total_income = int(SimData.res_income + SimData.comm_income + SimData.ind_income)
|
||||
|
||||
|
||||
if total_income >= 1:
|
||||
annual_income.text = "Income: " + SimData.currency + str(total_income) + "/yr"
|
||||
if SimData.prev_month < SimData.month and total_income > 1:
|
||||
annual_income.text = str(total_income) + "/mo"
|
||||
|
||||
func _on_ResSlider_value_changed(value):
|
||||
SimData.res_tax = int(value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue