Skip to content

Commit

Permalink
Add support for custom location extensions. Rework location coordinates.
Browse files Browse the repository at this point in the history
  • Loading branch information
TalicZealot committed Dec 30, 2023
1 parent 248c0da commit 5818dd5
Show file tree
Hide file tree
Showing 10 changed files with 259 additions and 143 deletions.
4 changes: 4 additions & 0 deletions SotnRandoTools/src/Configuration/TrackerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public TrackerConfig()
public bool CustomLocationsEquipment { get; set; }
public bool CustomLocationsClassic { get; set; }
public bool CustomLocationsSpread { get; set; }
public bool CustomLocationsCustom { get; set; }
public string CustomExtension { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public Point Location { get; set; }
Expand All @@ -45,6 +47,8 @@ public void Default()
CustomLocationsEquipment = false;
CustomLocationsClassic = false;
CustomLocationsSpread = false;
CustomLocationsCustom = false;
CustomExtension = "";
Width = 260;
Height = 490;
Username = "";
Expand Down
32 changes: 29 additions & 3 deletions SotnRandoTools/src/Panels/AutotrackerSettingsPanel.Designer.cs

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

18 changes: 17 additions & 1 deletion SotnRandoTools/src/Panels/AutotrackerSettingsPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ private void AutotrackerSettingsPanel_Load(object sender, EventArgs e)
muteCheckBox.Checked = toolConfig.Tracker.MuteMusic;
stereoCheckBox.Checked = toolConfig.Tracker.Stereo;

customExtension.Text = toolConfig.Tracker.CustomExtension;
customLocationsGuardedRadio.Checked = toolConfig.Tracker.CustomLocationsGuarded;
customLocationsEquipmentRadio.Checked = toolConfig.Tracker.CustomLocationsEquipment;
customLocationsClassicRadio.Checked = toolConfig.Tracker.CustomLocationsClassic;
customLocationsSpreadRadio.Checked = toolConfig.Tracker.CustomLocationsSpread;
customLocationsCustomExtensionRadio.Checked = toolConfig.Tracker.CustomLocationsCustom;

username.Text = toolConfig.Tracker.Username;

Expand Down Expand Up @@ -88,7 +90,6 @@ private void alwaysOnTopCheckBox_CheckedChanged(object sender, EventArgs e)
{
toolConfig.Tracker.AlwaysOnTop = alwaysOnTopCheckBox.Checked;
}

private void locationsCheckbox_CheckedChanged(object sender, EventArgs e)
{
toolConfig.Tracker.Locations = locationsCheckbox.Checked;
Expand All @@ -112,21 +113,36 @@ private void replaysCheckBox_CheckedChanged(object sender, EventArgs e)
private void customLocationsGuardedRadio_CheckedChanged(object sender, EventArgs e)
{
toolConfig.Tracker.CustomLocationsGuarded = customLocationsGuardedRadio.Checked;
toolConfig.Tracker.CustomExtension = "guarded";
}

private void customLocationsEquipmentRadio_CheckedChanged(object sender, EventArgs e)
{
toolConfig.Tracker.CustomLocationsEquipment = customLocationsEquipmentRadio.Checked;
toolConfig.Tracker.CustomExtension = "equipment";
}

private void customLocationsClassicRadio_CheckedChanged(object sender, EventArgs e)
{
toolConfig.Tracker.CustomLocationsClassic = customLocationsClassicRadio.Checked;
toolConfig.Tracker.CustomExtension = "classic";
}

private void customLocationsSpreadRadio_CheckedChanged(object sender, EventArgs e)
{
toolConfig.Tracker.CustomLocationsSpread = customLocationsSpreadRadio.Checked;
toolConfig.Tracker.CustomExtension = "spread";
}

private void customLocationsCustomExtensionRadio_CheckedChanged(object sender, EventArgs e)
{
toolConfig.Tracker.CustomLocationsCustom = customLocationsCustomExtensionRadio.Checked;
toolConfig.Tracker.CustomExtension = customExtension.Text;
}

private void customExtension_TextChanged(object sender, EventArgs e)
{
toolConfig.Tracker.CustomExtension = customExtension.Text;
}

private void username_TextChanged(object sender, EventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions SotnRandoTools/src/RandoTracker/Models/Location.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public Location()
public bool SpreadExtension { get; set; }
public MapColor AvailabilityColor { get; set; }
public bool Visited { get; set; }
public int MapRow { get; set; }
public int MapCol { get; set; }
public int X { get; set; }
public int Y { get; set; }
public List<string[]>? Locks { get; set; }
public List<string[]>? OutOfLogicLocks { get; set; }
public List<int> WatchIndecies { get; set; }
Expand Down
Loading

0 comments on commit 5818dd5

Please sign in to comment.