parent
f6ecffda02
commit
f8b2f1068f
@ -0,0 +1,34 @@ |
||||
[preset.0] |
||||
|
||||
name="HTML5" |
||||
platform="HTML5" |
||||
runnable=true |
||||
custom_features="" |
||||
export_filter="all_resources" |
||||
include_filter="" |
||||
exclude_filter="" |
||||
export_path="" |
||||
script_export_mode=1 |
||||
script_encryption_key="" |
||||
|
||||
[preset.0.options] |
||||
|
||||
custom_template/debug="" |
||||
custom_template/release="" |
||||
variant/export_type=0 |
||||
vram_texture_compression/for_desktop=true |
||||
vram_texture_compression/for_mobile=false |
||||
html/export_icon=true |
||||
html/custom_html_shell="" |
||||
html/head_include="" |
||||
html/canvas_resize_policy=2 |
||||
html/focus_canvas_on_start=true |
||||
html/experimental_virtual_keyboard=false |
||||
progressive_web_app/enabled=false |
||||
progressive_web_app/offline_page="" |
||||
progressive_web_app/display=1 |
||||
progressive_web_app/orientation=0 |
||||
progressive_web_app/icon_144x144="" |
||||
progressive_web_app/icon_180x180="" |
||||
progressive_web_app/icon_512x512="" |
||||
progressive_web_app/background_color=Color( 0, 0, 0, 1 ) |
@ -0,0 +1,58 @@ |
||||
extends GridContainer |
||||
|
||||
onready var game = owner as Game |
||||
|
||||
func _ready(): |
||||
for country in game.countries: |
||||
country.connect("state_changed", self, "refresh") |
||||
for player in game.players: |
||||
player.connect("state_changed", self, "refresh") |
||||
refresh() |
||||
|
||||
func refresh(): |
||||
for child in get_children(): |
||||
child.queue_free() |
||||
|
||||
add_label("Country") |
||||
for country in game.countries: |
||||
if country.id == 0: continue |
||||
add_label(country.name) |
||||
add_label("Money") |
||||
|
||||
for player in game.players: |
||||
add_label(player.name) |
||||
var country_id = 0 |
||||
for stock in player.stocks: |
||||
if country_id != 0: |
||||
add_label(str(stock) + ("/" if game.countries[country_id].player_acceptance[player.id] else " ")) |
||||
country_id += 1 |
||||
add_label(str(player.money) + "$") |
||||
|
||||
add_label("Money") |
||||
for country in game.countries: |
||||
if country.id == 0: continue |
||||
add_label( |
||||
str(country.money) + \ |
||||
"(" + signify(country.get_net_profit()) + ")" + \ |
||||
"$" |
||||
) |
||||
|
||||
add_label("") |
||||
add_label("Stock price") |
||||
for country in game.countries: |
||||
if country.id == 0: continue |
||||
add_label( |
||||
str(country.stock_price) + \ |
||||
("(" + signify(country.proposal) + ")" if country.proposal != 0 else "") + \ |
||||
"$" |
||||
) |
||||
|
||||
|
||||
func signify(num): |
||||
return ("+" if num >= 0 else "-") + str(abs(num)) |
||||
|
||||
func add_label(text): |
||||
var label = Label.new() |
||||
label.text = str(text) |
||||
add_child(label) |
||||
return label |
Loading…
Reference in new issue