gallery and options rendered images set to linear filterling

This commit is contained in:
Pal
2025-12-04 01:18:03 -08:00
parent 95227946d1
commit 76f4adc5be
7 changed files with 204 additions and 202 deletions

View File

@@ -55,229 +55,229 @@ public partial class OptionsMenu : Control
public void OnReady() public void OnReady()
{ {
ResolutionOptions.AddItem("Windowed"); ResolutionOptions.AddItem("Windowed");
ResolutionOptions.AddItem("Maximized"); ResolutionOptions.AddItem("Maximized");
ResolutionOptions.AddItem("Fullscreen"); ResolutionOptions.AddItem("Fullscreen");
ResolutionOptions.AddItem("Exclusive Fullscreen"); ResolutionOptions.AddItem("Exclusive Fullscreen");
ResolutionOptions.Select(0); ResolutionOptions.Select(0);
var devices = AudioServer.GetOutputDeviceList(); var devices = AudioServer.GetOutputDeviceList();
foreach (var device in devices) foreach (var device in devices)
SoundDeviceOptions.AddItem(device); SoundDeviceOptions.AddItem(device);
SoundDeviceOptions.Select(0); SoundDeviceOptions.Select(0);
SoundDeviceOptions.AllowReselect = true; SoundDeviceOptions.AllowReselect = true;
SoundDeviceOptions.Pressed += SoundDeviceOptions_Pressed; SoundDeviceOptions.Pressed += SoundDeviceOptions_Pressed;
SoundDeviceOptions.ItemSelected += ChangeAudioDevice; SoundDeviceOptions.ItemSelected += ChangeAudioDevice;
OptionsData = new OptionsData() OptionsData = new OptionsData()
{ {
MasterVolumeLevel = MasterVolumeSlider.Value, MasterVolumeLevel = MasterVolumeSlider.Value,
MusicVolumeLevel = MusicVolumeSlider.Value, MusicVolumeLevel = MusicVolumeSlider.Value,
SFXVolumeLevel = SFXVolumeSlider.Value, SFXVolumeLevel = SFXVolumeSlider.Value,
AudioDeviceName = "Default", AudioDeviceName = "Default",
ScreenResolution = ResolutionOptions.GetSelectedId(), ScreenResolution = ResolutionOptions.GetSelectedId(),
SkipCutscene = SkipOpeningCSCheck.ButtonPressed SkipCutscene = SkipOpeningCSCheck.ButtonPressed
}; };
SkipOpeningCSCheck.Pressed += SkipOpeningCS_Pressed; SkipOpeningCSCheck.Pressed += SkipOpeningCS_Pressed;
DeleteSaveButton.Pressed += DeleteSaveButton_Pressed; DeleteSaveButton.Pressed += DeleteSaveButton_Pressed;
YesDeleteButton.Pressed += YesDeleteButton_Pressed; YesDeleteButton.Pressed += YesDeleteButton_Pressed;
NoDeleteButton.Pressed += NoDeleteButton_Pressed; NoDeleteButton.Pressed += NoDeleteButton_Pressed;
MasterVolumeSlider.ValueChanged += MasterVolumeSlider_Changed; MasterVolumeSlider.ValueChanged += MasterVolumeSlider_Changed;
MusicVolumeSlider.ValueChanged += MusicVolumeSlider_Changed; MusicVolumeSlider.ValueChanged += MusicVolumeSlider_Changed;
SFXVolumeSlider.ValueChanged += SFXVolumeSlider_Changed; SFXVolumeSlider.ValueChanged += SFXVolumeSlider_Changed;
ResolutionOptions.ItemSelected += ResolutionOptions_ItemSelected; ResolutionOptions.ItemSelected += ResolutionOptions_ItemSelected;
_masterBusIndex = AudioServer.GetBusIndex("Master"); _masterBusIndex = AudioServer.GetBusIndex("Master");
_musicBusIndex = AudioServer.GetBusIndex("MUSIC"); _musicBusIndex = AudioServer.GetBusIndex("MUSIC");
_sfxBusIndex = AudioServer.GetBusIndex("SFX"); _sfxBusIndex = AudioServer.GetBusIndex("SFX");
GameTab.FocusEntered += Game_FocusEntered; GameTab.FocusEntered += Game_FocusEntered;
AudioTab.FocusEntered += Audio_FocusEntered; AudioTab.FocusEntered += Audio_FocusEntered;
ControllerTab.FocusEntered += Controller_FocusEntered; ControllerTab.FocusEntered += Controller_FocusEntered;
SELabel.Pressed += SELabel_Pressed; SELabel.Pressed += SELabel_Pressed;
MusicLabel.Pressed += MusicLabel_Pressed; MusicLabel.Pressed += MusicLabel_Pressed;
MasterLabel.Pressed += MasterLabel_Pressed; MasterLabel.Pressed += MasterLabel_Pressed;
GetViewport().GuiFocusChanged += OptionsMenu_GuiFocusChanged; GetViewport().GuiFocusChanged += OptionsMenu_GuiFocusChanged;
} }
public override void _Input(InputEvent @event) public override void _Input(InputEvent @event)
{ {
if (!Visible) if (!Visible)
return; return;
if (Input.IsActionJustPressed(GameInputs.Interact) || Input.IsActionJustPressed(GameInputs.Attack)) if (Input.IsActionJustPressed(GameInputs.Interact) || Input.IsActionJustPressed(GameInputs.Attack))
{ {
if (SFXVolumeSlider.HasFocus()) if (SFXVolumeSlider.HasFocus())
{ {
SELabel.GrabFocus(); SELabel.GrabFocus();
AcceptEvent(); AcceptEvent();
return; return;
} }
if (MusicVolumeSlider.HasFocus()) if (MusicVolumeSlider.HasFocus())
{ {
MusicLabel.GrabFocus(); MusicLabel.GrabFocus();
AcceptEvent(); AcceptEvent();
return; return;
} }
if (MasterVolumeSlider.HasFocus()) if (MasterVolumeSlider.HasFocus())
{ {
MasterLabel.GrabFocus(); MasterLabel.GrabFocus();
AcceptEvent(); AcceptEvent();
return; return;
} }
} }
if (Input.IsActionJustPressed(GameInputs.Interact) || Input.IsActionJustPressed(GameInputs.Pause)) if (Input.IsActionJustPressed(GameInputs.Interact) || Input.IsActionJustPressed(GameInputs.Pause))
{ {
if (GameTab.HasFocus() || AudioTab.HasFocus() || ControllerTab.HasFocus()) if (GameTab.HasFocus() || AudioTab.HasFocus() || ControllerTab.HasFocus())
{ {
AcceptEvent(); AcceptEvent();
SaveAndExitMenu(); SaveAndExitMenu();
} }
else else
{ {
var path = GetPathTo(_currentFocus).ToString(); var path = GetPathTo(_currentFocus).ToString();
if (path.Contains("Game")) if (path.Contains("Game"))
GameTab.GrabFocus(); GameTab.GrabFocus();
else if (path.Contains("Audio")) else if (path.Contains("Audio"))
AudioTab.GrabFocus(); AudioTab.GrabFocus();
else if (path.Contains("Controller")) else if (path.Contains("Controller"))
ControllerTab.GrabFocus(); ControllerTab.GrabFocus();
} }
} }
} }
private void ResolutionOptions_ItemSelected(long index) private void ResolutionOptions_ItemSelected(long index)
{ {
var resolutionIndex = ResolutionOptions.GetSelectedId(); var resolutionIndex = ResolutionOptions.GetSelectedId();
OptionsData.ScreenResolution = resolutionIndex; OptionsData.ScreenResolution = resolutionIndex;
DisplayServer.WindowSetMode(_windowModes[resolutionIndex]); DisplayServer.WindowSetMode(_windowModes[resolutionIndex]);
} }
private void ChangeAudioDevice(long index) private void ChangeAudioDevice(long index)
{ {
var i = SoundDeviceOptions.GetSelectedId(); var i = SoundDeviceOptions.GetSelectedId();
var deviceName = SoundDeviceOptions.GetItemText(i); var deviceName = SoundDeviceOptions.GetItemText(i);
AudioServer.SetOutputDevice(deviceName); AudioServer.SetOutputDevice(deviceName);
OptionsData.AudioDeviceName = deviceName; OptionsData.AudioDeviceName = deviceName;
} }
public void Load(OptionsData optionsData) public void Load(OptionsData optionsData)
{ {
MasterVolumeSlider.Value = optionsData.MasterVolumeLevel; MasterVolumeSlider.Value = optionsData.MasterVolumeLevel;
MusicVolumeSlider.Value = optionsData.MusicVolumeLevel; MusicVolumeSlider.Value = optionsData.MusicVolumeLevel;
SFXVolumeSlider.Value = optionsData.SFXVolumeLevel; SFXVolumeSlider.Value = optionsData.SFXVolumeLevel;
ResolutionOptions.Select(optionsData.ScreenResolution); ResolutionOptions.Select(optionsData.ScreenResolution);
var audioDevices = AudioServer.GetOutputDeviceList(); var audioDevices = AudioServer.GetOutputDeviceList();
if (!audioDevices.Contains(optionsData.AudioDeviceName)) if (!audioDevices.Contains(optionsData.AudioDeviceName))
SoundDeviceOptions.Select(0); SoundDeviceOptions.Select(0);
else else
{ {
var selectedDeviceIndex = AudioServer.GetOutputDeviceList().ToList().IndexOf(optionsData.AudioDeviceName); var selectedDeviceIndex = AudioServer.GetOutputDeviceList().ToList().IndexOf(optionsData.AudioDeviceName);
SoundDeviceOptions.Select(selectedDeviceIndex); SoundDeviceOptions.Select(selectedDeviceIndex);
} }
SkipOpeningCSCheck.ButtonPressed = optionsData.SkipCutscene; SkipOpeningCSCheck.ButtonPressed = optionsData.SkipCutscene;
DisplayServer.WindowSetMode(_windowModes[optionsData.ScreenResolution]); DisplayServer.WindowSetMode(_windowModes[optionsData.ScreenResolution]);
} }
private void OptionsMenu_GuiFocusChanged(Control node) => _currentFocus = node; private void OptionsMenu_GuiFocusChanged(Control node) => _currentFocus = node;
private void MasterLabel_Pressed() private void MasterLabel_Pressed()
{ {
MasterVolumeSlider.GrabFocus(); MasterVolumeSlider.GrabFocus();
} }
private void MusicLabel_Pressed() private void MusicLabel_Pressed()
{ {
MusicVolumeSlider.GrabFocus(); MusicVolumeSlider.GrabFocus();
} }
private void SELabel_Pressed() private void SELabel_Pressed()
{ {
SFXVolumeSlider.GrabFocus(); SFXVolumeSlider.GrabFocus();
} }
private void SoundDeviceOptions_Pressed() private void SoundDeviceOptions_Pressed()
{ {
var selectedItem = SoundDeviceOptions.Selected; var selectedItem = SoundDeviceOptions.Selected;
SoundDeviceOptions.Clear(); SoundDeviceOptions.Clear();
var devices = AudioServer.GetOutputDeviceList(); var devices = AudioServer.GetOutputDeviceList();
foreach (var device in devices) foreach (var device in devices)
SoundDeviceOptions.AddItem(device); SoundDeviceOptions.AddItem(device);
SoundDeviceOptions.Select(selectedItem); SoundDeviceOptions.Select(selectedItem);
} }
private void SkipOpeningCS_Pressed() => OptionsData.SkipCutscene = SkipOpeningCSCheck.ButtonPressed; private void SkipOpeningCS_Pressed() => OptionsData.SkipCutscene = SkipOpeningCSCheck.ButtonPressed;
private void NoDeleteButton_Pressed() private void NoDeleteButton_Pressed()
{ {
ReleaseFocus(); ReleaseFocus();
ConfirmDeletePopup.Hide(); ConfirmDeletePopup.Hide();
DeleteSaveButton.GrabFocus(); DeleteSaveButton.GrabFocus();
} }
private void YesDeleteButton_Pressed() private void YesDeleteButton_Pressed()
{ {
EmitSignal(SignalName.DeleteSaveData); EmitSignal(SignalName.DeleteSaveData);
ReleaseFocus(); ReleaseFocus();
ConfirmDeletePopup.Hide(); ConfirmDeletePopup.Hide();
DeleteSaveButton.GrabFocus(); DeleteSaveButton.GrabFocus();
} }
private void DeleteSaveButton_Pressed() private void DeleteSaveButton_Pressed()
{ {
NoDeleteButton.GrabFocus(); NoDeleteButton.GrabFocus();
ConfirmDeletePopup.Show(); ConfirmDeletePopup.Show();
} }
private void SaveAndExitMenu() => EmitSignal(SignalName.OptionsMenuExited); private void SaveAndExitMenu() => EmitSignal(SignalName.OptionsMenuExited);
private void MasterVolumeSlider_Changed(double valueChanged) private void MasterVolumeSlider_Changed(double valueChanged)
{ {
OptionsData.MasterVolumeLevel = valueChanged; OptionsData.MasterVolumeLevel = valueChanged;
AudioServer.SetBusVolumeDb(_masterBusIndex, Mathf.LinearToDb((float)valueChanged)); AudioServer.SetBusVolumeDb(_masterBusIndex, Mathf.LinearToDb((float)valueChanged));
} }
private void MusicVolumeSlider_Changed(double valueChanged) private void MusicVolumeSlider_Changed(double valueChanged)
{ {
OptionsData.MusicVolumeLevel = valueChanged; OptionsData.MusicVolumeLevel = valueChanged;
AudioServer.SetBusVolumeDb(_musicBusIndex, Mathf.LinearToDb((float)valueChanged)); AudioServer.SetBusVolumeDb(_musicBusIndex, Mathf.LinearToDb((float)valueChanged));
} }
private void SFXVolumeSlider_Changed(double valueChanged) private void SFXVolumeSlider_Changed(double valueChanged)
{ {
OptionsData.SFXVolumeLevel = valueChanged; OptionsData.SFXVolumeLevel = valueChanged;
AudioServer.SetBusVolumeDb(_sfxBusIndex, Mathf.LinearToDb((float)valueChanged)); AudioServer.SetBusVolumeDb(_sfxBusIndex, Mathf.LinearToDb((float)valueChanged));
} }
private void Controller_FocusEntered() private void Controller_FocusEntered()
{ {
Audio.Hide(); Audio.Hide();
Controller.Show(); Controller.Show();
Game.Hide(); Game.Hide();
} }
private void Game_FocusEntered() private void Game_FocusEntered()
{ {
Audio.Hide(); Audio.Hide();
Controller.Hide(); Controller.Hide();
Game.Show(); Game.Show();
} }
private void Audio_FocusEntered() private void Audio_FocusEntered()
{ {
Audio.Show(); Audio.Show();
Controller.Hide(); Controller.Hide();
Game.Hide(); Game.Hide();
} }
} }
@@ -286,4 +286,4 @@ public enum TabOption
Game, Game,
Audio, Audio,
Controls Controls
} }

View File

@@ -6,11 +6,11 @@
[ext_resource type="FontFile" uid="uid://beh6d5lo5ihq0" path="res://src/ui/fonts/georgiai.ttf" id="2_n0yw3"] [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="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="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://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="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" 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/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://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://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"] [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") script = ExtResource("1_jli36")
[node name="TextureRect" type="TextureRect" parent="."] [node name="TextureRect" type="TextureRect" parent="."]
texture_filter = 2
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0

View File

@@ -31,28 +31,28 @@ public partial class DeathMenu : Control, IDeathMenu
public void OnReady() public void OnReady()
{ {
Continue.Pressed += Continue_Pressed; Continue.Pressed += Continue_Pressed;
Exit.Pressed += Exit_Pressed; Exit.Pressed += Exit_Pressed;
VisibilityChanged += DeathMenu_VisibilityChanged; VisibilityChanged += DeathMenu_VisibilityChanged;
} }
private void DeathMenu_VisibilityChanged() private void DeathMenu_VisibilityChanged()
{ {
if (Visible) if (Visible)
Continue.CallDeferred(MethodName.GrabFocus, []); Continue.CallDeferred(MethodName.GrabFocus, []);
else else
ReleaseFocus(); ReleaseFocus();
} }
private void Exit_Pressed() private void Exit_Pressed()
{ {
EmitSignal(SignalName.QuitGame); EmitSignal(SignalName.QuitGame);
} }
private void Continue_Pressed() private void Continue_Pressed()
{ {
FadeOut(); FadeOut();
EmitSignal(SignalName.NewGame); EmitSignal(SignalName.NewGame);
} }
public void FadeIn() => AnimationPlayer.Play("fade_in"); public void FadeIn() => AnimationPlayer.Play("fade_in");

View File

@@ -56,8 +56,8 @@ public partial class GalleryMenu : Control
public void OnReady() public void OnReady()
{ {
GalleryData = new GalleryData() { PlaceholderImage1 = true }; GalleryData = new GalleryData() { PlaceholderImage1 = true };
BackButton.Pressed += BackButton_Pressed; BackButton.Pressed += BackButton_Pressed;
} }
private void BackButton_Pressed() => EmitSignal(SignalName.GalleryExited); private void BackButton_Pressed() => EmitSignal(SignalName.GalleryExited);

View File

@@ -35,6 +35,7 @@ size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="TextureRect" type="TextureRect" parent="Control"] [node name="TextureRect" type="TextureRect" parent="Control"]
texture_filter = 2
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0

View File

@@ -40,32 +40,32 @@ public partial class LoadNextLevel : Control, IFloorClearMenu
public void OnResolved() public void OnResolved()
{ {
_player.ExperiencePointsComponent.Level.Sync += Level_Sync; _player.ExperiencePointsComponent.Level.Sync += Level_Sync;
_player.ExperiencePointsComponent.CurrentExp.Sync += Exp_Sync; _player.ExperiencePointsComponent.CurrentExp.Sync += Exp_Sync;
_player.ExperiencePointsComponent.ExpToNextLevel.Sync += Exp_Sync; _player.ExperiencePointsComponent.ExpToNextLevel.Sync += Exp_Sync;
_player.HealthComponent.CurrentHP.Sync += HP_Sync; _player.HealthComponent.CurrentHP.Sync += HP_Sync;
_player.HealthComponent.MaximumHP.Sync += HP_Sync; _player.HealthComponent.MaximumHP.Sync += HP_Sync;
_player.VTComponent.CurrentVT.Sync += VT_Sync; _player.VTComponent.CurrentVT.Sync += VT_Sync;
_player.VTComponent.MaximumVT.Sync += VT_Sync; _player.VTComponent.MaximumVT.Sync += VT_Sync;
_player.AttackComponent.CurrentAttack.Sync += Attack_Sync; _player.AttackComponent.CurrentAttack.Sync += Attack_Sync;
_player.AttackComponent.MaximumAttack.Sync += Attack_Sync; _player.AttackComponent.MaximumAttack.Sync += Attack_Sync;
_player.DefenseComponent.CurrentDefense.Sync += Defense_Sync; _player.DefenseComponent.CurrentDefense.Sync += Defense_Sync;
_player.DefenseComponent.MaximumDefense.Sync += Defense_Sync; _player.DefenseComponent.MaximumDefense.Sync += Defense_Sync;
_player.EquipmentComponent.EquipmentChanged += EquipmentComponent_EquipmentChanged; _player.EquipmentComponent.EquipmentChanged += EquipmentComponent_EquipmentChanged;
_map.CurrentFloorNumber.Sync += CurrentFloorNumber_Sync; _map.CurrentFloorNumber.Sync += CurrentFloorNumber_Sync;
AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished; AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished;
AnimationPlayer.AnimationStarted += AnimationPlayer_AnimationStarted; AnimationPlayer.AnimationStarted += AnimationPlayer_AnimationStarted;
ContinueButton.Pressed += ContinueButton_Pressed; ContinueButton.Pressed += ContinueButton_Pressed;
ExitButton.Pressed += ExitButton_Pressed; ExitButton.Pressed += ExitButton_Pressed;
} }
private void CurrentFloorNumber_Sync(int _) => FloorNumber.Text = _map.CurrentFloorNumber.Value.ToString("D2"); private void CurrentFloorNumber_Sync(int _) => FloorNumber.Text = _map.CurrentFloorNumber.Value.ToString("D2");
private void EquipmentComponent_EquipmentChanged(EquipableItem obj) private void EquipmentComponent_EquipmentChanged(EquipableItem obj)
{ {
Attack_Sync(0); Attack_Sync(0);
Defense_Sync(0); Defense_Sync(0);
} }
private void Attack_Sync(int _) => ATKLabel.Text = $"{_player.AttackComponent.CurrentAttack.Value}/{_player.AttackComponent.MaximumAttack.Value}+{_player.EquipmentComponent.BonusAttack}"; 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() private void ExitButton_Pressed()
{ {
ContinueButton.Disabled = true; ContinueButton.Disabled = true;
ExitButton.Disabled = true; ExitButton.Disabled = true;
FadeOut(); FadeOut();
Exit?.Invoke(); Exit?.Invoke();
} }
private void ContinueButton_Pressed() private void ContinueButton_Pressed()
{ {
ContinueButton.Disabled = true; ContinueButton.Disabled = true;
ExitButton.Disabled = true; ExitButton.Disabled = true;
GoToNextFloor?.Invoke(); GoToNextFloor?.Invoke();
} }
private void AnimationPlayer_AnimationStarted(StringName animName) private void AnimationPlayer_AnimationStarted(StringName animName)
{ {
if (animName == "fade_in") if (animName == "fade_in")
ContinueButton.CallDeferred(MethodName.GrabFocus); ContinueButton.CallDeferred(MethodName.GrabFocus);
if (animName == "fade_out") if (animName == "fade_out")
CallDeferred(MethodName.ReleaseFocus); CallDeferred(MethodName.ReleaseFocus);
} }
private void AnimationPlayer_AnimationFinished(StringName animName) private void AnimationPlayer_AnimationFinished(StringName animName)
{ {
if (animName == "fade_in") if (animName == "fade_in")
{ {
ContinueButton.Disabled = false; ContinueButton.Disabled = false;
ExitButton.Disabled = false; ExitButton.Disabled = false;
} }
if (animName == "fade_out") if (animName == "fade_out")
TransitionCompleted?.Invoke(); TransitionCompleted?.Invoke();
} }
} }

View File

@@ -37,38 +37,38 @@ public partial class PlayerInfoUI : Control, IPlayerInfoUI
public void Activate() public void Activate()
{ {
Player.HealthComponent.CurrentHP.Sync += HPSync; Player.HealthComponent.CurrentHP.Sync += HPSync;
Player.HealthComponent.MaximumHP.Sync += HPSync; Player.HealthComponent.MaximumHP.Sync += HPSync;
Player.VTComponent.CurrentVT.Sync += VTSync; Player.VTComponent.CurrentVT.Sync += VTSync;
Player.VTComponent.MaximumVT.Sync += VTSync; Player.VTComponent.MaximumVT.Sync += VTSync;
Player.ExperiencePointsComponent.Level.Sync += CurrentLevel_Sync; Player.ExperiencePointsComponent.Level.Sync += CurrentLevel_Sync;
Player.ExperiencePointsComponent.CurrentExp.Sync += ExpSync; Player.ExperiencePointsComponent.CurrentExp.Sync += ExpSync;
Player.ExperiencePointsComponent.ExpToNextLevel.Sync += ExpSync; Player.ExperiencePointsComponent.ExpToNextLevel.Sync += ExpSync;
} }
private void CurrentLevel_Sync(int obj) private void CurrentLevel_Sync(int obj)
{ {
LevelNumber.Text = $"{obj}"; LevelNumber.Text = $"{obj}";
} }
private void VTSync(int obj) private void VTSync(int obj)
{ {
VTNumber.Text = $"{Player.VTComponent.CurrentVT.Value}/{Player.VTComponent.MaximumVT.Value}"; VTNumber.Text = $"{Player.VTComponent.CurrentVT.Value}/{Player.VTComponent.MaximumVT.Value}";
VTProgressBar.Value = Player.VTComponent.CurrentVT.Value; VTProgressBar.Value = Player.VTComponent.CurrentVT.Value;
VTProgressBar.MaxValue = Player.VTComponent.MaximumVT.Value; VTProgressBar.MaxValue = Player.VTComponent.MaximumVT.Value;
} }
private void HPSync(int obj) private void HPSync(int obj)
{ {
HPNumber.Text = $"{Player.HealthComponent.CurrentHP.Value}/{Player.HealthComponent.MaximumHP.Value}"; HPNumber.Text = $"{Player.HealthComponent.CurrentHP.Value}/{Player.HealthComponent.MaximumHP.Value}";
HPProgressBar.Value = Player.HealthComponent.CurrentHP.Value; HPProgressBar.Value = Player.HealthComponent.CurrentHP.Value;
HPProgressBar.MaxValue = Player.HealthComponent.MaximumHP.Value; HPProgressBar.MaxValue = Player.HealthComponent.MaximumHP.Value;
} }
private void ExpSync(int obj) 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}";
} }
} }