Merge branch 'master' of https://git.sjkillen.ca/sjkillen/everything_has_a_price_jam
This commit is contained in:
commit
116e10f4a1
47 changed files with 245 additions and 7 deletions
|
|
@ -5,4 +5,5 @@
|
|||
|
||||
[resource]
|
||||
script = ExtResource("2_qihur")
|
||||
name = "Plague"
|
||||
metadata/_custom_type_script = "uid://ucjmg8grkta8"
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
|
||||
[resource]
|
||||
script = ExtResource("2_tg12d")
|
||||
name = "Time"
|
||||
metadata/_custom_type_script = "uid://ucjmg8grkta8"
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
|
||||
[resource]
|
||||
script = ExtResource("2_h7qij")
|
||||
name = "Beer"
|
||||
metadata/_custom_type_script = "uid://b3tqa2kc2bu0p"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="InanimateCurrency" format=3 uid="uid://by3dayfdpobpt"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cthcf4w1il4h8" path="res://currency/inanimate_currency.gd" id="1_6u8vm"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_vpm3o"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_6u8vm")
|
||||
name = "Blood"
|
||||
metadata/_custom_type_script = "uid://b3tqa2kc2bu0p"
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
|
||||
[resource]
|
||||
script = ExtResource("2_nt5od")
|
||||
name = "Bread"
|
||||
metadata/_custom_type_script = "uid://b3tqa2kc2bu0p"
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
|
||||
[resource]
|
||||
script = ExtResource("2_aao11")
|
||||
name = "Corpse"
|
||||
metadata/_custom_type_script = "uid://b3tqa2kc2bu0p"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="InanimateCurrency" format=3 uid="uid://bnlnq4ucsgfxe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cthcf4w1il4h8" path="res://currency/inanimate_currency.gd" id="1_i8ogj"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_u4rls"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_i8ogj")
|
||||
name = "Gold"
|
||||
metadata/_custom_type_script = "uid://b3tqa2kc2bu0p"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="InanimateCurrency" format=3 uid="uid://ytteqojj7k1o"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_oss13"]
|
||||
[ext_resource type="Script" uid="uid://cthcf4w1il4h8" path="res://currency/inanimate_currency.gd" id="1_r1hhf"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_r1hhf")
|
||||
name = "Stone"
|
||||
metadata/_custom_type_script = "uid://b3tqa2kc2bu0p"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="InanimateCurrency" format=3 uid="uid://b8b6yr444ecdk"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_6tuon"]
|
||||
[ext_resource type="Script" uid="uid://cthcf4w1il4h8" path="res://currency/inanimate_currency.gd" id="1_s2pc4"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_s2pc4")
|
||||
name = "Water"
|
||||
metadata/_custom_type_script = "uid://b3tqa2kc2bu0p"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="InanimateCurrency" format=3 uid="uid://b7vjuqkog7cxd"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_g2gb5"]
|
||||
[ext_resource type="Script" uid="uid://cthcf4w1il4h8" path="res://currency/inanimate_currency.gd" id="1_ilt41"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_ilt41")
|
||||
name = "Wood"
|
||||
metadata/_custom_type_script = "uid://b3tqa2kc2bu0p"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
extends Resource
|
||||
class_name Production
|
||||
|
||||
enum Type {
|
||||
Produce,
|
||||
Consume,
|
||||
}
|
||||
|
||||
@export var type = Type.Produce
|
||||
@export var currency: Currency
|
||||
@export var amount: int
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://l8osuuxl7exe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_e7gnr"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_m37xt"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_e7gnr")
|
||||
name = "Archer"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dlxnbyiurne1s"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_cnnt2"]
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_o1w50"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_o1w50")
|
||||
name = "Calvary"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dsohovjbf3s2p"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_10o5k"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_cup2e"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_10o5k")
|
||||
name = "Chicken"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://b5qok0rcalr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_0c5xt"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_607lg"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_0c5xt")
|
||||
name = "Cow"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://clx8tbrad4m7c"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_0dcki"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_qayfp"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_0dcki")
|
||||
name = "Dinosaur"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://b1tgtujqs5lnr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_8u0th"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_ohece"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_8u0th")
|
||||
name = "Doctor"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
|
||||
[resource]
|
||||
script = ExtResource("2_j265y")
|
||||
name = "Drunk"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dn0c1pfq04obw"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_35xhy"]
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_kipvp"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_kipvp")
|
||||
name = "Farmer"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
|
||||
[resource]
|
||||
script = ExtResource("1_y7sat")
|
||||
name = "King Guard"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://8uo3q8rn6qqr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_8hvx0"]
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_qvvhd"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_qvvhd")
|
||||
name = "Lover"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://sq2lrgnfjugj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_81xhi"]
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_m8i4c"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_m8i4c")
|
||||
name = "Mercenary"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dq70tpr5osjkk"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_egwdx"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_iy37t"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_egwdx")
|
||||
name = "Messenger"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dpaj2dk3qm7ow"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_phc4h"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_yn73g"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_phc4h")
|
||||
name = "Miner"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://rdrcyvuvrp2m"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_c1r5q"]
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_g345f"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_g345f")
|
||||
name = "Pig"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dk3wsnr3ku7ka"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_acsld"]
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_jo5ux"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_jo5ux")
|
||||
name = "Royalty"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dfj4jwdmff6bu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_ou6ev"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_wync1"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_ou6ev")
|
||||
name = "Spy"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://chsv8oeajty8j"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_0qymk"]
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_an3bl"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_an3bl")
|
||||
name = "Town Crier"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://6xylw7p78fvf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_05kyk"]
|
||||
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_tds6s"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_tds6s")
|
||||
name = "Wizard"
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
32
economy.gd
32
economy.gd
|
|
@ -1,6 +1,36 @@
|
|||
extends Node
|
||||
|
||||
signal productions_update(p: Array[Production])
|
||||
signal production_log(producer: Currency, p: Production)
|
||||
@export var currencies: Array[Production]
|
||||
@export var members: Array
|
||||
|
||||
func get_currency(c: Currency) -> Production:
|
||||
for p in currencies:
|
||||
if c == p.currency:
|
||||
return p
|
||||
var p := Production.new()
|
||||
p.currency = c
|
||||
p.amount = 0
|
||||
currencies.append(p)
|
||||
productions_update.emit.call_deferred(currencies)
|
||||
return p
|
||||
|
||||
func sync_currency():
|
||||
#for p in currencies:
|
||||
#if p.amount == 0:
|
||||
#currencies.remove_at()
|
||||
productions_update.emit.call_deferred(currencies)
|
||||
|
||||
|
||||
func produce(producer: Currency, production: Production):
|
||||
production_log.emit.call_deferred(producer, production)
|
||||
|
||||
func simulate():
|
||||
pass
|
||||
productions_update.emit.call_deferred(currencies)
|
||||
|
||||
func _ready() -> void:
|
||||
simulate()
|
||||
for i in range(100):
|
||||
produce(preload("res://currency/sentient/chicken.tres"), currencies[0])
|
||||
produce(preload("res://currency/sentient/chicken.tres"), currencies[2])
|
||||
|
|
|
|||
23
economy.tscn
23
economy.tscn
|
|
@ -1,6 +1,29 @@
|
|||
[gd_scene format=3 uid="uid://dnpioqaes87yb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://i14prh1jocdd" path="res://economy.gd" id="1_csm0v"]
|
||||
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="2_tljx8"]
|
||||
[ext_resource type="Resource" uid="uid://dmctedq3pav0t" path="res://currency/inanimate/corpse.tres" id="3_4ctyq"]
|
||||
[ext_resource type="Resource" uid="uid://rdrcyvuvrp2m" path="res://currency/sentient/pig.tres" id="4_d7dul"]
|
||||
[ext_resource type="Resource" uid="uid://dfj4jwdmff6bu" path="res://currency/sentient/spy.tres" id="5_4ctyq"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jd86c"]
|
||||
script = ExtResource("2_tljx8")
|
||||
currency = ExtResource("3_4ctyq")
|
||||
amount = 10
|
||||
metadata/_custom_type_script = "uid://dddyxbkq0ienn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jd7cj"]
|
||||
script = ExtResource("2_tljx8")
|
||||
currency = ExtResource("4_d7dul")
|
||||
amount = 3
|
||||
metadata/_custom_type_script = "uid://dddyxbkq0ienn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ei3g1"]
|
||||
script = ExtResource("2_tljx8")
|
||||
currency = ExtResource("5_4ctyq")
|
||||
amount = -4
|
||||
metadata/_custom_type_script = "uid://dddyxbkq0ienn"
|
||||
|
||||
[node name="Economy" type="Node" unique_id=1950923383]
|
||||
script = ExtResource("1_csm0v")
|
||||
currencies = Array[ExtResource("2_tljx8")]([SubResource("Resource_jd86c"), SubResource("Resource_jd7cj"), SubResource("Resource_ei3g1")])
|
||||
|
|
|
|||
12
gui/production_chart.gd
Normal file
12
gui/production_chart.gd
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
extends VBoxContainer
|
||||
|
||||
func _ready() -> void:
|
||||
Economy.productions_update.connect(sync)
|
||||
|
||||
func sync(productions: Array[Production]):
|
||||
for child in get_children():
|
||||
child.queue_free()
|
||||
for p in productions:
|
||||
var display := preload("res://gui/production_display.tscn").instantiate()
|
||||
display.production = p
|
||||
add_child(display)
|
||||
1
gui/production_chart.gd.uid
Normal file
1
gui/production_chart.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://6u0icldaifvd
|
||||
6
gui/production_chart.tscn
Normal file
6
gui/production_chart.tscn
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[gd_scene format=3 uid="uid://desvyn6e28oar"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://6u0icldaifvd" path="res://gui/production_chart.gd" id="1_esxju"]
|
||||
|
||||
[node name="ProductionChart" type="VBoxContainer" unique_id=1301678172]
|
||||
script = ExtResource("1_esxju")
|
||||
7
gui/production_display.gd
Normal file
7
gui/production_display.gd
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
extends Control
|
||||
|
||||
@export var production: Production
|
||||
|
||||
func _ready() -> void:
|
||||
%Name.text = production.currency.name
|
||||
%Amount.text = str(production.amount)
|
||||
1
gui/production_display.gd.uid
Normal file
1
gui/production_display.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ck17fbo6svid8
|
||||
18
gui/production_display.tscn
Normal file
18
gui/production_display.tscn
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
[gd_scene format=3 uid="uid://dmka51sldrutn"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ck17fbo6svid8" path="res://gui/production_display.gd" id="1_dfe88"]
|
||||
|
||||
[node name="ProductionDisplay" type="MarginContainer" unique_id=253822540]
|
||||
custom_minimum_size = Vector2(400, 0)
|
||||
script = ExtResource("1_dfe88")
|
||||
|
||||
[node name="Name" type="Label" parent="." unique_id=1739229616]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "<Currency Name>"
|
||||
|
||||
[node name="Amount" type="Label" parent="." unique_id=660284845]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
text = "0"
|
||||
10
gui/production_ledger.gd
Normal file
10
gui/production_ledger.gd
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
extends VBoxContainer
|
||||
|
||||
func _ready() -> void:
|
||||
Economy.production_log.connect(append)
|
||||
|
||||
func append(producer: Currency, production: Production):
|
||||
var display := preload("res://gui/production_log.tscn").instantiate()
|
||||
display.producer = producer
|
||||
display.production = production
|
||||
add_child(display)
|
||||
1
gui/production_ledger.gd.uid
Normal file
1
gui/production_ledger.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://5u2qeh5gvhhl
|
||||
6
gui/production_ledger.tscn
Normal file
6
gui/production_ledger.tscn
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[gd_scene format=3 uid="uid://cxv743rjsolk5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://5u2qeh5gvhhl" path="res://gui/production_ledger.gd" id="1_8f0gq"]
|
||||
|
||||
[node name="ProductionChart" type="VBoxContainer" unique_id=1301678172]
|
||||
script = ExtResource("1_8f0gq")
|
||||
14
gui/production_log.gd
Normal file
14
gui/production_log.gd
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
extends Control
|
||||
|
||||
@export var producer: Currency
|
||||
@export var production: Production
|
||||
|
||||
func _ready() -> void:
|
||||
%producer.text = producer.name
|
||||
%amount.text = str(abs(production.amount))
|
||||
if production.amount > 0:
|
||||
%type.text = "produced"
|
||||
else:
|
||||
%type.text = "consumed"
|
||||
|
||||
%production.text = production.currency.name
|
||||
1
gui/production_log.gd.uid
Normal file
1
gui/production_log.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cm5y8byaoeda5
|
||||
37
gui/production_log.tscn
Normal file
37
gui/production_log.tscn
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
[gd_scene format=3 uid="uid://dth0nxini731n"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cm5y8byaoeda5" path="res://gui/production_log.gd" id="1_ei3g1"]
|
||||
|
||||
[node name="ProductionLog" type="MarginContainer" unique_id=253822540]
|
||||
script = ExtResource("1_ei3g1")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=1073672077]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="producer" type="Label" parent="HBoxContainer" unique_id=1739229616]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "<Currency Name>"
|
||||
|
||||
[node name="type" type="Label" parent="HBoxContainer" unique_id=660284845]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
text = "produced"
|
||||
|
||||
[node name="amount" type="Label" parent="HBoxContainer" unique_id=146404186]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
text = "0"
|
||||
|
||||
[node name="text_produced2" type="Label" parent="HBoxContainer" unique_id=1784666448]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
text = "of"
|
||||
|
||||
[node name="production" type="Label" parent="HBoxContainer" unique_id=1547964707]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
text = "<currency name>"
|
||||
|
|
@ -10,11 +10,13 @@ config_version=5
|
|||
|
||||
[application]
|
||||
|
||||
run/main_scene="uid://d06w1wtct0mfs"
|
||||
config/features=PackedStringArray("4.7")
|
||||
|
||||
[autoload]
|
||||
|
||||
Dialogic="*uid://ds2q0uclmolvu"
|
||||
Economy="*uid://dnpioqaes87yb"
|
||||
|
||||
[dialogic]
|
||||
|
||||
|
|
|
|||
1
test/test_economy.gd
Normal file
1
test/test_economy.gd
Normal file
|
|
@ -0,0 +1 @@
|
|||
extends Control
|
||||
1
test/test_economy.gd.uid
Normal file
1
test/test_economy.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://6438cbkn3fhm
|
||||
24
test/test_economy.tscn
Normal file
24
test/test_economy.tscn
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[gd_scene format=3 uid="uid://d06w1wtct0mfs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://6438cbkn3fhm" path="res://test/test_economy.gd" id="1_s48qe"]
|
||||
[ext_resource type="PackedScene" uid="uid://desvyn6e28oar" path="res://gui/production_chart.tscn" id="2_jd86c"]
|
||||
[ext_resource type="PackedScene" uid="uid://cxv743rjsolk5" path="res://gui/production_ledger.tscn" id="3_jd7cj"]
|
||||
|
||||
[node name="TestEconomy" type="Control" unique_id=629898212]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_s48qe")
|
||||
|
||||
[node name="ProductionChart" parent="." unique_id=1301678172 instance=ExtResource("2_jd86c")]
|
||||
layout_mode = 0
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="." unique_id=1023925432]
|
||||
custom_minimum_size = Vector2(600, 100)
|
||||
layout_mode = 0
|
||||
offset_left = 153.0
|
||||
offset_top = 346.0
|
||||
offset_right = 161.0
|
||||
offset_bottom = 346.0
|
||||
|
||||
[node name="ProductionChart2" parent="ScrollContainer" unique_id=1698529519 instance=ExtResource("3_jd7cj")]
|
||||
layout_mode = 2
|
||||
Loading…
Add table
Reference in a new issue