From e87212ea601b2a144d114c196352d77102c3714c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DragonRatTiger=20/=20=E3=83=AA=E3=83=A5=E3=82=A6=E3=82=B3?= Date: Wed, 23 Oct 2024 10:10:43 -0500 Subject: [PATCH] More stuff and also imgui (#717) * Add names to input devices * Deprecate unused textures * ImGui debugging - track Script.lua textures * ImGui debugging - track Module textures * ImGui debugging - track Kusudama textures * actually let's not put that in a tree * Remove unused input methods for now * Update ImGuiDebugWindow.cs * Update OpenTaiko/src/Common/ImGuiDebugWindow.cs Co-authored-by: Wei-Cheng Yeh (IID) * Further simplify lyric sandwich --------- Co-authored-by: Wei-Cheng Yeh (IID) --- FDK/src/02.Input/CInputGamepad.cs | 8 ++ FDK/src/02.Input/CInputJoystick.cs | 19 +-- FDK/src/02.Input/CInputKeyboard.cs | 2 + FDK/src/02.Input/CInputMIDI.cs | 2 + FDK/src/02.Input/CInputManager.cs | 2 +- FDK/src/02.Input/CInputMouse.cs | 10 +- FDK/src/02.Input/IInputDevice.cs | 3 + OpenTaiko/src/Common/ImGuiDebugWindow.cs | 133 +++++++++++++++--- OpenTaiko/src/Lua/CLuaScript.cs | 4 +- .../src/Stages/01.StartUp/TextureLoader.cs | 6 +- .../Stages/07.Game/Taiko/CActImplBalloon.cs | 2 +- .../07.Game/Taiko/CActImplClearAnimation.cs | 42 +++--- .../src/Stages/07.Game/Taiko/CActImplGauge.cs | 67 +++++---- .../src/Stages/07.Game/Taiko/CActImplMob.cs | 2 +- 14 files changed, 198 insertions(+), 104 deletions(-) diff --git a/FDK/src/02.Input/CInputGamepad.cs b/FDK/src/02.Input/CInputGamepad.cs index 4800fa28..94857464 100644 --- a/FDK/src/02.Input/CInputGamepad.cs +++ b/FDK/src/02.Input/CInputGamepad.cs @@ -4,10 +4,14 @@ namespace FDK { public class CInputGamepad : IInputDevice, IDisposable { // Constructor + private IGamepad Gamepad { get; set; } + public CInputGamepad(IGamepad gamepad) { + this.Gamepad = gamepad; this.CurrentType = InputDeviceType.Gamepad; this.GUID = gamepad.Index.ToString(); this.ID = gamepad.Index; + this.Name = gamepad.Name; this.InputEvents = new List(32); @@ -36,6 +40,10 @@ namespace FDK { get; private set; } + public string Name { + get; + private set; + } public List InputEvents { get; private set; diff --git a/FDK/src/02.Input/CInputJoystick.cs b/FDK/src/02.Input/CInputJoystick.cs index 915244ba..18699bdc 100644 --- a/FDK/src/02.Input/CInputJoystick.cs +++ b/FDK/src/02.Input/CInputJoystick.cs @@ -4,20 +4,19 @@ namespace FDK { public class CInputJoystick : IInputDevice, IDisposable { // Constructor - private IJoystick Joystick { get; set; } + public IJoystick Joystick { get; private set; } public CInputJoystick(IJoystick joystick) { - Joystick = joystick; + this.Joystick = joystick; this.CurrentType = InputDeviceType.Joystick; this.GUID = joystick.Index.ToString(); this.ID = joystick.Index; + this.Name = joystick.Name; this.InputEvents = new List(32); joystick.ButtonDown += Joystick_ButtonDown; joystick.ButtonUp += Joystick_ButtonUp; - joystick.AxisMoved += Joystick_AxisMoved; - joystick.HatMoved += Joystick_HatMoved; } @@ -41,6 +40,10 @@ namespace FDK { get; private set; } + public string Name { + get; + private set; + } public List InputEvents { get; private set; @@ -145,14 +148,6 @@ namespace FDK { ButtonStates[(int)button.Name].Item1 = false; } } - - private void Joystick_AxisMoved(IJoystick joystick, Axis axis) { - - } - - private void Joystick_HatMoved(IJoystick joystick, Hat hat) { - - } //----------------- #endregion } diff --git a/FDK/src/02.Input/CInputKeyboard.cs b/FDK/src/02.Input/CInputKeyboard.cs index ff39c44f..d3067597 100644 --- a/FDK/src/02.Input/CInputKeyboard.cs +++ b/FDK/src/02.Input/CInputKeyboard.cs @@ -8,6 +8,7 @@ namespace FDK { this.CurrentType = InputDeviceType.Keyboard; this.GUID = ""; this.ID = 0; + this.Name = keyboards.Count > 0 ? keyboards[0].Name : ""; foreach (var keyboard in keyboards) { keyboard.KeyDown += KeyDown; @@ -28,6 +29,7 @@ namespace FDK { public InputDeviceType CurrentType { get; private set; } public string GUID { get; private set; } public int ID { get; private set; } + public string Name { get; private set; } public List InputEvents { get; private set; } public string strDeviceName { get; set; } diff --git a/FDK/src/02.Input/CInputMIDI.cs b/FDK/src/02.Input/CInputMIDI.cs index 70db65eb..9b126185 100644 --- a/FDK/src/02.Input/CInputMIDI.cs +++ b/FDK/src/02.Input/CInputMIDI.cs @@ -14,6 +14,7 @@ this.CurrentType = InputDeviceType.MidiIn; this.GUID = ""; this.ID = (int)nID; + this.Name = ""; this.strDeviceName = ""; // CInput管理で初期化する } @@ -59,6 +60,7 @@ public InputDeviceType CurrentType { get; private set; } public string GUID { get; private set; } public int ID { get; private set; } + public string Name { get; private set; } public List InputEvents { get; private set; } public string strDeviceName { get; set; } diff --git a/FDK/src/02.Input/CInputManager.cs b/FDK/src/02.Input/CInputManager.cs index e3cc8feb..de7bdd48 100644 --- a/FDK/src/02.Input/CInputManager.cs +++ b/FDK/src/02.Input/CInputManager.cs @@ -80,7 +80,7 @@ namespace FDK { Trace.TraceInformation("Found {0} Input Device{1}", InputDevices.Count, InputDevices.Count != 1 ? "s:" : ":"); for (int i = 0; i < InputDevices.Count; i++) { try { - Trace.TraceInformation("Input Device #" + i + " (" + InputDevices[i].CurrentType.ToString() + ")"); + Trace.TraceInformation("Input Device #" + i + " (" + InputDevices[i].CurrentType.ToString() + " - " + InputDevices[i].Name + ")"); } catch { } } diff --git a/FDK/src/02.Input/CInputMouse.cs b/FDK/src/02.Input/CInputMouse.cs index 1b2e3444..30bdbeee 100644 --- a/FDK/src/02.Input/CInputMouse.cs +++ b/FDK/src/02.Input/CInputMouse.cs @@ -15,13 +15,7 @@ namespace FDK { this.CurrentType = InputDeviceType.Mouse; this.GUID = ""; this.ID = 0; - try { - Trace.TraceInformation(mouse.Name + " を生成しました。"); // なぜか0x00のゴミが出るので削除 - this.strDeviceName = mouse.Name; - } catch { - Trace.TraceWarning("Mouse デバイスの生成に失敗しました。"); - throw; - } + this.Name = mouse.Name; mouse.Click += Mouse_Click; mouse.DoubleClick += Mouse_DoubleClick; @@ -40,8 +34,8 @@ namespace FDK { public InputDeviceType CurrentType { get; private set; } public string GUID { get; private set; } public int ID { get; private set; } + public string Name { get; private set; } public List InputEvents { get; private set; } - public string strDeviceName { get; set; } public void Polling(bool useBufferInput) { InputEvents.Clear(); diff --git a/FDK/src/02.Input/IInputDevice.cs b/FDK/src/02.Input/IInputDevice.cs index 504529f9..349b785b 100644 --- a/FDK/src/02.Input/IInputDevice.cs +++ b/FDK/src/02.Input/IInputDevice.cs @@ -11,6 +11,9 @@ int ID { get; } + string Name { + get; + } List InputEvents { get; } diff --git a/OpenTaiko/src/Common/ImGuiDebugWindow.cs b/OpenTaiko/src/Common/ImGuiDebugWindow.cs index 07566ba5..9a711110 100644 --- a/OpenTaiko/src/Common/ImGuiDebugWindow.cs +++ b/OpenTaiko/src/Common/ImGuiDebugWindow.cs @@ -18,6 +18,7 @@ namespace OpenTaiko { private static long memoryReadTimer = 0; private static long pagedmemory = 0; private static int textureMemoryUsage = 0; + private static int currentStageMemoryUsage = 0; private static int sortType = -1; private static readonly string[] sortNames = ["Memory Usage (Highest->Lowest)", "Memory Usage (Lowest->Highest)", "Pointer ID"]; @@ -98,7 +99,7 @@ namespace OpenTaiko { ImGui.Text("Unknown: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Unknown)); foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) { - if (ImGui.TreeNodeEx(device.CurrentType.ToString() + " (ID " + device.ID + ")")) { + if (ImGui.TreeNodeEx(device.CurrentType.ToString() + " (ID " + device.ID + " / Name: " + device.Name + ")")) { switch (device.CurrentType) { case InputDeviceType.Keyboard: var keyboard = (CInputKeyboard)device; @@ -313,7 +314,6 @@ namespace OpenTaiko { ImGui.Text("Subtitle: " + dtx.SUBTITLE.GetString("")); ImGui.Text("Charter: " + dtx.MAKER); - // BPM ImGui.Text("BPM: " + dtx.BASEBPM + (dtx.listBPM.Count > 1 ? (" (Min: " + dtx.MinBPM + " / Max: " + dtx.MaxBPM + ")") : "")); if (dtx.listBPM.Count > 1) { if (ImGui.TreeNodeEx($"BPM List ({dtx.listBPM.Count})###GAME_BPM_LIST_{i}")) { @@ -324,6 +324,8 @@ namespace OpenTaiko { } } + ImGui.Text("Lyrics: " + (dtx.usingLyricsFile ? dtx.listLyric2.Count : dtx.listLyric.Count)); + ImGui.NewLine(); ImGui.Text("Note Count: "); @@ -346,12 +348,7 @@ namespace OpenTaiko { } private static void Textures() { if (ImGui.BeginTabItem("Textures")) { - ImGui.Text("Total Texture Count: " + OpenTaiko.Tx.listTexture.Count); - ImGui.Text("Total Memory Usage: " + textureMemoryUsage + "bytes (" + GetMemAllocationInMegabytes(textureMemoryUsage) + "MB)"); - if (ImGui.Button("Refresh") || textureMemoryUsage == 0) { - textureMemoryUsage = OpenTaiko.Tx.listTexture.Where(tex => tex != null).Sum(tex => tex.szTextureSize.Width * tex.szTextureSize.Height * 4); - } - if (ImGui.BeginCombo("Change Sort", sortType != -1 ? sortNames[sortType] : "(Default)")) { + if (ImGui.BeginCombo("Change listTexture Sort###TEXTURE_TOTAL_SORT", sortType != -1 ? sortNames[sortType] : "(Default)")) { if (ImGui.Selectable(sortNames[0], sortType == 0)) { OpenTaiko.Tx.listTexture.Sort((tex1, tex2) => (tex2 != null ? tex2.szTextureSize.Width * tex2.szTextureSize.Height : -1).CompareTo(tex1 != null ? tex1.szTextureSize.Width * tex1.szTextureSize.Height : -1)); sortType = 0; @@ -366,17 +363,93 @@ namespace OpenTaiko { } ImGui.EndCombo(); } + if (OpenTaiko.r現在のステージ.eStageID != CStage.EStage.StartUp) + CTextureListPopup(OpenTaiko.Tx.listTexture, "Show listTexture", "TEXTURE_ALL"); + else + ImGui.TextDisabled("To prevent crash during enumeration,\nyou can not view the texture list during StartUp stage."); - if (ImGui.TreeNodeEx("Show All Textures###TEXTURE_SHOWALL")) { - int index = 0; - if (OpenTaiko.r現在のステージ.eStageID == CStage.EStage.StartUp) - ImGui.TextDisabled("To prevent crash during enumeration,\nyou can not view the texture list during StartUp stage."); - else - foreach (CTexture tex in OpenTaiko.Tx.listTexture) { - CTexturePopup(tex, $"#{index} (Pointer: {(tex != null ? tex.Pointer : "null")})###TEXTURE_SHOW_POPUP_{index++}"); - } - ImGui.TreePop(); + currentStageMemoryUsage = 0; + + #region Script.lua Memory Usage + int index = 0; + foreach (CLuaScript luascript in CLuaScript.listScripts) + currentStageMemoryUsage += CTextureListPopup(luascript.listDisposables.OfType(), + $"Module #{index}", $"MODULE{index++}_TEXTURES"); + + switch (OpenTaiko.r現在のステージ.eStageID) { + #region Game + case CStage.EStage.Game: + + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBackground.UpScript, + "Up Background", "TEXTURE_LUA_UPBG"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBackground.DownScript, + "Down Background", "TEXTURE_LUA_DOWNBG"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actMob.MobScript, + "Mob", "TEXTURE_LUA_MOB"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBalloon.KusudamaScript, + "Kusudama", "TEXTURE_LUA_KUSUDAMA"); + + #region Endings + switch ((Difficulty)OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) { + case Difficulty.Tower: + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_DropoutScript, + "Tower Dropout", "TEXTURE_LUA_TOWERDROPOUT"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_PassScript, + "Tower Cleared", "TEXTURE_LUA_TOWERCLEAR"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_FullComboScript, + "Tower Full Combo", "TEXTURE_LUA_TOWERFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_PerfectScript, + "Tower Perfect Combo", "TEXTURE_LUA_TOWERPFC"); + break; + case Difficulty.Dan: + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_FailScript, + "Dan Clear Failed", "TEXTURE_LUA_DANFAILED"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PassScript, + "Dan Red Clear", "TEXTURE_LUA_DANCLEAR"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_FullComboScript, + "Dan Red Full Combo", "TEXTURE_LUA_DANFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PerfectScript, + "Dan Red Perfect", "TEXTURE_LUA_DANPFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PassScript, + "Dan Gold Clear", "TEXTURE_LUA_DANGOLDCLEAR"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_FullComboScript, + "Dan Gold Full Combo", "TEXTURE_LUA_DANGOLDFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PerfectScript, + "Dan Gold Perfect", "TEXTURE_LUA_DANGOLDPFC"); + break; + default: + if (OpenTaiko.ConfigIni.bAIBattleMode) { + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AILoseScript, + "AI Clear Failed", "TEXTURE_LUA_AIFAILED"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWinScript, + "AI Cleared", "TEXTURE_LUA_AICLEAR"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWin_FullComboScript, + "AI Full Combo", "TEXTURE_LUA_AIFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWin_PerfectScript, + "AI Perfect Combo", "TEXTURE_LUA_AIPFC"); + } + else { + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.FailedScript, + "Clear Failed", "TEXTURE_LUA_GAMEFAILED"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.ClearScript, + "Cleared", "TEXTURE_LUA_GAMECLEAR"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.FullComboScript, + "Full Combo", "TEXTURE_LUA_GAMEFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.PerfectComboScript, + "Perfect Combo", "TEXTURE_LUA_GAMEPFC"); + } + break; + } + #endregion + + #endregion + + break; } + + ImGui.Text("Script.lua Tex Memory Usage: " + GetMemAllocationInMegabytes(currentStageMemoryUsage) + "MB"); + #endregion + ImGui.EndTabItem(); } } @@ -409,6 +482,22 @@ namespace OpenTaiko { } } } + private static int CTextureListPopup(IEnumerable textureList, string label, string id) { + if (textureList == null) return 0; + int memoryCount = GetTotalMemoryUsageFromCTextureList(textureList); + + if (ImGui.TreeNodeEx($"{label} Textures: ({textureList.Count()} / {String.Format("{0:0.###}", GetMemAllocationInMegabytes(memoryCount))}MB)###{id}")) { + int index = 0; + foreach (CTexture tex in textureList) { + CTexturePopup(tex, $"Texture #{index} (Pointer: {(tex != null ? tex.Pointer : "null")})###{id}_{index++}"); + } + ImGui.TreePop(); + } + return memoryCount; + } + private static int CTextureListPopup(ScriptBG script, string label, string id) { + return script != null ? CTextureListPopup(script.Textures.Values, label, id) : 0; + } private static bool DrawCTextureForImGui(CTexture texture) { if (texture == null) return false; return DrawCTextureForImGui(texture, @@ -446,12 +535,18 @@ namespace OpenTaiko { return (float)GetTextureMemAllocation(texture) / (1024 * 1024); } private static int GetTextureMemAllocation(CTexture texture) { - if (texture == null) return 0; - return texture.szTextureSize.Width * texture.szTextureSize.Height * 4; + return texture != null ? (texture.szTextureSize.Width * texture.szTextureSize.Height * 4) : 0; } private static Vector4 ColorToVector4(Color color) { return new Vector4((float)color.R / 255, (float)color.G / 255, (float)color.B / 255, (float)color.A / 255); } + + private static int GetTotalMemoryUsageFromCTextureList(IEnumerable textureList) { + return textureList.Where(tex => tex != null).Sum(GetTextureMemAllocation); + } + private static int GetTotalMemoryUsageFromCTextureList(ScriptBG script) { + return script != null ? GetTotalMemoryUsageFromCTextureList(script.Textures.Values) : 0; + } #endregion } diff --git a/OpenTaiko/src/Lua/CLuaScript.cs b/OpenTaiko/src/Lua/CLuaScript.cs index 41a11232..e9506709 100644 --- a/OpenTaiko/src/Lua/CLuaScript.cs +++ b/OpenTaiko/src/Lua/CLuaScript.cs @@ -7,7 +7,7 @@ using NLua; namespace OpenTaiko { class CLuaScript : IDisposable { - private static List listScripts = new List(); + public static List listScripts { get; private set; } = new List(); public static void tReloadLanguage(string lang) { foreach (var item in listScripts) { item.ReloadLanguage(lang); @@ -32,7 +32,7 @@ namespace OpenTaiko { private CLuaInfo luaInfo; private CLuaFps luaFPS = new CLuaFps(); - private List listDisposables = new List(); + public List listDisposables { get; private set; } = new List(); protected bool Available { get { diff --git a/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs b/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs index 7eec42b2..17c6d2fc 100644 --- a/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs +++ b/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs @@ -602,7 +602,6 @@ namespace OpenTaiko { Gauge_Dan[5] = TxC(GAME + GAUGE + @$"1P_Dan_Right.png"); Gauge_Soul = TxC(GAME + GAUGE + @$"Soul.png"); - Gauge_Flash = TxC(GAME + GAUGE + @$"Flash.png"); Gauge_Soul_Fire = TxC(GAME + GAUGE + @$"Fire.png"); Gauge_Soul_Explosion = new CTexture[2]; Gauge_Soul_Explosion[0] = TxC(GAME + GAUGE + @$"1P_Explosion.png"); @@ -875,7 +874,6 @@ namespace OpenTaiko { #endregion #region 6_結果発表 - Result_FadeIn = TxC(RESULT + @$"FadeIn.png"); Result_Gauge[0] = TxC(RESULT + @$"Gauge.png"); Result_Gauge_Base[0] = TxC(RESULT + @$"Gauge_Base.png"); @@ -2529,7 +2527,6 @@ namespace OpenTaiko { Gauge_Killzone, Gauge_Soul_Explosion; public CTexture Gauge_Soul, - Gauge_Flash, Gauge_Soul_Fire; public CTexture[] Gauge_Dan; public CTexture[] Gauge_Dan_Rainbow; @@ -2672,8 +2669,7 @@ namespace OpenTaiko { #endregion #region 6_結果発表 - public CTexture Result_FadeIn, - Result_Header, + public CTexture Result_Header, Result_Number, Result_Panel, Result_Panel_2P, diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs index f78ff179..4c54b740 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs @@ -182,7 +182,7 @@ namespace OpenTaiko { return base.Draw(); } - private KusudamaScript KusudamaScript; + public KusudamaScript KusudamaScript { get; private set; } private CCounter ct風船終了; diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs index b34f2738..f5dcd896 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs @@ -742,29 +742,29 @@ namespace OpenTaiko { #region[ private ] //----------------- - private EndAnimeScript FailedScript; - private EndAnimeScript ClearScript; - private EndAnimeScript FullComboScript; - private EndAnimeScript PerfectComboScript; + public EndAnimeScript FailedScript { get; private set; } + public EndAnimeScript ClearScript { get; private set; } + public EndAnimeScript FullComboScript { get; private set; } + public EndAnimeScript PerfectComboScript { get; private set; } - private EndAnimeScript AILoseScript; - private EndAnimeScript AIWinScript; - private EndAnimeScript AIWin_FullComboScript; - private EndAnimeScript AIWin_PerfectScript; + public EndAnimeScript AILoseScript { get; private set; } + public EndAnimeScript AIWinScript { get; private set; } + public EndAnimeScript AIWin_FullComboScript { get; private set; } + public EndAnimeScript AIWin_PerfectScript { get; private set; } - private EndAnimeScript Tower_DropoutScript; - private EndAnimeScript Tower_TopReached_PassScript; - private EndAnimeScript Tower_TopReached_FullComboScript; - private EndAnimeScript Tower_TopReached_PerfectScript; + public EndAnimeScript Tower_DropoutScript { get; private set; } + public EndAnimeScript Tower_TopReached_PassScript { get; private set; } + public EndAnimeScript Tower_TopReached_FullComboScript { get; private set; } + public EndAnimeScript Tower_TopReached_PerfectScript { get; private set; } - private EndAnimeScript Dan_FailScript; - private EndAnimeScript Dan_Red_PassScript; - private EndAnimeScript Dan_Red_FullComboScript; - private EndAnimeScript Dan_Red_PerfectScript; + public EndAnimeScript Dan_FailScript { get; private set; } + public EndAnimeScript Dan_Red_PassScript { get; private set; } + public EndAnimeScript Dan_Red_FullComboScript { get; private set; } + public EndAnimeScript Dan_Red_PerfectScript { get; private set; } - private EndAnimeScript Dan_Gold_PassScript; - private EndAnimeScript Dan_Gold_FullComboScript; - private EndAnimeScript Dan_Gold_PerfectScript; + public EndAnimeScript Dan_Gold_PassScript { get; private set; } + public EndAnimeScript Dan_Gold_FullComboScript { get; private set; } + public EndAnimeScript Dan_Gold_PerfectScript { get; private set; } @@ -804,8 +804,8 @@ namespace OpenTaiko { CSound soundAIWinFullCombo; CSound soundAIWinPerfectCombo; - EndMode[] Mode; - enum EndMode { + public EndMode[] Mode { get; private set; } + public enum EndMode { StageFailed, StageCleared, StageFullCombo, diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplGauge.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplGauge.cs index 9fa17233..680b71df 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplGauge.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplGauge.cs @@ -240,42 +240,41 @@ namespace OpenTaiko { } + #region [Rainbow] + + if (this.db現在のゲージ値[0] >= 100.0) { + this.ct虹アニメ.TickLoop(); + this.ct虹透明度.TickLoop(); + if (OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue] != null) { + OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.X = scale; + OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.Y = scale; + + OpenTaiko.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.X = scale; + OpenTaiko.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.Y = scale; + + bool smart = OpenTaiko.ConfigIni.nPlayerCount > 2 || OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan; + + + OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].Opacity = 255; + OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].t2D描画(x, y + (smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0), + new RectangleF(0, + smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0, + OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Width, + smart ? OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Height - (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Height)); + + + OpenTaiko.Tx.Gauge_Rainbow[虹ベース].Opacity = (ct虹透明度.CurrentValue * 255 / (int)ct虹透明度.EndValue) / 1; + OpenTaiko.Tx.Gauge_Rainbow[虹ベース].t2D描画(x, y + (smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0), + new RectangleF(0, + smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0, + OpenTaiko.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Width, + smart ? OpenTaiko.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Height - (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : OpenTaiko.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Height)); + } + } + + #endregion if (OpenTaiko.Tx.Gauge_Line[0] != null) { - #region [Rainbow] - - if (this.db現在のゲージ値[0] >= 100.0) { - this.ct虹アニメ.TickLoop(); - this.ct虹透明度.TickLoop(); - if (OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue] != null) { - OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.X = scale; - OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.Y = scale; - - OpenTaiko.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.X = scale; - OpenTaiko.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.Y = scale; - - bool smart = OpenTaiko.ConfigIni.nPlayerCount > 2 || OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan; - - - OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].Opacity = 255; - OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].t2D描画(x, y + (smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0), - new RectangleF(0, - smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0, - OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Width, - smart ? OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Height - (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Height)); - - - OpenTaiko.Tx.Gauge_Rainbow[虹ベース].Opacity = (ct虹透明度.CurrentValue * 255 / (int)ct虹透明度.EndValue) / 1; - OpenTaiko.Tx.Gauge_Rainbow[虹ベース].t2D描画(x, y + (smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0), - new RectangleF(0, - smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0, - OpenTaiko.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Width, - smart ? OpenTaiko.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Height - (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : OpenTaiko.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Height)); - } - } - - #endregion - OpenTaiko.Tx.Gauge_Line[0].vcScaleRatio.X = scale; OpenTaiko.Tx.Gauge_Line[0].vcScaleRatio.Y = scale; diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs index 8c5e8ff7..34f1426b 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs @@ -78,7 +78,7 @@ namespace OpenTaiko { } #region[ private ] //----------------- - private ScriptBG MobScript; + public ScriptBG MobScript { get; private set; } //----------------- #endregion }