diff --git a/Main.tscn b/Main.tscn index 782610d..b08d5d7 100644 --- a/Main.tscn +++ b/Main.tscn @@ -114,6 +114,16 @@ offset_bottom = 92 script = ExtResource("25") digit_height = 60.0 +[node name="GasIcon" type="Control" parent="UI"] +mouse_filter = 2 +offset_left = 640 +offset_top = 24 +offset_right = 696 +offset_bottom = 80 +script = ExtResource("10") +icon = 25 +glow_color = Color(0.85, 0.52, 1, 1) + [node name="GasCaption" type="Label" parent="UI"] mouse_filter = 2 offset_left = 336 diff --git a/ResourceBar.gd b/ResourceBar.gd index b23eb46..5dd0c28 100644 --- a/ResourceBar.gd +++ b/ResourceBar.gd @@ -42,6 +42,7 @@ const RULE_COLOR: Color = Color(0.25, 0.55, 0.7) var _numbers: Array[NeonNumber] = [] var _captions: Array[Label] = [] var _gas_caption: Label +var _gas_icon: IconButton func _ready() -> void: @@ -75,6 +76,11 @@ func _ready() -> void: _gas_caption.add_theme_font_size_override("font_size", 20) _gas_caption.add_theme_color_override("font_color", Color(0.85, 0.52, 1.0)) add_child(_gas_caption) + _gas_icon = IconButton.new() + _gas_icon.mouse_filter = Control.MOUSE_FILTER_IGNORE + _gas_icon.icon = IconButton.Icon.GAS + _gas_icon.glow_color = Color(0.85, 0.52, 1.0) + add_child(_gas_icon) func _layout() -> void: @@ -90,6 +96,10 @@ func _layout() -> void: _gas_caption.position = Vector2(size.x - 110.0, 2.0) _gas_caption.size = Vector2(106.0, CAPTION_HEIGHT) _gas_caption.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT + if _gas_icon != null: + _gas_icon.position = Vector2(size.x - 34.0, 0.0) + _gas_icon.size = Vector2(32.0, 32.0) + _gas_caption.size.x = maxf(0.0, _gas_caption.size.x - 36.0) func _process(_delta: float) -> void: diff --git a/tests/_lab_menu_preview.gd b/tests/_lab_menu_preview.gd index 1818a14..2552f58 100644 --- a/tests/_lab_menu_preview.gd +++ b/tests/_lab_menu_preview.gd @@ -12,6 +12,7 @@ func _ready() -> void: GameState.transporters.clear() GameState.reset_progression() GameState.rocks = 240 + GameState.gas = 36 GameState.unlocked = ["shipyards", "vessel_science"] var main: Node = load("res://Main.tscn").instantiate() add_child(main) @@ -19,6 +20,7 @@ func _ready() -> void: var lab_id: int = int(GameState.buildings[-1].id) GameState.deposit_to_building(lab_id, 18) GameState.fleet_cargo = 12 + GameState.fleet_gas_cargo = 8 # A level already bought, so the list shows both a researched and an # unresearched line rather than a uniform page of zeroes. GameState.vessel_levels["int_damage"] = 1 diff --git a/tests/_transfer_menu_preview.gd b/tests/_transfer_menu_preview.gd index 3589a88..b903fa6 100644 --- a/tests/_transfer_menu_preview.gd +++ b/tests/_transfer_menu_preview.gd @@ -13,13 +13,16 @@ func _ready() -> void: GameState.extractors.clear() GameState.transporters.clear() GameState.rocks = 180 + GameState.gas = 36 GameState.fleet_cargo = 24 + GameState.fleet_gas_cargo = 12 GameState.unlocked = ["shipyards", "logistics", "freight"] var main: Node = load("res://Main.tscn").instantiate() add_child(main) main.get_node("BuildingField").place(GameState.BUILDING_SHIP_CRAFTER, Vector2(400.0, 0.0)) var crafter_id: int = int(GameState.buildings[-1].id) GameState.deposit_to_building(crafter_id, 42) + GameState.find_building(crafter_id).gas_stock = 18 var bc: Node = main.get_node("BuildController") bc.transfer_building_id = crafter_id main.get_node("UI/TransferMenu").visible = true