Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase vault size to 18x20 and rework main form #37

Merged
merged 5 commits into from
Dec 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 10 additions & 48 deletions src/TQVaultAE.GUI/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 26 additions & 69 deletions src/TQVaultAE.GUI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -877,12 +877,6 @@ private void ShowMainForm()
private void CreatePanels()
{
this.CreatePlayerPanel();
int textPanelOffset = 0;
textPanelOffset = Convert.ToInt32(2.0F * Database.DB.Scale);

this.itemTextPanel.Location = new Point(this.playerPanel.Location.X, this.playerPanel.Location.Y + this.playerPanel.Height + textPanelOffset);
this.itemTextPanel.Size = new Size(this.playerPanel.Width, Convert.ToInt32(22.0F * Database.DB.Scale));
this.itemText.Width = this.itemTextPanel.Width - Convert.ToInt32(4.0F * Database.DB.Scale);

// Put the secondary vault list on top of the player list drop down
// since only one can be shown at a time.
Expand All @@ -909,6 +903,11 @@ private void CreatePanels()
this.secondaryVaultPanel.Visible = false;
this.lastBag = -1;

int textPanelOffset = 0;
textPanelOffset = Convert.ToInt32(18.0F * Database.DB.Scale);
this.itemTextPanel.Size = new Size(this.vaultPanel.Width, Convert.ToInt32(22.0F * Database.DB.Scale));
this.itemTextPanel.Location = new Point(this.vaultPanel.Location.X, this.ClientSize.Height - (this.itemTextPanel.Size.Height + textPanelOffset));
this.itemText.Width = this.itemTextPanel.Width - Convert.ToInt32(4.0F * Database.DB.Scale);
this.GetVaultList(false);

// Now we always create the stash panel since everyone can have equipment
Expand All @@ -923,8 +922,6 @@ private void SetupFormSize()
{
this.DrawCustomBorder = true;
this.ResizeCustomAllowed = true;
this.loadedCharacterLabel.Text = Resources.PlayerPanelNoPlayer;
this.loadedVaultLabel.Text = Resources.PlayerPanelNoVault;
this.fadeInterval = Settings.Default.FadeInInterval;

// Save the height / width ratio for resizing.
Expand All @@ -950,7 +947,7 @@ private void SetupFormSize()
else if (Screen.PrimaryScreen.Bounds.Height < this.Height)
{
// We really should not need this unless the screen resolution is REALLY low on a wide screen monitor.
this.ScaleForm(Convert.ToSingle(Screen.PrimaryScreen.Bounds.Height) / Convert.ToSingle(this.Height), false);
this.ScaleForm(Convert.ToSingle(Screen.PrimaryScreen.WorkingArea.Height) / Convert.ToSingle(this.Height), false);
}
else if (CurrentAutoScaleDimensions.Width != Database.DesignDpi)
{
Expand Down Expand Up @@ -1197,13 +1194,12 @@ private void CreateActionButton()
/// <param name="numBags">Number of bags in the vault panel.</param>
private void CreateVaultPanel(int numBags)
{
this.vaultPanel = new VaultPanel(this.dragInfo, numBags, new Size(12, 5), this.tooltip, 1, AutoMoveLocation.Vault);
this.vaultPanel = new VaultPanel(this.dragInfo, numBags, new Size(18, 20), this.tooltip, 1, AutoMoveLocation.Vault);

// Move to the top just below the dropdowns. Swap the vault and the player panel locations.
int locationY = Convert.ToInt32(138.0F * Database.DB.Scale);
int locationY = this.vaultListComboBox.Location.Y + Convert.ToInt32(28.0F * Database.DB.Scale);
this.vaultPanel.DrawAsGroupBox = false;

this.vaultPanel.Location = new Point(Convert.ToInt32(16.0F * Database.DB.Scale), locationY);
this.vaultPanel.Location = new Point(Convert.ToInt32(22.0F * Database.DB.Scale), locationY);
this.vaultPanel.OnNewItemHighlighted += new EventHandler<SackPanelEventArgs>(this.NewItemHighlightedCallback);
this.vaultPanel.OnAutoMoveItem += new EventHandler<SackPanelEventArgs>(this.AutoMoveItemCallback);
this.vaultPanel.OnActivateSearch += new EventHandler<SackPanelEventArgs>(this.ActivateSearchCallback);
Expand All @@ -1219,11 +1215,14 @@ private void CreateVaultPanel(int numBags)
/// <param name="numBags">Number of bags in the secondary vault panel.</param>
private void CreateSecondaryVaultPanel(int numBags)
{
this.secondaryVaultPanel = new VaultPanel(this.dragInfo, numBags, new Size(12, 5), this.tooltip, 1, AutoMoveLocation.SecondaryVault);
this.secondaryVaultPanel = new VaultPanel(this.dragInfo, numBags, new Size(18, 20), this.tooltip, 1, AutoMoveLocation.SecondaryVault);
this.secondaryVaultPanel.DrawAsGroupBox = false;

// Place it with the same Y value as the character panel and X value of the vault panel.
this.secondaryVaultPanel.Location = new Point(Convert.ToInt32(16.0F * Database.DB.Scale), this.playerPanel.Location.Y);
this.secondaryVaultPanel.Location = new Point(
this.ClientSize.Width - (this.secondaryVaultPanel.Width + Convert.ToInt32(49.0F * Database.DB.Scale)),
this.vaultPanel.Location.Y);

this.secondaryVaultPanel.OnNewItemHighlighted += new EventHandler<SackPanelEventArgs>(this.NewItemHighlightedCallback);
this.secondaryVaultPanel.OnAutoMoveItem += new EventHandler<SackPanelEventArgs>(this.AutoMoveItemCallback);
this.secondaryVaultPanel.OnActivateSearch += new EventHandler<SackPanelEventArgs>(this.ActivateSearchCallback);
Expand Down Expand Up @@ -1260,12 +1259,12 @@ private void CreatePlayerPanel()
{
this.playerPanel = new PlayerPanel(this.dragInfo, 3, new Size(12, 5), new Size(8, 5), this.tooltip);

// Move to bottom. Add scaled 30 pixels (20 for textPanel + 10 for padding).
int locationY = this.ClientSize.Height - (this.playerPanel.Height + Convert.ToInt32(30.0F * Database.DB.Scale));
int locationX = Convert.ToInt32(16.0F * Database.DB.Scale);
this.playerPanel.Location = new Point(
this.ClientSize.Width - (this.playerPanel.Width + Convert.ToInt32(22.0F * Database.DB.Scale)),
this.characterComboBox.Location.Y + Convert.ToInt32(28.0F * Database.DB.Scale));

this.playerPanel.DrawAsGroupBox = false;

this.playerPanel.Location = new Point(locationX, locationY);
this.playerPanel.OnNewItemHighlighted += new EventHandler<SackPanelEventArgs>(this.NewItemHighlightedCallback);
this.playerPanel.OnAutoMoveItem += new EventHandler<SackPanelEventArgs>(this.AutoMoveItemCallback);
this.playerPanel.OnActivateSearch += new EventHandler<SackPanelEventArgs>(this.ActivateSearchCallback);
Expand All @@ -1286,9 +1285,10 @@ private void CreateStashPanel()
this.stashPanel = new StashPanel(this.dragInfo, panelSize, this.tooltip);

// New location in bottom right of the Main Form.
//Align to playerPanel
this.stashPanel.Location = new Point(
this.ClientSize.Width - (this.stashPanel.Width + Convert.ToInt32(10.0F * Database.DB.Scale)),
this.ClientSize.Height - (this.stashPanel.Height + Convert.ToInt32(5.0F * Database.DB.Scale)));
this.playerPanel.Location.X,
this.ClientSize.Height - (this.stashPanel.Height + Convert.ToInt32(16.0F * Database.DB.Scale)));
this.stashPanel.DrawAsGroupBox = false;

this.stashPanel.OnNewItemHighlighted += new EventHandler<SackPanelEventArgs>(this.NewItemHighlightedCallback);
Expand Down Expand Up @@ -1610,24 +1610,10 @@ private void LoadVault(string vaultName, bool secondaryVault)
if (secondaryVault)
{
this.secondaryVaultPanel.Player = vault;
if (this.loadedCharacterLabel.Enabled)
{
string name = Resources.PlayerPanelNoVault;
if (vault != null)
{
name = vault.PlayerName;
}

this.loadedCharacterLabel.Text = name;
}
}
else
{
this.vaultPanel.Player = vault;
if (this.loadedVaultLabel.Enabled)
{
this.loadedVaultLabel.Text = vault.PlayerName;
}
}
}

Expand All @@ -1642,6 +1628,8 @@ private void UpdateTopPanel()
this.playerPanel.Visible = false;
this.playerPanel.SackPanel.ClearSelectedItems();
this.playerPanel.BagSackPanel.ClearSelectedItems();
this.stashPanel.Visible = false;
this.stashPanel.Enabled = false;
this.secondaryVaultPanel.Enabled = true;
this.secondaryVaultPanel.Visible = true;
this.panelSelectButton.Text = Resources.MainFormBtnShowPlayer;
Expand Down Expand Up @@ -1669,20 +1657,11 @@ private void UpdateTopPanel()

this.secondaryVaultPanel.SackPanel.IsSecondaryVault = true;
this.GetSecondaryVaultList();

if (this.loadedCharacterLabel.Enabled)
{
string name = Resources.PlayerPanelNoVault;
if (this.secondaryVaultPanel.Player != null)
{
name = this.secondaryVaultPanel.Player.PlayerName;
}

this.loadedCharacterLabel.Text = name;
}
}
else
{
this.stashPanel.Visible = true;
this.stashPanel.Enabled = true;
this.secondaryVaultPanel.Enabled = false;
this.secondaryVaultPanel.Visible = false;
this.secondaryVaultPanel.SackPanel.ClearSelectedItems();
Expand All @@ -1705,17 +1684,6 @@ private void UpdateTopPanel()
}
}

if (this.loadedCharacterLabel.Enabled)
{
string name = Resources.PlayerPanelNoPlayer;
if (this.playerPanel.Player != null)
{
name = this.playerPanel.Player.PlayerName;
}

this.loadedCharacterLabel.Text = name;
}

this.vaultPanel.SackPanel.SecondaryVaultShown = false;
this.stashPanel.SackPanel.SecondaryVaultShown = false;
if (this.trashPanel != null)
Expand Down Expand Up @@ -1840,11 +1808,6 @@ private void ClearPlayer()
{
this.stashPanel.Stash = null;
}

if (this.loadedCharacterLabel.Enabled)
{
this.loadedCharacterLabel.Text = Resources.PlayerPanelNoPlayer;
}
}
}

Expand Down Expand Up @@ -1909,11 +1872,6 @@ private void LoadPlayer(string selectedText)
}

this.playerPanel.Player = player;
if (this.loadedCharacterLabel.Enabled)
{
this.loadedCharacterLabel.Text = player.PlayerName;
}

this.stashPanel.Player = player;
this.stashPanel.CurrentBag = 0;
}
Expand Down Expand Up @@ -3278,7 +3236,6 @@ private void SecondaryVaultListComboBoxSelectedIndexChanged(object sender, Event
if (this.secondaryVaultPanel.Player != null)
{
this.secondaryVaultPanel.Player = null;
this.loadedCharacterLabel.Text = Resources.PlayerPanelNoVault;
}
}
else
Expand Down Expand Up @@ -3848,4 +3805,4 @@ private void FadeInTimerTick(object sender, EventArgs e)
}
}
}
}
}
Binary file modified src/TQVaultAE.GUI/resources/img/MainForm_NewBackground.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.