diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f7de99..433c580 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Latest Changelog -- Attempting to fix the False Positives with the two only FREE Anti Viruses. (Avast and AVG) again... +- Added OSC parameter option: 'ToN_MasterChange' + - You can use this parameter to detect when the instance master has changed. - Updated Simplified Chinese localization (Thank you @Fallen-ice) -- I always knew. \ No newline at end of file +- Updated Japanese localization (Thank you @nomlasvrc) \ No newline at end of file diff --git a/Docs/OSC/OSC_Parameters.md b/Docs/OSC/OSC_Parameters.md index ddba821..d2bc578 100644 --- a/Docs/OSC/OSC_Parameters.md +++ b/Docs/OSC/OSC_Parameters.md @@ -17,6 +17,7 @@ Parameter | Type | Description `ToN_ItemStatus` | `BOOL` | (Experimental) Determines the active status of items like the **Chaos Coil**, **Emerald Coil**, **Corkscrew** and **TBH**. `ToN_Saboteur` | `BOOL` | The player is the killer on a Sabotage round. `ToN_DeathID` | `INT` | You can use this parameter to track when your friends die in the game. +`ToN_MasterChange` | `BOOL` | Set to `true` for a short period of time when the instance master has changed. > You need to specify a list of player names to use with the **ToN_DeathID** parameter.
> You can do so under Settings > Send Death ID > (Edit)
diff --git a/Localization/Language/en-US.json b/Localization/Language/en-US.json index 83a03f3..e0840b4 100644 --- a/Localization/Language/en-US.json +++ b/Localization/Language/en-US.json @@ -206,6 +206,11 @@ "SETTINGS.OSCDEATHEVENT_COOLDOWN": "(Cooldown)", "SETTINGS.OSCDEATHEVENT_COOLDOWN.TT": "Set the time (in milliseconds) to wait before setting the ID value for this parameter after multiple players die in quick succession.", "SETTINGS.OSCDEATHEVENT_COOLDOWN.TITLE": "Set Cooldown Time", + "SETTINGS.OSCMASTERCHANGE": "Send Master Change", + "SETTINGS.OSCMASTERCHANGE.TT": "Sends 'TRUE' to the parameter 'ToN_MasterChange' when the instance master has changed.", + "SETTINGS.OSCMASTERCHANGE_EDIT": "(Set Interval)", + "SETTINGS.OSCMASTERCHANGE_EDIT.TT": "Sets the interval (in milliseconds) to wait before setting this parameter value back to 'FALSE'", + "SETTINGS.OSCMASTERCHANGE.TITLE": "Set Master Interval", "SETTINGS.GROUP.NOTIFICATIONS": "Notifications", @@ -255,7 +260,7 @@ "OBJECTIVES.DIVINE_AVENGER": "Divine Avenger", "OBJECTIVES.DIVINE_AVENGER.TT": "Survive Arkus with '$$OBJECTIVES.SEALED_SWORD$$' after hitting them at least two times.", "OBJECTIVES.MAXWELL": "Maxwell", - "OBJECTIVES.MAXWELL.TT": "Found in Its Maze. (spawns once per round)", + "OBJECTIVES.MAXWELL.TT": "Found in Experimentation. (spawns once per round)", "OBJECTIVES.ROCK": "Rock", "OBJECTIVES.ROCK.TT": "Survive Fusion Pilot.", "OBJECTIVES.ILLUMINA": "Illumina", diff --git a/Localization/Language/ja-JP.json b/Localization/Language/ja-JP.json index 1cdfc36..4b696e7 100644 --- a/Localization/Language/ja-JP.json +++ b/Localization/Language/ja-JP.json @@ -1,4 +1,4 @@ -{ +{ "DISPLAY_INIT": "JP", "DISPLAY_NAME": "日本語", @@ -60,6 +60,7 @@ "MAIN.ENTRY_PLAYERS": "インスタンス内のプレイヤー:", "MAIN.ENTRY_MAP": "マップ:", "MAIN.ENTRY_WARNING": "$$SAVE.TAG_X$$ 警告!! このセーブコードは、セーブコードを読み込む前に生成されました。\n新規プレイヤーでない場合は、一つ前のセーブコードを読み込んでください。", + "MAIN.ENTRY_COPIED": "クリップボードにコピーしました!", "ROUND_TYPE.INTERMISSION": "休憩時間", "ROUND_TYPE.CLASSIC": "クラシック", @@ -91,7 +92,9 @@ "SAVE.TAG_D": "🔌", "SAVE.TAG_L": "💀", "SAVE.TAG_X": "❗", - + "SAVE.TAG_B": "😇", + "SAVE.TAG_C": "✅", + "SETTINGS.CHECK_UPDATE": "アップデートを確認", "SETTINGS.OPEN_DATA_BTN": "データ", "SETTINGS.OPEN_DATA_BTN.TT": "セーブデータが保存されているフォルダーを開きます。", @@ -192,7 +195,17 @@ "SETTINGS.OSCDAMAGEDEVENT_EDIT": "(インターバルを設定)", "SETTINGS.OSCDAMAGEDEVENT_EDIT.TT": "ダメージイベントの送信とそれをゼロにリセットするまでの間隔(ミリ秒)を設定します。", "SETTINGS.OSCDAMAGEDEVENT.TITLE": "ダメージインターバルを設定", - + "SETTINGS.OSCDEATHEVENT": "死亡イベントを送信", + "SETTINGS.OSCDEATHEVENT.TT": "INTパラメータ'ToN_DeathID'に死亡イベントを送信します。\nこの機能を使って、ゲーム内でフレンドがいつ死んだかを追跡できます。\n数値は死亡したユーザー名のリスト上の位置を表し、減衰時間が経過するとこの値は0にリセットされます。", + "SETTINGS.OSCDEATHEVENT.TITLE": "プレイヤー名を設定", + "SETTINGS.OSCDEATHEVENT_EDIT": "(編集)", + "SETTINGS.OSCDEATHEVENT_EDIT.TT": "このパラメータで使用するプレイヤー名のリストを設定します。\nプレイヤー名はカンマ(,)で区切ってください。", + "SETTINGS.OSCDEATHEVENT_DECAY": "(減衰)", + "SETTINGS.OSCDEATHEVENT_DECAY.TT": "値を0にリセットするまでの待機時間(ミリ秒単位)を設定します。", + "SETTINGS.OSCDEATHEVENT_DECAY.TITLE": "減衰時間を設定", + "SETTINGS.OSCDEATHEVENT_COOLDOWN": "(クールダウン)", + "SETTINGS.OSCDEATHEVENT_COOLDOWN.TT": "複数のプレイヤーが連続して死亡した場合に、このパラメータのID値を設定するまでの待機時間(ミリ秒)を設定します。", + "SETTINGS.OSCDEATHEVENT_COOLDOWN.TITLE": "クールダウンタイムを設定", "SETTINGS.GROUP.NOTIFICATIONS": "通知", @@ -201,10 +214,20 @@ "SETTINGS.XSOVERLAY.MESSAGE": "ToN: セーブデータを保存しました。", "SETTINGS.XSOVERLAY.TOGGLE": "ToN: 通知が有効です。", - "SETTINGS.PLAYAUDIO": "オーディオを再生 ({0})", - "SETTINGS.PLAYAUDIO.TT": "ダブルクリックしてカスタムオーディオファイルを選択します。\n右クリックで'default.wav'に戻します。", + "SETTINGS.PLAYAUDIO.TITLE": "カスタムオーディオを選択", + "SETTINGS.PLAYAUDIOSAVE": "セーブ時に音声を再生", + "SETTINGS.PLAYAUDIOSAVE.TT": "新しいセーブコードが作成されたときに音声を再生します。", + + "SETTINGS.PLAYAUDIOCOPY": "コピー時に音声を再生", + "SETTINGS.PLAYAUDIOCOPY.TT": "セーブコードをコピーしたときに音声を再生します。", + + "SETTINGS.PLAYAUDIO_SELECT": "(音声ファイルを選択)", + "SETTINGS.PLAYAUDIO_SELECT.TT": "通知に使うカスタムオーディオを選択します。", + "SETTINGS.PLAYAUDIO_SELECT.ALT": "$$SETTINGS.PLAYAUDIO_SELECT.TT$$\n通知音をデフォルトに戻すにはこのボタンを右クリックしてください。", + + "SETTINGS.GROUP.TIME_FORMAT": "時刻フォーマット", "SETTINGS.USE24HOUR": "24時間表示", "SETTINGS.SHOWSECONDS": "秒を表示", @@ -232,7 +255,7 @@ "OBJECTIVES.DIVINE_AVENGER": "ディバインアベンジャー", "OBJECTIVES.DIVINE_AVENGER.TT": "Arkusを$$OBJECTIVES.SEALED_SWORD$$を持ったまま2回以上スタンして生存。", "OBJECTIVES.MAXWELL": "マクスウェル", - "OBJECTIVES.MAXWELL.TT": "Its Mazeにある(1ラウンドに1回出現)。", + "OBJECTIVES.MAXWELL.TT": "Experimentationにある(1ラウンドに1回出現)。", "OBJECTIVES.ROCK": "岩石", "OBJECTIVES.ROCK.TT": "Fusion Pilotを生存。", "OBJECTIVES.ILLUMINA": "イルミナ", @@ -243,6 +266,7 @@ "OBJECTIVES.OMORI_PLUSH.TT": "Somethingを生存。", "OBJECTIVES.PARADISE_LOST": "失楽園", "OBJECTIVES.PARADISE_LOST.TT": "使徒を指定回数スタンさせる。", + "OBJECTIVES.ITEM_SKIN_UNLOCKS": "解放したアイテムスキン", "OBJECTIVES.RED_MEDKIT": "赤メッドキット", "OBJECTIVES.RED_MEDKIT.TT": "メッドキットを持ちながらVirusを生存。", @@ -273,6 +297,44 @@ "OBJECTIVES.SNOWY_SPEED_COIL.TT": "雪の中に何かがある。", "OBJECTIVES.TORCH_OF_OBSESSION": "松明", "OBJECTIVES.TORCH_OF_OBSESSION.TT": "Cold Nightを生存。", + + "OBJECTIVES.HAVE_PLUSH": "Have人形", + "OBJECTIVES.HAVE_PLUSH.TT": "The Observationを生存。", + "OBJECTIVES.PORTABLE_SLOTS": "ポータブルスロット", + "OBJECTIVES.PORTABLE_SLOTS.TT": "Haveの秘密に包まれた酒を持ちながらアンバウンドを生存。", + "OBJECTIVES.SOUL_VISITOR": "ソウルビジター", + "OBJECTIVES.SOUL_VISITOR.TT": "テレポーターを持ちながらアンバウンドを生存。", + "OBJECTIVES.DEFLECT_COIL": "蒼白のコイル", + "OBJECTIVES.DEFLECT_COIL.TT": "リジェネコイルを持ちながらオルタネイトを生存。", + "OBJECTIVES.ROOT_COIL": "樹根リジェネコイル", + "OBJECTIVES.ROOT_COIL.TT": "草むらで待つ。", + "OBJECTIVES.GHOST_BAT": "ゴーストバット", + "OBJECTIVES.GHOST_BAT.TT": "金属バットを持ちながらゴーストを生存。", + "OBJECTIVES.BLOODY_CHARM": "血濡れチャーム", + "OBJECTIVES.BLOODY_CHARM.TT": "シルバーキャットチャームを持ちながらブラッドバスを生存。", + "OBJECTIVES.LUNA_CHARM": "ルナチャーム", + "OBJECTIVES.LUNA_CHARM.TT": "Kimeraを生存。", + "OBJECTIVES.DESTROYER_COIL": "デストロイヤーコイル", + "OBJECTIVES.DESTROYER_COIL.TT": "コルクスクリューコイルを持ちながらミッドナイトを生存。", + "OBJECTIVES.BLOODY_REVOLVER": "血濡れリボルバー", + "OBJECTIVES.BLOODY_REVOLVER.TT": "アンティークリボルバーを持ちながらブラッドバスを生存。", + "OBJECTIVES.HAUNTED_HAMBURGER": "ハウント ハンバーガー", + "OBJECTIVES.HAUNTED_HAMBURGER.TT": "ハンバーガーを持ちながらゴーストを生存。", + "OBJECTIVES.THORN_GLOGNUT": "ソーングロッグナッツ", + "OBJECTIVES.THORN_GLOGNUT.TT": "Glaggle Gangを生存。", + "OBJECTIVES.JAILBIRD": "ジェイルバード", + "OBJECTIVES.JAILBIRD.TT": "全てのクラシックテラーで生存。", + "OBJECTIVES.JOYOUS_ORB": "ジョイアスオーブ", + "OBJECTIVES.JOYOUS_ORB.TT": "JOYを生存。", + + "OBJECTIVES.CLAW_MACHINE_UNLOCKS": "クレーンゲームで解放", + "OBJECTIVES.NORA_PLUSH": "Nora人形", + "OBJECTIVES.NORA_PLUSH.TT": "Beyond人形が必要。", + "OBJECTIVES.ROBLANDER_PLUSH": "Roblander人形", + "OBJECTIVES.ROBLANDER_PLUSH.TT": "Darkgrey人形が必要。", + "OBJECTIVES.OBSERVATION_PLUSH": "Observation人形", + "OBJECTIVES.OBSERVATION_PLUSH.TT": "Have人形が必要。", + "STATS.TITLE": "ToN 統計トラッカー", "STATS.SHOW_LOBBY": "ロビーの統計を表示", @@ -333,6 +395,8 @@ "STATS.LABEL_MAPORIGIN.TT": "このマップの出典。", "STATS.LABEL_ISALIVE": "生存中", "STATS.LABEL_ISALIVE.TT": "プレイヤーが現在のラウンドで生きている場合「True」。", + "STATS.LABEL_ISREBORN": "復活", + "STATS.LABEL_ISREBORN.TT": "ラウンド中にマクスウェルで生き返った場合「True」。", "STATS.LABEL_ISSTARTED": "ラウンド進行中", "STATS.LABEL_ISSTARTED.TT": "ラウンドが開始して進行中の場合「True」。", "STATS.LABEL_INSTANCEURL": "インスタンスURL", diff --git a/Localization/Language/zh-CN.json b/Localization/Language/zh-CN.json index 863c090..23d0a35 100644 --- a/Localization/Language/zh-CN.json +++ b/Localization/Language/zh-CN.json @@ -255,7 +255,7 @@ "OBJECTIVES.DIVINE_AVENGER": "神圣复仇者(Divine Avenger)", "OBJECTIVES.DIVINE_AVENGER.TT": "使用$$OBJECTIVES.SEALED_SWORD$$至少打中两下阿库斯(Arkus)并存活。", "OBJECTIVES.MAXWELL": "麦克斯韦(Maxwell)", - "OBJECTIVES.MAXWELL.TT": "在迷宫(Its Maze)中找到(每轮生成一次)。", + "OBJECTIVES.MAXWELL.TT": "在实验室(Experimentation)中找到(每轮生成一次)。", "OBJECTIVES.ROCK": "岩石(Rock)", "OBJECTIVES.ROCK.TT": "在熔核领航者(Fusion Pilot)下存活。", "OBJECTIVES.ILLUMINA": "依诺米那(Illumina)", @@ -320,6 +320,12 @@ "OBJECTIVES.BLOODY_REVOLVER.TT": "使用古董左轮手枪(Antique Revolver)在血浴(Bloodbath)回合中存活。", "OBJECTIVES.HAUNTED_HAMBURGER": "闹鬼汉堡(Haunted Hamburger)", "OBJECTIVES.HAUNTED_HAMBURGER.TT": "使用汉堡(Hamburger)在幽灵(Ghost)回合中存活。", + "OBJECTIVES.THORN_GLOGNUT": "索恩·格洛鲁特(Thorn Glognut)", + "OBJECTIVES.THORN_GLOGNUT.TT": "在格拉格尔帮派(Glaggle Gang)下存活。", + "OBJECTIVES.JAILBIRD": "狱鸟(Jailbird)", + "OBJECTIVES.JAILBIRD.TT": "在所有经典(Classic)怪物下至少存活过一次。", + "OBJECTIVES.JOYOUS_ORB": "欢乐之球(Joyous Orb)", + "OBJECTIVES.JOYOUS_ORB.TT": "在欢乐(JOY)下存活。", "OBJECTIVES.CLAW_MACHINE_UNLOCKS": "抓娃娃机解锁", "OBJECTIVES.NORA_PLUSH": "Nora玩偶(Nora Plush)", diff --git a/Models/AppSettings.cs b/Models/AppSettings.cs index a6e5ed1..2cbfa3c 100644 --- a/Models/AppSettings.cs +++ b/Models/AppSettings.cs @@ -169,6 +169,16 @@ public int GetDeathID (string id) { return Array.IndexOf(OSCDeathIDs, id) + 1; } + + /// + /// OSC Master Changed event for OSC. + /// + public bool OSCMasterChange { get; set; } = false; + /// + /// OSC Master Change event interval. + /// + public int OSCMasterChangeInterval { get; set; } = 500; + /// /// Enables OSC chatbox messages. /// diff --git a/Utils/LilOSC.cs b/Utils/LilOSC.cs index a2415dc..aca7705 100644 --- a/Utils/LilOSC.cs +++ b/Utils/LilOSC.cs @@ -45,13 +45,14 @@ internal static class LilOSC { const string ParamDeath = "ToN_DeathID"; const string ParamPages = "ToN_Pages"; const string ParamItemStatus = "ToN_ItemStatus"; + const string ParamMaster = "ToN_MasterChange"; static readonly string[] ParamAll = [ ParamRoundType, ParamTerror1, ParamTerror2, ParamTerror3, ParamTPhase1, ParamTPhase2, ParamTPhase3, ParamOptedIn, ParamSaboteur, ParamMap, ParamEncounter, ParamTerrorColorH, ParamTerrorColorS, ParamTerrorColorV, ParamTerrorColorL, ParamTerrorColorR, ParamTerrorColorG, ParamTerrorColorB, - ParamAlive, ParamReborn, ParamDamaged, ParamDeath, ParamPages, ParamItemStatus + ParamAlive, ParamReborn, ParamDamaged, ParamMaster, ParamDeath, ParamPages, ParamItemStatus ]; const string ParameterFileName = "osc_parameters.txt"; internal static void Initialize() { @@ -186,6 +187,36 @@ private static void DeathTimer_Tick(object? sender, EventArgs e) { } #endregion + #region Host Change + private static Timer? HostTimer; + private static bool LastHost = false; + internal static void SendHostChange() { + if (LastHost || !MainWindow.Started || !Settings.Get.OSCMasterChange || !Settings.Get.OSCEnabled) return; + + if (HostTimer == null) { + HostTimer = new Timer(); + HostTimer.Tick += HostTimer_Tick; + HostTimer.Interval = Settings.Get.OSCMasterChangeInterval; + } + + LastHost = true; + SendParam(ParamMaster, LastHost); + + HostTimer.Stop(); + if (Settings.Get.OSCMasterChangeInterval > 0) { + HostTimer.Interval = Settings.Get.OSCMasterChangeInterval; + HostTimer.Start(); + } else LastHost = false; + } + + private static void HostTimer_Tick(object? sender, EventArgs e) { + HostTimer?.Stop(); + + LastHost = false; + SendParam(ParamMaster, LastHost); + } + #endregion + private static Timer? DamageTimer; private static int LastDamage = 0; internal static void SetDamage(int damage) { @@ -198,11 +229,16 @@ internal static void SetDamage(int damage) { } if (LastDamage != damage) { - DamageTimer.Stop(); - DamageTimer.Start(); - LastDamage = damage; SendParam(ParamDamaged, damage); // change param to a const + + DamageTimer.Stop(); + if (Settings.Get.OSCDamagedInterval > 0) { + DamageTimer.Interval = Settings.Get.OSCDamagedInterval; + DamageTimer.Start(); + } else { + LastDamage = 0; + } } } diff --git a/Windows/MainWindow.cs b/Windows/MainWindow.cs index 45f7ff4..330201e 100644 --- a/Windows/MainWindow.cs +++ b/Windows/MainWindow.cs @@ -872,6 +872,9 @@ private bool HandleTerrorIndex(string line, DateTime timestamp, ToNLogContext co const string STAT_STUN_LANDED = " landed a stun!"; const string STAT_STUN_TARGET = " was stunned."; const string STAT_HIT = "Hit - "; + + const string EVENT_MASTER_CHANGE = "[Behaviour] OnMasterClientSwitched"; + private bool HandleStatCollection(string line, DateTime timestamp, ToNLogContext context) { if (!context.IsRecent) return false; @@ -893,6 +896,11 @@ private bool HandleStatCollection(string line, DateTime timestamp, ToNLogContext } if (Settings.Get.OSCEnabled) { + if (Settings.Get.OSCMasterChange && line.StartsWith(EVENT_MASTER_CHANGE)) { + LilOSC.SendHostChange(); + return true; + } + bool isActivated = line.StartsWith("[UNSTABLE COIL] Activated!") || line.StartsWith("[EMERALD COIL] Activated!") || line.StartsWith("[CORKSCREW COIL] Activated!"); bool isDeactivated = line.StartsWith("[UNSTABLE COIL] Deactivated!") || line.StartsWith("[EMERALD COIL] Deactivated!") || line.StartsWith("[CORKSCREW COIL] Deactivated!"); if (isActivated || isDeactivated) { diff --git a/Windows/SettingsWindow.Designer.cs b/Windows/SettingsWindow.Designer.cs index 43daf84..07f7819 100644 --- a/Windows/SettingsWindow.Designer.cs +++ b/Windows/SettingsWindow.Designer.cs @@ -108,6 +108,9 @@ private void InitializeComponent() { linkEditDeathID = new LinkLabel(); linkSetDeathDecay = new LinkLabel(); linkSetDeathCooldown = new LinkLabel(); + flowLayoutPanel10 = new FlowLayoutPanel(); + checkOSCMasterChange = new CheckBox(); + linkSetMasterInterval = new LinkLabel(); flowLayoutPanel2 = new FlowLayoutPanel(); linkEditChatbox = new LinkLabel(); labelGroupFormat = new Label(); @@ -133,6 +136,7 @@ private void InitializeComponent() { flowTerrorColor.SuspendLayout(); flowLayoutPanel3.SuspendLayout(); flowLayoutPanel9.SuspendLayout(); + flowLayoutPanel10.SuspendLayout(); flowLayoutPanel2.SuspendLayout(); flowLayoutPanel4.SuspendLayout(); SuspendLayout(); @@ -274,7 +278,7 @@ private void InitializeComponent() { // checkShowDate // checkShowDate.AutoSize = true; - checkShowDate.Location = new Point(3, 817); + checkShowDate.Location = new Point(3, 838); checkShowDate.Margin = new Padding(3, 1, 3, 1); checkShowDate.Name = "checkShowDate"; checkShowDate.Padding = new Padding(20, 0, 3, 0); @@ -287,7 +291,7 @@ private void InitializeComponent() { // checkInvertMD // checkInvertMD.AutoSize = true; - checkInvertMD.Location = new Point(3, 775); + checkInvertMD.Location = new Point(3, 796); checkInvertMD.Margin = new Padding(3, 1, 3, 1); checkInvertMD.Name = "checkInvertMD"; checkInvertMD.Padding = new Padding(20, 0, 3, 0); @@ -300,7 +304,7 @@ private void InitializeComponent() { // checkShowSeconds // checkShowSeconds.AutoSize = true; - checkShowSeconds.Location = new Point(3, 796); + checkShowSeconds.Location = new Point(3, 817); checkShowSeconds.Margin = new Padding(3, 1, 3, 1); checkShowSeconds.Name = "checkShowSeconds"; checkShowSeconds.Padding = new Padding(20, 0, 3, 0); @@ -313,7 +317,7 @@ private void InitializeComponent() { // check24Hour // check24Hour.AutoSize = true; - check24Hour.Location = new Point(3, 754); + check24Hour.Location = new Point(3, 775); check24Hour.Margin = new Padding(3, 1, 3, 1); check24Hour.Name = "check24Hour"; check24Hour.Padding = new Padding(20, 0, 3, 0); @@ -389,7 +393,7 @@ private void InitializeComponent() { // checkColorObjectives // checkColorObjectives.AutoSize = true; - checkColorObjectives.Location = new Point(3, 889); + checkColorObjectives.Location = new Point(3, 910); checkColorObjectives.Margin = new Padding(3, 1, 3, 1); checkColorObjectives.Name = "checkColorObjectives"; checkColorObjectives.Padding = new Padding(20, 0, 3, 0); @@ -502,6 +506,7 @@ private void InitializeComponent() { flowLayoutPanel1.Controls.Add(flowTerrorColor); flowLayoutPanel1.Controls.Add(flowLayoutPanel3); flowLayoutPanel1.Controls.Add(flowLayoutPanel9); + flowLayoutPanel1.Controls.Add(flowLayoutPanel10); flowLayoutPanel1.Controls.Add(flowLayoutPanel2); flowLayoutPanel1.Controls.Add(labelGroupFormat); flowLayoutPanel1.Controls.Add(check24Hour); @@ -516,7 +521,7 @@ private void InitializeComponent() { flowLayoutPanel1.FlowDirection = FlowDirection.TopDown; flowLayoutPanel1.Location = new Point(3, 3); flowLayoutPanel1.Name = "flowLayoutPanel1"; - flowLayoutPanel1.Size = new Size(544, 930); + flowLayoutPanel1.Size = new Size(544, 951); flowLayoutPanel1.TabIndex = 0; flowLayoutPanel1.WrapContents = false; // @@ -1265,13 +1270,57 @@ private void InitializeComponent() { linkSetDeathCooldown.TextAlign = ContentAlignment.MiddleLeft; linkSetDeathCooldown.VisitedLinkColor = Color.Gray; // + // flowLayoutPanel10 + // + flowLayoutPanel10.AutoSize = true; + flowLayoutPanel10.AutoSizeMode = AutoSizeMode.GrowAndShrink; + flowLayoutPanel10.Controls.Add(checkOSCMasterChange); + flowLayoutPanel10.Controls.Add(linkSetMasterInterval); + flowLayoutPanel10.Location = new Point(3, 703); + flowLayoutPanel10.Margin = new Padding(3, 1, 3, 1); + flowLayoutPanel10.Name = "flowLayoutPanel10"; + flowLayoutPanel10.Size = new Size(303, 19); + flowLayoutPanel10.TabIndex = 19; + flowLayoutPanel10.WrapContents = false; + // + // checkOSCMasterChange + // + checkOSCMasterChange.AutoSize = true; + checkOSCMasterChange.ForeColor = Color.PowderBlue; + checkOSCMasterChange.Location = new Point(0, 0); + checkOSCMasterChange.Margin = new Padding(0); + checkOSCMasterChange.Name = "checkOSCMasterChange"; + checkOSCMasterChange.Padding = new Padding(50, 0, 3, 0); + checkOSCMasterChange.Size = new Size(230, 19); + checkOSCMasterChange.TabIndex = 12; + checkOSCMasterChange.Tag = "OSCMasterChange"; + checkOSCMasterChange.Text = "Send Master Change (BOOL)"; + checkOSCMasterChange.UseVisualStyleBackColor = true; + // + // linkSetMasterInterval + // + linkSetMasterInterval.ActiveLinkColor = Color.White; + linkSetMasterInterval.AutoSize = true; + linkSetMasterInterval.LinkBehavior = LinkBehavior.HoverUnderline; + linkSetMasterInterval.LinkColor = Color.Gray; + linkSetMasterInterval.Location = new Point(230, 0); + linkSetMasterInterval.Margin = new Padding(0); + linkSetMasterInterval.Name = "linkSetMasterInterval"; + linkSetMasterInterval.Size = new Size(73, 15); + linkSetMasterInterval.TabIndex = 11; + linkSetMasterInterval.TabStop = true; + linkSetMasterInterval.Text = "(Set Interval)"; + linkSetMasterInterval.TextAlign = ContentAlignment.MiddleLeft; + linkSetMasterInterval.VisitedLinkColor = Color.Gray; + linkSetMasterInterval.LinkClicked += linkSetMasterInterval_LinkClicked; + // // flowLayoutPanel2 // flowLayoutPanel2.AutoSize = true; flowLayoutPanel2.AutoSizeMode = AutoSizeMode.GrowAndShrink; flowLayoutPanel2.Controls.Add(checkSendChatbox); flowLayoutPanel2.Controls.Add(linkEditChatbox); - flowLayoutPanel2.Location = new Point(0, 703); + flowLayoutPanel2.Location = new Point(0, 724); flowLayoutPanel2.Margin = new Padding(0, 1, 0, 1); flowLayoutPanel2.Name = "flowLayoutPanel2"; flowLayoutPanel2.Padding = new Padding(3, 0, 0, 0); @@ -1299,7 +1348,7 @@ private void InitializeComponent() { // labelGroupFormat // labelGroupFormat.AutoSize = true; - labelGroupFormat.Location = new Point(3, 738); + labelGroupFormat.Location = new Point(3, 759); labelGroupFormat.Margin = new Padding(3, 15, 3, 0); labelGroupFormat.Name = "labelGroupFormat"; labelGroupFormat.Size = new Size(74, 15); @@ -1309,7 +1358,7 @@ private void InitializeComponent() { // checkShowTime // checkShowTime.AutoSize = true; - checkShowTime.Location = new Point(3, 838); + checkShowTime.Location = new Point(3, 859); checkShowTime.Margin = new Padding(3, 1, 3, 1); checkShowTime.Name = "checkShowTime"; checkShowTime.Padding = new Padding(20, 0, 3, 0); @@ -1322,7 +1371,7 @@ private void InitializeComponent() { // labelGroupStyle // labelGroupStyle.AutoSize = true; - labelGroupStyle.Location = new Point(3, 873); + labelGroupStyle.Location = new Point(3, 894); labelGroupStyle.Margin = new Padding(3, 15, 3, 0); labelGroupStyle.Name = "labelGroupStyle"; labelGroupStyle.Size = new Size(32, 15); @@ -1335,7 +1384,7 @@ private void InitializeComponent() { flowLayoutPanel4.AutoSizeMode = AutoSizeMode.GrowAndShrink; flowLayoutPanel4.Controls.Add(checkOpenRGBEnabled); flowLayoutPanel4.Controls.Add(linkOpenRGB); - flowLayoutPanel4.Location = new Point(0, 910); + flowLayoutPanel4.Location = new Point(0, 931); flowLayoutPanel4.Margin = new Padding(0, 1, 0, 1); flowLayoutPanel4.Name = "flowLayoutPanel4"; flowLayoutPanel4.Padding = new Padding(3, 0, 0, 0); @@ -1425,6 +1474,8 @@ private void InitializeComponent() { flowLayoutPanel3.PerformLayout(); flowLayoutPanel9.ResumeLayout(false); flowLayoutPanel9.PerformLayout(); + flowLayoutPanel10.ResumeLayout(false); + flowLayoutPanel10.PerformLayout(); flowLayoutPanel2.ResumeLayout(false); flowLayoutPanel2.PerformLayout(); flowLayoutPanel4.ResumeLayout(false); @@ -1520,5 +1571,8 @@ private void InitializeComponent() { private LinkLabel linkEditDeathID; private LinkLabel linkSetDeathDecay; private LinkLabel linkSetDeathCooldown; + private FlowLayoutPanel flowLayoutPanel10; + private CheckBox checkOSCMasterChange; + private LinkLabel linkSetMasterInterval; } } \ No newline at end of file diff --git a/Windows/SettingsWindow.cs b/Windows/SettingsWindow.cs index 92c18e6..8bfca5a 100644 --- a/Windows/SettingsWindow.cs +++ b/Windows/SettingsWindow.cs @@ -71,7 +71,7 @@ public static void Open(Form parent) { #region Form Events private Dictionary LocalizedControlCache = new Dictionary(); - private readonly string[] ColorFormatLabels = [ "HSV", "RGB", "HSL", "RGB32" ]; + private readonly string[] ColorFormatLabels = ["HSV", "RGB", "HSL", "RGB32"]; private static string ColorFormatTooltip = "Sends the current Terror color represented as {3}.\nColor will be sent as 3 FLOAT parameters:\n- {0}\n- {1}\n- {2}"; internal void LocalizeContent() { @@ -92,6 +92,7 @@ internal void LocalizeContent() { // OSC LINKS LANG.C(linkEditChatbox, "SETTINGS.OSCSENDCHATBOX_EDIT", toolTip); LANG.C(linkSetDamageInterval, "SETTINGS.OSCDAMAGEDEVENT_EDIT", toolTip); + LANG.C(linkSetMasterInterval, "SETTINGS.OSCMASTERCHANGE_EDIT", toolTip); LANG.C(linkEditDeathID, "SETTINGS.OSCDEATHEVENT_EDIT", toolTip); LANG.C(linkSetDeathDecay, "SETTINGS.OSCDEATHEVENT_DECAY", toolTip); LANG.C(linkSetDeathCooldown, "SETTINGS.OSCDEATHEVENT_COOLDOWN", toolTip); @@ -636,6 +637,17 @@ private void linkAutoNoteEdit_LinkClicked(object sender, LinkLabelLinkClickedEve } } + private void linkSetMasterInterval_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { + int original = Settings.Get.OSCMasterChangeInterval; + string value = original.ToString(); + EditResult show = EditWindow.Show(value, LANG.S("SETTINGS.OSCMASTERCHANGE.TITLE") ?? "Set Interval", this); + + if (show.Accept && !string.IsNullOrEmpty(show.Text) && int.TryParse(show.Text.Trim(), out int result) && result != original) { + Settings.Get.OSCMasterChangeInterval = result; + Settings.Export(); + } + } + private void linkSetDamageInterval_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { int original = Settings.Get.OSCDamagedInterval; string value = original.ToString(); @@ -686,7 +698,7 @@ private void checkAutoCopy_CheckedChanged(object? sender, EventArgs e) { private void checkOSCEnabled_CheckedChanged(object? sender, EventArgs e) { if (checkOSCEnabled.Checked && sender != null) LilOSC.SendData(true); - checkOSCDeathEvent.ForeColor = checkOSCSendDamage.ForeColor = checkOSCSendColor.ForeColor = + checkOSCMasterChange.ForeColor = checkOSCDeathEvent.ForeColor = checkOSCSendDamage.ForeColor = checkOSCSendColor.ForeColor = checkOSCEnabled.Checked ? Color.White : Color.Gray; } @@ -778,6 +790,5 @@ private void BindControlsRecursive(Control.ControlCollection controls) { } } #endregion - } } diff --git a/Windows/SettingsWindow.resx b/Windows/SettingsWindow.resx index 3e5624b..0d64ddc 100644 --- a/Windows/SettingsWindow.resx +++ b/Windows/SettingsWindow.resx @@ -127,7 +127,7 @@ RoundInfoToFile|Write round information to a file. (Such as terror name, map name, round type, etc.)\nThese files can be used in streaming tools like OBS to give your viewers more information about your current pain and suffering. - 33 + 25