Commit pending working-tree changes (local edits, line endings)
This commit is contained in:
1 parent
68976523f0
commit
10f5b3455b
27 files changed
+1677
-1677
No files matched your search
+63
-63
@@ -1,63 +1,63 @@
|
||||
using Cthangover.Core.Audio;
|
||||
using Cthangover.Core.Battle;
|
||||
using Cthangover.Core.Mods;
|
||||
using Cthangover.Core.Mods.Resolvers;
|
||||
using Cthangover.Core.Scenes;
|
||||
using Cthangover.Core.Settings;
|
||||
using Cthangover.Mods.Interface.Base.Lists;
|
||||
using Cthangover.Core.UI.Theming;
|
||||
using Cthangover.Core.Utils;
|
||||
using Godot;
|
||||
|
||||
namespace Cthangover.TurnBattle
|
||||
{
|
||||
/// <summary>
|
||||
/// Defeat screen widget. Minimal compared to WingroundBehaviour —
|
||||
/// only sets the deadground background texture (resolved from mods)
|
||||
/// and offers a Main Menu button that clears BattleData and reloads
|
||||
/// the menu scene. No loot, no EXP.
|
||||
/// </summary>
|
||||
public partial class DeadgroundBehaviour : TransitionWidget
|
||||
{
|
||||
/// <summary>
|
||||
/// Clears battle data and switches to the main menu scene.
|
||||
/// Bound to the "Main Menu" button on the defeat screen.
|
||||
/// </summary>
|
||||
public void ToMainMenuClick()
|
||||
{
|
||||
var sceneService = GetNode<GodotSceneService>("/root/GodotSceneService");
|
||||
sceneService?.SwitchToMenu();
|
||||
BattleRequest.Current = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Plays the defeat sound, resolves the deadground background
|
||||
/// texture from mods, and shows the transition widget.
|
||||
/// </summary>
|
||||
public override void Show()
|
||||
{
|
||||
CthangoverTheme.Apply(this);
|
||||
CthangoverTheme.ApplyPrimary(GetNodeOrNull<Button>("Content/CenterPanel/MainMenuButton"));
|
||||
|
||||
GameLogger.Log("BATTLE", $"Deadground.Show() ENTER: Visible={Visible}, GodotVisible={base.Visible}", LogLevel.Debug);
|
||||
|
||||
var audioService = GetNodeOrNull<Node>("/root/AudioService") as IAudioService;
|
||||
audioService?.PlaySound("battle/deadground", SoundType.UI);
|
||||
|
||||
var bg = GetNodeOrNull<TextureRect>("TransitionBg");
|
||||
|
||||
GameLogger.Log("BATTLE", $"Deadground.Show: TransitionBg={(bg != null ? "found" : "NULL")}, texture={(bg?.Texture != null ? "has" : "null")}", LogLevel.Error);
|
||||
|
||||
if (bg != null && bg.Texture == null)
|
||||
{
|
||||
var tex = Textures.Resolve("deadground");
|
||||
GameLogger.Log("BATTLE", $"Deadground.Show: ResolveTexture('deadground') = {(tex != null ? "loaded" : "NULL")}", LogLevel.Error);
|
||||
bg.Texture = tex;
|
||||
}
|
||||
|
||||
base.Show();
|
||||
|
||||
GameLogger.Log("BATTLE", $"Deadground.Show() EXIT: Visible={Visible}, GodotVisible={base.Visible}", LogLevel.Debug);
|
||||
}
|
||||
}
|
||||
}
|
||||
using Cthangover.Core.Audio;
|
||||
using Cthangover.Core.Battle;
|
||||
using Cthangover.Core.Mods;
|
||||
using Cthangover.Core.Mods.Resolvers;
|
||||
using Cthangover.Core.Scenes;
|
||||
using Cthangover.Core.Settings;
|
||||
using Cthangover.Mods.Interface.Base.Lists;
|
||||
using Cthangover.Core.UI.Theming;
|
||||
using Cthangover.Core.Utils;
|
||||
using Godot;
|
||||
|
||||
namespace Cthangover.TurnBattle
|
||||
{
|
||||
/// <summary>
|
||||
/// Defeat screen widget. Minimal compared to WingroundBehaviour —
|
||||
/// only sets the deadground background texture (resolved from mods)
|
||||
/// and offers a Main Menu button that clears BattleData and reloads
|
||||
/// the menu scene. No loot, no EXP.
|
||||
/// </summary>
|
||||
public partial class DeadgroundBehaviour : TransitionWidget
|
||||
{
|
||||
/// <summary>
|
||||
/// Clears battle data and switches to the main menu scene.
|
||||
/// Bound to the "Main Menu" button on the defeat screen.
|
||||
/// </summary>
|
||||
public void ToMainMenuClick()
|
||||
{
|
||||
var sceneService = GetNode<GodotSceneService>("/root/GodotSceneService");
|
||||
sceneService?.SwitchToMenu();
|
||||
BattleRequest.Current = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Plays the defeat sound, resolves the deadground background
|
||||
/// texture from mods, and shows the transition widget.
|
||||
/// </summary>
|
||||
public override void Show()
|
||||
{
|
||||
CthangoverTheme.Apply(this);
|
||||
CthangoverTheme.ApplyPrimary(GetNodeOrNull<Button>("Content/CenterPanel/MainMenuButton"));
|
||||
|
||||
GameLogger.Log("BATTLE", $"Deadground.Show() ENTER: Visible={Visible}, GodotVisible={base.Visible}", LogLevel.Debug);
|
||||
|
||||
var audioService = GetNodeOrNull<Node>("/root/AudioService") as IAudioService;
|
||||
audioService?.PlaySound("battle/deadground", SoundType.UI);
|
||||
|
||||
var bg = GetNodeOrNull<TextureRect>("TransitionBg");
|
||||
|
||||
GameLogger.Log("BATTLE", $"Deadground.Show: TransitionBg={(bg != null ? "found" : "NULL")}, texture={(bg?.Texture != null ? "has" : "null")}", LogLevel.Error);
|
||||
|
||||
if (bg != null && bg.Texture == null)
|
||||
{
|
||||
var tex = Textures.Resolve("deadground");
|
||||
GameLogger.Log("BATTLE", $"Deadground.Show: ResolveTexture('deadground') = {(tex != null ? "loaded" : "NULL")}", LogLevel.Error);
|
||||
bg.Texture = tex;
|
||||
}
|
||||
|
||||
base.Show();
|
||||
|
||||
GameLogger.Log("BATTLE", $"Deadground.Show() EXIT: Visible={Visible}, GodotVisible={base.Visible}", LogLevel.Debug);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user