From 76f4adc5bec9e05cb6112059d95786202ec94377 Mon Sep 17 00:00:00 2001 From: Pal Date: Thu, 4 Dec 2025 01:18:03 -0800 Subject: [PATCH] gallery and options rendered images set to linear filterling --- Zennysoft.Game.Ma/src/options/OptionsMenu.cs | 270 +++++++++--------- .../src/options/OptionsMenu.tscn | 7 +- .../src/ui/death_menu/DeathMenu.cs | 20 +- .../src/ui/gallery/GalleryMenu.cs | 4 +- .../src/ui/gallery/GalleryMenu.tscn | 1 + .../src/ui/load_next_level/LoadNextLevel.cs | 74 ++--- .../src/ui/player_ui/PlayerInfoUI.cs | 30 +- 7 files changed, 204 insertions(+), 202 deletions(-) diff --git a/Zennysoft.Game.Ma/src/options/OptionsMenu.cs b/Zennysoft.Game.Ma/src/options/OptionsMenu.cs index d84a7667..e96e82d0 100644 --- a/Zennysoft.Game.Ma/src/options/OptionsMenu.cs +++ b/Zennysoft.Game.Ma/src/options/OptionsMenu.cs @@ -55,229 +55,229 @@ public partial class OptionsMenu : Control public void OnReady() { - ResolutionOptions.AddItem("Windowed"); - ResolutionOptions.AddItem("Maximized"); - ResolutionOptions.AddItem("Fullscreen"); - ResolutionOptions.AddItem("Exclusive Fullscreen"); - ResolutionOptions.Select(0); + ResolutionOptions.AddItem("Windowed"); + ResolutionOptions.AddItem("Maximized"); + ResolutionOptions.AddItem("Fullscreen"); + ResolutionOptions.AddItem("Exclusive Fullscreen"); + ResolutionOptions.Select(0); - var devices = AudioServer.GetOutputDeviceList(); - foreach (var device in devices) - SoundDeviceOptions.AddItem(device); + var devices = AudioServer.GetOutputDeviceList(); + foreach (var device in devices) + SoundDeviceOptions.AddItem(device); - SoundDeviceOptions.Select(0); + SoundDeviceOptions.Select(0); - SoundDeviceOptions.AllowReselect = true; - SoundDeviceOptions.Pressed += SoundDeviceOptions_Pressed; - SoundDeviceOptions.ItemSelected += ChangeAudioDevice; + SoundDeviceOptions.AllowReselect = true; + SoundDeviceOptions.Pressed += SoundDeviceOptions_Pressed; + SoundDeviceOptions.ItemSelected += ChangeAudioDevice; - OptionsData = new OptionsData() - { - MasterVolumeLevel = MasterVolumeSlider.Value, - MusicVolumeLevel = MusicVolumeSlider.Value, - SFXVolumeLevel = SFXVolumeSlider.Value, - AudioDeviceName = "Default", - ScreenResolution = ResolutionOptions.GetSelectedId(), - SkipCutscene = SkipOpeningCSCheck.ButtonPressed - }; + OptionsData = new OptionsData() + { + MasterVolumeLevel = MasterVolumeSlider.Value, + MusicVolumeLevel = MusicVolumeSlider.Value, + SFXVolumeLevel = SFXVolumeSlider.Value, + AudioDeviceName = "Default", + ScreenResolution = ResolutionOptions.GetSelectedId(), + SkipCutscene = SkipOpeningCSCheck.ButtonPressed + }; - SkipOpeningCSCheck.Pressed += SkipOpeningCS_Pressed; + SkipOpeningCSCheck.Pressed += SkipOpeningCS_Pressed; - DeleteSaveButton.Pressed += DeleteSaveButton_Pressed; - YesDeleteButton.Pressed += YesDeleteButton_Pressed; - NoDeleteButton.Pressed += NoDeleteButton_Pressed; + DeleteSaveButton.Pressed += DeleteSaveButton_Pressed; + YesDeleteButton.Pressed += YesDeleteButton_Pressed; + NoDeleteButton.Pressed += NoDeleteButton_Pressed; - MasterVolumeSlider.ValueChanged += MasterVolumeSlider_Changed; - MusicVolumeSlider.ValueChanged += MusicVolumeSlider_Changed; - SFXVolumeSlider.ValueChanged += SFXVolumeSlider_Changed; + MasterVolumeSlider.ValueChanged += MasterVolumeSlider_Changed; + MusicVolumeSlider.ValueChanged += MusicVolumeSlider_Changed; + SFXVolumeSlider.ValueChanged += SFXVolumeSlider_Changed; - ResolutionOptions.ItemSelected += ResolutionOptions_ItemSelected; + ResolutionOptions.ItemSelected += ResolutionOptions_ItemSelected; - _masterBusIndex = AudioServer.GetBusIndex("Master"); - _musicBusIndex = AudioServer.GetBusIndex("MUSIC"); - _sfxBusIndex = AudioServer.GetBusIndex("SFX"); + _masterBusIndex = AudioServer.GetBusIndex("Master"); + _musicBusIndex = AudioServer.GetBusIndex("MUSIC"); + _sfxBusIndex = AudioServer.GetBusIndex("SFX"); - GameTab.FocusEntered += Game_FocusEntered; - AudioTab.FocusEntered += Audio_FocusEntered; - ControllerTab.FocusEntered += Controller_FocusEntered; + GameTab.FocusEntered += Game_FocusEntered; + AudioTab.FocusEntered += Audio_FocusEntered; + ControllerTab.FocusEntered += Controller_FocusEntered; - SELabel.Pressed += SELabel_Pressed; - MusicLabel.Pressed += MusicLabel_Pressed; - MasterLabel.Pressed += MasterLabel_Pressed; + SELabel.Pressed += SELabel_Pressed; + MusicLabel.Pressed += MusicLabel_Pressed; + MasterLabel.Pressed += MasterLabel_Pressed; - GetViewport().GuiFocusChanged += OptionsMenu_GuiFocusChanged; + GetViewport().GuiFocusChanged += OptionsMenu_GuiFocusChanged; } public override void _Input(InputEvent @event) { - if (!Visible) - return; + if (!Visible) + return; - if (Input.IsActionJustPressed(GameInputs.Interact) || Input.IsActionJustPressed(GameInputs.Attack)) - { - if (SFXVolumeSlider.HasFocus()) - { - SELabel.GrabFocus(); - AcceptEvent(); - return; - } - if (MusicVolumeSlider.HasFocus()) - { - MusicLabel.GrabFocus(); - AcceptEvent(); - return; - } - if (MasterVolumeSlider.HasFocus()) - { - MasterLabel.GrabFocus(); - AcceptEvent(); - return; - } - } + if (Input.IsActionJustPressed(GameInputs.Interact) || Input.IsActionJustPressed(GameInputs.Attack)) + { + if (SFXVolumeSlider.HasFocus()) + { + SELabel.GrabFocus(); + AcceptEvent(); + return; + } + if (MusicVolumeSlider.HasFocus()) + { + MusicLabel.GrabFocus(); + AcceptEvent(); + return; + } + if (MasterVolumeSlider.HasFocus()) + { + MasterLabel.GrabFocus(); + AcceptEvent(); + return; + } + } - if (Input.IsActionJustPressed(GameInputs.Interact) || Input.IsActionJustPressed(GameInputs.Pause)) - { - if (GameTab.HasFocus() || AudioTab.HasFocus() || ControllerTab.HasFocus()) - { - AcceptEvent(); - SaveAndExitMenu(); - } - else - { - var path = GetPathTo(_currentFocus).ToString(); - if (path.Contains("Game")) - GameTab.GrabFocus(); - else if (path.Contains("Audio")) - AudioTab.GrabFocus(); - else if (path.Contains("Controller")) - ControllerTab.GrabFocus(); - } - } + if (Input.IsActionJustPressed(GameInputs.Interact) || Input.IsActionJustPressed(GameInputs.Pause)) + { + if (GameTab.HasFocus() || AudioTab.HasFocus() || ControllerTab.HasFocus()) + { + AcceptEvent(); + SaveAndExitMenu(); + } + else + { + var path = GetPathTo(_currentFocus).ToString(); + if (path.Contains("Game")) + GameTab.GrabFocus(); + else if (path.Contains("Audio")) + AudioTab.GrabFocus(); + else if (path.Contains("Controller")) + ControllerTab.GrabFocus(); + } + } } private void ResolutionOptions_ItemSelected(long index) { - var resolutionIndex = ResolutionOptions.GetSelectedId(); - OptionsData.ScreenResolution = resolutionIndex; - DisplayServer.WindowSetMode(_windowModes[resolutionIndex]); + var resolutionIndex = ResolutionOptions.GetSelectedId(); + OptionsData.ScreenResolution = resolutionIndex; + DisplayServer.WindowSetMode(_windowModes[resolutionIndex]); } private void ChangeAudioDevice(long index) { - var i = SoundDeviceOptions.GetSelectedId(); - var deviceName = SoundDeviceOptions.GetItemText(i); - AudioServer.SetOutputDevice(deviceName); - OptionsData.AudioDeviceName = deviceName; + var i = SoundDeviceOptions.GetSelectedId(); + var deviceName = SoundDeviceOptions.GetItemText(i); + AudioServer.SetOutputDevice(deviceName); + OptionsData.AudioDeviceName = deviceName; } public void Load(OptionsData optionsData) { - MasterVolumeSlider.Value = optionsData.MasterVolumeLevel; - MusicVolumeSlider.Value = optionsData.MusicVolumeLevel; - SFXVolumeSlider.Value = optionsData.SFXVolumeLevel; - ResolutionOptions.Select(optionsData.ScreenResolution); - var audioDevices = AudioServer.GetOutputDeviceList(); - if (!audioDevices.Contains(optionsData.AudioDeviceName)) - SoundDeviceOptions.Select(0); - else - { - var selectedDeviceIndex = AudioServer.GetOutputDeviceList().ToList().IndexOf(optionsData.AudioDeviceName); - SoundDeviceOptions.Select(selectedDeviceIndex); - } - SkipOpeningCSCheck.ButtonPressed = optionsData.SkipCutscene; - DisplayServer.WindowSetMode(_windowModes[optionsData.ScreenResolution]); + MasterVolumeSlider.Value = optionsData.MasterVolumeLevel; + MusicVolumeSlider.Value = optionsData.MusicVolumeLevel; + SFXVolumeSlider.Value = optionsData.SFXVolumeLevel; + ResolutionOptions.Select(optionsData.ScreenResolution); + var audioDevices = AudioServer.GetOutputDeviceList(); + if (!audioDevices.Contains(optionsData.AudioDeviceName)) + SoundDeviceOptions.Select(0); + else + { + var selectedDeviceIndex = AudioServer.GetOutputDeviceList().ToList().IndexOf(optionsData.AudioDeviceName); + SoundDeviceOptions.Select(selectedDeviceIndex); + } + SkipOpeningCSCheck.ButtonPressed = optionsData.SkipCutscene; + DisplayServer.WindowSetMode(_windowModes[optionsData.ScreenResolution]); } private void OptionsMenu_GuiFocusChanged(Control node) => _currentFocus = node; private void MasterLabel_Pressed() { - MasterVolumeSlider.GrabFocus(); + MasterVolumeSlider.GrabFocus(); } private void MusicLabel_Pressed() { - MusicVolumeSlider.GrabFocus(); + MusicVolumeSlider.GrabFocus(); } private void SELabel_Pressed() { - SFXVolumeSlider.GrabFocus(); + SFXVolumeSlider.GrabFocus(); } private void SoundDeviceOptions_Pressed() { - var selectedItem = SoundDeviceOptions.Selected; - SoundDeviceOptions.Clear(); + var selectedItem = SoundDeviceOptions.Selected; + SoundDeviceOptions.Clear(); - var devices = AudioServer.GetOutputDeviceList(); - foreach (var device in devices) - SoundDeviceOptions.AddItem(device); - SoundDeviceOptions.Select(selectedItem); + var devices = AudioServer.GetOutputDeviceList(); + foreach (var device in devices) + SoundDeviceOptions.AddItem(device); + SoundDeviceOptions.Select(selectedItem); } private void SkipOpeningCS_Pressed() => OptionsData.SkipCutscene = SkipOpeningCSCheck.ButtonPressed; private void NoDeleteButton_Pressed() { - ReleaseFocus(); - ConfirmDeletePopup.Hide(); - DeleteSaveButton.GrabFocus(); + ReleaseFocus(); + ConfirmDeletePopup.Hide(); + DeleteSaveButton.GrabFocus(); } private void YesDeleteButton_Pressed() { - EmitSignal(SignalName.DeleteSaveData); - ReleaseFocus(); - ConfirmDeletePopup.Hide(); - DeleteSaveButton.GrabFocus(); + EmitSignal(SignalName.DeleteSaveData); + ReleaseFocus(); + ConfirmDeletePopup.Hide(); + DeleteSaveButton.GrabFocus(); } private void DeleteSaveButton_Pressed() { - NoDeleteButton.GrabFocus(); - ConfirmDeletePopup.Show(); + NoDeleteButton.GrabFocus(); + ConfirmDeletePopup.Show(); } private void SaveAndExitMenu() => EmitSignal(SignalName.OptionsMenuExited); private void MasterVolumeSlider_Changed(double valueChanged) { - OptionsData.MasterVolumeLevel = valueChanged; - AudioServer.SetBusVolumeDb(_masterBusIndex, Mathf.LinearToDb((float)valueChanged)); + OptionsData.MasterVolumeLevel = valueChanged; + AudioServer.SetBusVolumeDb(_masterBusIndex, Mathf.LinearToDb((float)valueChanged)); } private void MusicVolumeSlider_Changed(double valueChanged) { - OptionsData.MusicVolumeLevel = valueChanged; - AudioServer.SetBusVolumeDb(_musicBusIndex, Mathf.LinearToDb((float)valueChanged)); + OptionsData.MusicVolumeLevel = valueChanged; + AudioServer.SetBusVolumeDb(_musicBusIndex, Mathf.LinearToDb((float)valueChanged)); } private void SFXVolumeSlider_Changed(double valueChanged) { - OptionsData.SFXVolumeLevel = valueChanged; - AudioServer.SetBusVolumeDb(_sfxBusIndex, Mathf.LinearToDb((float)valueChanged)); + OptionsData.SFXVolumeLevel = valueChanged; + AudioServer.SetBusVolumeDb(_sfxBusIndex, Mathf.LinearToDb((float)valueChanged)); } private void Controller_FocusEntered() { - Audio.Hide(); - Controller.Show(); - Game.Hide(); + Audio.Hide(); + Controller.Show(); + Game.Hide(); } private void Game_FocusEntered() { - Audio.Hide(); - Controller.Hide(); - Game.Show(); + Audio.Hide(); + Controller.Hide(); + Game.Show(); } private void Audio_FocusEntered() { - Audio.Show(); - Controller.Hide(); - Game.Hide(); + Audio.Show(); + Controller.Hide(); + Game.Hide(); } } @@ -286,4 +286,4 @@ public enum TabOption Game, Audio, Controls -} \ No newline at end of file +} diff --git a/Zennysoft.Game.Ma/src/options/OptionsMenu.tscn b/Zennysoft.Game.Ma/src/options/OptionsMenu.tscn index e1ae2a3b..28e1896d 100644 --- a/Zennysoft.Game.Ma/src/options/OptionsMenu.tscn +++ b/Zennysoft.Game.Ma/src/options/OptionsMenu.tscn @@ -6,11 +6,11 @@ [ext_resource type="FontFile" uid="uid://beh6d5lo5ihq0" path="res://src/ui/fonts/georgiai.ttf" id="2_n0yw3"] [ext_resource type="LabelSettings" uid="uid://cuuo43x72xcsc" path="res://src/ui/label_settings/MainTextBold.tres" id="2_o7aaw"] [ext_resource type="FontFile" uid="uid://cke424xtk2s0o" path="res://src/ui/fonts/ebrima.ttf" id="2_ohii5"] -[ext_resource type="LabelSettings" uid="uid://b6f8ggy3ulonb" path="res://src/ui/label_settings/GeorgiaItalic.tres" id="5_1mx8s"] +[ext_resource type="LabelSettings" path="res://src/ui/label_settings/GeorgiaItalic.tres" id="5_1mx8s"] [ext_resource type="Texture2D" uid="uid://u255bg4nytuf" path="res://src/ui/gallery/checkbox.png" id="5_wn77p"] [ext_resource type="Texture2D" uid="uid://2fwkphkxib7p" path="res://src/ui/gallery/Unchecked.png" id="6_ko1q6"] -[ext_resource type="StyleBox" uid="uid://bxuy4tnftibfq" path="res://src/options/SelectedOptionsBox.tres" id="9_lx8gn"] -[ext_resource type="StyleBox" uid="uid://bl15q835s4ene" path="res://src/options/UnselectedOptionsBox.tres" id="10_qvpxc"] +[ext_resource type="StyleBox" path="res://src/options/SelectedOptionsBox.tres" id="9_lx8gn"] +[ext_resource type="StyleBox" path="res://src/options/UnselectedOptionsBox.tres" id="10_qvpxc"] [ext_resource type="Script" uid="uid://c6lw5yp8p0wb5" path="res://src/options/InputMapper.cs" id="12_776se"] [ext_resource type="Script" uid="uid://b70br20xue678" path="res://src/options/KeyboardRemapButton.cs" id="13_rjjwr"] [ext_resource type="Script" uid="uid://bo7vk56h1lr07" path="res://src/options/JoypadRemapButton.cs" id="14_wsiwg"] @@ -46,6 +46,7 @@ size_flags_vertical = 3 script = ExtResource("1_jli36") [node name="TextureRect" type="TextureRect" parent="."] +texture_filter = 2 layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 diff --git a/Zennysoft.Game.Ma/src/ui/death_menu/DeathMenu.cs b/Zennysoft.Game.Ma/src/ui/death_menu/DeathMenu.cs index 720ff8e9..ad5b0ac6 100644 --- a/Zennysoft.Game.Ma/src/ui/death_menu/DeathMenu.cs +++ b/Zennysoft.Game.Ma/src/ui/death_menu/DeathMenu.cs @@ -31,28 +31,28 @@ public partial class DeathMenu : Control, IDeathMenu public void OnReady() { - Continue.Pressed += Continue_Pressed; - Exit.Pressed += Exit_Pressed; - VisibilityChanged += DeathMenu_VisibilityChanged; + Continue.Pressed += Continue_Pressed; + Exit.Pressed += Exit_Pressed; + VisibilityChanged += DeathMenu_VisibilityChanged; } private void DeathMenu_VisibilityChanged() { - if (Visible) - Continue.CallDeferred(MethodName.GrabFocus, []); - else - ReleaseFocus(); + if (Visible) + Continue.CallDeferred(MethodName.GrabFocus, []); + else + ReleaseFocus(); } private void Exit_Pressed() { - EmitSignal(SignalName.QuitGame); + EmitSignal(SignalName.QuitGame); } private void Continue_Pressed() { - FadeOut(); - EmitSignal(SignalName.NewGame); + FadeOut(); + EmitSignal(SignalName.NewGame); } public void FadeIn() => AnimationPlayer.Play("fade_in"); diff --git a/Zennysoft.Game.Ma/src/ui/gallery/GalleryMenu.cs b/Zennysoft.Game.Ma/src/ui/gallery/GalleryMenu.cs index 73c5c94a..6aefc341 100644 --- a/Zennysoft.Game.Ma/src/ui/gallery/GalleryMenu.cs +++ b/Zennysoft.Game.Ma/src/ui/gallery/GalleryMenu.cs @@ -56,8 +56,8 @@ public partial class GalleryMenu : Control public void OnReady() { - GalleryData = new GalleryData() { PlaceholderImage1 = true }; - BackButton.Pressed += BackButton_Pressed; + GalleryData = new GalleryData() { PlaceholderImage1 = true }; + BackButton.Pressed += BackButton_Pressed; } private void BackButton_Pressed() => EmitSignal(SignalName.GalleryExited); diff --git a/Zennysoft.Game.Ma/src/ui/gallery/GalleryMenu.tscn b/Zennysoft.Game.Ma/src/ui/gallery/GalleryMenu.tscn index 9dfe4add..c7d19911 100644 --- a/Zennysoft.Game.Ma/src/ui/gallery/GalleryMenu.tscn +++ b/Zennysoft.Game.Ma/src/ui/gallery/GalleryMenu.tscn @@ -35,6 +35,7 @@ size_flags_horizontal = 3 size_flags_vertical = 3 [node name="TextureRect" type="TextureRect" parent="Control"] +texture_filter = 2 layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 diff --git a/Zennysoft.Game.Ma/src/ui/load_next_level/LoadNextLevel.cs b/Zennysoft.Game.Ma/src/ui/load_next_level/LoadNextLevel.cs index 75a244cc..4f5bbd50 100644 --- a/Zennysoft.Game.Ma/src/ui/load_next_level/LoadNextLevel.cs +++ b/Zennysoft.Game.Ma/src/ui/load_next_level/LoadNextLevel.cs @@ -40,32 +40,32 @@ public partial class LoadNextLevel : Control, IFloorClearMenu public void OnResolved() { - _player.ExperiencePointsComponent.Level.Sync += Level_Sync; - _player.ExperiencePointsComponent.CurrentExp.Sync += Exp_Sync; - _player.ExperiencePointsComponent.ExpToNextLevel.Sync += Exp_Sync; - _player.HealthComponent.CurrentHP.Sync += HP_Sync; - _player.HealthComponent.MaximumHP.Sync += HP_Sync; - _player.VTComponent.CurrentVT.Sync += VT_Sync; - _player.VTComponent.MaximumVT.Sync += VT_Sync; - _player.AttackComponent.CurrentAttack.Sync += Attack_Sync; - _player.AttackComponent.MaximumAttack.Sync += Attack_Sync; - _player.DefenseComponent.CurrentDefense.Sync += Defense_Sync; - _player.DefenseComponent.MaximumDefense.Sync += Defense_Sync; - _player.EquipmentComponent.EquipmentChanged += EquipmentComponent_EquipmentChanged; - _map.CurrentFloorNumber.Sync += CurrentFloorNumber_Sync; + _player.ExperiencePointsComponent.Level.Sync += Level_Sync; + _player.ExperiencePointsComponent.CurrentExp.Sync += Exp_Sync; + _player.ExperiencePointsComponent.ExpToNextLevel.Sync += Exp_Sync; + _player.HealthComponent.CurrentHP.Sync += HP_Sync; + _player.HealthComponent.MaximumHP.Sync += HP_Sync; + _player.VTComponent.CurrentVT.Sync += VT_Sync; + _player.VTComponent.MaximumVT.Sync += VT_Sync; + _player.AttackComponent.CurrentAttack.Sync += Attack_Sync; + _player.AttackComponent.MaximumAttack.Sync += Attack_Sync; + _player.DefenseComponent.CurrentDefense.Sync += Defense_Sync; + _player.DefenseComponent.MaximumDefense.Sync += Defense_Sync; + _player.EquipmentComponent.EquipmentChanged += EquipmentComponent_EquipmentChanged; + _map.CurrentFloorNumber.Sync += CurrentFloorNumber_Sync; - AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished; - AnimationPlayer.AnimationStarted += AnimationPlayer_AnimationStarted; - ContinueButton.Pressed += ContinueButton_Pressed; - ExitButton.Pressed += ExitButton_Pressed; + AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished; + AnimationPlayer.AnimationStarted += AnimationPlayer_AnimationStarted; + ContinueButton.Pressed += ContinueButton_Pressed; + ExitButton.Pressed += ExitButton_Pressed; } private void CurrentFloorNumber_Sync(int _) => FloorNumber.Text = _map.CurrentFloorNumber.Value.ToString("D2"); private void EquipmentComponent_EquipmentChanged(EquipableItem obj) { - Attack_Sync(0); - Defense_Sync(0); + Attack_Sync(0); + Defense_Sync(0); } private void Attack_Sync(int _) => ATKLabel.Text = $"{_player.AttackComponent.CurrentAttack.Value}/{_player.AttackComponent.MaximumAttack.Value}+{_player.EquipmentComponent.BonusAttack}"; @@ -78,35 +78,35 @@ public partial class LoadNextLevel : Control, IFloorClearMenu private void ExitButton_Pressed() { - ContinueButton.Disabled = true; - ExitButton.Disabled = true; - FadeOut(); - Exit?.Invoke(); + ContinueButton.Disabled = true; + ExitButton.Disabled = true; + FadeOut(); + Exit?.Invoke(); } private void ContinueButton_Pressed() { - ContinueButton.Disabled = true; - ExitButton.Disabled = true; - GoToNextFloor?.Invoke(); + ContinueButton.Disabled = true; + ExitButton.Disabled = true; + GoToNextFloor?.Invoke(); } private void AnimationPlayer_AnimationStarted(StringName animName) { - if (animName == "fade_in") - ContinueButton.CallDeferred(MethodName.GrabFocus); - if (animName == "fade_out") - CallDeferred(MethodName.ReleaseFocus); + if (animName == "fade_in") + ContinueButton.CallDeferred(MethodName.GrabFocus); + if (animName == "fade_out") + CallDeferred(MethodName.ReleaseFocus); } private void AnimationPlayer_AnimationFinished(StringName animName) { - if (animName == "fade_in") - { - ContinueButton.Disabled = false; - ExitButton.Disabled = false; - } - if (animName == "fade_out") - TransitionCompleted?.Invoke(); + if (animName == "fade_in") + { + ContinueButton.Disabled = false; + ExitButton.Disabled = false; + } + if (animName == "fade_out") + TransitionCompleted?.Invoke(); } } diff --git a/Zennysoft.Game.Ma/src/ui/player_ui/PlayerInfoUI.cs b/Zennysoft.Game.Ma/src/ui/player_ui/PlayerInfoUI.cs index 1d852838..97c29edc 100644 --- a/Zennysoft.Game.Ma/src/ui/player_ui/PlayerInfoUI.cs +++ b/Zennysoft.Game.Ma/src/ui/player_ui/PlayerInfoUI.cs @@ -37,38 +37,38 @@ public partial class PlayerInfoUI : Control, IPlayerInfoUI public void Activate() { - Player.HealthComponent.CurrentHP.Sync += HPSync; - Player.HealthComponent.MaximumHP.Sync += HPSync; + Player.HealthComponent.CurrentHP.Sync += HPSync; + Player.HealthComponent.MaximumHP.Sync += HPSync; - Player.VTComponent.CurrentVT.Sync += VTSync; - Player.VTComponent.MaximumVT.Sync += VTSync; + Player.VTComponent.CurrentVT.Sync += VTSync; + Player.VTComponent.MaximumVT.Sync += VTSync; - Player.ExperiencePointsComponent.Level.Sync += CurrentLevel_Sync; - Player.ExperiencePointsComponent.CurrentExp.Sync += ExpSync; - Player.ExperiencePointsComponent.ExpToNextLevel.Sync += ExpSync; + Player.ExperiencePointsComponent.Level.Sync += CurrentLevel_Sync; + Player.ExperiencePointsComponent.CurrentExp.Sync += ExpSync; + Player.ExperiencePointsComponent.ExpToNextLevel.Sync += ExpSync; } private void CurrentLevel_Sync(int obj) { - LevelNumber.Text = $"{obj}"; + LevelNumber.Text = $"{obj}"; } private void VTSync(int obj) { - VTNumber.Text = $"{Player.VTComponent.CurrentVT.Value}/{Player.VTComponent.MaximumVT.Value}"; - VTProgressBar.Value = Player.VTComponent.CurrentVT.Value; - VTProgressBar.MaxValue = Player.VTComponent.MaximumVT.Value; + VTNumber.Text = $"{Player.VTComponent.CurrentVT.Value}/{Player.VTComponent.MaximumVT.Value}"; + VTProgressBar.Value = Player.VTComponent.CurrentVT.Value; + VTProgressBar.MaxValue = Player.VTComponent.MaximumVT.Value; } private void HPSync(int obj) { - HPNumber.Text = $"{Player.HealthComponent.CurrentHP.Value}/{Player.HealthComponent.MaximumHP.Value}"; - HPProgressBar.Value = Player.HealthComponent.CurrentHP.Value; - HPProgressBar.MaxValue = Player.HealthComponent.MaximumHP.Value; + HPNumber.Text = $"{Player.HealthComponent.CurrentHP.Value}/{Player.HealthComponent.MaximumHP.Value}"; + HPProgressBar.Value = Player.HealthComponent.CurrentHP.Value; + HPProgressBar.MaxValue = Player.HealthComponent.MaximumHP.Value; } private void ExpSync(int obj) { - EXPNumber.Text = $"{Player.ExperiencePointsComponent.CurrentExp.Value}/{Player.ExperiencePointsComponent.ExpToNextLevel.Value}"; + EXPNumber.Text = $"{Player.ExperiencePointsComponent.CurrentExp.Value}/{Player.ExperiencePointsComponent.ExpToNextLevel.Value}"; } }