Show gas icons in resource displays
This commit is contained in:
parent
4c82155cf3
commit
cccdc85c9e
4 changed files with 25 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue