-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to specify compression settings for hs build codes (#27)
Co-authored-by: Sobrinth <hey@sobrinth.net> Co-authored-by: Plenyx <1507236+Plenyx@users.noreply.github.com>
- Loading branch information
1 parent
de08d90
commit ec2f293
Showing
8 changed files
with
333 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Newtonsoft.Json; | ||
using static Hardstuck.GuildWars2.BuildCodes.V2.Static; | ||
|
||
namespace PlenBotLogUploader.AppSettings | ||
{ | ||
internal sealed class ApplicationSettingsBuildCodes | ||
{ | ||
[JsonProperty("demoteRunes")] internal bool DemoteRunes { get; set; } = true; | ||
[JsonProperty("demoteSigils")] internal bool DemoteSigils { get; set; } = true; | ||
[JsonProperty("compression")] internal CompressionOptions Compression { get; set; } = CompressionOptions.ALL; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using PlenBotLogUploader.AppSettings; | ||
using System; | ||
using System.Windows.Forms; | ||
using static Hardstuck.GuildWars2.BuildCodes.V2.Static; | ||
|
||
namespace PlenBotLogUploader | ||
{ | ||
public partial class FormHsBuildCodeCompressionSettings : Form | ||
{ | ||
public FormHsBuildCodeCompressionSettings() | ||
{ | ||
InitializeComponent(); | ||
Icon = Properties.Resources.AppIcon; | ||
|
||
var settings = ApplicationSettings.Current.BuildCodes; | ||
checkBoxDemoteRunes.Checked = settings.DemoteRunes; | ||
checkBoxDemoteSigils.Checked = settings.DemoteSigils; | ||
foreach (var option in Enum.GetValues<CompressionOptions>()) | ||
{ | ||
if ((option == CompressionOptions.ALL) || (option == CompressionOptions.NONE)) | ||
{ | ||
continue; | ||
} | ||
checkboxListCompressionOptions.Items.Add(option, settings.Compression.HasFlag(option)); | ||
} | ||
} | ||
|
||
private void CheckBoxDemoteRunes_CheckedChanged(object s, EventArgs e) => ApplicationSettings.Current.BuildCodes.DemoteRunes = checkBoxDemoteRunes.Checked; | ||
private void CheckBoxDemoteSigils_CheckedChanged(object s, EventArgs e) => ApplicationSettings.Current.BuildCodes.DemoteSigils = checkBoxDemoteSigils.Checked; | ||
|
||
private void CheckboxListCompressionOptions_ItemCheck(object s, ItemCheckEventArgs e) | ||
{ | ||
var compressionOption = (CompressionOptions)checkboxListCompressionOptions.Items[e.Index]; | ||
|
||
if (e.NewValue == CheckState.Checked) | ||
{ | ||
ApplicationSettings.Current.BuildCodes.Compression |= compressionOption; | ||
} | ||
else | ||
{ | ||
ApplicationSettings.Current.BuildCodes.Compression &= ~compressionOption; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.