/// <summary> /// 表示切り替えボタン(スペスペボタン)の状態を切り替える /// </summary> /// <param name="visible"> /// 切り替える状態</param> public static void ChangeSwitchVisibleButton( bool visible) { Settings.Default.OverlayVisible = visible; Settings.Default.Save(); SpellTimerCore.Default.ClosePanels(); OnePointTelopController.CloseTelops(); FF14PluginHelper.RefreshPlayer(); LogBuffer.RefreshPartyList(); LogBuffer.RefreshPetID(); if (Settings.Default.OverlayVisible) { SpellTimerCore.Default.ActivatePanels(); OnePointTelopController.ActivateTelops(); } ActInvoker.Invoke(() => { if (Settings.Default.OverlayVisible) { SwitchVisibleButton.BackColor = Color.OrangeRed; SwitchVisibleButton.ForeColor = Color.WhiteSmoke; } else { SwitchVisibleButton.BackColor = SystemColors.Control; SwitchVisibleButton.ForeColor = Color.Black; } }); }
/// <summary> /// 表示切り替えボタンを配置する /// </summary> private void SetSwitchVisibleButton() { var changeColor = new Action <Button>((button) => { if (Settings.Default.OverlayVisible) { button.BackColor = Color.OrangeRed; button.ForeColor = Color.WhiteSmoke; } else { button.BackColor = SystemColors.Control; button.ForeColor = Color.Black; } }); SwitchVisibleButton = new Button(); SwitchVisibleButton.Name = "SpecialSpellTimerSwitchVisibleButton"; SwitchVisibleButton.Size = new Size(90, 24); SwitchVisibleButton.Text = Utility.Translate.Get("SupeSupe"); SwitchVisibleButton.TextAlign = ContentAlignment.MiddleCenter; SwitchVisibleButton.UseVisualStyleBackColor = true; SwitchVisibleButton.Click += (s, e) => { var button = s as Button; Settings.Default.OverlayVisible = !Settings.Default.OverlayVisible; Settings.Default.Save(); SpellTimerCore.Default.ClosePanels(); OnePointTelopController.CloseTelops(); FF14PluginHelper.RefreshPlayer(); LogBuffer.RefreshPartyList(); LogBuffer.RefreshPetID(); if (Settings.Default.OverlayVisible) { SpellTimerCore.Default.ActivatePanels(); OnePointTelopController.ActivateTelops(); } changeColor(s as Button); }; changeColor(SwitchVisibleButton); ActGlobals.oFormActMain.Resize += this.oFormActMain_Resize; ActGlobals.oFormActMain.Controls.Add(SwitchVisibleButton); ActGlobals.oFormActMain.Controls.SetChildIndex(SwitchVisibleButton, 1); this.oFormActMain_Resize(this, null); }
/// <summary> /// Commandとマッチングする /// </summary> /// <param name="logLines"> /// ログ行</param> public static void MatchCommand( IReadOnlyList <string> logLines) { var commandDone = false; foreach (var log in logLines) { // 正規表現の前にキーワードがなければ抜けてしまう if (!log.ToLower().Contains("/spespe")) { continue; } var match = regexCommand.Match(log); if (!match.Success) { continue; } var command = match.Groups["command"].ToString().ToLower(); var target = match.Groups["target"].ToString().ToLower(); var windowname = match.Groups["windowname"].ToString().Replace(@"""", string.Empty); var valueAsText = match.Groups["value"].ToString(); var value = false; if (!bool.TryParse(valueAsText, out value)) { value = false; } switch (command) { case "analyze": switch (target) { case "on": SpecialSpellTimerPlugin.ConfigPanel.CombatAnalyzerEnabled = true; commandDone = true; break; case "off": SpecialSpellTimerPlugin.ConfigPanel.CombatAnalyzerEnabled = false; commandDone = true; break; } break; case "refresh": switch (target) { case "spells": SpellTimerCore.Default.ClosePanels(); commandDone = true; break; case "telops": OnePointTelopController.CloseTelops(); commandDone = true; break; case "me": FF14PluginHelper.RefreshPlayer(); commandDone = true; break; case "pt": LogBuffer.RefreshPartyList(); commandDone = true; break; case "pet": LogBuffer.RefreshPetID(); commandDone = true; break; } break; case "changeenabled": var changed = false; switch (target) { case "spells": foreach (var spell in SpellTimerTable.Table) { if (spell.Panel.Trim().ToLower() == windowname.Trim().ToLower() || spell.SpellTitle.Trim().ToLower() == windowname.Trim().ToLower() || windowname.Trim().ToLower() == "all") { changed = true; spell.Enabled = value; } } if (changed) { ActInvoker.Invoke(() => { SpecialSpellTimerPlugin.ConfigPanel.LoadSpellTimerTable(); }); commandDone = true; } break; case "telops": foreach (var telop in OnePointTelopTable.Default.Table) { if (telop.Title.Trim().ToLower() == windowname.Trim().ToLower() || windowname.Trim().ToLower() == "all") { changed = true; telop.Enabled = value; } } if (changed) { ActInvoker.Invoke(() => { SpecialSpellTimerPlugin.ConfigPanel.LoadTelopTable(); }); commandDone = true; } break; } break; case "set": switch (target) { case "placeholder": if (windowname.Trim().ToLower() != "all" && windowname.Trim() != string.Empty && valueAsText.Trim() != string.Empty) { LogBuffer.SetCustomPlaceholder(windowname.Trim(), valueAsText.Trim()); commandDone = true; } break; } break; case "clear": switch (target) { case "placeholder": if (windowname.Trim().ToLower() == "all") { LogBuffer.ClearCustomPlaceholderAll(); commandDone = true; } else if (windowname.Trim() != string.Empty) { LogBuffer.ClearCustomPlaceholder(windowname.Trim()); commandDone = true; } break; } break; case "on": SpecialSpellTimerPlugin.ChangeSwitchVisibleButton(true); commandDone = true; break; case "off": SpecialSpellTimerPlugin.ChangeSwitchVisibleButton(false); commandDone = true; break; } } // loop end logLines // コマンドを実行したらシステム音を鳴らす if (commandDone) { SystemSounds.Asterisk.Play(); } } // method end