Skip to content

Commit

Permalink
Remove remaining ICON references
Browse files Browse the repository at this point in the history
  • Loading branch information
hatmix committed Jan 27, 2025
1 parent c665f1f commit df37304
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 29 deletions.
2 changes: 1 addition & 1 deletion autoloads/globals.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extends Node
# If it's independent, it (probably) belongs in utils.gd

## Use UI/MessageBox to display a status update message to the player
signal post_ui_message(text: String, icon: Message.ICON)
signal post_ui_message(text: String)

## Emitted by UI/Controls when a action is remapped
signal controls_changed(config: GUIDERemappingConfig)
10 changes: 5 additions & 5 deletions autoloads/settings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ func load_controls() -> GUIDERemappingConfig:
func save_controls(data: GUIDERemappingConfig) -> void:
var err: int = ResourceSaver.save(data, CONTROLS_FILE)
if err:
Globals.post_ui_message.emit("Error saving controls '%s'" % str(err), Message.ICON.FAILURE)
Globals.post_ui_message.emit("Error saving controls '%s'" % str(err))
else:
Globals.post_ui_message.emit("Controls saved", Message.ICON.SUCCESS)
Globals.post_ui_message.emit("Controls saved")
data.take_over_path(CONTROLS_FILE)


Expand All @@ -55,7 +55,7 @@ func load_settings() -> void:
_settings = ConfigFile.new()
var err: int = _settings.load(SETTINGS_FILE)
if err:
Globals.post_ui_message.emit("Loading default settings", Message.ICON.SUCCESS)
Globals.post_ui_message.emit("Loading default settings")
err = _settings.load(DEFAULT_SETTINGS_FILE)
if not err:
err = _settings.save(SETTINGS_FILE)
Expand All @@ -72,10 +72,10 @@ func save_settings() -> void:
var err: int = _settings.save(SETTINGS_FILE)
if err:
print("post failure message")
Globals.post_ui_message.emit("Error saving settings '%s'" % str(err), Message.ICON.FAILURE)
Globals.post_ui_message.emit("Error saving settings '%s'" % str(err))
else:
print("post success message")
Globals.post_ui_message.emit("Settings saved", Message.ICON.SUCCESS)
Globals.post_ui_message.emit("Settings saved")


func get_value(section: SECTION, key: String, default: Variant) -> Variant:
Expand Down
1 change: 0 additions & 1 deletion ui/notifications/message.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const MAX_HEIGHT: int = 90
@export_color_no_alpha var border_color: Color = Color("FA6149")
# Panel container color controlled by the ui theme

@onready var icon_node: TextureRect = %Icon
@onready var text_node: Label = %Text


Expand Down
22 changes: 2 additions & 20 deletions ui/notifications/message.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://udxerxnmw35e"]
[gd_scene load_steps=2 format=3 uid="uid://udxerxnmw35e"]

[ext_resource type="Script" path="res://ui/notifications/message.gd" id="1_pe0jv"]
[ext_resource type="Texture2D" uid="uid://dfrj2up44fax" path="res://ui/assets/icons/notifications/checkmark-circle-outline-white.png" id="2_itaa2"]

[node name="Message" type="PanelContainer"]
anchors_preset = 5
Expand All @@ -16,24 +15,7 @@ size_flags_horizontal = 4
size_flags_vertical = 4
script = ExtResource("1_pe0jv")

[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 4
alignment = 1

[node name="Icon" type="TextureRect" parent="HBoxContainer"]
unique_name_in_owner = true
visible = false
modulate = Color(0.980392, 0.380392, 0.286275, 1)
custom_minimum_size = Vector2(30, 30)
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 4
texture = ExtResource("2_itaa2")
expand_mode = 3

[node name="Text" type="Label" parent="HBoxContainer"]
[node name="Text" type="Label" parent="."]
unique_name_in_owner = true
modulate = Color(0.980392, 0.380392, 0.286275, 1)
layout_mode = 2
Expand Down
4 changes: 2 additions & 2 deletions ui/notifications/message_board.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ func _check_queue() -> void:
ui.hide_ui("MessageBoard")


func show_message(text: String, icon: Message.ICON = Message.ICON.NONE) -> void:
func show_message(text: String) -> void:
if not ui.is_shown("MessageBoard"):
ui.show_ui("MessageBoard")
var message: Message = message_scene.instantiate()
%Messages.add_child(message)
message.display(text, icon)
message.display(text)

0 comments on commit df37304

Please sign in to comment.