Set affinity icon in UI

This commit is contained in:
2026-05-31 17:38:53 -07:00
parent b16d0c3169
commit 463d91d640
8 changed files with 758 additions and 621 deletions
+2
View File
@@ -404,6 +404,8 @@ public partial class Game : Node3D, IGame
}); });
} }
public void SetAffinity(ElementType elementType) => InGameUI.SetAffinity(elementType);
private void FloorClearMenu_Exit() private void FloorClearMenu_Exit()
{ {
_player.Deactivate(); _player.Deactivate();
+2
View File
@@ -27,6 +27,8 @@ public interface IGame : IProvide<IGame>, IProvide<IGameRepo>, IProvide<IPlayer>
public void ThrowItem(IBaseInventoryItem item); public void ThrowItem(IBaseInventoryItem item);
public void SetAffinity(ElementType elementType);
public void FloorExitReached(); public void FloorExitReached();
public void GameOver(); public void GameOver();
+1
View File
@@ -312,6 +312,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
public void SetSigil(ISigil sigil) public void SetSigil(ISigil sigil)
{ {
SigilComponent.Sigil = sigil; SigilComponent.Sigil = sigil;
_game.SetAffinity(sigil.ElementType);
} }
public void Knockback(float impulse) public void Knockback(float impulse)
Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dhm6n6h40rm6s"
path.bptc="res://.godot/imported/None.png-a5cee11f73c49293b07fad00a9a44197.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://src/ui/Affinity Icons/None.png"
dest_files=["res://.godot/imported/None.png-a5cee11f73c49293b07fad00a9a44197.bptc.ctex"]
[params]
compress/mode=2
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
@@ -9,6 +9,8 @@ namespace Zennysoft.Game.Ma;
public interface IInGameUI : IControl public interface IInGameUI : IControl
{ {
void CloseInventory(); void CloseInventory();
public void SetAffinity(ElementType elementType);
} }
[Meta(typeof(IAutoNode))] [Meta(typeof(IAutoNode))]
@@ -30,6 +32,18 @@ public partial class InGameUI : Control, IInGameUI
[Node] public DebugInfo DebugInfo { get; set; } = default!; [Node] public DebugInfo DebugInfo { get; set; } = default!;
[Node] public TextureRect EolicImg { get; set; } = default!;
[Node] public TextureRect FerrumImg { get; set; } = default!;
[Node] public TextureRect HydricImg { get; set; } = default!;
[Node] public TextureRect IgneousImg { get; set; } = default!;
[Node] public TextureRect SanktaImg { get; set; } = default!;
[Node] public TextureRect TelluricImg { get; set; } = default!;
[Dependency] private IGameRepo _gameRepo => this.DependOn<IGameRepo>(); [Dependency] private IGameRepo _gameRepo => this.DependOn<IGameRepo>();
public IInGameUILogic InGameUILogic { get; set; } = default!; public IInGameUILogic InGameUILogic { get; set; } = default!;
@@ -58,6 +72,38 @@ public partial class InGameUI : Control, IInGameUI
InGameUILogic.Start(); InGameUILogic.Start();
} }
public void SetAffinity(ElementType elementType)
{
EolicImg.Visible = false;
FerrumImg.Visible = false;
HydricImg.Visible = false;
IgneousImg.Visible = false;
SanktaImg.Visible = false;
TelluricImg.Visible = false;
switch (elementType)
{
case ElementType.Aeolic:
EolicImg.Visible = true;
break;
case ElementType.Hydric:
HydricImg.Visible = true;
break;
case ElementType.Ferrum:
FerrumImg.Visible = true;
break;
case ElementType.Igneous:
IgneousImg.Visible = true;
break;
case ElementType.Telluric:
TelluricImg.Visible = true;
break;
case ElementType.Curse:
SanktaImg.Visible = true;
break;
}
}
public void CloseInventory() public void CloseInventory()
{ {
InventoryMenu.Hide(); InventoryMenu.Hide();
@@ -1,10 +1,11 @@
[gd_scene load_steps=14 format=3 uid="uid://b8tclvmc7j7dl"] [gd_scene load_steps=22 format=3 uid="uid://b8tclvmc7j7dl"]
[ext_resource type="Script" uid="uid://dlq2mkhl4pe7a" path="res://src/ui/in_game_ui/InGameUI.cs" id="1_sc13i"] [ext_resource type="Script" uid="uid://dlq2mkhl4pe7a" path="res://src/ui/in_game_ui/InGameUI.cs" id="1_sc13i"]
[ext_resource type="Texture2D" uid="uid://cijojm8gcjime" path="res://src/ui/rendered_assets/No Signal Screen.png" id="2_1e3dg"] [ext_resource type="Texture2D" uid="uid://cijojm8gcjime" path="res://src/ui/rendered_assets/No Signal Screen.png" id="2_1e3dg"]
[ext_resource type="PackedScene" uid="uid://bwbofurcvf3yh" path="res://src/minimap/Minimap.tscn" id="2_6sfje"] [ext_resource type="PackedScene" uid="uid://bwbofurcvf3yh" path="res://src/minimap/Minimap.tscn" id="2_6sfje"]
[ext_resource type="PackedScene" uid="uid://0eo47mewhlit" path="res://src/debug_info/DebugInfo.tscn" id="2_f0tui"] [ext_resource type="PackedScene" uid="uid://0eo47mewhlit" path="res://src/debug_info/DebugInfo.tscn" id="2_f0tui"]
[ext_resource type="PackedScene" uid="uid://dxl8il8f13c2x" path="res://src/ui/player_ui/PlayerInfoUI.tscn" id="4_46s5l"] [ext_resource type="PackedScene" uid="uid://dxl8il8f13c2x" path="res://src/ui/player_ui/PlayerInfoUI.tscn" id="4_46s5l"]
[ext_resource type="Texture2D" uid="uid://b8fio74j577pj" path="res://src/ui/Affinity Icons/EOLIC.png" id="4_rqc8e"]
[ext_resource type="PackedScene" uid="uid://bea2waybmgd6u" path="res://src/ui/teleport_prompt/UseTeleportPrompt.tscn" id="5_h1hgq"] [ext_resource type="PackedScene" uid="uid://bea2waybmgd6u" path="res://src/ui/teleport_prompt/UseTeleportPrompt.tscn" id="5_h1hgq"]
[ext_resource type="PackedScene" uid="uid://x0f1ol50nnp3" path="res://src/ui/in_game_ui/InventoryMessageUI.tscn" id="6_y26qy"] [ext_resource type="PackedScene" uid="uid://x0f1ol50nnp3" path="res://src/ui/in_game_ui/InventoryMessageUI.tscn" id="6_y26qy"]
[ext_resource type="PackedScene" uid="uid://8f3dk16nj0dn" path="res://src/menu/DebugMenu.tscn" id="7_llomk"] [ext_resource type="PackedScene" uid="uid://8f3dk16nj0dn" path="res://src/menu/DebugMenu.tscn" id="7_llomk"]
@@ -12,9 +13,17 @@
[ext_resource type="PackedScene" uid="uid://cbxw70qa7gifp" path="res://src/ui/inventory_menu/InventoryMenu.tscn" id="9_ur8ag"] [ext_resource type="PackedScene" uid="uid://cbxw70qa7gifp" path="res://src/ui/inventory_menu/InventoryMenu.tscn" id="9_ur8ag"]
[ext_resource type="PackedScene" uid="uid://dwa7o6hkkwjg1" path="res://src/ui/inventory_menu/ItemRescueMenu.tscn" id="10_higkc"] [ext_resource type="PackedScene" uid="uid://dwa7o6hkkwjg1" path="res://src/ui/inventory_menu/ItemRescueMenu.tscn" id="10_higkc"]
[ext_resource type="Texture2D" uid="uid://chqlapqsi0ga0" path="res://src/ui/Minimap Special Displays/maze floor.png" id="11_f0tui"] [ext_resource type="Texture2D" uid="uid://chqlapqsi0ga0" path="res://src/ui/Minimap Special Displays/maze floor.png" id="11_f0tui"]
[ext_resource type="Texture2D" uid="uid://dhm6n6h40rm6s" path="res://src/ui/Affinity Icons/None.png" id="11_k4h7r"]
[ext_resource type="Texture2D" uid="uid://bm877afagx7rv" path="res://src/ui/Affinity Icons/FERRUM.png" id="12_2of7j"]
[ext_resource type="Texture2D" uid="uid://b6wnipbpck5ea" path="res://src/ui/Affinity Icons/HYDRIC.png" id="13_4d2sw"]
[ext_resource type="Texture2D" uid="uid://buaj462dmtl6u" path="res://src/ui/Affinity Icons/IGNEOUS.png" id="14_4f3xk"]
[ext_resource type="Texture2D" uid="uid://ddlmguje21x8k" path="res://src/ui/Affinity Icons/SANKTA.png" id="15_rilgc"]
[ext_resource type="Texture2D" uid="uid://cr4g3ippdu2sk" path="res://src/ui/Affinity Icons/TELERIC.png" id="16_k3082"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_higkc"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_higkc"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1e3dg"]
[node name="InGameUI" type="Control"] [node name="InGameUI" type="Control"]
process_mode = 3 process_mode = 3
layout_mode = 3 layout_mode = 3
@@ -25,7 +34,7 @@ grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("1_sc13i") script = ExtResource("1_sc13i")
[node name="TextureRect" type="TextureRect" parent="."] [node name="NoSignal" type="TextureRect" parent="."]
layout_mode = 2 layout_mode = 2
offset_left = 1498.0 offset_left = 1498.0
offset_top = 346.0 offset_top = 346.0
@@ -117,9 +126,9 @@ theme_override_constants/margin_left = 15
theme_override_constants/margin_top = 0 theme_override_constants/margin_top = 0
[node name="MinimapZone" type="Panel" parent="Sidebar Container/MinimapContainer"] [node name="MinimapZone" type="Panel" parent="Sidebar Container/MinimapContainer"]
visible = false
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxEmpty_1e3dg")
[node name="MiniMap" parent="Sidebar Container/MinimapContainer/MinimapZone" instance=ExtResource("2_6sfje")] [node name="MiniMap" parent="Sidebar Container/MinimapContainer/MinimapZone" instance=ExtResource("2_6sfje")]
unique_name_in_owner = true unique_name_in_owner = true
@@ -135,6 +144,57 @@ offset_top = 354.0
offset_right = 423.0 offset_right = 423.0
offset_bottom = 620.0 offset_bottom = 620.0
[node name="Sigil" type="Control" parent="Sidebar Container"]
layout_mode = 2
[node name="SigilContainer" type="MarginContainer" parent="Sidebar Container/Sigil"]
layout_mode = 2
offset_left = 330.0
offset_top = 207.0
offset_right = 586.0
offset_bottom = 463.0
scale = Vector2(0.4, 0.4)
[node name="NoneImg" type="TextureRect" parent="Sidebar Container/Sigil/SigilContainer"]
layout_mode = 2
texture = ExtResource("11_k4h7r")
[node name="EolicImg" type="TextureRect" parent="Sidebar Container/Sigil/SigilContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
texture = ExtResource("4_rqc8e")
[node name="FerrumImg" type="TextureRect" parent="Sidebar Container/Sigil/SigilContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
texture = ExtResource("12_2of7j")
[node name="HydricImg" type="TextureRect" parent="Sidebar Container/Sigil/SigilContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
texture = ExtResource("13_4d2sw")
[node name="IgneousImg" type="TextureRect" parent="Sidebar Container/Sigil/SigilContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
texture = ExtResource("14_4f3xk")
[node name="SanktaImg" type="TextureRect" parent="Sidebar Container/Sigil/SigilContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
texture = ExtResource("15_rilgc")
[node name="TelluricImg" type="TextureRect" parent="Sidebar Container/Sigil/SigilContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
texture = ExtResource("16_k3082")
[node name="Sidebar Texture" type="TextureRect" parent="Sidebar Container"] [node name="Sidebar Texture" type="TextureRect" parent="Sidebar Container"]
layout_mode = 2 layout_mode = 2
texture = ExtResource("9_higkc") texture = ExtResource("9_higkc")
@@ -148,13 +208,3 @@ theme_override_constants/margin_top = 200
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
[node name="SigilContainer" type="MarginContainer" parent="Sidebar Container"]
layout_mode = 2
theme_override_constants/margin_left = 50
theme_override_constants/margin_top = 800
theme_override_constants/margin_right = 175
theme_override_constants/margin_bottom = 50
[node name="ReferenceRect" type="ReferenceRect" parent="Sidebar Container/SigilContainer"]
layout_mode = 2
@@ -85,6 +85,7 @@ layout_mode = 2
[node name="HPProgressBar" type="ProgressBar" parent="AspectRatio/PlayerInfo/HBoxContainer/VBox/HP Box/CenterContainer"] [node name="HPProgressBar" type="ProgressBar" parent="AspectRatio/PlayerInfo/HBoxContainer/VBox/HP Box/CenterContainer"]
unique_name_in_owner = true unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(150, 12) custom_minimum_size = Vector2(150, 12)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
@@ -118,6 +119,7 @@ layout_mode = 2
[node name="VTProgressBar" type="ProgressBar" parent="AspectRatio/PlayerInfo/HBoxContainer/VBox/VT Box/CenterContainer"] [node name="VTProgressBar" type="ProgressBar" parent="AspectRatio/PlayerInfo/HBoxContainer/VBox/VT Box/CenterContainer"]
unique_name_in_owner = true unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(150, 12) custom_minimum_size = Vector2(150, 12)
layout_mode = 2 layout_mode = 2
size_flags_vertical = 4 size_flags_vertical = 4
@@ -144,7 +146,6 @@ custom_minimum_size = Vector2(60, 0)
layout_mode = 2 layout_mode = 2
text = "1" text = "1"
label_settings = ExtResource("3_xdjh1") label_settings = ExtResource("3_xdjh1")
horizontal_alignment = 1
[node name="EXP Box" type="HBoxContainer" parent="AspectRatio/PlayerInfo/HBoxContainer/VBox"] [node name="EXP Box" type="HBoxContainer" parent="AspectRatio/PlayerInfo/HBoxContainer/VBox"]
layout_mode = 2 layout_mode = 2