Skip to content

Commit

Permalink
Fixed a bug with rearranging layout for Pistol, and added the ability…
Browse files Browse the repository at this point in the history
… to save tracker window size.
  • Loading branch information
thezerothcat committed Feb 27, 2018
1 parent f66c1c2 commit c2b20e2
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 55 deletions.
6 changes: 6 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
<setting name="FormWidth" serializeAs="String">
<value>320</value>
</setting>
<setting name="FormHeight" serializeAs="String">
<value>605</value>
</setting>
</LMRItemTracker.Properties.Settings>
<LMRItemTracker.Settings1>
<setting name="panel1Contents" serializeAs="String">
Expand Down
102 changes: 47 additions & 55 deletions LaMulanaItemTrackerForm.Designer.cs

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

16 changes: 16 additions & 0 deletions LaMulanaItemTrackerForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public LaMulanaItemTrackerForm()
this.chainWhip.VisibleChanged += new System.EventHandler(this.setChainWhipIndex);
this.flailWhip.VisibleChanged += new System.EventHandler(this.setFlailWhipIndex);

updateFormSize();
updateFormColor();
updateTextColor();
InitializePossibleItems();
Expand Down Expand Up @@ -1720,6 +1721,10 @@ public Control GetControl(String itemName)
{
return bomb;
}
if ("Pistol".Equals(itemName))
{
return pistol;
}
if ("Philosopher's Ocarina".Equals(itemName))
{
return ocarina;
Expand Down Expand Up @@ -1798,6 +1803,12 @@ private String rebuildPanelContents(String currentSettingString, String itemName
return String.Join(",", itemsInPanel);
}

private void updateFormSize()
{
this.Width = Properties.Settings.Default.FormWidth;
this.Height = Properties.Settings.Default.FormHeight;
}

private void updateFormColor()
{
this.BackColor = Properties.Settings.Default.BackgroundColor;
Expand All @@ -1813,6 +1824,8 @@ private void updateTextColor()

private void saveSettings(object sender, EventArgs e)
{
Properties.Settings.Default.FormWidth = this.Width;
Properties.Settings.Default.FormHeight = this.Height;
Properties.Settings.Default.Save();
}

Expand All @@ -1825,7 +1838,10 @@ private void restoreDefaultSettings(object sender, EventArgs e)
Properties.Settings.Default.Panel5Contents = "Philosopher's Ocarina,Mantra/Djed Pillar,Vessel/Medicine,Key Sword,Lamp of Time,Maps,Ankh Jewels";
Properties.Settings.Default.BackgroundColor = System.Drawing.SystemColors.Control;
Properties.Settings.Default.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(70)))), ((int)(((byte)(200)))));
Properties.Settings.Default.FormWidth = 320;
Properties.Settings.Default.FormHeight = 605;

updateFormSize();
updateFormColor();
updateTextColor();
InitializeFormPanels();
Expand Down
24 changes: 24 additions & 0 deletions Properties/Settings.Designer.cs

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

6 changes: 6 additions & 0 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,11 @@
<Setting Name="UpgradeRequired" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="FormWidth" Type="System.Int32" Scope="User">
<Value Profile="(Default)">320</Value>
</Setting>
<Setting Name="FormHeight" Type="System.Int32" Scope="User">
<Value Profile="(Default)">605</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit c2b20e2

Please sign in to comment.