Redesign resource transfer interface
This commit is contained in:
parent
cccdc85c9e
commit
7d05042f51
3 changed files with 44 additions and 20 deletions
|
|
@ -43,6 +43,7 @@ var _numbers: Array[NeonNumber] = []
|
|||
var _captions: Array[Label] = []
|
||||
var _gas_caption: Label
|
||||
var _gas_icon: IconButton
|
||||
var _summary: Label
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
|
@ -81,6 +82,12 @@ func _ready() -> void:
|
|||
_gas_icon.icon = IconButton.Icon.GAS
|
||||
_gas_icon.glow_color = Color(0.85, 0.52, 1.0)
|
||||
add_child(_gas_icon)
|
||||
_summary = Label.new()
|
||||
_summary.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
_summary.add_theme_font_size_override("font_size", 18)
|
||||
_summary.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
_summary.size = size
|
||||
add_child(_summary)
|
||||
|
||||
|
||||
func _layout() -> void:
|
||||
|
|
@ -103,6 +110,13 @@ func _layout() -> void:
|
|||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
# Resource rows scale without inventing a new menu per resource. The old
|
||||
# ore-only columns remain behind this concise, explicit summary.
|
||||
_summary.text = "ORE Bank %d Fleet %d Local %d\nGAS Bank %d Fleet %d Local %d" % [GameState.rocks, GameState.fleet_cargo, GameState.building_holdings(building_id), GameState.gas, GameState.fleet_gas_cargo, GameState.building_gas_holdings(building_id)]
|
||||
for number in _numbers: number.visible = false
|
||||
for caption in _captions: caption.visible = false
|
||||
_gas_caption.visible = false
|
||||
_gas_icon.visible = false
|
||||
_gas_caption.text = "GAS %d / %d / %d" % [GameState.gas, GameState.fleet_gas_cargo, GameState.building_gas_holdings(building_id)]
|
||||
_numbers[0].set_amount(GameState.rocks)
|
||||
_numbers[1].set_amount(GameState.fleet_cargo)
|
||||
|
|
|
|||
Loading…
Reference in a new issue