diff --git a/OpenTaiko/System/Open-World Memories/ConfigConfig.ini b/OpenTaiko/System/Open-World Memories/ConfigConfig.ini index dd28383a..4176076e 100644 --- a/OpenTaiko/System/Open-World Memories/ConfigConfig.ini +++ b/OpenTaiko/System/Open-World Memories/ConfigConfig.ini @@ -38,4 +38,8 @@ Config_Selected_Menu_Text_Grad_Color_2=#404FF6 Config_ExplanationPanel=67,570 -Config_SkinSample1=200,660 \ No newline at end of file +Config_SkinSample1=200,660 + +Config_Calibration_OffsetText=300,288 +Config_Calibration_InfoText=8,550 +Config_Calibration_Highlights=371,724,371,209,774,724,371,209,1179,724,371,209 \ No newline at end of file diff --git a/OpenTaiko/System/Open-World Memories/Graphics/2_Config/Calibration/BG.png b/OpenTaiko/System/Open-World Memories/Graphics/2_Config/Calibration/BG.png new file mode 100644 index 00000000..8a7ee689 Binary files /dev/null and b/OpenTaiko/System/Open-World Memories/Graphics/2_Config/Calibration/BG.png differ diff --git a/OpenTaiko/System/Open-World Memories/Graphics/2_Config/Calibration/FG.png b/OpenTaiko/System/Open-World Memories/Graphics/2_Config/Calibration/FG.png new file mode 100644 index 00000000..9878c024 Binary files /dev/null and b/OpenTaiko/System/Open-World Memories/Graphics/2_Config/Calibration/FG.png differ diff --git a/OpenTaiko/System/Open-World Memories/Graphics/2_Config/Calibration/FG_ja.png b/OpenTaiko/System/Open-World Memories/Graphics/2_Config/Calibration/FG_ja.png new file mode 100644 index 00000000..9f947199 Binary files /dev/null and b/OpenTaiko/System/Open-World Memories/Graphics/2_Config/Calibration/FG_ja.png differ diff --git a/OpenTaiko/System/Open-World Memories/Graphics/3_SongSelect/Favorite.png b/OpenTaiko/System/Open-World Memories/Graphics/3_SongSelect/Favorite.png index 1044e575..4c7c617a 100644 Binary files a/OpenTaiko/System/Open-World Memories/Graphics/3_SongSelect/Favorite.png and b/OpenTaiko/System/Open-World Memories/Graphics/3_SongSelect/Favorite.png differ diff --git a/OpenTaiko/System/Open-World Memories/Graphics/5_Game/19_Training/Background_Up.png b/OpenTaiko/System/Open-World Memories/Graphics/5_Game/19_Training/Background_Up.png index 6bfbd080..f7fa191d 100644 Binary files a/OpenTaiko/System/Open-World Memories/Graphics/5_Game/19_Training/Background_Up.png and b/OpenTaiko/System/Open-World Memories/Graphics/5_Game/19_Training/Background_Up.png differ diff --git a/OpenTaiko/System/Open-World Memories/SongSelectConfig.ini b/OpenTaiko/System/Open-World Memories/SongSelectConfig.ini index 1023340b..143c4058 100644 --- a/OpenTaiko/System/Open-World Memories/SongSelectConfig.ini +++ b/OpenTaiko/System/Open-World Memories/SongSelectConfig.ini @@ -12,6 +12,7 @@ SongSelect_Bar_Y=-125,-35,55,145,235,325,415,505,595,685,775,865,955,1045,1135 SongSelect_Bar_Select=276,501 SongSelect_Bar_Anim_X=0,360,320,280,240,200,160,0,-160,-200,-240,-280,-320,-360,0 SongSelect_Bar_Anim_Y=0,2700,2400,2100,1800,1500,1200,0,-1200,-1500,-1800,-2100,-2400,-2700,0 +SongSelect_FavoriteStatus_Offset=730,40 SongSelect_BoxExplanation_X=1365 SongSelect_BoxExplanation_Y=463 diff --git a/OpenTaiko/System/Open-World Memories/Sounds/Calibrate.ogg b/OpenTaiko/System/Open-World Memories/Sounds/Calibrate.ogg new file mode 100644 index 00000000..b6a72ecb Binary files /dev/null and b/OpenTaiko/System/Open-World Memories/Sounds/Calibrate.ogg differ diff --git a/OpenTaiko/src/Common/CSkin.cs b/OpenTaiko/src/Common/CSkin.cs index 0a66d398..7041308e 100644 --- a/OpenTaiko/src/Common/CSkin.cs +++ b/OpenTaiko/src/Common/CSkin.cs @@ -421,6 +421,8 @@ namespace TJAPlayer3 public CSystemSound[] soundExToExtra = null; public CSystemSound[] soundExtraToEx = null; + public CSystemSound calibrationTick = null; + public CSystemSound[] soundModal = null; public CSystemSound soundCrownIn = null; @@ -809,6 +811,8 @@ namespace TJAPlayer3 soundExToExtra = new CSystemSound[1] { new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongSelect{System.IO.Path.DirectorySeparatorChar}0{System.IO.Path.DirectorySeparatorChar}ExToExtra.ogg", false, false, false, ESoundGroup.SoundEffect) }; // Placeholder until Komi decides soundExtraToEx = new CSystemSound[1] { new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongSelect{System.IO.Path.DirectorySeparatorChar}0{System.IO.Path.DirectorySeparatorChar}ExtraToEx.ogg", false, false, false, ESoundGroup.SoundEffect) }; // what to do with it lol + calibrationTick = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Calibrate.ogg", false, false, false, ESoundGroup.SoundEffect); + soundModal = new CSystemSound[6]; for (int i = 0; i < soundModal.Length - 1; i++) { @@ -1805,6 +1809,34 @@ namespace TJAPlayer3 Config_KeyAssign_Move = int.Parse(strParam); break; } + case nameof(Config_Calibration_OffsetText): + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Config_Calibration_OffsetText[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Config_Calibration_InfoText): + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Config_Calibration_InfoText[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Config_Calibration_Highlights): + { + string[] strSplit = strParam.Split(','); + int recs = Math.Min(strSplit.Length, 12); + for (int i = 0; i+3 < recs; i+=4) + { + Config_Calibration_Highlights[i/4] = new Rectangle(int.Parse(strSplit[i]), int.Parse(strSplit[i+1]), int.Parse(strSplit[i+2]), int.Parse(strSplit[i+3])); + } + break; + } #endregion #region [Mod Icons] @@ -9513,6 +9545,14 @@ namespace TJAPlayer3 public int[] Config_KeyAssign_Font = new int[] { 308, 64 }; public int Config_KeyAssign_Move = 20; + public int[] Config_Calibration_OffsetText = new int[] { 300, 288 }; + public int[] Config_Calibration_InfoText = new int[] { 8, 550 }; + public Rectangle[] Config_Calibration_Highlights = new Rectangle[] { + new Rectangle(371, 724, 371, 209), + new Rectangle(774, 724, 371, 209), + new Rectangle(1179, 724, 371, 209) + }; + #endregion #region Puchichara diff --git a/OpenTaiko/src/Common/C文字コンソール.cs b/OpenTaiko/src/Common/C文字コンソール.cs index 6e700249..43eee3df 100644 --- a/OpenTaiko/src/Common/C文字コンソール.cs +++ b/OpenTaiko/src/Common/C文字コンソール.cs @@ -125,7 +125,7 @@ namespace TJAPlayer3 //----------------- private Rectangle[,] rc文字の矩形領域; private const string str表記可能文字 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ "; - private int nFontWidth = 8, nFontHeight = 16; + public int nFontWidth = 8, nFontHeight = 16; private CTexture[] txフォント8x16 = new CTexture[ 2 ]; //----------------- #endregion diff --git a/OpenTaiko/src/Helpers/HScenePreset.cs b/OpenTaiko/src/Helpers/HScenePreset.cs index 8a2daeb2..90ebe425 100644 --- a/OpenTaiko/src/Helpers/HScenePreset.cs +++ b/OpenTaiko/src/Helpers/HScenePreset.cs @@ -51,30 +51,32 @@ namespace TJAPlayer3 break; }; - var preset = (_ps != null + bool sectionIsValid = _ps != null ? ((Dictionary)_ps).Count > 0 : false; + + var preset = (sectionIsValid && TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset != null && ((Dictionary)_ps).ContainsKey(TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset)) ? ((Dictionary)_ps)[TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset] : null; - if (_ps != null + if (sectionIsValid && TJAPlayer3.DTX.scenePreset != null && ((Dictionary)_ps).ContainsKey(TJAPlayer3.DTX.scenePreset)) // If currently selected song has valid SCENEPRESET metadata within TJA { preset = ((Dictionary)_ps)[TJAPlayer3.DTX.scenePreset]; } - else if (_ps != null + else if (sectionIsValid && TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset != null && ((Dictionary)_ps).ContainsKey(TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset)) { preset = ((Dictionary)_ps)[TJAPlayer3.stageSongSelect.rChoosenSong.strScenePreset]; } - else if (_ps != null + else if (sectionIsValid && ((Dictionary)_ps).ContainsKey("")) { preset = ((Dictionary)_ps)[""]; } - else if (_ps != null) + else if (sectionIsValid) { var cstps = (Dictionary)_ps; Random rand = new Random(); diff --git a/OpenTaiko/src/I18N/CLang_en.cs b/OpenTaiko/src/I18N/CLang_en.cs index b0dc3f99..d54cb2a1 100644 --- a/OpenTaiko/src/I18N/CLang_en.cs +++ b/OpenTaiko/src/I18N/CLang_en.cs @@ -29,7 +29,7 @@ namespace TJAPlayer3 [10149] = "Clean the existing database and\n" + "reload the song folder from scratch.", [6] = "Player Count", - [7] = "Select how many players you want to play with. Up to 5 players can be active at once.", + [7] = "Select how many players you want to play with.\nUp to 5 players can be active at once.", [8] = "Kanpeki Mode", [9] = "Choose how many BADs are allowed\nbefore a song is automatically failed.\nSet this to 0 to disable the mode.", [10] = "Song Playback Speed", @@ -380,6 +380,9 @@ namespace TJAPlayer3 [10190] = "Jump to Last Measure", [10191] = "Drums key assign:\nAssign any key for jumping to the last measure.", + [10192] = "Calibrate Offset", + [10193] = "Calibrate your offset.\nGlobal Offset will be overwritten if saved.", + [100] = "Taiko Mode", [101] = "Dan-i Dojo", [102] = "Taiko Towers", diff --git a/OpenTaiko/src/I18N/CLang_es.cs b/OpenTaiko/src/I18N/CLang_es.cs index 64e9c1c0..37d0e9d2 100644 --- a/OpenTaiko/src/I18N/CLang_es.cs +++ b/OpenTaiko/src/I18N/CLang_es.cs @@ -251,6 +251,9 @@ namespace TJAPlayer3 [10189] = "Drums key assign:\nAssign any key for jumping to the first measure.", [10190] = "Jump to Last Measure", [10191] = "Drums key assign:\nAssign any key for jumping to the last measure.", + + [10192] = "Calibrate Offset", + [10193] = "Calibrate your offset.\nGlobal Offset will be overwritten if saved.", // Please translate the text above! [99] = "Rojo izquierdo", diff --git a/OpenTaiko/src/I18N/CLang_fr.cs b/OpenTaiko/src/I18N/CLang_fr.cs index f59776eb..b9d925ba 100644 --- a/OpenTaiko/src/I18N/CLang_fr.cs +++ b/OpenTaiko/src/I18N/CLang_fr.cs @@ -224,6 +224,9 @@ namespace TJAPlayer3 [10189] = "Drums key assign:\nAssign any key for jumping to the first measure.", [10190] = "Jump to Last Measure", [10191] = "Drums key assign:\nAssign any key for jumping to the last measure.", + + [10192] = "Calibrate Offset", + [10193] = "Calibrate your offset.\nGlobal Offset will be overwritten if saved.", // Please translate the text above! [99] = "Rouge gauche", diff --git a/OpenTaiko/src/I18N/CLang_jp.cs b/OpenTaiko/src/I18N/CLang_jp.cs index 9a71fb93..d27bab81 100644 --- a/OpenTaiko/src/I18N/CLang_jp.cs +++ b/OpenTaiko/src/I18N/CLang_jp.cs @@ -279,6 +279,9 @@ namespace TJAPlayer3 [10190] = "Jump to Last Measure", [10191] = "Drums key assign:\nAssign any key for jumping to the last measure.", + [10192] = "Calibrate Offset", + [10193] = "Calibrate your offset.\nGlobal Offset will be overwritten if saved.", + [99] = "LeftRed", [9992] = "太鼓の数字がアニメーションしなくなります\n" + diff --git a/OpenTaiko/src/I18N/CLang_ko.cs b/OpenTaiko/src/I18N/CLang_ko.cs index e34fafd3..46a0202f 100644 --- a/OpenTaiko/src/I18N/CLang_ko.cs +++ b/OpenTaiko/src/I18N/CLang_ko.cs @@ -376,6 +376,9 @@ namespace TJAPlayer3 [10189] = "Drums key assign:\nAssign any key for jumping to the first measure.", [10190] = "Jump to Last Measure", [10191] = "Drums key assign:\nAssign any key for jumping to the last measure.", + + [10192] = "Calibrate Offset", + [10193] = "Calibrate your offset.\nGlobal Offset will be overwritten if saved.", // Please translate the text above! [100] = "Taiko Mode", diff --git a/OpenTaiko/src/I18N/CLang_nl.cs b/OpenTaiko/src/I18N/CLang_nl.cs index ee84cf18..69f0e952 100644 --- a/OpenTaiko/src/I18N/CLang_nl.cs +++ b/OpenTaiko/src/I18N/CLang_nl.cs @@ -376,6 +376,9 @@ namespace TJAPlayer3 [10189] = "Drums key assign:\nAssign any key for jumping to the first measure.", [10190] = "Jump to Last Measure", [10191] = "Drums key assign:\nAssign any key for jumping to the last measure.", + + [10192] = "Calibrate Offset", + [10193] = "Calibrate your offset.\nGlobal Offset will be overwritten if saved.", // Please translate the text above! [100] = "Taiko Mode", diff --git a/OpenTaiko/src/I18N/CLang_zh.cs b/OpenTaiko/src/I18N/CLang_zh.cs index 321756c8..c1774b8f 100644 --- a/OpenTaiko/src/I18N/CLang_zh.cs +++ b/OpenTaiko/src/I18N/CLang_zh.cs @@ -423,6 +423,9 @@ namespace TJAPlayer3 [10190] = "跳转至最后一小节", [10191] = "鼓按键分配:\n分配跳转至最后一小节按键。", + [10192] = "Calibrate Offset", + [10193] = "Calibrate your offset.\nGlobal Offset will be overwritten if saved.", + [100] = "演奏模式", [101] = "段位道场", [102] = "太鼓塔", diff --git a/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs b/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs index c1f0bd1c..de5a4588 100644 --- a/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs +++ b/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs @@ -142,6 +142,9 @@ namespace TJAPlayer3 public void LoadTexture() { + CalibrateFG = TxC(CONFIG + $@"Calibration{Path.DirectorySeparatorChar}FG.png"); + CalibrateBG = TxC(CONFIG + $@"Calibration{Path.DirectorySeparatorChar}BG.png"); + #region 共通 Tile_Black = TxC(@$"Tile_Black.png"); Menu_Title = TxC(@$"Menu_Title.png"); @@ -2544,6 +2547,12 @@ namespace TJAPlayer3 } } } + #region Calibration + + public CTexture CalibrateFG, + CalibrateBG; + + #endregion #region 共通 public CTexture Tile_Black, diff --git a/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs b/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs new file mode 100644 index 00000000..990b1a08 --- /dev/null +++ b/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs @@ -0,0 +1,232 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActCalibrationMode : CActivity + { + public CActCalibrationMode() { } + + public override void Activate() + { + //hitSound = TJAPlayer3.SoundManager.tCreateSound($@"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + TJAPlayer3.Skin.hsHitSoundsInformations.don[0], ESoundGroup.SoundEffect); + font = HPrivateFastFont.tInstantiateMainFont(30); + base.Activate(); + } + + public override void DeActivate() + { + Stop(); + Offsets.Clear(); + font.Dispose(); + offsettext.Dispose(); + //hitSound?.tDispose(); + + base.DeActivate(); + } + + public void Start() + { + CalibrateTick = new CCounter(0, 500, 1, TJAPlayer3.Timer); + UpdateText(); + } + + public void Stop() + { + CalibrateTick = new CCounter(); + Offsets.Clear(); + LastOffset = 0; + buttonIndex = 1; + } + + public int Update() + { + if (IsDeActivated || CalibrateTick.IsStoped) + return 1; + + CalibrateTick.Tick(); + + bool decide = TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Decide) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RRed) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LRed) || + TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return); + + if (CalibrateTick.IsEnded) + { + TJAPlayer3.Skin.calibrationTick.tPlay(); + CalibrateTick.Start(0, 500, 1, TJAPlayer3.Timer); + } + + if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LeftChange) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.LBlue) || + TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) + { + buttonIndex = Math.Max(buttonIndex - 1, 0); + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } + else if (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RightChange) || + TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.RBlue) || + TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) + { + buttonIndex = Math.Min(buttonIndex + 1, 2); + TJAPlayer3.Skin.soundChangeSFX.tPlay(); + } + else if (buttonIndex == 0 && decide) // Cancel + { + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + Stop(); + } + else if (buttonIndex == 1 && decide) // Hit! + { + //hitSound?.PlayStart(); + AddOffset(); + UpdateText(); + } + else if (buttonIndex == 2 && decide) // Save + { + TJAPlayer3.ConfigIni.nGlobalOffsetMs = GetMedianOffset(); + TJAPlayer3.stageコンフィグ.actList.iGlobalOffsetMs.n現在の値 = GetMedianOffset(); + TJAPlayer3.Skin.soundDecideSFX.tPlay(); + Stop(); + + return 0; + } + else if (TJAPlayer3.ConfigIni.KeyAssign.KeyIsPressed(TJAPlayer3.ConfigIni.KeyAssign.System.Cancel) || + TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) + { + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + Stop(); + + return 0; + } + + return 0; + } + + public override int Draw() + { + if (IsDeActivated || CalibrateTick.IsStoped) + return 1; + + if (TJAPlayer3.Tx.Tile_Black != null) + { + TJAPlayer3.Tx.Tile_Black.Opacity = 128; + for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += TJAPlayer3.Tx.Tile_Black.szTextureSize.Width) + { + for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += TJAPlayer3.Tx.Tile_Black.szTextureSize.Height) + { + TJAPlayer3.Tx.Tile_Black.t2D描画(i, j); + } + } + TJAPlayer3.Tx.Tile_Black.Opacity = 255; + } + + TJAPlayer3.Tx.CalibrateBG?.t2D描画(TJAPlayer3.Skin.Config_Calibration_Highlights[buttonIndex].X, + TJAPlayer3.Skin.Config_Calibration_Highlights[buttonIndex].Y, + TJAPlayer3.Skin.Config_Calibration_Highlights[buttonIndex]); + TJAPlayer3.Tx.CalibrateFG?.t2D描画(0, 0); + + TJAPlayer3.Tx.Lane_Background_Main?.t2D描画(TJAPlayer3.Skin.Game_Lane_X[0], TJAPlayer3.Skin.Game_Lane_Y[0]); + TJAPlayer3.Tx.Lane_Background_Sub?.t2D描画(TJAPlayer3.Skin.Game_Lane_Sub_X[0], TJAPlayer3.Skin.Game_Lane_Sub_Y[0]); + TJAPlayer3.Tx.Taiko_Frame[2]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); + + TJAPlayer3.Tx.Notes[0]?.t2D描画(TJAPlayer3.Skin.nScrollFieldX[0], TJAPlayer3.Skin.nScrollFieldY[0], new RectangleF(0, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + + for (int x = TJAPlayer3.Skin.nScrollFieldX[0]; x < SampleFramework.GameWindowSize.Width + 500; x += 500) + { + TJAPlayer3.Tx.Bar?.t2D描画( + (x - CalibrateTick.CurrentValue) + ((TJAPlayer3.Skin.Game_Notes_Size[0] - TJAPlayer3.Tx.Bar.szTextureSize.Width) / 2), + TJAPlayer3.Skin.nScrollFieldY[0], + new Rectangle(0, 0, TJAPlayer3.Tx.Bar.szTextureSize.Width, TJAPlayer3.Skin.Game_Notes_Size[1]) + ); + TJAPlayer3.Tx.Notes[0]?.t2D描画( + (x - CalibrateTick.CurrentValue), + TJAPlayer3.Skin.nScrollFieldY[0], + new Rectangle(TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1], TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1]) + ); + } + + if (TJAPlayer3.P1IsBlue()) + TJAPlayer3.Tx.Taiko_Background[4]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Background_X[0], TJAPlayer3.Skin.Game_Taiko_Background_Y[0]); + else + TJAPlayer3.Tx.Taiko_Background[0]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Background_X[0], TJAPlayer3.Skin.Game_Taiko_Background_Y[0]); + + #region Calibration Info + + offsettext?.t2D描画(TJAPlayer3.Skin.Config_Calibration_OffsetText[0] - offsettext.szTextureSize.Width, TJAPlayer3.Skin.Config_Calibration_OffsetText[1]); + + TJAPlayer3.act文字コンソール.tPrint(TJAPlayer3.Skin.Config_Calibration_InfoText[0], TJAPlayer3.Skin.Config_Calibration_InfoText[1], C文字コンソール.Eフォント種別.赤, + "MEDIAN OFFSET : " + GetMedianOffset() + "ms\n"); + TJAPlayer3.act文字コンソール.tPrint(TJAPlayer3.Skin.Config_Calibration_InfoText[0], TJAPlayer3.Skin.Config_Calibration_InfoText[1] + TJAPlayer3.act文字コンソール.nFontHeight, C文字コンソール.Eフォント種別.白, + "MIN OFFSET : " + GetLowestOffset() + "ms\n" + + "MAX OFFSET : " + GetHighestOffset() + "ms\n" + + "LAST OFFSET : " + LastOffset + "ms\n" + + "OFFSET COUNT : " + (Offsets != null ? Offsets.Count : 0)); + TJAPlayer3.act文字コンソール.tPrint(TJAPlayer3.Skin.Config_Calibration_InfoText[0], TJAPlayer3.Skin.Config_Calibration_InfoText[1] + (TJAPlayer3.act文字コンソール.nFontHeight * 5), C文字コンソール.Eフォント種別.白, + "CURRENT OFFSET: " + CurrentOffset() + "ms"); + + #endregion + + return 0; + } + + public void AddOffset() { Offsets.Add(CurrentOffset()); LastOffset = CurrentOffset(); } + + public int GetMedianOffset() + { + if (Offsets != null) + if (Offsets.Count > 0) + { + Offsets.Sort(); + return Offsets[Offsets.Count / 2]; + } + return 0; + } + public int GetLowestOffset() + { + if (Offsets != null) + return Offsets.Count > 0 ? Offsets.Min() : 0; + return 0; + } + public int GetHighestOffset() + { + if (Offsets != null) + return Offsets.Count > 0 ? Offsets.Max() : 0; + return 0; + } + public int CurrentOffset() + { + return CalibrateTick.CurrentValue > 250 ? CalibrateTick.CurrentValue - 500 : CalibrateTick.CurrentValue; + } + + private void UpdateText() + { + offsettext?.Dispose(); + offsettext = new CTexture(font.DrawText("OFFSET: " + GetMedianOffset().ToString(), Color.White, Color.Black, null, 32)); + } + + public bool IsStarted { get { return CalibrateTick.IsStarted; } } + #region Private + private CCounter CalibrateTick = new CCounter(); + private List Offsets = new List(); + private int LastOffset = 0; + private CCachedFontRenderer font; + private CTexture offsettext; + + //private CSound hitSound; + + private int buttonIndex = 1; + private Rectangle[] BGs = new Rectangle[3] + { + new Rectangle(371, 724, 371, 209), + new Rectangle(774, 724, 371, 209), + new Rectangle(1179, 724, 371, 209) + }; + #endregion + } +} diff --git a/OpenTaiko/src/Stages/04.Config/CActConfigList.cs b/OpenTaiko/src/Stages/04.Config/CActConfigList.cs index e5d3add8..14fb2d19 100644 --- a/OpenTaiko/src/Stages/04.Config/CActConfigList.cs +++ b/OpenTaiko/src/Stages/04.Config/CActConfigList.cs @@ -330,6 +330,10 @@ namespace TJAPlayer3 CLangManager.LangInstance.GetString(3)); this.list項目リスト.Add( this.iDrumsReturnToMenu ); + this.iDrumsGoToCalibration = new CItemBase(CLangManager.LangInstance.GetString(10192), CItemBase.EPanelType.Other, + CLangManager.LangInstance.GetString(10193)); + this.list項目リスト.Add(this.iDrumsGoToCalibration); + this.iRollsPerSec = new CItemInteger(CLangManager.LangInstance.GetString(60), 0, 1000, TJAPlayer3.ConfigIni.nRollsPerSec, CLangManager.LangInstance.GetString(61)); this.list項目リスト.Add(this.iRollsPerSec); @@ -782,6 +786,10 @@ namespace TJAPlayer3 tConfigIniへ記録する(); t項目リストの設定_KeyAssignTraining(); } + else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iDrumsGoToCalibration ) + { + TJAPlayer3.stageコンフィグ.actCalibrationMode.Start(); + } else if ( this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignDrumsReturnToMenu || this.list項目リスト[ this.n現在の選択項目 ] == this.iKeyAssignTrainingReturnToMenu ) // #24525 2011.3.15 yyagi { @@ -1827,9 +1835,10 @@ namespace TJAPlayer3 private int nSkinSampleIndex; // private int nSkinIndex; // + private CItemBase iDrumsGoToCalibration; private CItemBase iDrumsGoToKeyAssign; private CItemBase iDrumsGoToTrainingKeyAssign; - private CItemBase iSystemGoToKeyAssign; // #24609 + private CItemBase iSystemGoToKeyAssign; private CItemInteger iCommonPlaySpeed; private CItemInteger iLayoutType; @@ -1873,7 +1882,7 @@ namespace TJAPlayer3 CItemInteger TokkunMashInterval; private CItemInteger iInputAdjustTimeMs; - private CItemInteger iGlobalOffsetMs; + public CItemInteger iGlobalOffsetMs; private CItemList iSystemSkinSubfolder; // #28195 2012.5.2 yyagi private CItemBase iSystemReloadDTX; // #32081 2013.10.21 yyagi diff --git a/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs b/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs index 9b8c31a6..da3522d5 100644 --- a/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs +++ b/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs @@ -15,6 +15,7 @@ namespace TJAPlayer3 // プロパティ public CActDFPFont actFont { get; private set; } + public CActCalibrationMode actCalibrationMode; // コンストラクタ @@ -30,6 +31,7 @@ namespace TJAPlayer3 base.ChildActivities.Add( this.actList = new CActConfigList() ); base.ChildActivities.Add( this.actKeyAssign = new CActConfigKeyAssign() ); base.ChildActivities.Add( this.actオプションパネル = new CActオプションパネル() ); + base.ChildActivities.Add( this.actCalibrationMode = new CActCalibrationMode() ); base.IsDeActivated = true; } @@ -404,10 +406,21 @@ namespace TJAPlayer3 || TJAPlayer3.act現在入力を占有中のプラグイン != null ) return 0; - // 曲データの一覧取得中は、キー入力を無効化する - if ( !TJAPlayer3.EnumSongs.IsEnumerating || TJAPlayer3.actEnumSongs.bコマンドでの曲データ取得 != true ) + if (actCalibrationMode.IsStarted) { - if ( ( TJAPlayer3.InputManager.Keyboard.KeyPressed( (int)SlimDXKeys.Key.Escape ) || TJAPlayer3.Pad.bPressed( EInstrumentPad.DRUMS, EPad.FT ) ) || TJAPlayer3.Pad.bPressedGB( EPad.FT ) ) + if (TJAPlayer3.Skin.bgmコンフィグ画面.bIsPlaying) + TJAPlayer3.Skin.bgmコンフィグ画面.tStop(); + + actCalibrationMode.Update(); + actCalibrationMode.Draw(); + } + // 曲データの一覧取得中は、キー入力を無効化する + else if ( !TJAPlayer3.EnumSongs.IsEnumerating || TJAPlayer3.actEnumSongs.bコマンドでの曲データ取得 != true ) + { + if (!TJAPlayer3.Skin.bgmコンフィグ画面.bIsPlaying) + TJAPlayer3.Skin.bgmコンフィグ画面.tPlay(); + + if ( ( TJAPlayer3.InputManager.Keyboard.KeyPressed( (int)SlimDXKeys.Key.Escape ) || TJAPlayer3.Pad.bPressed( EInstrumentPad.DRUMS, EPad.FT ) ) || TJAPlayer3.Pad.bPressedGB( EPad.FT ) ) { TJAPlayer3.Skin.soundCancelSFX.tPlay(); if ( !this.bメニューにフォーカス中 ) @@ -553,7 +566,7 @@ namespace TJAPlayer3 //private CCounter ctBackgroundAnime; private CActFIFOWhite actFIFO; private CActConfigKeyAssign actKeyAssign; - private CActConfigList actList; + public CActConfigList actList; private CActオプションパネル actオプションパネル; private bool bメニューにフォーカス中; private STキー反復用カウンタ ctキー反復用;