mirror of
https://github.com/tonytins/citylimits
synced 2025-12-19 22:24:42 -05:00
Rewrote news ticker
- Rewrote news ticker based on JSON web API tutorials - Simplified json files for news ticker as part of rewrite - Renamed /dialog to /json
This commit is contained in:
parent
b443ee61fe
commit
ef6b097ef2
20 changed files with 170 additions and 71 deletions
|
|
@ -11,32 +11,32 @@ onready var ind_rate = $PrecentCtr/IndPctLbl
|
|||
onready var annual_income = $IncomeCtr/IcnomeLbl
|
||||
|
||||
func _ready():
|
||||
if SimData.res_tax >= 0:
|
||||
res_slider.value = SimData.res_tax
|
||||
res_rate.text = str(SimData.res_tax) + "%"
|
||||
if ZoneData.res_tax >= 0:
|
||||
res_slider.value = ZoneData.res_tax
|
||||
res_rate.text = str(ZoneData.res_tax) + "%"
|
||||
|
||||
if SimData.res_tax >= 0:
|
||||
com_slider.value = SimData.comm_tax
|
||||
com_rate.text = str(SimData.comm_tax) + "%"
|
||||
if ZoneData.res_tax >= 0:
|
||||
com_slider.value = ZoneData.comm_tax
|
||||
com_rate.text = str(ZoneData.comm_tax) + "%"
|
||||
|
||||
if SimData.indust_tax >= 0:
|
||||
ind_slider.value = SimData.indust_tax
|
||||
ind_rate.text = str(SimData.indust_tax) + "%"
|
||||
if ZoneData.indust_tax >= 0:
|
||||
ind_slider.value = ZoneData.indust_tax
|
||||
ind_rate.text = str(ZoneData.indust_tax) + "%"
|
||||
|
||||
func _process(delta):
|
||||
var total_income = int(SimData.res_income + SimData.comm_income + SimData.ind_income)
|
||||
var total_income = int(ZoneData.res_income + ZoneData.comm_income + ZoneData.ind_income)
|
||||
|
||||
if SimData.prev_month < SimData.month and total_income > 1:
|
||||
if SimTime.prev_month < SimTime.month and total_income > 1:
|
||||
annual_income.text = str(total_income) + "/mo"
|
||||
|
||||
func _on_ResSlider_value_changed(value):
|
||||
SimData.res_tax = int(value)
|
||||
ZoneData.res_tax = int(value)
|
||||
res_rate.text = str(value) + "%"
|
||||
|
||||
func _on_ComSlider_value_changed(value):
|
||||
SimData.comm_tax = int(value)
|
||||
ZoneData.comm_tax = int(value)
|
||||
com_rate.text = str(value) + "%"
|
||||
|
||||
func _on_IndSlider_value_changed(value):
|
||||
SimData.indust_tax = int(value)
|
||||
ZoneData.indust_tax = int(value)
|
||||
ind_rate.text = str(value) + "%"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue