Skip to content

Commit

Permalink
Merge pull request #79 from ChrisFeline/dev
Browse files Browse the repository at this point in the history
No more pop-ups
  • Loading branch information
ChrisFeline authored Oct 12, 2024
2 parents 5c000a4 + 20124af commit 409b420
Show file tree
Hide file tree
Showing 23 changed files with 694 additions and 564 deletions.
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Latest Changelog

- Fixed OSC map values being mixed up sometimes. It should be consistent now.
- Fixed OSC Item Status for CorkScrew coil.
- Please note that Item Status only works with a specific set of items.
- Fixed a button on the Settings window slicing the text on high DPI resolution.
- Updated Japanese localization. (Thank you @nomlasvrc)
- The Save Manager program is a single file now. YAY
- Removed the pop-up message when you click a save code. A better less intrusive method have been implemented.
- Aditionally, a sound will play when you copy a save code. (Can be disabled in Settings)
- The custom sound notifications in settings have been reworked too.
- The 'Auto Copy' feature will also play an audio if the 'Play Audio on Copy' setting is enabled.
- Fixed OSC colors for Double Trouble.
- Stats for the chatbox is now stored in the correct location.
- Reworked the Automatic Updates.
- Updated Traditional Chinese localization (Thank you @XoF-eLtTiL)
18 changes: 15 additions & 3 deletions Localization/Language/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"MAIN.ENTRY_PLAYERS": "Players in room:",
"MAIN.ENTRY_MAP": "Map:",
"MAIN.ENTRY_WARNING": "$$SAVE.TAG_X$$ Warning!! This save was generated before you loaded your Save Code.\nIf you are not a new player, go back one save and load that instead.",
"MAIN.ENTRY_COPIED": "COPIED TO CLIPBOARD!",

"ROUND_TYPE.INTERMISSION": "Intermission",
"ROUND_TYPE.CLASSIC": "Classic",
Expand Down Expand Up @@ -91,6 +92,7 @@
"SAVE.TAG_D": "🔌",
"SAVE.TAG_L": "💀",
"SAVE.TAG_X": "",
"SAVE.TAG_C": "",

"SETTINGS.CHECK_UPDATE": "Check For Updates",
"SETTINGS.OPEN_DATA_BTN": "Data",
Expand Down Expand Up @@ -200,9 +202,19 @@
"SETTINGS.XSOVERLAY.MESSAGE": "<color=#ff9999><b>ToN</b></color><color=grey>:</color> <color=#adff2f>Save Data Stored</color>",
"SETTINGS.XSOVERLAY.TOGGLE": "<color=#ff9999><b>ToN</b></color><color=grey>:</color> <color=#adff2f>Notifications Enabled</color>",

"SETTINGS.PLAYAUDIO": "Play Audio ({0})",
"SETTINGS.PLAYAUDIO.TT": "Double click to select custom audio file.\nRight click to reset back to 'default.wav'",
"SETTINGS.PLAYAUDIO.TITLE": "Select Custom Audio",

"SETTINGS.PLAYAUDIO.TITLE": "Select Custom Audio File",

"SETTINGS.PLAYAUDIOSAVE": "Play Audio on Save",
"SETTINGS.PLAYAUDIOSAVE.TT": "Plays an audio when a new save code is created.",

"SETTINGS.PLAYAUDIOCOPY": "Play Audio on Copy",
"SETTINGS.PLAYAUDIOCOPY.TT": "Plays an audio when you copy a save code entry.",

"SETTINGS.PLAYAUDIO_SELECT": "(Select Audio File)",
"SETTINGS.PLAYAUDIO_SELECT.TT": "Select a custom audio file on your computer for this notification.",
"SETTINGS.PLAYAUDIO_SELECT.ALT": "$$SETTINGS.PLAYAUDIO_SELECT.TT$$\nRight click this button to reset this notification audio back to default.",


"SETTINGS.GROUP.TIME_FORMAT": "Time Formatting",
"SETTINGS.USE24HOUR": "24 Hour Time",
Expand Down
25 changes: 15 additions & 10 deletions Localization/Language/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"EDIT.DELETE": "刪除",
"EDIT.OK": "確定",
"EDIT.CANCEL": "取消",
"EDIT.INSERT_TEMPLATE": "導入範本參數",

"MESSAGE.WRITE_SETTINGS_ERROR": "嘗試將你的設定寫入檔案時發生錯誤\n\n請確保該程式具備在當前資料夾寫入檔案的權限",
"MESSAGE.COPY_FILES_ERROR": "嘗試將你的文件複製到選擇位置時發生錯誤\n\n請確保該程式具備向目標位置寫入檔案的權限\n路徑: {0}",
Expand Down Expand Up @@ -62,11 +63,11 @@

"ROUND_TYPE.INTERMISSION": "中場休息 (Intermission)",
"ROUND_TYPE.CLASSIC": "經典 (Classic)",
"ROUND_TYPE.FOG": "農霧 (Fog)",
"ROUND_TYPE.FOG": "濃霧 (Fog)",
"ROUND_TYPE.PUNISHED": "懲罰 (Punished)",
"ROUND_TYPE.SABOTAGE": "破壞 (Sabotage)",
"ROUND_TYPE.CRACKED": "崩裂 (Cracked)",
"ROUND_TYPE.BLOODBATH": "血浴 (Bloodbath)",
"ROUND_TYPE.BLOODBATH": "血戰 (Bloodbath)",
"ROUND_TYPE.DOUBLE_TROUBLE": "雙重麻煩 (Double Trouble)",
"ROUND_TYPE.EX": "EX (EX)",
"ROUND_TYPE.GHOST": "幽靈 (Ghost)",
Expand Down Expand Up @@ -184,6 +185,8 @@
"SETTINGS.OSCSENDCHATBOX_EDIT.TT": "自訂要顯示在聊天框中的訊息模板",
"SETTINGS.OSCSENDCOLOR": "發送怪物顏色",
"SETTINGS.OSCSENDCOLOR.TT": "以 HSV 形式發送當前的怪物顏色\n顏色將作為 3 個浮點參數發送:\n- ToN_ColorH (色相)\n- ToN_ColorS (飽和度)\n- ToN_ColorV (值)",
"SETTINGS.OSCSENDCOLORFORMAT": "變更顏色格式",
"SETTINGS.OSCSENDCOLORFORMAT.TT": "交替使用 OSC 傳送值的目前顏色格式。\n可用格式為 HSV、HSL、RGB 及 RGB32。",
"SETTINGS.OSCDAMAGEDEVENT": "發送傷害事件",
"SETTINGS.OSCDAMAGEDEVENT.TT": "向整數參數發送傷害事件,數字表示接收到的傷害值\n該值將發送到名為 'ToN_Damaged' 的參數,然後在間隔後重設為 0\n如果玩家死亡,傷害值將為 255,表示最大痛苦",
"SETTINGS.OSCDAMAGEDEVENT_EDIT": "(設定間隔)",
Expand All @@ -207,6 +210,8 @@
"SETTINGS.INVERTMD": "反轉月份/日期",
"SETTINGS.SHOWDATE": "右側面板日期",
"SETTINGS.SHOWDATE.TT": "右側面板的條目將顯示完整日期",
"SETTINGS.SHOWTIME": "右側面板時間",
"SETTINGS.SHOWTIME.TT": "右側面板的條目將顯示完整時間",

"SETTINGS.GROUP.STYLE": "樣式",
"SETTINGS.COLORFULOBJECTIVES": "多彩目標",
Expand All @@ -220,17 +225,17 @@
"OBJECTIVES.TITLE": "ToN 目標 (ToN Objectives)",
"OBJECTIVES.EVENT_ITEMS_UNLOCKS": "事件物品解鎖 (Event Items Unlocks)",
"OBJECTIVES.SEALED_SWORD": "封印之劍 (Sealed Sword)",
"OBJECTIVES.SEALED_SWORD.TT": "在博物館中找到用閃電工具打破保險櫃 (Found in Museum. Break case with a stun tool.)",
"OBJECTIVES.SEALED_SWORD.TT": "在博物館中找到用擊暈道具打破保險櫃 (Found in Museum. Break case with a stun tool.)",
"OBJECTIVES.GRAN_FAUST": "格蘭·福斯特 (Gran Faust)",
"OBJECTIVES.GRAN_FAUST.TT": "使用 '$$OBJECTIVES.SEALED_SWORD$$' 生存下來,抵抗阿爾庫斯 (Survive Arkus with '$$OBJECTIVES.SEALED_SWORD$$'.)",
"OBJECTIVES.DIVINE_AVENGER": "神聖復仇者 (Divine Avenger)",
"OBJECTIVES.DIVINE_AVENGER.TT": "在打擊他們至少兩次後,使用 '$$OBJECTIVES.SEALED_SWORD$$' 生存下來抵抗阿爾庫斯 (Survive Arkus with '$$OBJECTIVES.SEALED_SWORD$$' after hitting them at least two times.)",
"OBJECTIVES.MAXWELL": "麥克斯威爾 (Maxwell)",
"OBJECTIVES.MAXWELL.TT": "在迷宮中找到(每回合生成一次) (Found in Its Maze. (spawns once per round))",
"OBJECTIVES.ROCK": "石頭 (Rock)",
"OBJECTIVES.ROCK.TT": "生存下來對抗融合駕駛員 (Survive Fusion Pilot.)",
"OBJECTIVES.ROCK.TT": "Fusion Pilot 手中生存下來 (Survive Fusion Pilot.)",
"OBJECTIVES.ILLUMINA": "光明 (Illumina)",
"OBJECTIVES.ILLUMINA.TT": "生存下來對抗極樂 (Survive Bliss.)",
"OBJECTIVES.ILLUMINA.TT": "在 Bliss 中生存下來 (Survive Bliss.)",
"OBJECTIVES.REDBULL": "紅牛 (Redbull)",
"OBJECTIVES.REDBULL.TT": "生存下來對抗羅布蘭德 (Survive Roblander.)",
"OBJECTIVES.OMORI_PLUSH": "小小的 OMORI (Omori Plush)",
Expand All @@ -241,17 +246,17 @@
"OBJECTIVES.RED_MEDKIT": "紅色醫療包 (Red Medkit)",
"OBJECTIVES.RED_MEDKIT.TT": "使用醫療包抵抗病毒生存 (Survive Virus with Medkit.)",
"OBJECTIVES.PSYCHO_COIL": "瘋狂線圈 (Psycho Coil)",
"OBJECTIVES.PSYCHO_COIL.TT": "使用發光線圈在心靈噩夢中生存下來 (Survive Psychosis with Glow Coil.)",
"OBJECTIVES.PSYCHO_COIL.TT": "使用發光線圈在 Psychosis 中生存下來 (Survive Psychosis with Glow Coil.)",
"OBJECTIVES.BLOODY_TELEPORTER": "血腥傳送器 (Bloody Teleporter)",
"OBJECTIVES.BLOODY_TELEPORTER.TT": "在血浴回合中使用傳送器生存 (Survive a Bloodbath round with Teleporter.)",
"OBJECTIVES.BLOODY_TELEPORTER.TT": "在血戰回合中使用傳送器生存 (Survive a Bloodbath round with Teleporter.)",
"OBJECTIVES.PALE_SUITCASE": "蒼白的手提箱 (Pale Suitcase)",
"OBJECTIVES.PALE_SUITCASE.TT": "在精英回合中使用傳送器生存 (Survive an Alternate round with Teleporter.)",
"OBJECTIVES.THORN_HACKER": "荊棘駭客 (Thorn Hacker)",
"OBJECTIVES.THORN_HACKER.TT": "在潘多拉中使用傳送器生存 (Survive Pandora with Teleporter.)",
"OBJECTIVES.BLOODY_COIL": "血腥線圈 (Bloody Coil)",
"OBJECTIVES.BLOODY_COIL.TT": "在血浴回合中使用速度線圈生存 (Survive a Bloodbath round with Speed Coil.)",
"OBJECTIVES.BLOODY_COIL.TT": "在血戰回合中使用速度線圈生存 (Survive a Bloodbath round with Speed Coil.)",
"OBJECTIVES.BLOODY_BAT": "血腥球棒 (Bloody Bat)",
"OBJECTIVES.BLOODY_BAT.TT": "在血浴回合中使用金屬棒生存 (Survive a Bloodbath round with Metal Bat.)",
"OBJECTIVES.BLOODY_BAT.TT": "在血戰回合中使用金屬棒生存 (Survive a Bloodbath round with Metal Bat.)",
"OBJECTIVES.METAL_PIPE": "金屬管 (Metal Pipe)",
"OBJECTIVES.METAL_PIPE.TT": "在精英回合中使用金屬棒生存 (Survive an Alternate round with Metal Bat.)",
"OBJECTIVES.COLORABLE_BAT": "彩色球棒 (Colorable Bat)",
Expand All @@ -266,7 +271,7 @@
"OBJECTIVES.SNOWY_SPEED_COIL": "雪地速度線圈 (Snowy Speed Coil)",
"OBJECTIVES.SNOWY_SPEED_COIL.TT": "雪中有你想要的東西 (There's something in the snow for you.)",
"OBJECTIVES.TORCH_OF_OBSESSION": "痴謎之火把 (Torch Of Obsession)",
"OBJECTIVES.TORCH_OF_OBSESSION.TT": "生存下來對抗寒冷之夜 (Survive the Cold Night.)",
"OBJECTIVES.TORCH_OF_OBSESSION.TT": "在寒冷之夜生存下來 (Survive the Cold Night.)",

"STATS.TITLE": "ToN 統計追蹤器",
"STATS.SHOW_LOBBY": "顯示房間統計",
Expand Down
5 changes: 3 additions & 2 deletions Models/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ static Settings() {
/// <summary>
/// Play notification audio when a new save is detected.
/// </summary>
public bool PlayAudio { get; set; }
public bool PlayAudioCopy { get; set; }
public bool PlayAudioSave { get; set; } = true;
public bool PlayAudioCopy { get; set; } = true;

/// <summary>
/// Custom audio location, must be .wav
/// </summary>
public string? AudioLocation { get; set; }
public string? AudioCopyLocation { get; set; }

/// <summary>
/// Saves a list of players that were in the same room as you at the time of the save.
Expand Down
12 changes: 9 additions & 3 deletions Models/Entry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ internal class Entry {
static string TextPlayers = "Players in room:";
static string TextMap = "Map:";
static string TextWarn = "Warning!! You forgot to load your save code.";
public static string TextCopied = TextTagC + Separator + "COPIED TO CLIPBOARD!";

static string TextTagR = "🔄";
static string TextTagW = "🏆";
static string TextTagD = "🔌";
static string TextTagL = "💀";
static string TextTagX = "⚠️";
static string TextTagC = "✅";
const string Separator = " | ";

internal static void LocalizeContent() {
TextNote = LANG.S("MAIN.ENTRY_NOTE") ?? "Note:";
Expand All @@ -56,12 +59,16 @@ internal static void LocalizeContent() {
TextPlayers = LANG.S("MAIN.ENTRY_PLAYERS") ?? "Players in room:";
TextMap = LANG.S("MAIN.ENTRY_MAP") ?? "Map:";
TextWarn = LANG.S("MAIN.ENTRY_WARNING") ?? "Warning!! You forgot to load your save code.";
TextCopied = LANG.S("MAIN.ENTRY_COPIED") ?? "COPIED TO CLIPBOARD!";

TextTagR = LANG.S("SAVE.TAG_R") ?? "🔄";
TextTagW = LANG.S("SAVE.TAG_W") ?? "🏆";
TextTagD = LANG.S("SAVE.TAG_D") ?? "🔌";
TextTagL = LANG.S("SAVE.TAG_L") ?? "💀";
TextTagX = LANG.S("SAVE.TAG_X") ?? "⚠️";
TextTagC = LANG.S("SAVE.TAG_C") ?? "✅";

TextCopied = TextTagC + Separator + TextCopied;
}

public string Note = string.Empty;
Expand Down Expand Up @@ -98,7 +105,6 @@ public Entry(string content, DateTime timestamp)

public override string ToString()
{
const string separator = " | ";
StringBuilder sb = new StringBuilder();

if (Settings.Get.SaveRoundInfo && Settings.Get.ShowWinLose) {
Expand All @@ -112,13 +118,13 @@ public override string ToString()
case ToNRoundResult.X: sb.Append(TextTagX); break;
}

sb.Append(separator);
sb.Append(Separator);
}

string? dateFormat = EntryDate.GetDateFormat(true);
if (!string.IsNullOrEmpty(dateFormat)) {
sb.Append(Timestamp.ToString(dateFormat));
sb.Append(separator);
sb.Append(Separator);
}

if (!string.IsNullOrEmpty(Note))
Expand Down
31 changes: 30 additions & 1 deletion Models/GitHubRelease.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using static ToNSaveManager.Models.GitHubRelease;

namespace ToNSaveManager.Models
{
Expand All @@ -17,7 +18,7 @@ internal class GitHubRelease
public string body { get; set; } = string.Empty;
public DateTime created_at { get; set; }
public DateTime published_at { get; set; }
public Asset[] assets { get; set; } = new Asset[0];
public Asset[] assets { get; set; } = Array.Empty<Asset>();

internal class Asset
{
Expand Down Expand Up @@ -49,4 +50,32 @@ internal class Asset
}
}
}

internal class GitHubUpdate {
internal static GitHubRelease? Release;
internal static Asset? Asset;

internal static bool Update { get; set; }

internal static void Set(GitHubRelease release, GitHubRelease.Asset asset) {
Release = release;
Asset = asset;
Update = true;

List<Form> openForms = new List<Form>();

foreach (Form f in Application.OpenForms) {
openForms.Add(f);
}

foreach (Form f in openForms) {
f.Close();
}
}

internal static void Start() {
if (!Update || Release == null || Asset == null) return;
Updater.Start(Release, Asset);
}
}
}
15 changes: 10 additions & 5 deletions Models/Index/TerrorMatrix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,15 @@ public TerrorMatrix(string roundType, params int[] indexes) {
dupes.Clear();
}

Terrors = new ToNIndex.TerrorInfo[indexes.Length];
Terrors = new ToNIndex.TerrorInfo[3];
for (int i = 0; i < Terrors.Length; i++) {
ToNIndex.TerrorInfo info = new(indexes[i], i > 1 && RoundType == ToNRoundType.Midnight ? ToNIndex.TerrorGroup.Alternates : ToNIndex.TerrorGroup.Terrors);
if (i == StartIndex && lvl > 1) info.Level = lvl;
Terrors[i] = info;
if (i < TerrorCount) {
ToNIndex.TerrorInfo info = new(indexes[i], i > 1 && RoundType == ToNRoundType.Midnight ? ToNIndex.TerrorGroup.Alternates : ToNIndex.TerrorGroup.Terrors);
if (i == StartIndex && lvl > 1) info.Level = lvl;
Terrors[i] = info;
} else {
Terrors[i] = Terrors[0];
}
}
break;

Expand Down Expand Up @@ -212,9 +216,10 @@ private Color GetDisplayColor() {
RoundType != ToNRoundType.Fog_Alternate) {
Color c = Color.White;
int R = 0, G = 0, B = 0, L = 0;
for (int i = StartIndex; i < TerrorCount; i++) {
for (int i = 0; i < Terrors.Length; i++) {
if (i > 2) break;

if (Terrors[i].IsEmpty) continue;
c = Terrors[i].Value.Color;

R += c.R;
Expand Down
1 change: 0 additions & 1 deletion Models/SaveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ internal static string Destination
m_Destination = value;
string? dirName = Path.GetDirectoryName(m_Destination);
History.Destination = Path.Combine(dirName ?? "./", "Database");
ToNStats.Destination = dirName ?? "./";
}
}

Expand Down
8 changes: 2 additions & 6 deletions Models/Stats/ToNStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,9 @@ internal static class ToNStats {
static readonly LoggerSource Log = new LoggerSource(nameof(ToNStats));

#region Settings
private static string m_Destination = "Stats.json";
private static string? m_Destination = null;
internal static string Destination {
get => m_Destination;
set {
Log.Print("Setting destination: " + value);
m_Destination = Path.Combine(value, "Stats.json");
}
get => m_Destination ?? (m_Destination = Path.Combine(Program.DataLocation, "Stats.json"));
}
#endregion

Expand Down
Loading

0 comments on commit 409b420

Please sign in to comment.