예제 #1
0
        /// <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.GetFontAlbertusMTLight(12F);
            this.labelPrefixProperties.Font   = FontService.GetFontAlbertusMTLight(11.25F);
            this.labelBaseItemProperties.Font = FontService.GetFontAlbertusMTLight(11.25F);
            this.checkBoxFilterExtraInfo.Font = FontService.GetFontAlbertusMTLight(11.25F);
            this.labelSuffixProperties.Font   = FontService.GetFontAlbertusMTLight(11.25F);
            this.Font = FontService.GetFontAlbertusMT(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.DrawCustomBorder = true;
        }
예제 #2
0
        /// <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.GetFontAlbertusMTLight(11.25F);
            this.ButtonRandom.Font = FontService.GetFontAlbertusMTLight(12F);
            this.ButtonOk.Font     = FontService.GetFontAlbertusMTLight(12F);
            this.ButtonCancel.Font = FontService.GetFontAlbertusMTLight(12F);
            this.labelInfos.Font   = FontService.GetFontAlbertusMTLight(11.25F);
            this.Font = FontService.GetFontAlbertusMTLight(11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            #endregion

            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;
            }
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the ItemSeedDialog class.
        /// </summary>
        public CharacterEditDialog(IServiceProvider serviceProvider, ILogger <CharacterEditDialog> log) : base(serviceProvider)
        {
            this.Log = log.Logger;

            this.InitializeComponent();

            #region Apply custom font

            this.ResetMasteriesScalingButton.Font = FontService.GetFontAlbertusMTLight(12F);
            this.ok.Font     = FontService.GetFontAlbertusMTLight(12F);
            this.cancel.Font = FontService.GetFontAlbertusMTLight(12F);
            this.Font        = FontService.GetFontAlbertusMTLight(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.GetFontAlbertusMTLight(11F));

            #endregion

            this.NormalizeBox     = false;
            this.DrawCustomBorder = true;

            this.cancel.Text = Resources.GlobalCancel;
            this.ok.Text     = Resources.GlobalOK;
            this.ResetMasteriesScalingButton.Text = Resources.ResetMasteriesButton;
        }
예제 #4
0
        /// <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.GetFontAlbertusMTLight(11.25F);
            this.labelVersion.Font       = FontService.GetFontAlbertusMTLight(11.25F);
            this.labelCopyright.Font     = FontService.GetFontAlbertusMTLight(11.25F);
            this.textBoxDescription.Font = FontService.GetFontAlbertusMTLight(9.75F);
            this.buttonOK.Font           = FontService.GetFontAlbertusMTLight(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;
        }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of the SearchDialog class.
        /// </summary>
        public SearchDialog(MainForm instance) : base(instance.ServiceProvider)
        {
            this.Owner = instance;

            this.InitializeComponent();

            #region Apply custom font

            this.searchLabel.Font   = FontService.GetFontAlbertusMT(9F);
            this.searchTextBox.Font = FontService.GetFontAlbertusMT(9F);
            this.findButton.Font    = FontService.GetFontAlbertusMTLight(12F);
            this.cancelButton.Font  = FontService.GetFontAlbertusMTLight(12F);
            this.Font = FontService.GetFontAlbertusMT(9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)(0));

            #endregion

            // Load localized strings
            this.Text              = Resources.SearchDialogCaption;
            this.searchLabel.Text  = Resources.SearchDialogText;
            this.findButton.Text   = Resources.MainFormSearchButtonText;
            this.cancelButton.Text = Resources.GlobalCancel;

            this.searchTextBox.Focus();
            this.NormalizeBox = false;
        }
예제 #6
0
        /// <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.GetFontAlbertusMTLight(11F);
            this.instructionsLabel.Font      = FontService.GetFontAlbertusMTLight(11F);
            this.okayButton.Font             = FontService.GetFontAlbertusMTLight(12F);
            this.cancelButton.Font           = FontService.GetFontAlbertusMTLight(12F);
            this.vaultListComboBox.Font      = FontService.GetFontAlbertusMTLight(11F);
            this.newRadioButton.Font         = FontService.GetFontAlbertusMTLight(11.25F);
            this.selectFunctionGroupBox.Font = FontService.GetFontAlbertusMTLight(11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.renameRadioButton.Font      = FontService.GetFontAlbertusMTLight(11.25F);
            this.copyRadioButton.Font        = FontService.GetFontAlbertusMTLight(11.25F);
            this.deleteRadioButton.Font      = FontService.GetFontAlbertusMTLight(11.25F);
            this.sourceLabel.Font            = FontService.GetFontAlbertusMTLight(11F);
            this.targetLabel.Font            = FontService.GetFontAlbertusMTLight(11F);
            this.Font = FontService.GetFontAlbertusMT(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();
        }
예제 #7
0
        /// <summary>
        /// Initializes a new instance of the ItemSeedDialog class.
        /// </summary>
        public CharacterEditDialog(IServiceProvider serviceProvider, ILogger <CharacterEditDialog> log) : base(serviceProvider)
        {
            this.Log = log.Logger;

            this.InitializeComponent();

            #region Apply custom font

            this.ok.Font     = FontService.GetFontAlbertusMTLight(12F);
            this.cancel.Font = FontService.GetFontAlbertusMTLight(12F);
            this.Font        = FontService.GetFontAlbertusMTLight(11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            #endregion

            this.DrawCustomBorder = true;

            this.cancel.Text = Resources.GlobalCancel;
            this.ok.Text     = Resources.GlobalOK;
        }
예제 #8
0
        /// <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.GetFontAlbertusMTLight(12F);
            this.nextButton.Font      = FontService.GetFontAlbertusMTLight(12F);
            this.exitButton.Font      = FontService.GetFontAlbertusMTLight(12F);
            this.labelPleaseWait.Font = FontService.GetFontAlbertusMTLight(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();
        }
예제 #9
0
        /// <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.GetFontAlbertusMTLight(11.25F);
            this.allowItemEditCheckBox.Font     = FontService.GetFontAlbertusMTLight(11.25F);
            this.allowItemCopyCheckBox.Font     = FontService.GetFontAlbertusMTLight(11.25F);
            this.skipTitleCheckBox.Font         = FontService.GetFontAlbertusMTLight(11.25F);
            this.loadLastCharacterCheckBox.Font = FontService.GetFontAlbertusMTLight(11.25F);
            this.loadLastVaultCheckBox.Font     = FontService.GetFontAlbertusMTLight(11.25F);
            this.vaultPathTextBox.Font          = FontService.GetFontAlbertusMTLight(11.25F);
            this.vaultPathLabel.Font            = FontService.GetFontAlbertusMTLight(11.25F);
            this.cancelButton.Font                   = FontService.GetFontAlbertusMTLight(12F);
            this.okayButton.Font                     = FontService.GetFontAlbertusMTLight(12F);
            this.resetButton.Font                    = FontService.GetFontAlbertusMTLight(12F);
            this.vaultPathBrowseButton.Font          = FontService.GetFontAlbertusMTLight(12F);
            this.enableCustomMapsCheckBox.Font       = FontService.GetFontAlbertusMTLight(11.25F);
            this.loadAllFilesCheckBox.Font           = FontService.GetFontAlbertusMTLight(11.25F);
            this.suppressWarningsCheckBox.Font       = FontService.GetFontAlbertusMTLight(11.25F);
            this.playerReadonlyCheckbox.Font         = FontService.GetFontAlbertusMTLight(11.25F);
            this.languageComboBox.Font               = FontService.GetFontAlbertusMTLight(11.25F);
            this.languageLabel.Font                  = FontService.GetFontAlbertusMTLight(11.25F);
            this.detectLanguageCheckBox.Font         = FontService.GetFontAlbertusMTLight(11.25F);
            this.titanQuestPathTextBox.Font          = FontService.GetFontAlbertusMTLight(11.25F);
            this.titanQuestPathLabel.Font            = FontService.GetFontAlbertusMTLight(11.25F);
            this.immortalThronePathLabel.Font        = FontService.GetFontAlbertusMTLight(11.25F);
            this.immortalThronePathTextBox.Font      = FontService.GetFontAlbertusMTLight(11.25F);
            this.detectGamePathsCheckBox.Font        = FontService.GetFontAlbertusMTLight(11.25F);
            this.titanQuestPathBrowseButton.Font     = FontService.GetFontAlbertusMTLight(12F);
            this.immortalThronePathBrowseButton.Font = FontService.GetFontAlbertusMTLight(12F);
            this.customMapLabel.Font                 = FontService.GetFontAlbertusMTLight(11.25F);
            this.mapListComboBox.Font                = FontService.GetFontAlbertusMTLight(11.25F);
            this.baseFontLabel.Font                  = FontService.GetFontAlbertusMTLight(11.25F);
            this.baseFontComboBox.Font               = FontService.GetFontAlbertusMTLight(11.25F);
            this.Font = FontService.GetFontAlbertusMTLight(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.cancelButton.Text = Resources.GlobalCancel;
            this.okayButton.Text   = Resources.GlobalOK;
            this.Text = Resources.SettingsTitle;

            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;
            }
        }
예제 #10
0
        public MainForm(
            IServiceProvider serviceProvider
            , ILogger <MainForm> log
            , SessionContext sessionContext
            , IPlayerService playerService
            , IVaultService vaultService
            , ISearchService searchService
            , IStashService stashService
            , IFontService fontService
            ) : base(serviceProvider)
        {
            this.userContext   = sessionContext;
            this.playerService = playerService;
            this.vaultService  = vaultService;
            this.searchService = searchService;
            this.stashService  = stashService;

            Log = log.Logger;
            Log.Info("TQVaultAE Initialization !");

            InitForm();

            #region Apply custom font & scaling

            this.exitButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.exitButton);
            this.characterComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale);
            ScaleControl(this.UIService, this.characterComboBox);
            this.characterLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.characterLabel);
            ScaleControl(this.UIService, this.itemTextPanel);

            ScaleControl(this.UIService, this.itemText);
            this.vaultListComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale);
            ScaleControl(this.UIService, this.vaultListComboBox);
            this.vaultLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.vaultLabel);
            this.configureButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.configureButton);
            this.customMapText.Font = FontService.GetFontAlbertusMT(11.25F, UIService.Scale);
            ScaleControl(this.UIService, this.customMapText);
            this.panelSelectButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.panelSelectButton);
            this.secondaryVaultListComboBox.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.secondaryVaultListComboBox);
            this.aboutButton.Font = FontService.GetFontAlbertusMTLight(8.25F, UIService.Scale);
            ScaleControl(this.UIService, this.aboutButton);
            this.titleLabel.Font = FontService.GetFontAlbertusMTLight(24F, UIService.Scale);
            ScaleControl(this.UIService, this.titleLabel);
            this.searchButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.searchButton);

            #endregion

            if (TQDebug.DebugEnabled)
            {
                // Write this version into the debug file.
                Log.DebugFormat(CultureInfo.InvariantCulture, "Current TQVault Version: {0}", this.currentVersion);
                Log.Debug(string.Empty);
                Log.Debug("Debug Levels");
                Log.DebugFormat(CultureInfo.InvariantCulture, "ARCFileDebugLevel: {0}", TQDebug.ArcFileDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "DatabaseDebugLevel: {0}", TQDebug.DatabaseDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "ItemAttributesDebugLevel: {0}", TQDebug.ItemAttributesDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "ItemDebugLevel: {0}", TQDebug.ItemDebugLevel);
                Log.Debug(string.Empty);
            }

            // Set up Item strings
            Item.ItemWith           = Resources.ItemWith;
            Item.ItemRelicBonus     = Resources.ItemRelicBonus;
            Item.ItemRelicCompleted = Resources.ItemRelicCompleted;
            Item.ItemQuest          = Resources.ItemQuest;
            Item.ItemSeed           = Resources.ItemSeed;
            Item.ItemIT             = Resources.ItemIT;
            Item.ItemRagnarok       = Resources.ItemRagnarok;
            Item.ItemAtlantis       = Resources.ItemAtlantis;
            Item.ShowSkillLevel     = Config.Settings.Default.ShowSkillLevel;

            // Process the mouse scroll wheel to cycle through the vaults.
            this.MouseWheel += new MouseEventHandler(this.MainFormMouseWheel);
        }
예제 #11
0
        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 = Resources.ResourceManager.GetString(this.Player.PlayerInfo.Class) ?? string.Empty;
                var mclass = Resources.ResourceManager.GetString($"Masteries{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]    = Resources.ResourceManager.GetString($"Difficulty{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.BaseDexterity]         = this.Player.PlayerInfo.BaseDexterity.ToString(),
                    [Resources.BaseIntelligence]      = this.Player.PlayerInfo.BaseIntelligence.ToString(),
                    [Resources.BaseHealth]            = this.Player.PlayerInfo.BaseHealth.ToString(),
                    [Resources.BaseMana]              = this.Player.PlayerInfo.BaseMana.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.GetFontAlbertusMTLight(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;
        }
예제 #12
0
        public MainForm(
            IServiceProvider serviceProvider
            , ILogger <MainForm> log
            , SessionContext sessionContext
            , IPlayerService playerService
            , IVaultService vaultService
            , ISearchService searchService
            , IStashService stashService
            , IFontService fontService
            ) : base(serviceProvider)
        {
            this.userContext   = sessionContext;
            this.playerService = playerService;
            this.vaultService  = vaultService;
            this.searchService = searchService;
            this.stashService  = stashService;

            Log = log.Logger;
            Log.Info("TQVaultAE Initialization !");

            InitForm();

            #region Apply custom font & scaling

            this.exitButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.exitButton);
            this.characterComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale);
            ScaleControl(this.UIService, this.characterComboBox, false);
            this.characterLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.characterLabel, false);

            this.itemText.Font = FontService.GetFontAlbertusMTLight(11F, FontStyle.Bold, UIService.Scale);

            this.vaultListComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale);
            ScaleControl(this.UIService, this.vaultListComboBox, false);
            this.vaultLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.vaultLabel, false);
            this.configureButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.configureButton);
            this.customMapText.Font = FontService.GetFontAlbertusMT(11.25F, UIService.Scale);
            ScaleControl(this.UIService, this.customMapText, false);
            this.showVaulButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.showVaulButton);
            this.secondaryVaultListComboBox.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.secondaryVaultListComboBox, false);
            this.aboutButton.Font = FontService.GetFontAlbertusMTLight(8.25F, UIService.Scale);
            ScaleControl(this.UIService, this.aboutButton);
            this.titleLabel.Font = FontService.GetFontAlbertusMTLight(24F, UIService.Scale);
            ScaleControl(this.UIService, this.titleLabel);
            this.searchButton.Font = FontService.GetFontAlbertusMTLight(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.DebugFormat(CultureInfo.InvariantCulture, "Current TQVault Version: {0}", this.currentVersion);
                Log.Debug(string.Empty);
                Log.Debug("Debug Levels");
                Log.DebugFormat(CultureInfo.InvariantCulture, "ARCFileDebugLevel: {0}", TQDebug.ArcFileDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "DatabaseDebugLevel: {0}", TQDebug.DatabaseDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "ItemAttributesDebugLevel: {0}", TQDebug.ItemAttributesDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "ItemDebugLevel: {0}", TQDebug.ItemDebugLevel);
                Log.Debug(string.Empty);
            }

            // Process the mouse scroll wheel to cycle through the vaults.
            this.MouseWheel += new MouseEventHandler(this.MainFormMouseWheel);
        }