Skip to content

Commit

Permalink
Minor codestyle changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Plenyx committed Feb 18, 2024
1 parent f5afd6a commit 6c081cf
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion AppSettings/ApplicationSettingsSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal sealed class ApplicationSettingsSession
internal bool SaveToFile { get; set; } = true;

[JsonProperty("makeWvWSummaryEmbed")]
internal bool MakeWvwSummaryEmbed { get; set; } = true;
internal bool MakeWvWSummaryEmbed { get; set; } = true;

[JsonProperty("sort")]
internal LogSessionSortBy Sort { get; set; } = LogSessionSortBy.Wing;
Expand Down
4 changes: 2 additions & 2 deletions Forms/FormDiscordWebhooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ internal async Task ExecuteAllActiveWebhooksAsync(DpsReportJson reportJSON, List
var squadField = new DiscordApiJsonContentEmbedField()
{
Name = "Squad summary:",
Value = $"```{squadSummary.Render()}```"
Value = $"```{squadSummary.Render()}```",
};
// enemy summary field
var enemyField = new DiscordApiJsonContentEmbedField()
{
Name = "Enemy summary:",
Value = "```Summary could not have been generated.\nToggle detailed WvW to enable this feature.```"
Value = "```Summary could not have been generated.\nToggle detailed WvW to enable this feature.```",
};
if (reportJSON.ExtraJson.Targets.Length > 1)
{
Expand Down
10 changes: 7 additions & 3 deletions Forms/FormLogSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void FormLogSession_FormClosing(object sender, FormClosingEventArgs e)
Hide();
ApplicationSettings.Current.Session.Name = textBoxSessionName.Text;
ApplicationSettings.Current.Session.Message = textBoxSessionContent.Text;
ApplicationSettings.Current.Session.MakeWvwSummaryEmbed = checkBoxMakeWvWSummary.Checked;
ApplicationSettings.Current.Session.MakeWvWSummaryEmbed = checkBoxMakeWvWSummary.Checked;
ApplicationSettings.Current.Save();
}

Expand Down Expand Up @@ -70,7 +70,7 @@ private void ButtonSessionStarter_Click(object sender, EventArgs e)
ElapsedTime = elapsedTime,
ElapsedTimeSpan = elapsedTimeSpan,
SortBy = radioButtonSortByUpload.Checked ? LogSessionSortBy.UploadTime : LogSessionSortBy.Wing,
MakeWvwSummaryEmbed = checkBoxMakeWvWSummary.Checked,
MakeWvWSummaryEmbed = checkBoxMakeWvWSummary.Checked,
UseSelectedWebhooksInstead = radioButtonOnlySelectedWebhooks.Checked,
SelectedWebhooks = ConvertCheckboxListToList(),
};
Expand Down Expand Up @@ -165,7 +165,11 @@ private void ReloadWebhooks()
var allWebhooks = DiscordWebhooks.All;
foreach (var webhookNumber in allWebhooks.Keys)
{
checkedListBoxSelectedWebhooks.Items.Add(new DiscordWebhooksHelperClass() { WebhookId = webhookNumber, Text = $"{allWebhooks[webhookNumber].Name}" }, allWebhooks[webhookNumber].Active);
checkedListBoxSelectedWebhooks.Items.Add(new DiscordWebhooksHelperClass()
{
WebhookId = webhookNumber,
Text = $"{allWebhooks[webhookNumber].Name}",
}, allWebhooks[webhookNumber].Active);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Forms/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ internal FormMain()
logSessionLink.textBoxSessionContent.Text = ApplicationSettings.Current.Session.Message;
logSessionLink.radioButtonSortByUpload.Checked = ApplicationSettings.Current.Session.Sort == LogSessionSortBy.UploadTime;
logSessionLink.checkBoxSaveToFile.Checked = ApplicationSettings.Current.Session.SaveToFile;
logSessionLink.checkBoxMakeWvWSummary.Checked = ApplicationSettings.Current.Session.MakeWvwSummaryEmbed;
logSessionLink.checkBoxMakeWvWSummary.Checked = ApplicationSettings.Current.Session.MakeWvWSummaryEmbed;
discordWebhooksLink.checkBoxShortenThousands.Checked = ApplicationSettings.Current.ShortenThousands;
if (!string.IsNullOrWhiteSpace(ApplicationSettings.Current.Aleeva.RefreshToken) && (DateTime.Now < ApplicationSettings.Current.Aleeva.RefreshTokenExpire))
{
Expand Down
2 changes: 1 addition & 1 deletion Tools/LogSessionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ internal sealed class LogSessionSettings
/// <summary>
/// Make the WvW summary embed appended to the beginning of the session texts
/// </summary>
internal bool MakeWvwSummaryEmbed { get; set; }
internal bool MakeWvWSummaryEmbed { get; set; }

/// <summary>
/// Whether to use SelectedWebhooks for the session ping instead of all active sessions
Expand Down
8 changes: 4 additions & 4 deletions Tools/SessionTextConstructor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ internal static DiscordEmbeds ConstructSessionEmbeds(List<DpsReportJson> reports
.ToArray();

var durationText = $"Session duration: **{logSessionSettings.ElapsedTime}**";
var builderSuccessFailure = ((WvWLogs.Length > 0) && logSessionSettings.MakeWvwSummaryEmbed) ? new StringBuilder() : new StringBuilder($"{durationText}\n\n");
var builderSuccess = ((WvWLogs.Length > 0) && logSessionSettings.MakeWvwSummaryEmbed) ? new StringBuilder() : new StringBuilder($"{durationText}\n\n");
var builderFailure = ((WvWLogs.Length > 0) && logSessionSettings.MakeWvwSummaryEmbed) ? new StringBuilder() : new StringBuilder($"{durationText}\n\n");
var builderSuccessFailure = ((WvWLogs.Length > 0) && logSessionSettings.MakeWvWSummaryEmbed) ? new StringBuilder() : new StringBuilder($"{durationText}\n\n");
var builderSuccess = ((WvWLogs.Length > 0) && logSessionSettings.MakeWvWSummaryEmbed) ? new StringBuilder() : new StringBuilder($"{durationText}\n\n");
var builderFailure = ((WvWLogs.Length > 0) && logSessionSettings.MakeWvWSummaryEmbed) ? new StringBuilder() : new StringBuilder($"{durationText}\n\n");
int messageSuccessFailureCount = 0, messageSuccessCount = 0, messageFailureCount = 0;

if (RaidLogs.Length > 0)
Expand Down Expand Up @@ -403,7 +403,7 @@ internal static DiscordEmbeds ConstructSessionEmbeds(List<DpsReportJson> reports
}
if (WvWLogs.Length > 0)
{
if (logSessionSettings.MakeWvwSummaryEmbed)
if (logSessionSettings.MakeWvWSummaryEmbed)
{
var totalEnemyKills = WvWLogs.Select(x =>
x.ExtraJson?.Players
Expand Down

0 comments on commit 6c081cf

Please sign in to comment.