Compare commits

..

5 Commits

Author SHA1 Message Date
34c125e6bb no message 2026-02-15 01:14:09 -08:00
66905c9b53 Overhaul 2026-02-15 01:06:46 -08:00
Pal
a1f4a29eb3 Mask of Zeal, Mask Placeholder, Health Item Placeholder, VT pickup animation added. Temp Environment added to Final Floor. 2026-02-15 00:57:19 -08:00
a6ea1b1873 laptop 2026-02-14 19:26:33 -08:00
Pal
47ceb2f613 Remove E, fix UI, Altar scale better 2026-02-14 16:49:16 -08:00
53 changed files with 1215 additions and 518 deletions

View File

@@ -16,6 +16,8 @@ public interface IExperiencePointsComponent : IEntityComponent
public void Gain(int baseExpGain);
public void GainUnmodified(int flateRateExpGain);
public void LevelUp();
public event Action PlayerLevelUp;

View File

@@ -51,6 +51,16 @@ public class ExperiencePointsComponent : IExperiencePointsComponent
var cappedAmount = Math.Min(baseExpGain + _currentExp.Value, _expToNextLevel.Value);
_currentExp.OnNext(cappedAmount);
}
public void GainUnmodified(int flatRateExp)
{
var newCurrentExpTotal = flatRateExp + _currentExp.Value;
while (flatRateExp + _currentExp.Value >= _expToNextLevel.Value)
LevelUp();
var cappedAmount = Math.Min(flatRateExp + _currentExp.Value, _expToNextLevel.Value);
_currentExp.OnNext(cappedAmount);
}
public void ModifyExpGainRate(double newRate) => _expGainRate.OnNext(newRate);
public void LevelUp()

View File

@@ -146,7 +146,7 @@ public partial class App : Node, IApp
})
.Handle((in AppLogic.Output.SetupGameScene _) =>
{
LoadingScreen.Show();
LoadingScreen.ShowLoadingScreen();
LoadGame(GAME_SCENE_PATH);
})
.Handle((in AppLogic.Output.ShowMainMenu _) =>
@@ -155,7 +155,7 @@ public partial class App : Node, IApp
})
.Handle((in AppLogic.Output.CloseGame _) =>
{
LoadingScreen.Hide();
LoadingScreen.HideLoadingScreen();
_game.GameExitRequested -= GameExitRequested;
MainMenu.StartGameButton.GrabFocus();
_game.CallDeferred(MethodName.QueueFree, []);
@@ -166,13 +166,13 @@ public partial class App : Node, IApp
})
.Handle((in AppLogic.Output.EnemyViewerOpened _) =>
{
LoadingScreen.Show();
LoadingScreen.ShowLoadingScreen();
MainMenu.Hide();
LoadEnemyViewer(ENEMY_VIEWER_PATH);
})
.Handle((in AppLogic.Output.EnemyViewerExited _) =>
{
LoadingScreen.Hide();
LoadingScreen.HideLoadingScreen();
if (_enemyViewer != null && _enemyViewer is DataViewer enemyViewer)
enemyViewer.CallDeferred(MethodName.QueueFree);
MainMenu.Show();
@@ -203,24 +203,22 @@ public partial class App : Node, IApp
_game = scene as IGame;
_game.GameLoaded += OnGameLoaded;
_game.GameExitRequested += GameExitRequested;
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
CallDeferred(MethodName.AddChild, scene);
}
private void OnGameLoaded() => LoadingScreen.Hide();
private void OnGameLoaded() => LoadingScreen.HideLoadingScreen();
private async void LoadEnemyViewer(string sceneName)
{
var scene = await LoadSceneInternal(sceneName);
_enemyViewer = scene as IDataViewer;
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
CallDeferred(MethodName.AddChild, scene);
LoadingScreen.Hide();
LoadingScreen.HideLoadingScreen();
}
private async Task<Node> LoadSceneInternal(string sceneName)
{
LoadingScreen.Show();
LoadingScreen.ShowLoadingScreen();
LoadingScreen.ProgressBar.Value = 0;
var sceneLoader = new SceneLoader();
CallDeferred(MethodName.AddChild, sceneLoader);

View File

@@ -10,9 +10,16 @@
process_mode = 3
script = ExtResource("1_rt73h")
[node name="ColorRect" type="ColorRect" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="MainMenu" parent="." instance=ExtResource("2_1uiag")]
unique_name_in_owner = true
visible = false
[node name="OptionsMenu" parent="." instance=ExtResource("2_v0mgf")]
unique_name_in_owner = true
@@ -24,5 +31,6 @@ visible = false
[node name="LoadingScreen" parent="." instance=ExtResource("3_3st5l")]
unique_name_in_owner = true
visible = false
top_level = true
z_index = 999

View File

@@ -39,6 +39,7 @@ bus = &"SFX"
[node name="MoveSound" type="AudioStreamPlayer" parent="UI"]
unique_name_in_owner = true
stream = ExtResource("6_r16t0")
max_polyphony = 5
bus = &"SFX"
[node name="SelectSound" type="AudioStreamPlayer" parent="UI"]

View File

@@ -109,7 +109,6 @@ _acquireTargetTime = 2.0
unique_name_in_owner = true
avoidance_enabled = true
radius = 1.0
debug_enabled = true
[node name="SFX" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.0617, 0)

View File

@@ -157,9 +157,7 @@ public partial class Game : Node3D, IGame
GameState.Set(_player);
GameState.Set(_map);
GameState.Set(InGameUI);
GameRepo.Resume();
InGameUI.Show();
HandleGameLogic();
GameState.Start();
this.Provide();
@@ -188,6 +186,8 @@ public partial class Game : Node3D, IGame
GameRepo.IsPaused.Sync += IsPaused_Sync;
InGameUI.PlayerInfoUI.Activate();
InGameUI.Show();
GameRepo.Resume();
}
private void GameRepo_EnemyDied(IEnemy obj)
@@ -209,7 +209,6 @@ public partial class Game : Node3D, IGame
_effectService = new EffectService(this, _player, _map);
_player.Activate();
await _map.LoadFloor();
GameLoaded?.Invoke();
}
public async Task Save() => await SaveFile.Save();
@@ -233,9 +232,6 @@ public partial class Game : Node3D, IGame
EnactEffectItemEffects(effectItem);
break;
}
await ToSignal(GetTree().CreateTimer(0.3f), "timeout");
RemoveItemOrSubtractFromItemCount(item);
}
@@ -398,7 +394,10 @@ public partial class Game : Node3D, IGame
InGameUI.InventoryMenu.SetProcessInput(false);
}
private async void LoadLevel() => await _map.LoadFloor();
private async void LoadLevel()
{
await _map.LoadFloor();
}
private void FloorClearMenu_GoToNextFloor() => GameState.Input(new GameState.Input.LoadNextFloor());
@@ -419,7 +418,6 @@ public partial class Game : Node3D, IGame
private void UseTeleportPrompt_TeleportToNextFloor()
{
//_player.LookUp();
GameState.Input(new GameState.Input.UseTeleport());
}
@@ -588,6 +586,8 @@ public partial class Game : Node3D, IGame
private void OnFloorLoadFinished()
{
LoadNextLevel.Hide();
GameLoaded?.Invoke();
_map.FadeIn();
}
private void OnQuit() => GameExitRequested?.Invoke();

View File

@@ -11,11 +11,11 @@ process_mode = 3
script = ExtResource("1_ytcii")
[node name="SubViewportContainer" type="SubViewportContainer" parent="."]
custom_minimum_size = Vector2(1440, 1080)
custom_minimum_size = Vector2(1456, 1080)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -480.0
offset_right = -464.0
grow_horizontal = 2
grow_vertical = 2
stretch = true
@@ -23,7 +23,7 @@ stretch = true
[node name="SubViewport" type="SubViewport" parent="SubViewportContainer"]
handle_input_locally = false
audio_listener_enable_3d = true
size = Vector2i(1440, 1080)
size = Vector2i(1456, 1080)
render_target_update_mode = 4
[node name="PauseContainer" type="Node3D" parent="SubViewportContainer/SubViewport"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cy7qvpjahblv3"
path.bptc="res://.godot/imported/Mask of Zeal.png-27ba6e23bb2ecd6acedb6fdbc3423aee.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://src/items/3D Render Icons/Mask of Zeal.png"
dest_files=["res://.godot/imported/Mask of Zeal.png-27ba6e23bb2ecd6acedb6fdbc3423aee.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cy5bd7f37fi35"
path.bptc="res://.godot/imported/health item placeholder.png-d6e3fd30b79c4ebf810d66504d813903.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://src/items/3D Render Icons/health item placeholder.png"
dest_files=["res://.godot/imported/health item placeholder.png-d6e3fd30b79c4ebf810d66504d813903.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://m0f8xmp8l2fe"
path.bptc="res://.godot/imported/mask placeholder.png-214c6109a019a6bad1f6bd77ac323bd3.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://src/items/3D Render Icons/mask placeholder.png"
dest_files=["res://.godot/imported/mask placeholder.png-214c6109a019a6bad1f6bd77ac323bd3.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

View File

@@ -172,7 +172,11 @@ public class EffectService
SfxDatabase.Instance.Play(SoundEffect.IncreaseStat);
}
public void RaiseLevel() => _player.LevelUp();
public void RaiseLevel()
{
var expToNextLevel = _player.ExperiencePointsComponent.ExpToNextLevel.Value - _player.ExperiencePointsComponent.CurrentExp.Value;
_player.ExperiencePointsComponent.GainUnmodified(expToNextLevel);
}
public void TeleportToRandomRoom(IEnemy enemy)
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d3g5l5x5crrcy"
path.bptc="res://.godot/imported/FRAME 2.png-229cea0e1e02f919f524c9941094cf2b.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://src/items/VT Crystal/FRAME 2.png"
dest_files=["res://.godot/imported/FRAME 2.png-229cea0e1e02f919f524c9941094cf2b.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://evb7fqb01tm5"
path.bptc="res://.godot/imported/FRAME 3.png-d7f1ced39fbde420333fb73302a64991.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://src/items/VT Crystal/FRAME 3.png"
dest_files=["res://.godot/imported/FRAME 3.png-d7f1ced39fbde420333fb73302a64991.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b36xqrykgtdkw"
path.bptc="res://.godot/imported/FRAME1.png-2a41a5e2a774e029a8c5614fdd3304e6.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://src/items/VT Crystal/FRAME1.png"
dest_files=["res://.godot/imported/FRAME1.png-2a41a5e2a774e029a8c5614fdd3304e6.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

View File

@@ -20,6 +20,10 @@ public interface IMap : INode3D
void InitializeMapData();
public void FadeIn();
public void FadeOut();
public AutoProp<int> CurrentFloorNumber { get; }
public event Action<(Vector3 Rotation, Vector3 Position)> SpawnPointCreated;

View File

@@ -59,9 +59,11 @@ public partial class Map : Node3D, IMap
var floor = MapOrder.GetChildren().OfType<FloorNode>().ElementAt(CurrentFloorNumber.Value);
if (CurrentFloor is DungeonFloor dungeonFloor && floor is DungeonFloorNode dungeonFloorNode)
dungeonFloor.SpawnEnemies(dungeonFloorNode);
AnimationPlayer.CallDeferred(AnimationPlayer.MethodName.Play, ("fade_in"));
}
public void FadeIn() => AnimationPlayer.Play("fade_in");
public void FadeOut() => AnimationPlayer.Play("fade_out");
public void InitializeMapData()
{
CurrentFloorNumber.OnNext(-1);
@@ -89,7 +91,7 @@ public partial class Map : Node3D, IMap
public async Task LoadFloor(string sceneName)
{
AnimationPlayer.CallDeferred(AnimationPlayer.MethodName.Play, "fade_out");
CallDeferred(MethodName.FadeOut);
_sceneName = sceneName;
var dimmableAudio = GetTree().GetNodesInGroup("DimmableAudio").OfType<IDimmableAudioStreamPlayer>();
foreach (var node in dimmableAudio)

View File

@@ -19,7 +19,22 @@ tracks/0/keys = {
"values": [Color(0, 0, 0, 1)]
}
[sub_resource type="Animation" id="Animation_g6eui"]
[sub_resource type="Animation" id="Animation_v14r0"]
resource_name = "fade_out"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
}
[sub_resource type="Animation" id="Animation_0qcd2"]
resource_name = "fade_in"
tracks/0/type = "value"
tracks/0/imported = false
@@ -34,39 +49,16 @@ tracks/0/keys = {
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
}
[sub_resource type="Animation" id="Animation_v14r0"]
resource_name = "fade_out"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(-0.0666667, 0),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_00xd7"]
_data = {
&"RESET": SubResource("Animation_00xd7"),
&"fade_in": SubResource("Animation_g6eui"),
&"fade_in": SubResource("Animation_0qcd2"),
&"fade_out": SubResource("Animation_v14r0")
}
[node name="Map" type="Node3D"]
script = ExtResource("1_bw70o")
[node name="ColorRect" type="ColorRect" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
@@ -219,3 +211,11 @@ FloorName = 4
[node name="Final Floor" type="Node" parent="MapOrder"]
script = ExtResource("3_v14r0")
FloorName = 6
[node name="ColorRect" type="ColorRect" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)

View File

@@ -25,33 +25,33 @@ public partial class Altar : SpecialFloor, IDungeonFloor
public void OnResolved()
{
Show();
Exit.AreaEntered += Exit_AreaEntered;
NoExitArea.AreaEntered += NoExitArea_AreaEntered;
FloorIsLoaded = true;
Show();
Exit.AreaEntered += Exit_AreaEntered;
NoExitArea.AreaEntered += NoExitArea_AreaEntered;
FloorIsLoaded = true;
}
private void _player_PointUpFinished()
{
_player.Activate();
_player.Activate();
}
private void NoExitArea_AreaEntered(Area3D area)
{
DialogueController.ShowDialogue(Dialogue, "no_exit");
DialogueController.ShowDialogue(Dialogue, "no_exit");
}
private void Exit_AreaEntered(Area3D area)
{
if (area.GetOwner() is IPlayer)
ExitReached();
if (area.GetOwner() is IPlayer)
ExitReached();
}
public void ExitReached() => Game.FloorExitReached();
public void OnExitTree()
{
Exit.AreaEntered -= Exit_AreaEntered;
NoExitArea.AreaEntered -= NoExitArea_AreaEntered;
Exit.AreaEntered -= Exit_AreaEntered;
NoExitArea.AreaEntered -= NoExitArea_AreaEntered;
}
}

View File

@@ -18,16 +18,16 @@ public partial class FinalFloor : SpecialFloor
public void OnReady()
{
Exit.AreaEntered += Exit_AreaEntered;
Exit.AreaEntered += Exit_AreaEntered;
}
private void Exit_AreaEntered(Area3D area)
{
_player.Die();
_player.Die();
}
public void OnExitTree()
{
Exit.AreaEntered -= Exit_AreaEntered;
Exit.AreaEntered -= Exit_AreaEntered;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://cyrrhoarhxlhg"]
[gd_scene load_steps=13 format=3 uid="uid://cyrrhoarhxlhg"]
[ext_resource type="Script" uid="uid://r8mpxyum31ds" path="res://src/map/dungeon/code/FinalFloor.cs" id="1_b2jrf"]
[ext_resource type="PackedScene" uid="uid://dpd2y8evtea1t" path="res://src/map/dungeon/models/Special Floors & Rooms/36. Final Floor/36_A2_FINAL_FLOOR_VER.0.1.glb" id="2_b2jrf"]
@@ -10,10 +10,10 @@ size = Vector3(0.0974121, 15.1811, 23.3886)
size = Vector3(0.0974121, 15.1811, 27.7427)
[sub_resource type="BoxShape3D" id="BoxShape3D_s4mfk"]
size = Vector3(187.628, 118.514, 12.5598)
size = Vector3(234.085, 118.514, 12.5598)
[sub_resource type="BoxShape3D" id="BoxShape3D_170vw"]
size = Vector3(187.874, 144.552, 13.4706)
size = Vector3(235.028, 144.552, 13.4706)
[sub_resource type="BoxShape3D" id="BoxShape3D_ajpkj"]
size = Vector3(281.18, 0.081543, 80.3693)
@@ -27,6 +27,23 @@ size = Vector3(19.394, 30.059, 2.88283)
[sub_resource type="BoxShape3D" id="BoxShape3D_b2jrf"]
size = Vector3(12.9663, 20.8418, 50.175)
[sub_resource type="Environment" id="Environment_b2jrf"]
background_mode = 1
ambient_light_energy = 0.0
sdfgi_enabled = true
glow_enabled = true
glow_intensity = 1.57
glow_strength = 1.36
glow_bloom = 1.0
glow_blend_mode = 0
volumetric_fog_enabled = true
volumetric_fog_albedo = Color(0.830335, 0.830335, 0.830335, 1)
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_hojso"]
exposure_multiplier = 1.354
dof_blur_far_enabled = true
dof_blur_far_distance = 371.47
[node name="Final Floor" type="Node3D"]
script = ExtResource("1_b2jrf")
@@ -53,12 +70,12 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -3.576
shape = SubResource("BoxShape3D_djk74")
[node name="CollisionShape3D4" type="CollisionShape3D" parent="Collisions/StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -110.065, -2.28188, -12.327)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -133.294, -2.28188, -12.327)
shape = SubResource("BoxShape3D_s4mfk")
debug_color = Color(0, 0.6, 0.701961, 1)
[node name="CollisionShape3D5" type="CollisionShape3D" parent="Collisions/StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -110.065, -15.2228, 10.4977)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -133.642, -15.2228, 10.4977)
shape = SubResource("BoxShape3D_170vw")
[node name="CollisionShape3D6" type="CollisionShape3D" parent="Collisions/StaticBody3D"]
@@ -66,7 +83,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -110.065, -3.09368, -8.33632)
shape = SubResource("BoxShape3D_ajpkj")
[node name="CollisionShape3D7" type="CollisionShape3D" parent="Collisions/StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -226.104, -1.21697, -3.54719)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -255.62, -1.21697, -3.54719)
shape = SubResource("BoxShape3D_pdgpv")
[node name="CollisionShape3D8" type="CollisionShape3D" parent="Collisions/StaticBody3D"]
@@ -91,5 +108,17 @@ collision_layer = 0
collision_mask = 64
[node name="CollisionShape3D" type="CollisionShape3D" parent="Room/Exit"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -222.237, -3.35156, 3.78481)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -257.108, -3.35156, 3.78481)
shape = SubResource("BoxShape3D_b2jrf")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_b2jrf")
camera_attributes = SubResource("CameraAttributesPractical_hojso")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="WorldEnvironment"]
transform = Transform3D(0.85896, -0.300971, 0.414251, 0, -0.809017, -0.587785, 0.512043, 0.504884, -0.694913, 0, 0, 0)
light_color = Color(0.204372, 0.420196, 1, 1)
light_energy = 4.435
shadow_enabled = true
[editable path="Model/36_A2_FINAL_FLOOR_VER_0_2"]

View File

@@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c1eip3nh46fy0"
path.bptc="res://.godot/imported/36_A2_FINAL_FLOOR_VER.0_normal_opengl.png-19d807bda1d6515f9683734aa2231482.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "00b94bfeae1634510fa43553cce9c0fb"
}
[deps]
source_file="res://src/map/dungeon/models/Special Floors & Rooms/36. Final Floor/36_A2_FINAL_FLOOR_VER.0_normal_opengl.png"
dest_files=["res://.godot/imported/36_A2_FINAL_FLOOR_VER.0_normal_opengl.png-19d807bda1d6515f9683734aa2231482.bptc.ctex"]
[params]
compress/mode=2
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=1
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=1
roughness/src_normal="res://src/map/dungeon/models/Special Floors & Rooms/36. Final Floor/36_A2_FINAL_FLOOR_VER.0_normal_opengl.png"
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

View File

@@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ch4cjvuay2edg"
path.bptc="res://.godot/imported/36_A2_FINAL_FLOOR_VER.0_roughness.png-03b3a9d966651fcef8eae7c32f126fae.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "634f7d6ce3b2d5f17052a0abff3585b5"
}
[deps]
source_file="res://src/map/dungeon/models/Special Floors & Rooms/36. Final Floor/36_A2_FINAL_FLOOR_VER.0_roughness.png"
dest_files=["res://.godot/imported/36_A2_FINAL_FLOOR_VER.0_roughness.png-03b3a9d966651fcef8eae7c32f126fae.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=true
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

View File

@@ -1398,7 +1398,8 @@ omni_range = 19.166
omni_attenuation = 1.106
[node name="E symbol!" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.216361, 10.8155)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.550282, 10.8155)
visible = false
layers = 2
cast_shadow = 0
mesh = SubResource("PlaneMesh_l1s1j")

View File

@@ -675,6 +675,7 @@ autoplay = "Flame Flicker"
[node name="E symbol!" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.469518, 10.8155)
visible = false
layers = 2
mesh = SubResource("PlaneMesh_vsgtq")

View File

@@ -7,6 +7,28 @@ public partial class LoadingScreen : Control
{
public override void _Notification(int what) => this.Notify(what);
[Node]
public ProgressBar ProgressBar { get; set; } = default!;
[Node] public ProgressBar ProgressBar { get; set; } = default!;
[Node] public AnimationPlayer AnimationPlayer { get; set; } = default!;
public void OnResolved()
{
AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished;
}
private void AnimationPlayer_AnimationFinished(StringName animName)
{
if (animName == "fade_out")
Hide();
}
public void ShowLoadingScreen()
{
Show();
}
public void HideLoadingScreen()
{
AnimationPlayer.Play("fade_out");
}
}

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=5 format=3 uid="uid://cpjlj7kxdhv16"]
[gd_scene load_steps=9 format=3 uid="uid://cpjlj7kxdhv16"]
[ext_resource type="Script" uid="uid://b07ueredevhr3" path="res://src/menu/LoadingScreen.cs" id="1_5uxhf"]
[ext_resource type="Texture2D" uid="uid://d2krh4u2v06k5" path="res://src/ui/rendered_assets/SCREEN_RENDERS_Loading_720_16_9.png" id="2_xfkmi"]
@@ -8,8 +8,61 @@
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xfkmi"]
bg_color = Color(0.804743, 0.804743, 0.804743, 1)
[sub_resource type="Animation" id="Animation_xfkmi"]
resource_name = "fade_in"
length = 0.500003
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
}
[sub_resource type="Animation" id="Animation_6i7rn"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0, 0, 0, 0)]
}
[sub_resource type="Animation" id="Animation_jrbvh"]
resource_name = "fade_out"
length = 1.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_jrbvh"]
_data = {
&"RESET": SubResource("Animation_6i7rn"),
&"fade_in": SubResource("Animation_xfkmi"),
&"fade_out": SubResource("Animation_jrbvh")
}
[node name="LoadingScreen" type="Control"]
visible = false
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@@ -48,3 +101,18 @@ offset_bottom = 981.0
theme_override_styles/background = SubResource("StyleBoxTexture_xfkmi")
theme_override_styles/fill = SubResource("StyleBoxFlat_xfkmi")
show_percentage = false
[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 0)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_jrbvh")
}

View File

@@ -1,7 +1,10 @@
[gd_scene load_steps=3 format=3 uid="uid://rfvnddfqufho"]
[gd_scene load_steps=6 format=3 uid="uid://rfvnddfqufho"]
[ext_resource type="Script" uid="uid://14b7o2c6cgry" path="res://src/menu/MainMenu.cs" id="1_y6722"]
[ext_resource type="StyleBox" uid="uid://bxuy4tnftibfq" path="res://src/options/SelectedOptionsBox.tres" id="2_2ijnm"]
[ext_resource type="Shortcut" uid="uid://dumkrjur22k2a" path="res://src/ui/ButtonShortcut.tres" id="2_7fwjx"]
[ext_resource type="FontFile" uid="uid://0syyay37admf" path="res://src/ui/fonts/georgiab.ttf" id="2_dftre"]
[ext_resource type="StyleBox" uid="uid://bl15q835s4ene" path="res://src/options/UnselectedOptionsBox.tres" id="3_dftre"]
[node name="MainMenu" type="Control"]
layout_mode = 3
@@ -19,45 +22,78 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.137255, 0.121569, 0.12549, 1)
color = Color(0.0962047, 0.0962048, 0.0962047, 1)
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -59.0
offset_top = -171.0
offset_right = 59.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 100
theme_override_constants/margin_top = 100
theme_override_constants/margin_right = 100
theme_override_constants/margin_bottom = 100
grow_vertical = 0
theme_override_constants/margin_bottom = 200
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
[node name="CenterContainer" type="CenterContainer" parent="MarginContainer"]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterContainer"]
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
[node name="StartGameButton" type="Button" parent="MarginContainer/VBoxContainer"]
[node name="StartGameButton" type="Button" parent="MarginContainer/CenterContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_bottom = NodePath("../EnemyViewerButton")
focus_next = NodePath("../EnemyViewerButton")
theme_override_colors/font_focus_color = Color(0.976471, 0.827451, 0, 1)
theme_override_fonts/font = ExtResource("2_dftre")
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = ExtResource("2_2ijnm")
theme_override_styles/disabled_mirrored = ExtResource("3_dftre")
theme_override_styles/disabled = ExtResource("3_dftre")
theme_override_styles/hover_pressed_mirrored = ExtResource("3_dftre")
theme_override_styles/hover_pressed = ExtResource("3_dftre")
theme_override_styles/hover_mirrored = ExtResource("3_dftre")
theme_override_styles/hover = ExtResource("3_dftre")
theme_override_styles/pressed_mirrored = ExtResource("3_dftre")
theme_override_styles/pressed = ExtResource("3_dftre")
theme_override_styles/normal_mirrored = ExtResource("3_dftre")
theme_override_styles/normal = ExtResource("3_dftre")
shortcut = ExtResource("2_7fwjx")
text = "Start Game"
alignment = 0
[node name="EnemyViewerButton" type="Button" parent="MarginContainer/VBoxContainer"]
[node name="EnemyViewerButton" type="Button" parent="MarginContainer/CenterContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_bottom = NodePath("../GalleryButton")
focus_next = NodePath("../GalleryButton")
focus_previous = NodePath("../StartGameButton")
theme_override_colors/font_focus_color = Color(0.976471, 0.827451, 0, 1)
theme_override_fonts/font = ExtResource("2_dftre")
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = ExtResource("2_2ijnm")
theme_override_styles/disabled_mirrored = ExtResource("3_dftre")
theme_override_styles/disabled = ExtResource("3_dftre")
theme_override_styles/hover_pressed_mirrored = ExtResource("3_dftre")
theme_override_styles/hover_pressed = ExtResource("3_dftre")
theme_override_styles/hover_mirrored = ExtResource("3_dftre")
theme_override_styles/hover = ExtResource("3_dftre")
theme_override_styles/pressed_mirrored = ExtResource("3_dftre")
theme_override_styles/pressed = ExtResource("3_dftre")
theme_override_styles/normal_mirrored = ExtResource("3_dftre")
theme_override_styles/normal = ExtResource("3_dftre")
shortcut = ExtResource("2_7fwjx")
text = "Enemy Viewer"
alignment = 0
[node name="GalleryButton" type="Button" parent="MarginContainer/VBoxContainer"]
[node name="GalleryButton" type="Button" parent="MarginContainer/CenterContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_top = NodePath("../EnemyViewerButton")
@@ -65,10 +101,24 @@ focus_neighbor_bottom = NodePath("../OptionsButton")
focus_next = NodePath("../OptionsButton")
focus_previous = NodePath("../EnemyViewerButton")
theme_override_colors/font_focus_color = Color(0.976471, 0.827451, 0, 1)
theme_override_fonts/font = ExtResource("2_dftre")
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = ExtResource("2_2ijnm")
theme_override_styles/disabled_mirrored = ExtResource("3_dftre")
theme_override_styles/disabled = ExtResource("3_dftre")
theme_override_styles/hover_pressed_mirrored = ExtResource("3_dftre")
theme_override_styles/hover_pressed = ExtResource("3_dftre")
theme_override_styles/hover_mirrored = ExtResource("3_dftre")
theme_override_styles/hover = ExtResource("3_dftre")
theme_override_styles/pressed_mirrored = ExtResource("3_dftre")
theme_override_styles/pressed = ExtResource("3_dftre")
theme_override_styles/normal_mirrored = ExtResource("3_dftre")
theme_override_styles/normal = ExtResource("3_dftre")
shortcut = ExtResource("2_7fwjx")
text = "Gallery"
alignment = 0
[node name="OptionsButton" type="Button" parent="MarginContainer/VBoxContainer"]
[node name="OptionsButton" type="Button" parent="MarginContainer/CenterContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_top = NodePath("../GalleryButton")
@@ -76,10 +126,24 @@ focus_neighbor_bottom = NodePath("../QuitButton")
focus_next = NodePath("../QuitButton")
focus_previous = NodePath("../GalleryButton")
theme_override_colors/font_focus_color = Color(0.976471, 0.827451, 0, 1)
theme_override_fonts/font = ExtResource("2_dftre")
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = ExtResource("2_2ijnm")
theme_override_styles/disabled_mirrored = ExtResource("3_dftre")
theme_override_styles/disabled = ExtResource("3_dftre")
theme_override_styles/hover_pressed_mirrored = ExtResource("3_dftre")
theme_override_styles/hover_pressed = ExtResource("3_dftre")
theme_override_styles/hover_mirrored = ExtResource("3_dftre")
theme_override_styles/hover = ExtResource("3_dftre")
theme_override_styles/pressed_mirrored = ExtResource("3_dftre")
theme_override_styles/pressed = ExtResource("3_dftre")
theme_override_styles/normal_mirrored = ExtResource("3_dftre")
theme_override_styles/normal = ExtResource("3_dftre")
shortcut = ExtResource("2_7fwjx")
text = "Options"
alignment = 0
[node name="QuitButton" type="Button" parent="MarginContainer/VBoxContainer"]
[node name="QuitButton" type="Button" parent="MarginContainer/CenterContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_top = NodePath("../OptionsButton")
@@ -87,6 +151,20 @@ focus_neighbor_bottom = NodePath(".")
focus_next = NodePath(".")
focus_previous = NodePath("../OptionsButton")
theme_override_colors/font_focus_color = Color(0.976471, 0.827451, 0, 1)
theme_override_fonts/font = ExtResource("2_dftre")
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = ExtResource("2_2ijnm")
theme_override_styles/disabled_mirrored = ExtResource("3_dftre")
theme_override_styles/disabled = ExtResource("3_dftre")
theme_override_styles/hover_pressed_mirrored = ExtResource("3_dftre")
theme_override_styles/hover_pressed = ExtResource("3_dftre")
theme_override_styles/hover_mirrored = ExtResource("3_dftre")
theme_override_styles/hover = ExtResource("3_dftre")
theme_override_styles/pressed_mirrored = ExtResource("3_dftre")
theme_override_styles/pressed = ExtResource("3_dftre")
theme_override_styles/normal_mirrored = ExtResource("3_dftre")
theme_override_styles/normal = ExtResource("3_dftre")
shortcut = ExtResource("2_7fwjx")
text = "Quit
"
alignment = 0

View File

@@ -61,4 +61,3 @@ unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_jiqgw")
}
autoplay = "intro"

View File

@@ -55,6 +55,7 @@ grow_vertical = 2
script = ExtResource("1_yn75n")
[node name="CenterContainer" type="CenterContainer" parent="."]
custom_minimum_size = Vector2(400, 400)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
@@ -63,13 +64,13 @@ grow_horizontal = 2
grow_vertical = 2
[node name="SubViewportContainer" type="SubViewportContainer" parent="CenterContainer"]
custom_minimum_size = Vector2(350, 300)
custom_minimum_size = Vector2(450, 400)
layout_mode = 2
[node name="SubViewport" type="SubViewport" parent="CenterContainer/SubViewportContainer"]
transparent_bg = true
handle_input_locally = false
size = Vector2i(350, 300)
size = Vector2i(400, 350)
render_target_update_mode = 4
[node name="MinimapCamera" type="Camera3D" parent="CenterContainer/SubViewportContainer/SubViewport"]
@@ -84,24 +85,26 @@ size = 100.0
near = 0.001
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/SubViewportContainer/SubViewport"]
anchors_preset = 15
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 200
theme_override_constants/margin_top = 200
offset_left = -190.0
offset_top = -48.0
grow_horizontal = 0
grow_vertical = 0
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="Control" type="Control" parent="CenterContainer/SubViewportContainer/SubViewport/MarginContainer"]
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/SubViewportContainer/SubViewport/MarginContainer"]
layout_mode = 2
[node name="LayerText" type="Label" parent="CenterContainer/SubViewportContainer/SubViewport/MarginContainer/Control"]
[node name="LayerText" type="Label" parent="CenterContainer/SubViewportContainer/SubViewport/MarginContainer/HBoxContainer"]
custom_minimum_size = Vector2(80, 15)
layout_mode = 2
offset_left = -14.0
offset_top = 26.0
offset_right = 136.0
offset_bottom = 68.0
size_flags_vertical = 6
theme = SubResource("Theme_75ec6")
theme_override_colors/font_color = Color(0.792157, 0.698039, 0.643137, 1)
@@ -114,14 +117,10 @@ text = "LAYER"
label_settings = SubResource("LabelSettings_yn75n")
vertical_alignment = 2
[node name="LayerNumberText" type="Label" parent="CenterContainer/SubViewportContainer/SubViewport/MarginContainer/Control"]
[node name="LayerNumberText" type="Label" parent="CenterContainer/SubViewportContainer/SubViewport/MarginContainer/HBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(80, 15)
layout_mode = 2
offset_left = 79.0
offset_top = 22.0
offset_right = 159.0
offset_bottom = 74.0
theme = SubResource("Theme_qgswn")
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_shadow_color = Color(1, 1, 1, 0.027451)

View File

@@ -10340,8 +10340,6 @@ animations = [{
collision_layer = 802
collision_mask = 775
script = ExtResource("1_xcol5")
HealthTimerIsActive = true
AutoRevive = true
[node name="MainCollision" type="CollisionShape3D" parent="."]
unique_name_in_owner = true

View File

@@ -38,29 +38,29 @@ public partial class InGameUI : Control, IInGameUI
public void Setup()
{
InGameUILogic = new InGameUILogic();
InGameUILogic.Set(_gameRepo);
InGameUILogic = new InGameUILogic();
InGameUILogic.Set(_gameRepo);
}
public void OnResolved()
{
InGameUILogicBinding = InGameUILogic.Bind();
InGameUILogicBinding = InGameUILogic.Bind();
InGameUILogicBinding
.Handle((in InGameUILogic.Output.AnnounceMessageOnMainScreen output) => { InventoryMessageUI.DisplayMessage(output.Message); })
.Handle((in InGameUILogic.Output.AnnounceMessageInInventory output) => { })
.Handle((in InGameUILogic.Output.RemoveItemFromInventory output) => { })
.Handle((in InGameUILogic.Output.ShowInventory _) => { InventoryMenu.Show(); InventoryMenu.SetProcessInput(true); })
.Handle((in InGameUILogic.Output.HideInventory _) => { CloseInventory(); });
InGameUILogicBinding
.Handle((in InGameUILogic.Output.AnnounceMessageOnMainScreen output) => { InventoryMessageUI.DisplayMessage(output.Message); })
.Handle((in InGameUILogic.Output.AnnounceMessageInInventory output) => { })
.Handle((in InGameUILogic.Output.RemoveItemFromInventory output) => { })
.Handle((in InGameUILogic.Output.ShowInventory _) => { InventoryMenu.Show(); InventoryMenu.SetProcessInput(true); })
.Handle((in InGameUILogic.Output.HideInventory _) => { CloseInventory(); });
DebugInfo.Visible = DebugMenu.DebugOverlayVisible;
DebugInfo.Visible = DebugMenu.DebugOverlayVisible;
InGameUILogic.Start();
InGameUILogic.Start();
}
public void CloseInventory()
{
InventoryMenu.Hide();
InventoryMenu.SetProcessInput(false);
InventoryMenu.Hide();
InventoryMenu.SetProcessInput(false);
}
}

View File

@@ -1,18 +1,17 @@
[gd_scene load_steps=12 format=3 uid="uid://b1muxus5qdbeu"]
[gd_scene load_steps=12 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="PackedScene" uid="uid://bwbofurcvf3yh" path="res://src/minimap/Minimap.tscn" id="2_6sfje"]
[ext_resource type="PackedScene" uid="uid://t22s2y1t8ktc" path="res://src/debug/DebugInfo.tscn" id="2_f0tui"]
[ext_resource type="PackedScene" uid="uid://t22s2y1t8ktc" 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://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://8f3dk16nj0dn" path="res://src/menu/DebugMenu.tscn" id="7_llomk"]
[ext_resource type="Texture2D" uid="uid://bj4p4qxb1mj3q" path="res://src/ui/player_ui/Assets/panel rough draft.png" id="7_ur8ag"]
[ext_resource type="PackedScene" uid="uid://c3e6hbctay1us" path="res://src/ui/inventory_menu/InventoryMenu.tscn" id="9_ur8ag"]
[ext_resource type="Texture2D" uid="uid://dnt8myee0ju3v" path="res://src/ui/UI Front with Transparency.png" id="9_f46co"]
[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"]
[sub_resource type="StyleBoxLine" id="StyleBoxLine_ur8ag"]
color = Color(0.792157, 0.698039, 0.643137, 1)
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_higkc"]
[node name="InGameUI" type="Control"]
process_mode = 3
@@ -76,17 +75,36 @@ visible = false
custom_minimum_size = Vector2(1440, 1080)
layout_mode = 2
[node name="Panel" type="ColorRect" parent="HBoxContainer"]
custom_minimum_size = Vector2(480, 0)
layout_mode = 2
[node name="InventoryMenu" parent="." instance=ExtResource("9_ur8ag")]
unique_name_in_owner = true
layout_mode = 1
[node name="MinimapZone" type="Panel" parent="HBoxContainer/Panel"]
layout_mode = 2
offset_top = 14.0
offset_right = 480.0
offset_bottom = 14.0
[node name="ItemRescueMenu" parent="." instance=ExtResource("10_higkc")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="MiniMap" parent="HBoxContainer/Panel/MinimapZone" instance=ExtResource("2_6sfje")]
[node name="Sidebar Container" type="PanelContainer" parent="."]
custom_minimum_size = Vector2(459, 0)
layout_mode = 1
anchors_preset = 11
anchor_left = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 0
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxEmpty_higkc")
[node name="MinimapContainer" type="MarginContainer" parent="Sidebar Container"]
layout_mode = 2
theme_override_constants/margin_left = 15
theme_override_constants/margin_top = 0
[node name="MinimapZone" type="Panel" parent="Sidebar Container/MinimapContainer"]
layout_mode = 2
size_flags_vertical = 3
[node name="MiniMap" parent="Sidebar Container/MinimapContainer/MinimapZone" instance=ExtResource("2_6sfje")]
unique_name_in_owner = true
custom_minimum_size = Vector2(50, 50)
layout_mode = 2
@@ -100,55 +118,26 @@ offset_top = 354.0
offset_right = 423.0
offset_bottom = 620.0
[node name="HSeparator2" type="HSeparator" parent="HBoxContainer/Panel/MinimapZone"]
[node name="Sidebar Texture" type="TextureRect" parent="Sidebar Container"]
layout_mode = 2
offset_left = 78.0
offset_top = 716.0
offset_right = 370.0
offset_bottom = 722.0
theme_override_styles/separator = SubResource("StyleBoxLine_ur8ag")
texture = ExtResource("9_f46co")
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_bottom = 1072.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("7_ur8ag")
stretch_mode = 4
[node name="PlayerInfoContainer" type="MarginContainer" parent="Sidebar Container"]
layout_mode = 2
theme_override_constants/margin_left = 50
theme_override_constants/margin_top = 200
[node name="PlayerInfoUI" parent="HBoxContainer/Panel" instance=ExtResource("4_46s5l")]
[node name="PlayerInfoUI" parent="Sidebar Container/PlayerInfoContainer" instance=ExtResource("4_46s5l")]
unique_name_in_owner = true
layout_mode = 2
anchors_preset = 0
offset_left = 29.0
offset_top = 197.0
offset_right = 29.0
offset_bottom = -746.0
[node name="HSeparator" type="HSeparator" parent="HBoxContainer/Panel"]
layout_mode = 2
offset_left = 99.0
offset_top = 326.0
offset_right = 391.0
offset_bottom = 332.0
theme_override_styles/separator = SubResource("StyleBoxLine_ur8ag")
[node name="Sigil Marker" type="ReferenceRect" parent="HBoxContainer/Panel"]
layout_mode = 2
offset_left = 75.0
offset_top = 813.0
offset_right = 267.0
offset_bottom = 1004.0
size_flags_vertical = 3
[node name="InventoryMenu" parent="." instance=ExtResource("9_ur8ag")]
unique_name_in_owner = true
layout_mode = 1
[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="ItemRescueMenu" parent="." instance=ExtResource("10_higkc")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="ReferenceRect" type="ReferenceRect" parent="Sidebar Container/SigilContainer"]
layout_mode = 2

View File

@@ -2,6 +2,7 @@ using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using System;
using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
[Meta(typeof(IAutoNode))]
@@ -13,6 +14,8 @@ public partial class ActionPanel : Panel
[Dependency] private IPlayer _player => this.DependOn<IPlayer>();
[Dependency] private IGame _game => this.DependOn<IGame>();
[Node] public Button InteractButton { get; set; }
[Node] public Button ThrowButton { get; set; }
@@ -21,6 +24,10 @@ public partial class ActionPanel : Panel
public event Action ActionPanelClosing;
public event Action ReturnToGameAction;
public event Action AugmentMenuRequested;
public void OnResolved()
{
InteractButton.Pressed += InteractButton_Pressed;
@@ -39,22 +46,45 @@ public partial class ActionPanel : Panel
{
InteractButton.GrabFocus();
}
public void HideActionPanel()
{
InteractButton.Disabled = false;
ThrowButton.Disabled = false;
DropButton.Disabled = false;
ThrowButton.FocusMode = FocusModeEnum.All;
DropButton.FocusMode = FocusModeEnum.All;
ActionPanelClosing?.Invoke();
}
public override void _Input(InputEvent @event)
{
if (Visible && Input.IsActionJustPressed(GameInputs.Interact))
{
GetViewport().SetInputAsHandled();
HideActionPanel();
}
}
private void InteractButton_Pressed()
{
if (_currentlySelected is IEquipableItem equipable)
PerformAction(equipable);
_currentlySelected = null;
ActionPanelClosing?.Invoke();
PerformAction((dynamic)_currentlySelected);
}
private void ThrowButton_Pressed()
{
throw new System.NotImplementedException();
_game.ThrowItem(_currentlySelected);
_currentlySelected = null;
ActionPanelClosing?.Invoke();
ReturnToGameAction?.Invoke();
}
private void DropButton_Pressed()
{
throw new System.NotImplementedException();
_game.DropItem(_currentlySelected);
_currentlySelected = null;
ActionPanelClosing?.Invoke();
ReturnToGameAction?.Invoke();
}
private void SetOptions(IBaseInventoryItem item)
@@ -62,12 +92,24 @@ public partial class ActionPanel : Panel
SetOptionsInternal((dynamic)item);
}
private void ResetActionPanel()
{
InteractButton.Disabled = false;
ThrowButton.Disabled = false;
DropButton.Disabled = false;
ThrowButton.FocusMode = FocusModeEnum.All;
DropButton.FocusMode = FocusModeEnum.All;
}
private void SetOptionsInternal(IEquipableItem equipable)
{
InteractButton.Text = _player.EquipmentComponent.IsItemEquipped(equipable) ? "Unequip" : "Equip";
var isItemEquipped = _player.EquipmentComponent.IsItemEquipped(equipable);
InteractButton.Text = isItemEquipped ? "Unequip" : "Equip";
InteractButton.Disabled = equipable.Glued;
ThrowButton.Disabled = equipable.Glued;
DropButton.Disabled = equipable.Glued;
ThrowButton.Disabled = equipable.Glued || isItemEquipped;
DropButton.Disabled = equipable.Glued || isItemEquipped;
ThrowButton.FocusMode = ThrowButton.Disabled ? FocusModeEnum.None : FocusModeEnum.All;
DropButton.FocusMode = DropButton.Disabled ? FocusModeEnum.None : FocusModeEnum.All;
}
private void SetOptionsInternal(IAugmentItem equipable)
@@ -92,5 +134,32 @@ public partial class ActionPanel : Panel
_player.EquipmentComponent.Equip(equipable);
SfxDatabase.Instance.Play(SoundEffect.Equip);
}
_currentlySelected = null;
ActionPanelClosing?.Invoke();
}
private void PerformAction(Plastique plastique)
{
SfxDatabase.Instance.Play(SoundEffect.SelectUI);
_game.SetItem(plastique);
_currentlySelected = null;
ActionPanelClosing?.Invoke();
ReturnToGameAction?.Invoke();
}
private void PerformAction(Jewel jewel)
{
SfxDatabase.Instance.Play(SoundEffect.SelectUI);
ActionPanelClosing?.Invoke();
AugmentMenuRequested?.Invoke();
}
private void PerformAction(IBaseInventoryItem item)
{
SfxDatabase.Instance.Play(SoundEffect.SelectUI);
_game.UseItem(item);
_currentlySelected = null;
ActionPanelClosing?.Invoke();
}
}

View File

@@ -10,6 +10,7 @@ bg_color = Color(0, 0, 0, 0.745098)
[node name="ActionPanel" type="Panel"]
custom_minimum_size = Vector2(200, 200)
focus_mode = 2
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_g7ag1")
script = ExtResource("1_r13ox")

View File

@@ -0,0 +1,106 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
[Meta(typeof(IAutoNode))]
public partial class AugmentableItemsMenu : Control
{
public override void _Notification(int what) => this.Notify(what);
[Dependency] private IPlayer _player => this.DependOn<IPlayer>();
[Node] public VBoxContainer Inventory { get; set; }
[Node] public Button CancelAugmentButton { get; set; }
[Node] public Button ConfirmAugmentButton { get; set; }
[Node] public Control ConfirmAugmentContainer { get; set; }
private List<IItemSlot> ItemSlots;
private IItemSlot _currentlySelected;
private IAugmentItem _augmentingItem;
public event Action AugmentMenuClosing;
public void OnResolved()
{
ItemSlots = [.. Inventory.GetChildren().OfType<IItemSlot>()];
ItemSlots.ForEach(x => x.ItemPressed += ItemPressed);
ItemSlots.ForEach(x => x.ItemSelected += ItemSelected);
CancelAugmentButton.Pressed += CancelAugmentButton_Pressed;
ConfirmAugmentButton.Pressed += ConfirmAugmentButton_Pressed;
}
private void ConfirmAugmentButton_Pressed()
{
_player.ApplyNewAugment(_augmentingItem, _currentlySelected.Item.Value as IAugmentableItem);
ConfirmAugmentContainer.Hide();
AugmentMenuClosing?.Invoke();
SfxDatabase.Instance.Play(SoundEffect.SelectUI);
}
private void CancelAugmentButton_Pressed()
{
CloseAugmentMenu();
}
private void CloseAugmentMenu()
{
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
ConfirmAugmentContainer.Hide();
AugmentMenuClosing?.Invoke();
}
public void OpenAugmentMenu(IAugmentItem augmentingItem)
{
_augmentingItem = augmentingItem;
var inventory = _player.Inventory.Items;
ItemSlots.ForEach(x => x.SetEmpty());
var slotIndex = 0;
foreach (var item in inventory)
{
if (item is IAugmentableItem augmentable && augmentable.Augment == null)
ItemSlots[slotIndex++].SetItemToSlot(item);
}
Show();
ItemSlots.First().FocusItem();
}
public override void _Input(InputEvent @event)
{
if (Visible && Input.IsActionJustPressed(GameInputs.Interact))
{
GetViewport().SetInputAsHandled();
if (ConfirmAugmentContainer.Visible)
{
if (ConfirmAugmentButton.HasFocus())
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
CancelAugmentButton.GrabFocus();
}
else
CloseAugmentMenu();
}
}
private void ItemSelected(IItemSlot selectedItem)
{
_currentlySelected = selectedItem;
}
private void ItemPressed(IItemSlot slot)
{
ConfirmAugmentContainer.Show();
ConfirmAugmentButton.GrabFocus();
}
}

View File

@@ -0,0 +1 @@
uid://brtic4hw6thox

View File

@@ -0,0 +1,245 @@
[gd_scene load_steps=11 format=3 uid="uid://tpqh7q0xh63c"]
[ext_resource type="PackedScene" uid="uid://c005nd0m2eim" path="res://src/ui/inventory_menu/ItemSlot.tscn" id="1_a5r0f"]
[ext_resource type="Script" uid="uid://brtic4hw6thox" path="res://src/ui/inventory_menu/AugmentableItemsMenu.cs" id="1_ukqf2"]
[ext_resource type="FontFile" uid="uid://beh6d5lo5ihq0" path="res://src/ui/fonts/georgiai.ttf" id="2_ukqf2"]
[ext_resource type="FontFile" uid="uid://0syyay37admf" path="res://src/ui/fonts/georgiab.ttf" id="3_qtvkp"]
[ext_resource type="StyleBox" uid="uid://bxuy4tnftibfq" path="res://src/options/SelectedOptionsBox.tres" id="4_p84pf"]
[ext_resource type="StyleBox" uid="uid://bl15q835s4ene" path="res://src/options/UnselectedOptionsBox.tres" id="5_rxojm"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_l0byb"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7co7g"]
bg_color = Color(0, 0, 0, 0.745098)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_unikd"]
bg_color = Color(0, 0, 0, 1)
[sub_resource type="LabelSettings" id="LabelSettings_unikd"]
line_spacing = 1.0
font = ExtResource("2_ukqf2")
font_size = 40
outline_size = 3
outline_color = Color(0, 0, 0, 1)
[node name="AugmentMenu" type="Panel"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxEmpty_l0byb")
script = ExtResource("1_ukqf2")
[node name="CenterContainer2" type="CenterContainer" parent="."]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -400.0
offset_right = 400.0
offset_bottom = 1025.0
grow_horizontal = 2
[node name="AugmentableItemsList" type="PanelContainer" parent="CenterContainer2"]
unique_name_in_owner = true
custom_minimum_size = Vector2(800, 1025)
layout_mode = 2
[node name="Panel" type="Panel" parent="CenterContainer2/AugmentableItemsList"]
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_7co7g")
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer2/AugmentableItemsList/Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="ReferenceRect" type="ReferenceRect" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer"]
layout_mode = 2
border_color = Color(1, 1, 1, 1)
editor_only = false
[node name="MarginContainer2" type="MarginContainer" parent="CenterContainer2/AugmentableItemsList/Panel"]
layout_mode = 2
offset_right = 800.0
offset_bottom = 1050.0
theme_override_constants/margin_left = 25
theme_override_constants/margin_top = 15
theme_override_constants/margin_right = 25
theme_override_constants/margin_bottom = 15
[node name="Inventory" type="VBoxContainer" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
theme_override_constants/separation = 0
[node name="AugmentableSlot" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot2" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot3" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot4" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot5" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot6" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot7" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot8" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot9" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot10" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot11" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot12" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot13" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot14" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot15" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot16" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot17" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot18" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot19" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="AugmentableSlot20" parent="CenterContainer2/AugmentableItemsList/Panel/MarginContainer2/Inventory" instance=ExtResource("1_a5r0f")]
layout_mode = 2
[node name="ConfirmAugmentContainer" type="Panel" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="CenterContainer" type="CenterContainer" parent="ConfirmAugmentContainer"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -40.0
grow_horizontal = 2
grow_vertical = 2
[node name="PanelContainer" type="PanelContainer" parent="ConfirmAugmentContainer/CenterContainer"]
layout_mode = 2
[node name="Panel" type="Panel" parent="ConfirmAugmentContainer/CenterContainer/PanelContainer"]
custom_minimum_size = Vector2(400, 250)
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_unikd")
[node name="MarginContainer" type="MarginContainer" parent="ConfirmAugmentContainer/CenterContainer/PanelContainer"]
layout_mode = 2
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="ReferenceRect" type="ReferenceRect" parent="ConfirmAugmentContainer/CenterContainer/PanelContainer/MarginContainer"]
layout_mode = 2
border_color = Color(1, 1, 1, 1)
editor_only = false
[node name="CenterContainer" type="CenterContainer" parent="ConfirmAugmentContainer/CenterContainer/PanelContainer"]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="ConfirmAugmentContainer/CenterContainer/PanelContainer/CenterContainer"]
layout_mode = 2
theme_override_constants/separation = 25
[node name="Label" type="Label" parent="ConfirmAugmentContainer/CenterContainer/PanelContainer/CenterContainer/VBoxContainer"]
layout_mode = 2
text = "Augment Item?"
label_settings = SubResource("LabelSettings_unikd")
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="ConfirmAugmentContainer/CenterContainer/PanelContainer/CenterContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 20
alignment = 1
[node name="CancelAugmentButton" type="Button" parent="ConfirmAugmentContainer/CenterContainer/PanelContainer/CenterContainer/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_left = NodePath(".")
focus_neighbor_top = NodePath(".")
focus_neighbor_right = NodePath("../ConfirmAugmentButton")
focus_neighbor_bottom = NodePath(".")
theme_override_fonts/font = ExtResource("3_qtvkp")
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = ExtResource("4_p84pf")
theme_override_styles/disabled_mirrored = ExtResource("5_rxojm")
theme_override_styles/disabled = ExtResource("5_rxojm")
theme_override_styles/hover_pressed_mirrored = ExtResource("5_rxojm")
theme_override_styles/hover_pressed = ExtResource("5_rxojm")
theme_override_styles/hover_mirrored = ExtResource("5_rxojm")
theme_override_styles/hover = ExtResource("5_rxojm")
theme_override_styles/pressed_mirrored = ExtResource("5_rxojm")
theme_override_styles/pressed = ExtResource("5_rxojm")
theme_override_styles/normal_mirrored = ExtResource("5_rxojm")
theme_override_styles/normal = ExtResource("5_rxojm")
text = "Cancel"
[node name="ConfirmAugmentButton" type="Button" parent="ConfirmAugmentContainer/CenterContainer/PanelContainer/CenterContainer/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_left = NodePath("../CancelAugmentButton")
focus_neighbor_top = NodePath(".")
focus_neighbor_right = NodePath(".")
focus_neighbor_bottom = NodePath(".")
theme_override_fonts/font = ExtResource("3_qtvkp")
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = ExtResource("4_p84pf")
theme_override_styles/disabled_mirrored = ExtResource("5_rxojm")
theme_override_styles/disabled = ExtResource("5_rxojm")
theme_override_styles/hover_pressed_mirrored = ExtResource("5_rxojm")
theme_override_styles/hover_pressed = ExtResource("5_rxojm")
theme_override_styles/hover_mirrored = ExtResource("5_rxojm")
theme_override_styles/hover = ExtResource("5_rxojm")
theme_override_styles/pressed_mirrored = ExtResource("5_rxojm")
theme_override_styles/pressed = ExtResource("5_rxojm")
theme_override_styles/normal_mirrored = ExtResource("5_rxojm")
theme_override_styles/normal = ExtResource("5_rxojm")
text = "Confirm"

View File

@@ -27,8 +27,14 @@ public partial class InventoryMenu : Control, IInventoryMenu
[Node] public VBoxContainer Inventory { get; set; }
[Node] public Control MenuPanel { get; set; }
[Node] public AugmentableItemsMenu AugmentMenu { get; set; }
private List<IItemSlot> ItemSlots;
private IItemSlot _currentlySelected;
public void OnResolved()
{
ItemSlots = [.. Inventory.GetChildren().OfType<IItemSlot>()];
@@ -36,16 +42,51 @@ public partial class InventoryMenu : Control, IInventoryMenu
ItemSlots.ForEach(x => x.ItemSelected += ItemSelected);
VisibilityChanged += ResetInventoryState;
ActionPanel.ActionPanelClosing += ActionPanel_ActionPanelClosing;
ActionPanel.ReturnToGameAction += ActionPanel_ReturnToGameAction;
ActionPanel.AugmentMenuRequested += ActionPanel_AugmentMenuRequested;
AugmentMenu.AugmentMenuClosing += AugmentMenu_AugmentMenuClosing;
AugmentMenu.FocusMode = FocusModeEnum.None;
ClearDescriptionBox();
}
public override void _Input(InputEvent @event)
{
if (Input.IsActionJustPressed(GameInputs.MoveUp) && _currentlySelected != ItemSlots.First())
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
if (Input.IsActionJustPressed(GameInputs.MoveDown) && _currentlySelected != ItemSlots.Last(x => x.Item.Value != null))
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
}
private void ActionPanel_AugmentMenuRequested()
{
ReleaseFocus();
ItemSlots.ForEach(x => x.ItemPressed -= ItemPressed);
ItemSlots.ForEach(x => x.ItemSelected -= ItemSelected);
MenuPanel.Hide();
MenuPanel.FocusMode = FocusModeEnum.None;
AugmentMenu.FocusMode = FocusModeEnum.All;
SetProcessInput(false);
AugmentMenu.SetProcessInput(true);
AugmentMenu.OpenAugmentMenu(_currentlySelected.Item.Value as IAugmentItem);
}
private void ActionPanel_ReturnToGameAction()
{
_gameRepo.CloseInventory();
}
private void ItemPressed(IItemSlot selectedItem)
{
SetProcessInput(false);
ActionPanel.SetProcessInput(true);
ActionPanel.ShowPanel(selectedItem.Item.Value);
ActionPanel.FocusActionPanel();
SfxDatabase.Instance.Play(SoundEffect.SelectUI);
}
private void ItemSelected(IItemSlot selectedItem)
{
_currentlySelected = selectedItem;
ItemName.Text = selectedItem.Item.Value.ItemName;
ItemFlavor.Text = selectedItem.Item.Value.Description;
}
@@ -54,217 +95,45 @@ public partial class InventoryMenu : Control, IInventoryMenu
{
var inventory = _player.Inventory.Items;
ItemSlots.ForEach(x => x.SetEmpty());
ClearDescriptionBox();
for (var i = 0; i < inventory.Count; i++)
ItemSlots[i].SetItemToSlot(inventory[i]);
if (_currentlySelected == null && inventory.Any())
_currentlySelected = ItemSlots.First();
if (inventory.Any())
ItemSlots.First().FocusItem();
_currentlySelected.FocusItem();
ActionPanel.Hide();
}
private void ClearDescriptionBox()
{
ItemName.Text = string.Empty;
ItemFlavor.Text = string.Empty;
ItemStats.Text = string.Empty;
}
private void ActionPanel_ActionPanelClosing()
{
ActionPanel.Hide();
SetProcessInput(true);
ActionPanel.SetProcessInput(false);
if (!_player.Inventory.Items.Contains(_currentlySelected.Item.Value))
_currentlySelected = null;
ResetInventoryState();
}
private void Slot_FocusEntered(IItemSlot slot)
private void AugmentMenu_AugmentMenuClosing()
{
var item = slot.Item.Value;
ItemName.Text = item.ItemName;
ItemFlavor.Text = item.Description;
}
private void InteractButton_Pressed()
{
//if (_currentlySelected != null)
//{
// var item = _currentlySelected.Item.Value;
// if (_augmentMode)
// {
// _player.ApplyNewAugment(_augmentingJewel, item as EquipableItem);
// _augmentMode = false;
// ResetInventoryState();
// }
// else if (item is EquipableItem equipable)
// {
// if (_player.EquipmentComponent.IsItemEquipped(equipable))
// _player.Unequip(equipable);
// else
// {
// _player.Equip(equipable);
// }
// ResetInventoryState();
// }
// else if (item is Plastique plastique)
// {
// _game.SetItem(plastique);
// ResetInventoryState();
// }
// else if (item is Jewel jewel)
// {
// _augmentMode = true;
// AugmentMode(jewel);
// }
// else
// {
// _game.UseItem(_currentlySelected.Item.Value);
// ResetInventoryState();
// }
// CloseActionMenu();
//}
}
private void DropButton_Pressed()
{
//var previousItemInList = Mathf.Max(0, ItemSlots.IndexOf(_currentlySelected) - 1);
//_game.DropItem(_currentlySelected.Item.Value);
//CloseActionMenu();
//_gameRepo.CloseInventory();
//if (_currentlySelected != null && !_player.Inventory.Items.Contains(_currentlySelected.Item.Value))
// _currentlySelected = ItemSlots[previousItemInList];
}
private void ThrowButton_Pressed()
{
//var previousItemInList = Mathf.Max(0, ItemSlots.IndexOf(_currentlySelected) - 1);
//_game.ThrowItem(_currentlySelected.Item.Value);
//CloseActionMenu();
//_gameRepo.CloseInventory();
//if (_currentlySelected != null && !_player.Inventory.Items.Contains(_currentlySelected.Item.Value))
// _currentlySelected = ItemSlots[previousItemInList];
}
public override void _Input(InputEvent @event)
{
//if (ActionPanel.Visible && Input.IsActionJustPressed(GameInputs.Interact))
//{
// CloseActionMenu();
// SfxDatabase.Instance.Play(SoundEffect.CancelUI);
// GetViewport().SetInputAsHandled();
//}
//else if (_augmentMode && !ActionPanel.Visible && Input.IsActionJustPressed(GameInputs.Interact))
//{
// GetViewport().SetInputAsHandled();
// _augmentMode = false;
// SfxDatabase.Instance.Play(SoundEffect.CancelUI);
// ResetInventoryState();
//}
//if (!ActionPanel.Visible && Input.IsActionJustPressed(GameInputs.MoveUp))
//{
// if (ItemSlots.First(x => x.Visible) != _currentlySelected)
// SfxDatabase.Instance.Play(SoundEffect.MoveUI);
//}
//if (!ActionPanel.Visible && Input.IsActionJustPressed(GameInputs.MoveDown))
//{
// if (ItemSlots.Last(x => x.Visible) != _currentlySelected)
// SfxDatabase.Instance.Play(SoundEffect.MoveUI);
//}
//if (Input.IsActionJustPressed(GameInputs.MoveDown) && ActionPanel.Visible && InteractButton.HasFocus() && !ThrowButton.Disabled)
// SfxDatabase.Instance.Play(SoundEffect.MoveUI);
//if (Input.IsActionJustPressed(GameInputs.MoveDown) && ActionPanel.Visible && ThrowButton.HasFocus() && !DropButton.Disabled)
// SfxDatabase.Instance.Play(SoundEffect.MoveUI);
//if (Input.IsActionJustPressed(GameInputs.MoveUp) && ActionPanel.Visible && ThrowButton.HasFocus() && !InteractButton.Disabled)
// SfxDatabase.Instance.Play(SoundEffect.MoveUI);
//if (Input.IsActionJustPressed(GameInputs.MoveUp) && ActionPanel.Visible && DropButton.HasFocus() && !ThrowButton.Disabled)
// SfxDatabase.Instance.Play(SoundEffect.MoveUI);
//if (!ActionPanel.Visible && Input.IsActionJustPressed(GameInputs.InventorySort))
//{
// _player.Inventory.Sort(_player.EquipmentComponent.EquippedWeapon.Value, _player.EquipmentComponent.EquippedArmor.Value, _player.EquipmentComponent.EquippedAccessory.Value, _player.EquipmentComponent.EquippedAmmo.Value);
// SfxDatabase.Instance.Play(SoundEffect.SortInventory);
// ResetInventoryState();
//}
}
private void Slot_ItemPressed(IItemSlot slot)
{
//var item = slot.Item.Value;
//InteractButton.Disabled = false;
//ThrowButton.Disabled = false;
//DropButton.Disabled = false;
//InteractButton.FocusMode = FocusModeEnum.All;
//ThrowButton.FocusMode = FocusModeEnum.All;
//DropButton.FocusMode = FocusModeEnum.All;
//if (_augmentMode)
//{
// InteractButton.Text = "Augment";
// ThrowButton.Disabled = true;
// DropButton.Disabled = true;
// InteractButton.GrabFocus();
//}
//else if (item is IEquipableItem equipable)
//{
// var itemIsEquipped = _player.EquipmentComponent.IsItemEquipped(equipable);
// InteractButton.Text = itemIsEquipped ? "Unequip" : "Equip";
// ThrowButton.Disabled = itemIsEquipped;
// ThrowButton.FocusMode = itemIsEquipped ? FocusModeEnum.None : FocusModeEnum.All;
// DropButton.Disabled = itemIsEquipped;
// DropButton.FocusMode = itemIsEquipped ? FocusModeEnum.None : FocusModeEnum.All;
// InteractButton.GrabFocus();
// if ((item is Weapon weapon && _player.EquipmentComponent.EquippedWeapon.Value.Glued) ||
// (item is Armor && _player.EquipmentComponent.EquippedArmor.Value.Glued) ||
// (item is Accessory && _player.EquipmentComponent.EquippedAccessory.Value.Glued))
// {
// InteractButton.Disabled = true;
// InteractButton.FocusMode = FocusModeEnum.None;
// ThrowButton.GrabFocus();
// }
//}
//else if (item is Plastique plastique)
//{
// InteractButton.Text = "Set";
// InteractButton.GrabFocus();
//}
//else if (item is ThrowableItem throwable)
//{
// InteractButton.Disabled = true;
// InteractButton.FocusMode = FocusModeEnum.None;
// ThrowButton.GrabFocus();
//}
//else if (item is Jewel jewel)
//{
// InteractButton.Text = "Augment";
// InteractButton.GrabFocus();
//}
//else
//{
// InteractButton.Text = "Use";
// InteractButton.GrabFocus();
//}
//ActionPanel.Show();
}
private void AugmentMode(Jewel jewel)
{
//_augmentingJewel = jewel;
//foreach (var item in ItemSlots)
//{
// item.Disabled = true;
// item.FocusMode = FocusModeEnum.None;
// if (item.Item.Value is EquipableItem equipable && equipable is not Ammo && equipable.Augment == null)
// {
// item.Disabled = false;
// item.FocusMode = FocusModeEnum.All;
// }
//}
//var itemToSelect = ItemSlots.First(x => !x.Disabled);
//itemToSelect.GrabFocus();
}
private void CloseActionMenu()
{
//if (_currentlySelected != null)
// _currentlySelected.GrabFocus();
//ActionPanel.Hide();
ItemSlots.ForEach(x => x.ItemPressed += ItemPressed);
ItemSlots.ForEach(x => x.ItemSelected += ItemSelected);
MenuPanel.Show();
MenuPanel.FocusMode = FocusModeEnum.All;
AugmentMenu.FocusMode = FocusModeEnum.None;
SetProcessInput(true);
AugmentMenu.SetProcessInput(false);
AugmentMenu.Hide();
ResetInventoryState();
}
}

View File

@@ -1,12 +1,10 @@
[gd_scene load_steps=19 format=3 uid="uid://cbxw70qa7gifp"]
[gd_scene load_steps=15 format=3 uid="uid://cbxw70qa7gifp"]
[ext_resource type="Script" uid="uid://yh8qxmn058w2" path="res://src/ui/inventory_menu/InventoryMenu.cs" id="1_unikd"]
[ext_resource type="FontFile" uid="uid://beh6d5lo5ihq0" path="res://src/ui/fonts/georgiai.ttf" id="2_7co7g"]
[ext_resource type="PackedScene" uid="uid://b648lhohtue70" path="res://src/ui/inventory_menu/ActionPanel.tscn" id="3_7co7g"]
[ext_resource type="StyleBox" uid="uid://bxuy4tnftibfq" path="res://src/options/SelectedOptionsBox.tres" id="3_b6rkr"]
[ext_resource type="StyleBox" uid="uid://bl15q835s4ene" path="res://src/options/UnselectedOptionsBox.tres" id="4_l0byb"]
[ext_resource type="FontFile" uid="uid://0syyay37admf" path="res://src/ui/fonts/georgiab.ttf" id="6_ldqki"]
[ext_resource type="PackedScene" uid="uid://c005nd0m2eim" path="res://src/ui/inventory_menu/ItemSlot.tscn" id="6_unikd"]
[ext_resource type="PackedScene" uid="uid://tpqh7q0xh63c" path="res://src/ui/inventory_menu/AugmentableItemsMenu.tscn" id="6_xwkpe"]
[ext_resource type="LabelSettings" uid="uid://b6f8ggy3ulonb" path="res://src/ui/label_settings/GeorgiaItalic.tres" id="7_we8a6"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7co7g"]
@@ -33,18 +31,9 @@ outline_color = Color(0, 0, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7co7g"]
bg_color = Color(0, 0, 0, 0.745098)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_unikd"]
bg_color = Color(0, 0, 0, 1)
[sub_resource type="LabelSettings" id="LabelSettings_unikd"]
line_spacing = 1.0
font = ExtResource("2_7co7g")
font_size = 40
outline_size = 3
outline_color = Color(0, 0, 0, 1)
[node name="InventoryMenu" type="PanelContainer"]
process_mode = 2
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
@@ -74,6 +63,7 @@ layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxEmpty_b6rkr")
[node name="MenuPanel" type="Panel" parent="Panel/MarginContainer/PanelContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxEmpty_unikd")
@@ -200,16 +190,16 @@ text = "Text Stats"
label_settings = ExtResource("7_we8a6")
[node name="InventoryList" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel"]
custom_minimum_size = Vector2(500, 100)
custom_minimum_size = Vector2(800, 100)
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -95.0
offset_left = -120.0
offset_top = -515.0
offset_right = 405.0
offset_right = 680.0
offset_bottom = 510.0
grow_horizontal = 2
grow_vertical = 2
@@ -237,11 +227,11 @@ editor_only = false
[node name="MarginContainer2" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel"]
layout_mode = 2
offset_right = 500.0
offset_right = 800.0
offset_bottom = 1050.0
theme_override_constants/margin_left = 15
theme_override_constants/margin_left = 25
theme_override_constants/margin_top = 15
theme_override_constants/margin_right = 15
theme_override_constants/margin_right = 25
theme_override_constants/margin_bottom = 15
[node name="Inventory" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2"]
@@ -310,98 +300,7 @@ layout_mode = 2
[node name="ItemSlot20" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("6_unikd")]
layout_mode = 2
[node name="AugmentItemPanelContainer" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel"]
[node name="AugmentMenu" parent="Panel/MarginContainer/PanelContainer" instance=ExtResource("6_xwkpe")]
unique_name_in_owner = true
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="CenterContainer" type="CenterContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -40.0
grow_horizontal = 2
grow_vertical = 2
[node name="PanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer"]
layout_mode = 2
[node name="Panel" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer/PanelContainer"]
custom_minimum_size = Vector2(400, 250)
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_unikd")
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer/PanelContainer"]
layout_mode = 2
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer/PanelContainer/MarginContainer"]
layout_mode = 2
border_color = Color(1, 1, 1, 1)
editor_only = false
[node name="CenterContainer" type="CenterContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer/PanelContainer"]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer/PanelContainer/CenterContainer"]
layout_mode = 2
theme_override_constants/separation = 25
[node name="Label" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer/PanelContainer/CenterContainer/VBoxContainer"]
layout_mode = 2
text = "Augment Item?"
label_settings = SubResource("LabelSettings_unikd")
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer/PanelContainer/CenterContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 20
alignment = 1
[node name="CancelAugmentButton" type="Button" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer/PanelContainer/CenterContainer/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_fonts/font = ExtResource("6_ldqki")
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = ExtResource("3_b6rkr")
theme_override_styles/disabled_mirrored = ExtResource("4_l0byb")
theme_override_styles/disabled = ExtResource("4_l0byb")
theme_override_styles/hover_pressed_mirrored = ExtResource("4_l0byb")
theme_override_styles/hover_pressed = ExtResource("4_l0byb")
theme_override_styles/hover_mirrored = ExtResource("4_l0byb")
theme_override_styles/hover = ExtResource("4_l0byb")
theme_override_styles/pressed_mirrored = ExtResource("4_l0byb")
theme_override_styles/pressed = ExtResource("4_l0byb")
theme_override_styles/normal_mirrored = ExtResource("4_l0byb")
theme_override_styles/normal = ExtResource("4_l0byb")
text = "Cancel"
[node name="ConfirmAugmentButton" type="Button" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer/PanelContainer/CenterContainer/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_fonts/font = ExtResource("6_ldqki")
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = ExtResource("3_b6rkr")
theme_override_styles/disabled_mirrored = ExtResource("4_l0byb")
theme_override_styles/disabled = ExtResource("4_l0byb")
theme_override_styles/hover_pressed_mirrored = ExtResource("4_l0byb")
theme_override_styles/hover_pressed = ExtResource("4_l0byb")
theme_override_styles/hover_mirrored = ExtResource("4_l0byb")
theme_override_styles/hover = ExtResource("4_l0byb")
theme_override_styles/pressed_mirrored = ExtResource("4_l0byb")
theme_override_styles/pressed = ExtResource("4_l0byb")
theme_override_styles/normal_mirrored = ExtResource("4_l0byb")
theme_override_styles/normal = ExtResource("4_l0byb")
text = "Confirm"
[node name="PanelContainer2" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/AugmentItemPanelContainer/CenterContainer"]
layout_mode = 2

View File

@@ -37,6 +37,7 @@ public partial class ItemSlot : Control, IItemSlot
{
Item.Changed += Item_Changed;
ItemName.Pressed += ItemSlot_Pressed;
ItemName.FocusEntered += FocusItemInternal;
}
public void SetItemToSlot(IBaseInventoryItem item)
@@ -53,6 +54,7 @@ public partial class ItemSlot : Control, IItemSlot
{
SetItemEquipmentStatus(_player.EquipmentComponent.IsItemEquipped(equipableItem));
ItemName.Disabled = equipableItem.Glued;
ItemName.FocusMode = ItemName.Disabled ? FocusModeEnum.None : FocusModeEnum.All;
}
if (item is IAugmentableItem augmentableItem)
@@ -91,6 +93,12 @@ public partial class ItemSlot : Control, IItemSlot
ItemSelected?.Invoke(this);
}
private void FocusItemInternal()
{
ItemName.GrabFocus();
ItemSelected?.Invoke(this);
}
private void ItemSlot_Pressed()
{
if (Item.Value == null)

View File

@@ -41,11 +41,14 @@ texture = ExtResource("2_rf22b")
[node name="Control" type="HBoxContainer" parent="ItemInfo"]
layout_mode = 2
theme_override_constants/separation = 20
[node name="ItemName" type="Button" parent="ItemInfo/Control"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 4
focus_neighbor_left = NodePath(".")
focus_neighbor_right = NodePath(".")
theme_override_fonts/font = ExtResource("4_t6dim")
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = ExtResource("4_lt1pw")
@@ -64,7 +67,6 @@ text = "Cross Sword"
[node name="AugmentTexture" type="TextureRect" parent="ItemInfo/Control"]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(15, 20)
layout_mode = 2
size_flags_horizontal = 4

View File

@@ -5,7 +5,6 @@ using Chickensoft.Introspection;
using Godot;
using System;
using System.Linq;
using Zennysoft.Game.Abstractions;
using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
@@ -82,16 +81,16 @@ public partial class LoadNextLevel : Control, IFloorClearMenu
private void ExitButton_Pressed()
{
ContinueButton.Disabled = true;
ExitButton.Disabled = true;
ContinueButton.FocusMode = FocusModeEnum.None;
ExitButton.FocusMode = FocusModeEnum.None;
FadeOut();
Exit?.Invoke();
}
private void ContinueButton_Pressed()
{
ContinueButton.Disabled = true;
ExitButton.Disabled = true;
ContinueButton.FocusMode = FocusModeEnum.None;
ExitButton.FocusMode = FocusModeEnum.None;
GoToNextFloor?.Invoke();
}
@@ -101,14 +100,13 @@ public partial class LoadNextLevel : Control, IFloorClearMenu
{
_fadingIn = true;
_map.CurrentFloor.FadeOutAudio();
ContinueButton.Disabled = true;
ExitButton.Disabled = true;
ContinueButton.CallDeferred(MethodName.GrabFocus);
ContinueButton.FocusMode = FocusModeEnum.None;
ExitButton.FocusMode = FocusModeEnum.None;
}
if (animName == "fade_out")
{
_fadingIn = false;
CallDeferred(MethodName.ReleaseFocus);
ContinueButton.CallDeferred(MethodName.ReleaseFocus);
}
}
@@ -116,9 +114,10 @@ public partial class LoadNextLevel : Control, IFloorClearMenu
{
if (animName == "fade_in")
{
ContinueButton.CallDeferred(MethodName.GrabFocus);
_fadingIn = false;
ContinueButton.Disabled = false;
ExitButton.Disabled = false;
ContinueButton.FocusMode = FocusModeEnum.All;
ExitButton.FocusMode = FocusModeEnum.All;
}
if (animName == "fade_out")
TransitionCompleted?.Invoke();