protected override void OnActivated(EventArgs e) { base.OnActivated(e); if (FromChild) { return; } #if DEBUG if (_frmDebug.Disposing || _frmDebug.IsDisposed) { return; } _frmDebug.FromMain = true; _frmDebug.Show(); if (_frmDebug.WindowState == FormWindowState.Minimized) { _frmDebug.WindowState = FormWindowState.Normal; } _frmDebug.FromMain = false; #endif }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); Theme.Changed += UpdateTheme; backPen = new Pen(Theme.Current.BackColor); backBrush = new SolidBrush(Theme.Current.BackColor); foreBrush = new SolidBrush(Theme.Current.ForeColor); _frmDebug = new CharacterDebugForm(this); PreventResize(); LogicEngine.Stopped += StopClicked; LogicEngine.Started += StartClicked; tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed; tabControl1.DrawItem += DrawTabItem; _runSeconds = 0; _timerRuntime = new Timer(1000); _timerRuntime.AutoReset = false; _timerRuntime.Elapsed += OnRuntimeUpdate; AddVersionNumber(); #if !DEBUG Task.Run(async() => { await Updater.CheckForUpdates(OnUpdateChecked); }); #endif _suppSkillUi = new SupportSkillUI[] { new SupportSkillUI(txtSuppSkill1, chkParty1), new SupportSkillUI(txtSuppSkill2, chkParty2), new SupportSkillUI(txtSuppSkill3, chkParty3), new SupportSkillUI(txtSuppSkill4, chkParty4), new SupportSkillUI(txtSuppSkill5, chkParty5), new SupportSkillUI(txtSuppSkill6, chkParty6), new SupportSkillUI(txtSuppSkill7, chkParty7), new SupportSkillUI(txtSuppSkill8, chkParty8) }; _txtAttackSkills = new TextBox[] { txtAtkSkill1, txtAtkSkill2, txtAtkSkill3, txtAtkSkill4 }; _txtRecoverSkills = new TextBox[] { txtRecSkill1, txtRecSkill2, txtRecSkill3, txtRecSkill4 }; _controls = new List <Control>() { txtSuppSkill1, txtSuppSkill2, txtSuppSkill3, txtSuppSkill4, txtSuppSkill5, txtSuppSkill6, txtSuppSkill7, txtSuppSkill8, chkParty1, chkParty2, chkParty3, chkParty4, chkParty5, chkParty6, chkParty7, chkParty8, txtAtkSkill1, txtAtkSkill2, txtAtkSkill3, txtAtkSkill4, txtRecSkill1, txtRecSkill2, txtRecSkill3, txtRecSkill4 }; _trkRecSkill = new TrackBarUI(trkRecoverySkillPercent, lblUseRecSkillPercent, btnRecSkillBarPlus, btnRecSkillBarMinus, SaveInfo); _trkHp = new TrackBarUI(trkHpRecovery, lblHpRecovery, btnHpRecoveryPlus, btnHpRecoveryMinus, SaveInfo); _trkMp = new TrackBarUI(trkMpRecovery, lblMpRecoveryPercent, btnMpRecoveryPlus, btnMpRecoveryMinus, SaveInfo); LoadInfo(); _loadDone = true; UpdateTheme(); this.Visible = true; #if DEBUG _frmDebug.Show(); #endif }