/// <summary> /// Initializes a new instance of the ItemSeedDialog class. /// </summary> public ItemSeedDialog(MainForm instance) : base(instance.ServiceProvider) { this.Owner = instance; this.InitializeComponent(); #region Apply custom font this.itemSeedBox.Font = FontService.GetFontLight(11.25F); this.ButtonRandom.Font = FontService.GetFontLight(12F); this.ButtonOk.Font = FontService.GetFontLight(12F); this.ButtonCancel.Font = FontService.GetFontLight(12F); this.labelInfos.Font = FontService.GetFontLight(11.25F); this.Font = FontService.GetFontLight(11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); #endregion this.NormalizeBox = false; this.DrawCustomBorder = true; this.Text = Resources.SeedText; this.labelInfos.Text = Resources.SeedLabel1; this.ButtonCancel.Text = Resources.GlobalCancel; this.ButtonRandom.Text = Resources.SeedBtnRandom; this.ButtonOk.Text = Resources.GlobalOK; // Set options for Right to Left reading. if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft) { rightToLeftOptions = MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading; } }
/// <summary> /// Initializes a new instance of the ItemSeedDialog class. /// </summary> public CharacterEditDialog(IServiceProvider serviceProvider, ITranslationService translationService, ILogger <CharacterEditDialog> log) : base(serviceProvider) { this.Log = log; this.TranslationService = translationService; this.InitializeComponent(); #region Apply custom font this.ResetMasteriesScalingButton.Font = FontService.GetFontLight(12F); this.ok.Font = FontService.GetFontLight(12F); this.cancel.Font = FontService.GetFontLight(12F); this.Font = FontService.GetFontLight(11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); new[] { this.attribGroupBox, this.levelingGroupBox, this.MasteriesGroupBox }.SelectMany(gb => gb.Controls.OfType <Control>(), (gb, child) => (gb, child)) .ToList() .ForEach(tup => tup.gb.Font = tup.child.Font = FontService.GetFontLight(11F)); #endregion this.NormalizeBox = false; this.DrawCustomBorder = true; this.cancel.Text = Resources.GlobalCancel; this.ok.Text = Resources.GlobalOK; this.ResetMasteriesScalingButton.Text = Resources.ResetMasteriesButton; }
/// <summary> /// Initializes a new instance of the ItemProperties class. /// </summary> public ItemProperties(MainForm instance) : base(instance.ServiceProvider) { this.Owner = instance; this.InitializeComponent(); #region Apply custom font this.ButtonOK.Font = FontService.GetFontLight(12F); this.labelPrefixProperties.Font = FontService.GetFontLight(11.25F); this.labelBaseItemProperties.Font = FontService.GetFontLight(11.25F); this.checkBoxFilterExtraInfo.Font = FontService.GetFontLight(11.25F); this.labelSuffixProperties.Font = FontService.GetFontLight(11.25F); this.Font = FontService.GetFont(9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); #endregion this.Text = Resources.ItemPropertiesText; this.ButtonOK.Text = Resources.GlobalOK; this.labelPrefixProperties.Text = Resources.ItemPropertiesLabelPrefixProperties; this.labelBaseItemProperties.Text = Resources.ItemPropertiesLabelBaseItemProperties; this.labelSuffixProperties.Text = Resources.ItemPropertiesLabelSuffixProperties; this.checkBoxFilterExtraInfo.Text = Resources.ItemPropertiesCheckBoxLabelFilterExtraInfo; this.NormalizeBox = false; this.DrawCustomBorder = true; }
/// <summary> /// Initializes a new instance of the AboutBox class. /// </summary> public AboutBox(IServiceProvider serviceProvider) : base(serviceProvider) { this.InitializeComponent(); #region Apply custom font this.labelProductName.Font = FontService.GetFontLight(11.25F); this.labelVersion.Font = FontService.GetFontLight(11.25F); this.labelCopyright.Font = FontService.GetFontLight(11.25F); this.textBoxDescription.Font = FontService.GetFontLight(9.75F); this.buttonOK.Font = FontService.GetFontLight(12F); #endregion // Initialize the AboutBox to display the product information from the assembly information. // Change assembly information settings for your application through either: // - Project->Properties->Application->Assembly Information // - AssemblyInfo.cs this.Text = string.Format(CultureInfo.CurrentCulture, Resources.AboutText, AssemblyTitle); this.labelProductName.Text = AssemblyProduct; this.labelVersion.Text = string.Format(CultureInfo.CurrentCulture, Resources.AboutVersion, AssemblyVersion); this.labelCopyright.Text = AssemblyCopyright; this.textBoxDescription.Text = Resources.AboutDescription; // AssemblyDescription; this.NormalizeBox = false; this.DrawCustomBorder = true; }
/// <summary> /// Initializes a new instance of the VaultMaintenanceDialog class. /// </summary> public VaultMaintenanceDialog(MainForm instance) : base(instance.ServiceProvider) { this.Owner = instance; this.InitializeComponent(); #region Apply custom font this.targetTextBox.Font = FontService.GetFontLight(11F); this.instructionsLabel.Font = FontService.GetFontLight(11F); this.okayButton.Font = FontService.GetFontLight(12F); this.cancelButton.Font = FontService.GetFontLight(12F); this.vaultListComboBox.Font = FontService.GetFontLight(11F); this.newRadioButton.Font = FontService.GetFontLight(11.25F); this.selectFunctionGroupBox.Font = FontService.GetFontLight(11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.renameRadioButton.Font = FontService.GetFontLight(11.25F); this.copyRadioButton.Font = FontService.GetFontLight(11.25F); this.deleteRadioButton.Font = FontService.GetFontLight(11.25F); this.sourceLabel.Font = FontService.GetFontLight(11F); this.targetLabel.Font = FontService.GetFontLight(11F); this.Font = FontService.GetFont(9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); #endregion // Load the localized resources this.Text = Resources.MaintenanceText; this.copyRadioButton.Text = Resources.MaintenanceRbCopy; this.deleteRadioButton.Text = Resources.MaintenanceRbDelete; this.newRadioButton.Text = Resources.MaintenanceRbNew; this.renameRadioButton.Text = Resources.MaintenanceRbRename; this.selectFunctionGroupBox.Text = Resources.MaintenanceGroup; this.selectFunctionGroupBox.ForeColor = Color.White; this.cancelButton.Text = Resources.GlobalCancel; this.okayButton.Text = Resources.GlobalOK; this.instructionsLabel.Text = Resources.MaintenanceInstructions; this.sourceLabel.Text = Resources.MaintenanceSource; this.targetLabel.Text = Resources.MaintenanceTarget; // Set options for Right to Left reading. if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft) { rightToLeftOptions = MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading; } this.DrawCustomBorder = true; // Load the invalid characters this.invalidChars = Path.GetInvalidFileNameChars(); this.GetVaultList(); }
/// <summary> /// Initializes a new instance of the SplashScreenForm class. /// </summary> public SplashScreenForm(MainForm instance) : base(instance.ServiceProvider) { this.Owner = instance; this.InitializeComponent(); #region Apply custom font this.label3.Font = FontService.GetFontLight(12F); this.nextButton.Font = FontService.GetFontLight(12F); this.exitButton.Font = FontService.GetFontLight(12F); this.labelPleaseWait.Font = FontService.GetFontLight(14.25F); #endregion this.Text = Resources.Form1Text; this.label3.Text = Resources.Form1Label3; this.exitButton.Text = Resources.GlobalExit; this.nextButton.Text = Resources.Form1bNext; this.labelPleaseWait.Text = Resources.Form1LblPleaseWait; this.Icon = Resources.TQVIcon; this.ShowMainForm = false; //this.Opacity = 0.0F; this.FormBorderStyle = FormBorderStyle.None; this.fadeInInterval = Config.Settings.Default.FadeInInterval; this.fadeOutInterval = Config.Settings.Default.FadeOutInterval; this.NormalizeBox = false; this.DrawCustomBorder = true; if (this.UseRoundedRectangle) { this.graphicsPath = this.CreatePath(20); if (this.graphicsPath != null) { this.Region = new Region(this.graphicsPath); } } this.flipColor = this.labelPleaseWait.ForeColor; this.fadeTimer.Start(); }
public MainForm( IServiceProvider serviceProvider // TODO Refactor : injecting service factory is anti pattern , ILogger <MainForm> log , SessionContext sessionContext , IPlayerService playerService , IVaultService vaultService , IStashService stashService , IFontService fontService ) : base(serviceProvider) { this.userContext = sessionContext; this.playerService = playerService; this.vaultService = vaultService; this.stashService = stashService; Log = log; Log.LogInformation("TQVaultAE Initialization !"); InitForm(); #region Apply custom font & scaling this.exitButton.Font = FontService.GetFontLight(12F, UIService.Scale); ScaleControl(this.UIService, this.exitButton); this.characterComboBox.Font = FontService.GetFontLight(13F, UIService.Scale); ScaleControl(this.UIService, this.characterComboBox, false); this.characterLabel.Font = FontService.GetFontLight(11F, UIService.Scale); ScaleControl(this.UIService, this.characterLabel, false); this.itemText.Font = FontService.GetFontLight(11F, FontStyle.Bold, UIService.Scale); this.vaultListComboBox.Font = FontService.GetFontLight(13F, UIService.Scale); ScaleControl(this.UIService, this.vaultListComboBox, false); this.vaultLabel.Font = FontService.GetFontLight(11F, UIService.Scale); ScaleControl(this.UIService, this.vaultLabel, false); this.configureButton.Font = FontService.GetFontLight(12F, UIService.Scale); ScaleControl(this.UIService, this.configureButton); this.customMapText.Font = FontService.GetFont(11.25F, UIService.Scale); ScaleControl(this.UIService, this.customMapText, false); this.showVaulButton.Font = FontService.GetFontLight(12F, UIService.Scale); ScaleControl(this.UIService, this.showVaulButton); this.secondaryVaultListComboBox.Font = FontService.GetFontLight(11F, UIService.Scale); ScaleControl(this.UIService, this.secondaryVaultListComboBox, false); this.aboutButton.Font = FontService.GetFontLight(8.25F, UIService.Scale); ScaleControl(this.UIService, this.aboutButton); this.titleLabel.Font = FontService.GetFontLight(24F, UIService.Scale); ScaleControl(this.UIService, this.titleLabel); this.searchButton.Font = FontService.GetFontLight(12F, UIService.Scale); ScaleControl(this.UIService, this.searchButton); ScaleControl(this.UIService, this.tableLayoutPanelMain); #endregion if (TQDebug.DebugEnabled) { // Write this version into the debug file. Log.LogDebug( $@"Current TQVault Version: {this.currentVersion} Debug Levels {nameof(TQDebug.ArcFileDebugLevel)}: {TQDebug.ArcFileDebugLevel} {nameof(TQDebug.DatabaseDebugLevel)}: {TQDebug.DatabaseDebugLevel} {nameof(TQDebug.ItemAttributesDebugLevel)}: {TQDebug.ItemAttributesDebugLevel} {nameof(TQDebug.ItemDebugLevel)}: {TQDebug.ItemDebugLevel} "); } // Process the mouse scroll wheel to cycle through the vaults. this.MouseWheel += new MouseEventHandler(this.MainFormMouseWheel); }
/// <summary> /// Initializes a new instance of the SettingsDialog class. /// </summary> public SettingsDialog(MainForm instance) : base(instance.ServiceProvider) { this.Owner = instance; this.InitializeComponent(); #region Apply custom font this.characterEditCheckBox.Font = FontService.GetFontLight(11.25F); this.allowItemEditCheckBox.Font = FontService.GetFontLight(11.25F); this.allowItemCopyCheckBox.Font = FontService.GetFontLight(11.25F); this.skipTitleCheckBox.Font = FontService.GetFontLight(11.25F); this.loadLastCharacterCheckBox.Font = FontService.GetFontLight(11.25F); this.loadLastVaultCheckBox.Font = FontService.GetFontLight(11.25F); this.vaultPathTextBox.Font = FontService.GetFontLight(11.25F); this.vaultPathLabel.Font = FontService.GetFontLight(11.25F); this.cancelButton.Font = FontService.GetFontLight(12F); this.okayButton.Font = FontService.GetFontLight(12F); this.resetButton.Font = FontService.GetFontLight(12F); this.vaultPathBrowseButton.Font = FontService.GetFontLight(12F); this.enableCustomMapsCheckBox.Font = FontService.GetFontLight(11.25F); this.loadAllFilesCheckBox.Font = FontService.GetFontLight(11.25F); this.suppressWarningsCheckBox.Font = FontService.GetFontLight(11.25F); this.playerReadonlyCheckbox.Font = FontService.GetFontLight(11.25F); this.languageComboBox.Font = FontService.GetFontLight(11.25F); this.languageLabel.Font = FontService.GetFontLight(11.25F); this.detectLanguageCheckBox.Font = FontService.GetFontLight(11.25F); this.titanQuestPathTextBox.Font = FontService.GetFontLight(11.25F); this.titanQuestPathLabel.Font = FontService.GetFontLight(11.25F); this.immortalThronePathLabel.Font = FontService.GetFontLight(11.25F); this.immortalThronePathTextBox.Font = FontService.GetFontLight(11.25F); this.detectGamePathsCheckBox.Font = FontService.GetFontLight(11.25F); this.titanQuestPathBrowseButton.Font = FontService.GetFontLight(12F); this.immortalThronePathBrowseButton.Font = FontService.GetFontLight(12F); this.customMapLabel.Font = FontService.GetFontLight(11.25F); this.mapListComboBox.Font = FontService.GetFontLight(11.25F); this.baseFontLabel.Font = FontService.GetFontLight(11.25F); this.baseFontComboBox.Font = FontService.GetFontLight(11.25F); this.EnableDetailedTooltipViewCheckBox.Font = FontService.GetFontLight(11.25F); this.EnableItemRequirementRestrictionCheckBox.Font = FontService.GetFontLight(11.25F); this.ItemBGColorOpacityLabel.Font = FontService.GetFontLight(11.25F); this.Font = FontService.GetFontLight(11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)(0)); #endregion this.vaultPathLabel.Text = Resources.SettingsLabel1; this.languageLabel.Text = Resources.SettingsLabel2; this.titanQuestPathLabel.Text = Resources.SettingsLabel3; this.immortalThronePathLabel.Text = Resources.SettingsLabel4; this.customMapLabel.Text = Resources.SettingsLabel5; this.detectGamePathsCheckBox.Text = Resources.SettingsDetectGamePath; this.detectLanguageCheckBox.Text = Resources.SettingsDetectLanguage; this.enableCustomMapsCheckBox.Text = Resources.SettingsEnableMod; this.toolTip.SetToolTip(this.enableCustomMapsCheckBox, Resources.SettingsEnableModTT); this.skipTitleCheckBox.Text = Resources.SettingsSkipTitle; this.toolTip.SetToolTip(this.skipTitleCheckBox, Resources.SettingsSkipTitleTT); this.allowItemCopyCheckBox.Text = Resources.SettingsAllowCopy; this.toolTip.SetToolTip(this.allowItemCopyCheckBox, Resources.SettingsAllowCopyTT); this.allowItemEditCheckBox.Text = Resources.SettingsAllowEdit; this.toolTip.SetToolTip(this.allowItemEditCheckBox, Resources.SettingsAllowEdit); this.characterEditCheckBox.Text = Resources.SettingsAllowEditCE; this.toolTip.SetToolTip(this.characterEditCheckBox, Resources.SettingsAllowEditCE); this.loadLastCharacterCheckBox.Text = Resources.SettingsLoadChar; this.toolTip.SetToolTip(this.loadLastCharacterCheckBox, Resources.SettingsLoadCharTT); this.loadLastVaultCheckBox.Text = Resources.SettingsLoadVault; this.toolTip.SetToolTip(this.loadLastVaultCheckBox, Resources.SettingsLoadVaultTT); this.loadAllFilesCheckBox.Text = Resources.SettingsPreLoad; this.toolTip.SetToolTip(this.loadAllFilesCheckBox, Resources.SettingsPreLoadTT); this.suppressWarningsCheckBox.Text = Resources.SettingsNoWarning; this.toolTip.SetToolTip(this.suppressWarningsCheckBox, Resources.SettingsNoWarningTT); this.playerReadonlyCheckbox.Text = Resources.SettingsPlayerReadonly; this.toolTip.SetToolTip(this.playerReadonlyCheckbox, Resources.SettingsPlayerReadonlyTT); this.resetButton.Text = Resources.SettingsReset; this.toolTip.SetToolTip(this.resetButton, Resources.SettingsResetTT); this.EnableDetailedTooltipViewCheckBox.Text = Resources.SettingEnableDetailedTooltipView; this.toolTip.SetToolTip(this.EnableDetailedTooltipViewCheckBox, Resources.SettingEnableDetailedTooltipViewTT); this.ItemBGColorOpacityLabel.Text = Resources.SettingsItemBGColorOpacityLabel; this.toolTip.SetToolTip(this.ItemBGColorOpacityLabel, Resources.SettingsItemBGColorOpacityLabelTT); this.EnableItemRequirementRestrictionCheckBox.Text = Resources.SettingsEnableItemRequirementRestriction; this.toolTip.SetToolTip(this.EnableItemRequirementRestrictionCheckBox, Resources.SettingsEnableItemRequirementRestrictionTT); this.cancelButton.Text = Resources.GlobalCancel; this.okayButton.Text = Resources.GlobalOK; this.Text = Resources.SettingsTitle; //this.NormalizeBox = false; this.DrawCustomBorder = true; this.mapListComboBox.Items.Clear(); var maps = GamePathResolver.GetCustomMapList(); if (maps?.Any() ?? false) { this.mapListComboBox.Items.AddRange(maps); } if (!Config.Settings.Default.AllowCheats) { this.allowItemEditCheckBox.Visible = false; this.allowItemCopyCheckBox.Visible = false; this.characterEditCheckBox.Visible = false; } }
private void DisplayPlayerInfo() { if (this.Player == null || !this.equipmentPanel.Visible || this.BagButtons[this.CurrentBag].ButtonText != Resources.StashPanelBtn1) { this.PlayerPanel.Visible = false; return; } this.PlayerPanel.Visible = true; if (DisplayPlayerInfoLastName == this.Player.PlayerName) { return; } this.SuspendLayout(); this.PlayerPanel.SuspendLayout(); this.PlayerPanel.Visible = false; this.PlayerPanel.Controls.Clear(); if (this.Player?.PlayerInfo != null) { DisplayPlayerInfoLastName = this.Player.PlayerName; var pclass = TranslationService.TranslateXTag(this.Player.PlayerInfo.Class) ?? string.Empty; var mclass = TranslationService.TranslateMastery(this.Player.PlayerInfo.Class) ?? string.Empty; mclass = mclass == Resources.Masteries ? string.Empty : mclass; var pi = new Dictionary <string, string> { [Resources.CurrentLevel] = this.Player.PlayerInfo.CurrentLevel.ToString(), [Resources.Class] = pclass, [Resources.Masteries] = mclass, [Resources.CurrentXP] = this.Player.PlayerInfo.CurrentXP.ToString(), [Resources.DifficultyUnlocked] = TranslationService.TranslateDifficulty(this.Player.PlayerInfo.DifficultyUnlocked) ?? "unknown", [Resources.Money] = this.Player.PlayerInfo.Money.ToString(), [Resources.SkillPoints] = this.Player.PlayerInfo.SkillPoints.ToString(), [Resources.AttributesPoints] = this.Player.PlayerInfo.AttributesPoints.ToString(), ////[Resources.BaseStrength] = this.Player.PlayerInfo.BaseStrength.ToString(), [Resources.CEStrength] = this.Player.PlayerInfo.CalculatedStrength.ToString(), ////[Resources.BaseDexterity] = this.Player.PlayerInfo.BaseDexterity.ToString(), [Resources.CEDexterity] = this.Player.PlayerInfo.CalculatedDexterity.ToString(), ////[Resources.BaseIntelligence] = this.Player.PlayerInfo.BaseIntelligence.ToString(), [Resources.CEIntelligence] = this.Player.PlayerInfo.CalculatedIntelligence.ToString(), ////[Resources.BaseHealth] = this.Player.PlayerInfo.BaseHealth.ToString(), [Resources.CEHealth] = this.Player.PlayerInfo.CalculatedHealth.ToString(), ////[Resources.BaseMana] = this.Player.PlayerInfo.BaseMana.ToString(), [Resources.CEMana] = this.Player.PlayerInfo.CalculatedMana.ToString(), [Resources.PlayTimeInSeconds] = this.Player.PlayerInfo.PlayTimeInSeconds.ToString(), [Resources.NumberOfDeaths] = this.Player.PlayerInfo.NumberOfDeaths.ToString(), [Resources.NumberOfKills] = this.Player.PlayerInfo.NumberOfKills.ToString(), [Resources.ExperienceFromKills] = this.Player.PlayerInfo.ExperienceFromKills.ToString(), [Resources.HealthPotionsUsed] = this.Player.PlayerInfo.HealthPotionsUsed.ToString(), [Resources.ManaPotionsUsed] = this.Player.PlayerInfo.ManaPotionsUsed.ToString(), [Resources.NumHitsReceived] = this.Player.PlayerInfo.NumHitsReceived.ToString(), [Resources.NumHitsInflicted] = this.Player.PlayerInfo.NumHitsInflicted.ToString(), [Resources.CriticalHitsInflicted] = this.Player.PlayerInfo.CriticalHitsInflicted.ToString(), [Resources.CriticalHitsReceived] = this.Player.PlayerInfo.CriticalHitsReceived.ToString(), }; var labStyle = BorderStyle.None; var mg = new Padding(0, 0, 0, 1); var pd = new Padding(0); int rowIdx = 0; var labFnt = new Font(this.Font.FontFamily, 7.5f * UIService.Scale); // Add Edit Button var editButton = new ScalingButton() { Anchor = AnchorStyles.Top | AnchorStyles.Right, BackColor = Color.Transparent, DialogResult = DialogResult.OK, DownBitmap = Resources.MainButtonDown, FlatStyle = FlatStyle.Flat, ForeColor = Color.FromArgb(51, 44, 28), Image = Resources.MainButtonUp, Name = "editButton", OverBitmap = Resources.MainButtonOver, Size = new Size(137, 30), SizeToGraphic = false, Text = Resources.CharacterEditBtn, UpBitmap = Resources.MainButtonUp, UseCustomGraphic = true, UseVisualStyleBackColor = false, Font = FontService.GetFontLight(11F), Margin = new Padding(0, 0, 0, 5), Padding = new Padding(10, 0, 10, 0), Visible = Config.Settings.Default.AllowCharacterEdit, }; editButton.FlatAppearance.BorderSize = 0; editButton.FlatAppearance.MouseDownBackColor = Color.FromArgb(0, 51, 44, 28); editButton.FlatAppearance.MouseOverBackColor = Color.FromArgb(0, 51, 44, 28); editButton.Click += EditButton_Click; this.PlayerPanel.SetColumnSpan(editButton, 2); this.PlayerPanel.Controls.Add(editButton, 0, rowIdx++); // Add Player Data foreach (var row in pi) { // Add Row this.PlayerPanel.Controls.Add(new ScalingLabel() { Margin = mg, Padding = pd, BorderStyle = labStyle, AutoSize = true, TextAlign = ContentAlignment.TopRight, Anchor = AnchorStyles.Top | AnchorStyles.Right, ForeColor = Color.White, Font = labFnt, Text = row.Key }, 0, rowIdx); this.PlayerPanel.Controls.Add(new ScalingLabel() { Margin = mg, Padding = pd, BorderStyle = labStyle, AutoSize = true, TextAlign = ContentAlignment.TopLeft, Anchor = AnchorStyles.Top | AnchorStyles.Left, ForeColor = Color.YellowGreen, Font = labFnt, Text = row.Value }, 1, rowIdx); rowIdx++; } } this.PlayerPanel.ResumeLayout(); this.ResumeLayout(); this.PlayerPanel.Visible = true; }