diff --git a/FDK/src/02.Input/CInputKeyboard.cs b/FDK/src/02.Input/CInputKeyboard.cs index 77f4927f..8811f77c 100644 --- a/FDK/src/02.Input/CInputKeyboard.cs +++ b/FDK/src/02.Input/CInputKeyboard.cs @@ -16,6 +16,10 @@ public class CInputKeyboard : CInputButtonsBase, IInputDevice, IDisposable { } private void KeyDown(IKeyboard keyboard, Key key, int keyCode) { +#if DEBUG + if (IMGUI_WindowIsFocused) return; +#endif + var keyNum = DeviceConstantConverter.DIKtoKey(key); if ((int)keyNum >= this.ButtonStates.Length || keyNum == SlimDXKeys.Key.Unknown) return; @@ -23,6 +27,9 @@ public class CInputKeyboard : CInputButtonsBase, IInputDevice, IDisposable { } private void KeyUp(IKeyboard keyboard, Key key, int keyCode) { +#if DEBUG + if (IMGUI_WindowIsFocused) return; +#endif var keyNum = DeviceConstantConverter.DIKtoKey(key); if ((int)keyNum >= this.ButtonStates.Length || keyNum == SlimDXKeys.Key.Unknown) return; @@ -32,4 +39,6 @@ public class CInputKeyboard : CInputButtonsBase, IInputDevice, IDisposable { private void KeyChar(IKeyboard keyboard, char ch) { } + + public bool IMGUI_WindowIsFocused = false; } diff --git a/OpenTaiko/Lang/de/lang.json b/OpenTaiko/Lang/de/lang.json index aca9543e..12d57b15 100644 --- a/OpenTaiko/Lang/de/lang.json +++ b/OpenTaiko/Lang/de/lang.json @@ -1,12 +1,12 @@ { - // The folder's name is used as the ID, which is used to identify which localized data to use. - // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. - // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. - // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes + // The folder's name is used as the ID, which is used to identify which localized data to use. + // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. + // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. + // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes - // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. - // i.e. "日本語 (Japanese)" - "Language": "Deutsch (German)", + // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. + // i.e. "日本語 (Japanese)" + "Language": "Deutsch (German)", "Version": "0.6.0.0", "Entries": { @@ -613,10 +613,10 @@ "MOD_FUN_AVALANCHE": "Lawine", "MOD_FUN_MINESWEEPER": "Minesweeper" }, - // In the case that a key is missing, this message will display, with the name of the missing/unknown key. - "InvalidKey": "TASTE NICHT GEFUNDEN: {0}", - // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. - // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. - "FontName": "Arial", - "BoxFontName": "font.ttf" + // In the case that a key is missing, this message will display, with the name of the missing/unknown key. + "InvalidKey": "TASTE NICHT GEFUNDEN: {0}", + // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. + // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. + "FontName": "../font.ttf", + "BoxFontName": "../font.ttf" } diff --git a/OpenTaiko/Lang/en/lang.json b/OpenTaiko/Lang/en/lang.json index 3f564979..b442d2b8 100644 --- a/OpenTaiko/Lang/en/lang.json +++ b/OpenTaiko/Lang/en/lang.json @@ -1,13 +1,13 @@ { - // The folder's name is used as the ID, which is used to identify which localized data to use. - // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. - // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. - // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes + // The folder's name is used as the ID, which is used to identify which localized data to use. + // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. + // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. + // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes - // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. - // i.e. "日本語 (Japanese)" + // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. + // i.e. "日本語 (Japanese)" "Language": "English", - "Version": "0.6.0.0", + "Version": "0.6.0.0", "Entries": { // Common @@ -613,10 +613,10 @@ "MOD_FUN_AVALANCHE": "Avalanche", "MOD_FUN_MINESWEEPER": "Minesweeper" }, - // In the case that a key is missing, this message will display, with the name of the missing/unknown key. - "InvalidKey": "KEY NOT FOUND: {0}", - // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. - // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. - "FontName": "Arial", - "BoxFontName": "font.ttf" + // In the case that a key is missing, this message will display, with the name of the missing/unknown key. + "InvalidKey": "KEY NOT FOUND: {0}", + // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. + // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. + "FontName": "../font.ttf", + "BoxFontName": "../font.ttf" } diff --git a/OpenTaiko/Lang/es/lang.json b/OpenTaiko/Lang/es/lang.json index 9d8be073..61dfa4d2 100644 --- a/OpenTaiko/Lang/es/lang.json +++ b/OpenTaiko/Lang/es/lang.json @@ -1,13 +1,13 @@ { - // The folder's name is used as the ID, which is used to identify which localized data to use. - // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. - // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. - // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes + // The folder's name is used as the ID, which is used to identify which localized data to use. + // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. + // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. + // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes - // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. - // i.e. "日本語 (Japanese)" - "Language": "Español (Spanish)", - "Version": "0.6.0.0", + // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. + // i.e. "日本語 (Japanese)" + "Language": "Español (Spanish)", + "Version": "0.6.0.0", "Entries": { // Common @@ -616,10 +616,10 @@ "MOD_FUN_AVALANCHE": "Avalancha", "MOD_FUN_MINESWEEPER": "Buscaminas" }, - // In the case that a key is missing, this message will display, with the name of the missing/unknown key. - "InvalidKey": "KEY NOT FOUND: {0}", - // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. - // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. - "FontName": "Arial", - "BoxFontName": "font.ttf" + // In the case that a key is missing, this message will display, with the name of the missing/unknown key. + "InvalidKey": "KEY NOT FOUND: {0}", + // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. + // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. + "FontName": "../font.ttf", + "BoxFontName": "../font.ttf" } diff --git a/OpenTaiko/Lang/ja/NotoSansJP-Medium.ttf b/OpenTaiko/Lang/font.ttf similarity index 100% rename from OpenTaiko/Lang/ja/NotoSansJP-Medium.ttf rename to OpenTaiko/Lang/font.ttf diff --git a/OpenTaiko/Lang/font_LICENSE.txt b/OpenTaiko/Lang/font_LICENSE.txt new file mode 100644 index 00000000..5ff8c809 --- /dev/null +++ b/OpenTaiko/Lang/font_LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source' + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/OpenTaiko/Lang/fr/lang.json b/OpenTaiko/Lang/fr/lang.json index 31b581e5..88a994c8 100644 --- a/OpenTaiko/Lang/fr/lang.json +++ b/OpenTaiko/Lang/fr/lang.json @@ -1,13 +1,13 @@ { - // The folder's name is used as the ID, which is used to identify which localized data to use. - // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. - // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. - // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes + // The folder's name is used as the ID, which is used to identify which localized data to use. + // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. + // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. + // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes - // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. - // i.e. "日本語 (Japanese)" - "Language": "Français (French)", - "Version": "0.6.0.0", + // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. + // i.e. "日本語 (Japanese)" + "Language": "Français (French)", + "Version": "0.6.0.0", "Entries": { // Common @@ -615,10 +615,10 @@ "MOD_FUN_AVALANCHE": "Avalanche", "MOD_FUN_MINESWEEPER": "Démineur" }, - // In the case that a key is missing, this message will display, with the name of the missing/unknown key. - "InvalidKey": "KEY NOT FOUND: {0}", - // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. - // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. - "FontName": "Arial", - "BoxFontName": "Arial" + // In the case that a key is missing, this message will display, with the name of the missing/unknown key. + "InvalidKey": "KEY NOT FOUND: {0}", + // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. + // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. + "FontName": "../font.ttf", + "BoxFontName": "../font.ttf" } diff --git a/OpenTaiko/Lang/ja/lang.json b/OpenTaiko/Lang/ja/lang.json index 2c34204c..5dbb8ba0 100644 --- a/OpenTaiko/Lang/ja/lang.json +++ b/OpenTaiko/Lang/ja/lang.json @@ -1,13 +1,13 @@ { - // The folder's name is used as the ID, which is used to identify which localized data to use. - // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. - // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. - // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes + // The folder's name is used as the ID, which is used to identify which localized data to use. + // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. + // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. + // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes - // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. - // i.e. "日本語 (Japanese)" - "Language": "日本語 (Japanese)", - "Version": "0.6.0.0", + // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. + // i.e. "日本語 (Japanese)" + "Language": "日本語 (Japanese)", + "Version": "0.6.0.0", "Entries": { // Common @@ -615,10 +615,10 @@ "MOD_FUN_AVALANCHE": "雪崩", "MOD_FUN_MINESWEEPER": "掃海" }, - // In the case that a key is missing, this message will display, with the name of the missing/unknown key. - "InvalidKey": "KEY NOT FOUND: {0}", - // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. - // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. - "FontName": "NotoSansJP-Medium.ttf", - "BoxFontName": "NotoSansJP-Regular.ttf" + // In the case that a key is missing, this message will display, with the name of the missing/unknown key. + "InvalidKey": "KEY NOT FOUND: {0}", + // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. + // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. + "FontName": "../font.ttf", + "BoxFontName": "NotoSansJP-Regular.ttf" } diff --git a/OpenTaiko/Lang/nl/lang.json b/OpenTaiko/Lang/nl/lang.json index 604bb230..579a72b6 100644 --- a/OpenTaiko/Lang/nl/lang.json +++ b/OpenTaiko/Lang/nl/lang.json @@ -1,13 +1,13 @@ { - // The folder's name is used as the ID, which is used to identify which localized data to use. - // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. - // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. - // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes + // The folder's name is used as the ID, which is used to identify which localized data to use. + // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. + // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. + // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes - // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. - // i.e. "日本語 (Japanese)" - "Language": "Nederlands (Dutch)", - "Version": "0.6.0.0", + // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. + // i.e. "日本語 (Japanese)" + "Language": "Nederlands (Dutch)", + "Version": "0.6.0.0", "Entries": { // Common @@ -613,10 +613,10 @@ "MOD_FUN_AVALANCHE": "Lawine", "MOD_FUN_MINESWEEPER": "Minesweeper" }, - // In the case that a key is missing, this message will display, with the name of the missing/unknown key. - "InvalidKey": "KEY NOT FOUND: {0}", - // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. - // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. - "FontName": "Arial", - "BoxFontName": "font.ttf" + // In the case that a key is missing, this message will display, with the name of the missing/unknown key. + "InvalidKey": "KEY NOT FOUND: {0}", + // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. + // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. + "FontName": "../font.ttf", + "BoxFontName": "../font.ttf" } diff --git a/OpenTaiko/Lang/ru/lang.json b/OpenTaiko/Lang/ru/lang.json index 9dfe553a..dce1cfc1 100644 --- a/OpenTaiko/Lang/ru/lang.json +++ b/OpenTaiko/Lang/ru/lang.json @@ -1,13 +1,13 @@ { - // The folder's name is used as the ID, which is used to identify which localized data to use. - // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. - // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. - // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes + // The folder's name is used as the ID, which is used to identify which localized data to use. + // This includes TJAs with localized titles/subtitles (i.e. TITLEJA/SUBTITLEJA) and Lua scripts which utilize the "lang" variable. + // It is STRONGLY recommended that you use a two-letter language code that follows the ISO 639 standard. Keep the ID lowercased. + // If you aren't sure which code fits your language, please refer to https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes - // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. - // i.e. "日本語 (Japanese)" + // "Language" should include the name of your language in its native text, as well as its English variant in parentheses. + // i.e. "日本語 (Japanese)" "Language": "Русский (Russian)", - "Version": "0.6.0.0", + "Version": "0.6.0.0", "Entries": { // Common @@ -613,10 +613,10 @@ "MOD_FUN_AVALANCHE": "Лавина", "MOD_FUN_MINESWEEPER": "Тральщик" }, - // In the case that a key is missing, this message will display, with the name of the missing/unknown key. - "InvalidKey": "КЛЮЧ НЕ НАЙДЕН: {0}", - // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. - // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. - "FontName": "Arial", - "BoxFontName": "font.ttf" + // In the case that a key is missing, this message will display, with the name of the missing/unknown key. + "InvalidKey": "КЛЮЧ НЕ НАЙДЕН: {0}", + // If a skin does not include a font for a specific language, the game will fallback to this language's fonts. This ensures that all text for all languages can be clearly read. + // Font name can be a file, or the name of an already installed font (i.e. "Arial"). If using a font name instead of a file name, please ensure that the user already has this font installed on their computer. + "FontName": "../font.ttf", + "BoxFontName": "../font.ttf" } diff --git a/OpenTaiko/src/Common/CSkin.cs b/OpenTaiko/src/Common/CSkin.cs index 1c7ec228..fb66879f 100644 --- a/OpenTaiko/src/Common/CSkin.cs +++ b/OpenTaiko/src/Common/CSkin.cs @@ -1506,6 +1506,10 @@ internal class CSkin : IDisposable { Config_KeyAssign_Move = int.Parse(strParam); break; } + case nameof(Config_Calibration_Font_Scale): { + Config_Calibration_Font_Scale = int.Parse(strParam); + break; + } case nameof(Config_Calibration_OffsetText): { string[] strSplit = strParam.Split(','); for (int i = 0; i < 2; i++) { @@ -7678,6 +7682,7 @@ internal class CSkin : IDisposable { public int[] Config_KeyAssign_Font = new int[] { 308, 64 }; public int Config_KeyAssign_Move = 20; + public int Config_Calibration_Font_Scale = 30; 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[] { diff --git a/OpenTaiko/src/Common/ImGuiDebugWindow.cs b/OpenTaiko/src/Common/ImGuiDebugWindow.cs index d0da824e..4c3970f2 100644 --- a/OpenTaiko/src/Common/ImGuiDebugWindow.cs +++ b/OpenTaiko/src/Common/ImGuiDebugWindow.cs @@ -11,7 +11,12 @@ namespace OpenTaiko; /* FOR DEBUGGING! This class is intended for developers only! */ -public static class ImGuiDebugWindow { +public static class ImGuiDebugWindow { + #region Public for debugging + public static bool DisableKeyboardInputs = false; + public static string OverrideBGPreset = ""; + #endregion + private static bool showImGuiDemoWindow = false; private static Assembly assemblyinfo = Assembly.GetExecutingAssembly(); @@ -44,6 +49,8 @@ public static class ImGuiDebugWindow { #region Debug Info ImGui.Checkbox("Show ImGui Demo Window", ref showImGuiDemoWindow); if (showImGuiDemoWindow) { ImGui.ShowDemoWindow(); } + if (ImGui.Checkbox("Disable Keyboard Inputs to OpenTaiko", ref DisableKeyboardInputs)) + ((CInputKeyboard)OpenTaiko.InputManager.Keyboard).IMGUI_WindowIsFocused = DisableKeyboardInputs; ImGui.Separator(); ImGui.Text($"Game Version: {OpenTaiko.VERSION}"); @@ -63,7 +70,7 @@ public static class ImGuiDebugWindow { #endregion ImGui.EndTabBar(); - + ImGui.End(); } } @@ -169,7 +176,7 @@ public static class ImGuiDebugWindow { ImGui.Text($"ID: {OpenTaiko.SaveFileInstances[save].data.SaveId}"); ImGui.InputText("Name", ref OpenTaiko.SaveFileInstances[save].data.Name, 64); - if (ImGui.Button("Update")) { + if (ImGui.Button("Update###UPDATE_PROFILE")) { OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges(); OpenTaiko.NamePlate.tNamePlateRefreshTitles(save); } @@ -204,7 +211,7 @@ public static class ImGuiDebugWindow { ImGui.InputInt("Title Type", ref OpenTaiko.SaveFileInstances[save].data.TitleType); - if (ImGui.Button("Update")) { + if (ImGui.Button("Update###UPDATE_NAMEPLATE")) { OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges(); OpenTaiko.NamePlate.tNamePlateRefreshTitles(save); } @@ -241,7 +248,7 @@ public static class ImGuiDebugWindow { ImGui.EndCombo(); } - if (ImGui.Button("Update")) { + if (ImGui.Button("Update###UPDATE_DAN")) { OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges(); OpenTaiko.NamePlate.tNamePlateRefreshTitles(save); } @@ -264,6 +271,7 @@ public static class ImGuiDebugWindow { switch (OpenTaiko.rCurrentStage.eStageID) { case CStage.EStage.SongSelect: + case CStage.EStage.DanDojoSelect: System.Numerics.Vector4 normal = new System.Numerics.Vector4(1, 1, 1, 1); System.Numerics.Vector4 diff = new System.Numerics.Vector4(0.5f, 1, 0.5f, 1); @@ -273,6 +281,11 @@ public static class ImGuiDebugWindow { ImGui.TextColored(OpenTaiko.ConfigIni.bTokkunMode ? diff : normal, "Training Mode: " + OpenTaiko.ConfigIni.bTokkunMode); + ImGui.InputText("Set BG Preset", ref OverrideBGPreset, 1024); + ImGui.Text("Type any preset name to override for the next selected song.\nLeave blank to disable this."); + + ImGui.NewLine(); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { bool modifiedstats = diff --git a/OpenTaiko/src/Helpers/HScenePreset.cs b/OpenTaiko/src/Helpers/HScenePreset.cs index 8bd994be..2155d156 100644 --- a/OpenTaiko/src/Helpers/HScenePreset.cs +++ b/OpenTaiko/src/Helpers/HScenePreset.cs @@ -34,6 +34,10 @@ class HScenePreset { bool sectionIsValid = _ps != null ? ((Dictionary)_ps).Count > 0 : false; +#if DEBUG + if (!string.IsNullOrWhiteSpace(ImGuiDebugWindow.OverrideBGPreset)) + return ((Dictionary)_ps).TryGetValue(ImGuiDebugWindow.OverrideBGPreset, out var value) ? value : null; +#endif var preset = (sectionIsValid && OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset != null && ((Dictionary)_ps).ContainsKey(OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset)) diff --git a/OpenTaiko/src/Lua/CLuaScript.cs b/OpenTaiko/src/Lua/CLuaScript.cs index 13064b21..c72c5185 100644 --- a/OpenTaiko/src/Lua/CLuaScript.cs +++ b/OpenTaiko/src/Lua/CLuaScript.cs @@ -170,6 +170,7 @@ class CLuaScript : IDisposable { LuaScript = new Lua(); LuaScript.LoadCLRPackage(); LuaScript.State.Encoding = Encoding.UTF8; + LuaSecurity.Secure(LuaScript); try { LuaScript.DoFile($"{strDir}/Script.lua"); diff --git a/OpenTaiko/src/Lua/LuaSecurity.cs b/OpenTaiko/src/Lua/LuaSecurity.cs new file mode 100644 index 00000000..42e708c8 --- /dev/null +++ b/OpenTaiko/src/Lua/LuaSecurity.cs @@ -0,0 +1,28 @@ +using NLua; + +namespace OpenTaiko { + public static class LuaSecurity { + public static void Secure(Lua lua) { + + lua.DoString(@" +for k, _ in pairs(os) do + if k ~= ""time"" then + os[k] = nil + end +end +for k, _ in pairs(io) do + io[k] = nil +end +io = nil +for k, _ in pairs(debug) do + debug[k] = nil +end +debug = nil + +while #package.searchers > 0 do + table.remove(package.searchers); +end +"); + } + } +} diff --git a/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs b/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs index b12f374e..0efd8233 100644 --- a/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs +++ b/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs @@ -8,7 +8,7 @@ internal class CActCalibrationMode : CActivity { 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); + font = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Config_Calibration_Font_Scale); base.Activate(); } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPopupMenu.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPopupMenu.cs index 922bf5e2..0ddf89e0 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPopupMenu.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPopupMenu.cs @@ -87,14 +87,16 @@ internal class CActSelectPopupMenu : CActivity { OpenTaiko.tDisposeSafely(ref prvFont); InitializePrvFont(); - using (var bitmap = prvFont.DrawText(stqMenuTitle.cItem.str項目名, Color.White, Color.Black, null, 30)) { + using (var bitmap = prvFont.DrawText(stqMenuTitle.cItem?.str項目名 ?? "", Color.White, Color.Black, null, 30)) { OpenTaiko.tDisposeSafely(ref stqMenuTitle.txName); stqMenuTitle.txName = OpenTaiko.tテクスチャの生成(bitmap, false); } - for (int i = 0; i < lciMenuItems.Length; i++) { - using (var bitmap = prvFont.DrawText(lciMenuItems[i].cItem.str項目名, Color.White, Color.Black, null, 30)) { - OpenTaiko.tDisposeSafely(ref lciMenuItems[i].txName); - lciMenuItems[i].txName = OpenTaiko.tテクスチャの生成(bitmap, false); + if (lciMenuItems != null) { + for (int i = 0; i < lciMenuItems.Length; i++) { + using (var bitmap = prvFont.DrawText(lciMenuItems[i].cItem?.str項目名 ?? "", Color.White, Color.Black, null, 30)) { + OpenTaiko.tDisposeSafely(ref lciMenuItems[i].txName); + lciMenuItems[i].txName = OpenTaiko.tテクスチャの生成(bitmap, false); + } } } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/ScriptBG.cs b/OpenTaiko/src/Stages/07.Game/Taiko/ScriptBG.cs index c23340e6..5e0f76b1 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/ScriptBG.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/ScriptBG.cs @@ -127,6 +127,7 @@ class ScriptBG : IDisposable { LuaScript = new Lua(); LuaScript.State.Encoding = Encoding.UTF8; + LuaSecurity.Secure(LuaScript); LuaScript["func"] = new ScriptBGFunc(Textures, Path.GetDirectoryName(filePath)); diff --git a/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs b/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs index c6404bd5..1fbd9cae 100644 --- a/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs +++ b/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs @@ -465,8 +465,8 @@ class CStageHeya : CStage { CTexture text_tex = TitleTextureKey.ResolveTitleTexture(textInputTitle); CTexture text_info = TitleTextureKey.ResolveTitleTexture(textInputInfo); - text_info.t2D_DisplayImage_AnchorCenter(960, 540); - text_tex.t2D_DisplayImage_AnchorCenter(960, 540 + text_info.szTextureSize.Height); + text_info.t2D_DisplayImage_AnchorCenter(GameWindowSize.Width / 2, GameWindowSize.Height / 2); + text_tex.t2D_DisplayImage_AnchorCenter(GameWindowSize.Width / 2, GameWindowSize.Height / 2 + text_info.szTextureSize.Height); } #endregion