From e82c482be1025ec7190ad75a896b28c96cf5bea2 Mon Sep 17 00:00:00 2001 From: burninrubber0 Date: Thu, 7 Dec 2023 16:19:05 -0500 Subject: [PATCH 1/3] Add language keys --- LangEditor/keys/unsorted.txt | 63 ++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/LangEditor/keys/unsorted.txt b/LangEditor/keys/unsorted.txt index d8355b4..4426b59 100644 --- a/LangEditor/keys/unsorted.txt +++ b/LangEditor/keys/unsorted.txt @@ -40,12 +40,18 @@ ACH_40X_MULTIPLIER_NAME ACH_500_TAKEDOWNS_DESC ACH_500_TAKEDOWNS_HOWTO ACH_500_TAKEDOWNS_NAME +ACH_50_CAM_SHOTS_DESC +ACH_50_CAM_SHOTS_HOWTO +ACH_50_CAM_SHOTS_NAME ACH_50_RIVALS_DESC ACH_50_RIVALS_HOWTO ACH_50_RIVALS_NAME ACH_50_SNAPSHOTS_DESC ACH_50_SNAPSHOTS_HOWTO ACH_50_SNAPSHOTS_NAME +ACH_5_CAM_SHOTS_DESC +ACH_5_CAM_SHOTS_HOWTO +ACH_5_CAM_SHOTS_NAME ACH_ALL_CAR_CHALLENGES_DESC ACH_ALL_CAR_CHALLENGES_HOWTO ACH_ALL_CAR_CHALLENGES_NAME @@ -100,6 +106,15 @@ ACH_COLLECT_5_STUNTS_NAME ACH_COLLECT_60_STUNTS_DESC ACH_COLLECT_60_STUNTS_HOWTO ACH_COLLECT_60_STUNTS_NAME +ACH_COLLECT_X_JUMPS_DESC +ACH_COLLECT_X_JUMPS_HOWTO +ACH_COLLECT_X_JUMPS_NAME +ACH_COLLECT_X_SMASHES_DESC +ACH_COLLECT_X_SMASHES_HOWTO +ACH_COLLECT_X_SMASHES_NAME +ACH_COLLECT_X_STUNTS_DESC +ACH_COLLECT_X_STUNTS_HOWTO +ACH_COLLECT_X_STUNTS_NAME ACH_COMPLETE_ALL_DAY_ROAD_RULES_DESC ACH_COMPLETE_ALL_DAY_ROAD_RULES_HOWTO ACH_COMPLETE_ALL_DAY_ROAD_RULES_NAME @@ -139,6 +154,9 @@ ACH_FIRST_NIGHT_ROAD_RULE_NAME ACH_FIRST_REPAIR_DESC ACH_FIRST_REPAIR_HOWTO ACH_FIRST_REPAIR_NAME +ACH_FIRST_RIVAL_DESC +ACH_FIRST_RIVAL_HOWTO +ACH_FIRST_RIVAL_NAME ACH_FLATSPIN_DESC ACH_FLATSPIN_HOWTO ACH_FLATSPIN_NAME @@ -190,6 +208,9 @@ ACH_MILLIONAIRES_NAME ACH_MONSTER_ROAD_RULE_TIME_DESC ACH_MONSTER_ROAD_RULE_TIME_HOWTO ACH_MONSTER_ROAD_RULE_TIME_NAME +ACH_ONLINE_RACE_DESC +ACH_ONLINE_RACE_HOWTO +ACH_ONLINE_RACE_NAME ACH_POWER_PARK_80_DESC ACH_POWER_PARK_80_HOWTO ACH_POWER_PARK_80_NAME @@ -214,6 +235,9 @@ ACH_SHORT_WHEELIE_NAME ACH_SHOWTIME_5X_MULTIPLIER_DESC ACH_SHOWTIME_5X_MULTIPLIER_HOWTO ACH_SHOWTIME_5X_MULTIPLIER_NAME +ACH_SHOWTIME_MULTIPLIER_DESC +ACH_SHOWTIME_MULTIPLIER_HOWTO +ACH_SHOWTIME_MULTIPLIER_NAME ACH_SHUTDOWN_HUNTER_DESC ACH_SHUTDOWN_HUNTER_HOWTO ACH_SHUTDOWN_HUNTER_NAME @@ -244,6 +268,9 @@ ACH_WIN_10_RACES_NAME ACH_WIN_10_XS_CARS_DESC ACH_WIN_10_XS_CARS_HOWTO ACH_WIN_10_XS_CARS_NAME +ACH_WIN_20_XS_CARS_DESC +ACH_WIN_20_XS_CARS_HOWTO +ACH_WIN_20_XS_CARS_NAME ACH_WIN_25_XS_CARS_DESC ACH_WIN_25_XS_CARS_HOWTO ACH_WIN_25_XS_CARS_NAME @@ -253,6 +280,12 @@ ACH_WIN_7_STUNT_RUNS_NAME ACH_WIN_8P_RACE_DESC ACH_WIN_8P_RACE_HOWTO ACH_WIN_8P_RACE_NAME +ACH_WIN_ALL_DAY_BURNING_ROUTES_DESC +ACH_WIN_ALL_DAY_BURNING_ROUTES_HOWTO +ACH_WIN_ALL_DAY_BURNING_ROUTES_NAME +ACH_WIN_ALL_NIGHT_BURNING_ROUTES_DESC +ACH_WIN_ALL_NIGHT_BURNING_ROUTES_HOWTO +ACH_WIN_ALL_NIGHT_BURNING_ROUTES_NAME ACH_WIN_DAY_BURNING_ROUTES_DESC ACH_WIN_DAY_BURNING_ROUTES_HOWTO ACH_WIN_DAY_BURNING_ROUTES_NAME @@ -321,6 +354,7 @@ ADV_CONTROL_OPTION_FFB_NONE AHEAD_IN_X AIR ALL_DRIVE_THRUS_OF_TYPE_FOUND +ALL_VEHICLES_TITLE BARRELROLL BARRELROLL_X BESTOFREST_CONTINUE @@ -365,6 +399,7 @@ BRH_SL BRH_WM BRIGHTNESS BROUGHT_TO_YOU_BY +BURNING_RIDES_COMPLETE BURNING_RIDES_DAY BURNING_RIDES_NIGHT BURNOUT_PLAYER_LIST_WOW @@ -465,7 +500,9 @@ CAPS_BUTTON_BUYNOW CAPS_BUTTON_CANCEL CAPS_BUTTON_CCANCELC CAPS_BUTTON_CHANGE_A +CAPS_BUTTON_CHANGE_CAR CAPS_BUTTON_CHANGE_ORDER +CAPS_BUTTON_CHANGE_ROUTE CAPS_BUTTON_CONFIRM CAPS_BUTTON_CONTINUE CAPS_BUTTON_DELETE @@ -520,7 +557,10 @@ CAPS_STORE_BACK CAPS_TRAX_MODE CAPTURED CAPTURED_FOR +CAPTURED_FROM +CAPTURING_FREEBURN_MUGSHOT CAPTURING_IMAGE +CAPTURING_PAYBACK_SMUGSHOT CAPTURING_SMUGSHOT CARS_OWNED CARS_TO_SHUTDOWN @@ -659,6 +699,7 @@ CN_TITLE_CREDITS CN_TITLE_DRIVERDETAILS CN_TITLE_EATRAX CN_TITLE_EDIT_ROUTE +CN_TITLE_FREEBURN CN_TITLE_FRIENDS CN_TITLE_ISLANDINFO CN_TITLE_LINEUP @@ -680,6 +721,7 @@ CN_TITLE_OPT_SCREENS CN_TITLE_OPT_VIDEO CN_TITLE_PLAYERS CN_TITLE_PROFILE +CN_TITLE_PROGRESS CN_TITLE_QUICK_MATCH CN_TITLE_RIDERDETAILS CN_TITLE_SELECT_ROUTE @@ -745,6 +787,7 @@ CONTROL_OPTION_CONTROLLER_LIST CONTROL_OPTION_REBIND_PROMPT CONT_OPT_BM_FAILED CONT_OPT_BM_WARNING +COPSNISLAND_TITLE COPSNROBBERSROOT_BLURB_LONG COPSNROBBERSROOT_BLURB_SHORT COPSNROBBERSROOT_TITLE @@ -921,6 +964,7 @@ GENERAL_DECIMAL_SEPARATOR GENERAL_OPTION_ACCEPT GENERAL_OPTION_BACK GENERAL_OPTION_BUTTON_BACKTOGAME +GENERAL_OPTION_BUTTON_CANCEL GENERAL_OPTION_BUTTON_EMAIL GENERAL_OPTION_BUTTON_MORE_INFO GENERAL_OPTION_BUTTON_NO_CONTINUE @@ -1119,6 +1163,7 @@ HUDMESSAGE_ONLINE_LAST_PLACE HUDMESSAGE_ONLINE_ON_TAIL HUDMESSAGE_ONLINE_TAKES_DOWN HUDMESSAGE_ONLINE_TAKES_LEAD +HUDMESSAGE_ONL_FBURN_X_CALLS_RACE HUDMESSAGE_ONL_FBURN_X_JOINS HUDMESSAGE_ONL_FBURN_X_LEAVES HUDMESSAGE_ON_PLAYER @@ -1216,6 +1261,13 @@ HUDMESSAGE_SKILLZ_X_GOT_TAKEDOWN HUDMESSAGE_SKILLZ_X_GOT_TIME_IN_AIR HUDMESSAGE_SKILLZ_X_GOT_TRAF HUDMESSAGE_SKILLZ_X_GOT_WHEELIE +HUDMESSAGE_SKILLZ_YOU_GOT_BOOST_CHAIN +HUDMESSAGE_SKILLZ_YOU_GOT_DRIFT +HUDMESSAGE_SKILLZ_YOU_GOT_NEAR_MISS +HUDMESSAGE_SKILLZ_YOU_GOT_ONCOMING +HUDMESSAGE_SKILLZ_YOU_GOT_TAKEDOWN +HUDMESSAGE_SKILLZ_YOU_GOT_TIME_IN_AIR +HUDMESSAGE_SKILLZ_YOU_GOT_WHEELIE HUDMESSAGE_SMASH HUDMESSAGE_SMASHES_COMPLETE HUDMESSAGE_SMASH_ISLAND @@ -1291,6 +1343,7 @@ HUD_INFO_TARGET_RUN HUD_INFO_TDTARGET HUD_INFO_TIME HUD_INFO_TIMED_CHALLENGE +HUD_INFO_TO HUD_LEFT_INITIAL HUD_NOCRASH HUD_NOTIME @@ -1372,6 +1425,8 @@ ISLAND_EVENTS_FOUND ISLAND_INFO ISLAND_RECORD_TITLE_BEST_BOOSTCHAIN ISLAND_RECORD_TITLE_BEST_POWER_PARKING +ISLAND_RECORD_TITLE_BEST_ROADRAGE +ISLAND_RECORD_TITLE_BEST_SHOWTIME ISLAND_RECORD_TITLE_BEST_STUNTRUN ISLAND_RECORD_TITLE_BIGGEST_FLATSPIN ISLAND_RECORD_TITLE_BILLBOARDS @@ -1402,6 +1457,7 @@ KEEP_TRYING KPC_EVENT_DRIVETHRUS_PLURAL KPC_EVENT_DRIVETHRUS_PLURAL_ISLAND KPC_EVENT_JUNCTIONS_ALL_BRN_ROUTE +KPC_EVENT_JUNCTIONS_ALL_MM KPC_EVENT_JUNCTIONS_ALL_RACE KPC_EVENT_JUNCTIONS_ALL_RR KPC_EVENT_JUNCTIONS_ALL_STUNT @@ -1581,6 +1637,7 @@ K_FBMG_HEIST_LOAD_GOLD K_FBMG_HEIST_LOAD_ROBBER_DEST K_FBMG_HEIST_LOAD_ROBBER_GET_GOLD K_FBMG_HEIST_LOAD_TITLE +K_FBMG_HEIST_LOAD_YOU K_FBMG_HEIST_LOAD_YOU_COPS K_FBMG_HEIST_LOAD_YOU_ROBBER K_FBMG_HEIST_LOSE_COPS @@ -2154,6 +2211,7 @@ NUDGE NUM_ROUNDS OFFLINE_POPUP_RACE_SPLASH_TEXT ONCOMING +ONLINE_ACCOUNT_DISABLED ONLINE_ALREADY_SIGNED_IN ONLINE_AWARD_LONGEST_DRIFT_OVERALL ONLINE_AWARD_LONGEST_DRIFT_OVERALL_1 @@ -3311,6 +3369,7 @@ PP_TIME PP_UNLUCKY PP_WRONG_WAY PP_X_POINTS +PP_YOUR_SCORE PP_YOU_ARE_ALMOST_OUT_OF_TIME PP_YOU_CRASHED PP_YOU_STRAYED_TOO_FAR @@ -3513,6 +3572,7 @@ SB_5P_CHALS SB_6P_CHALS SB_7P_CHALS SB_8P_CHALS +SCOREBOARD_BIKE SCOREBOARD_CAR SCOREBOARD_COUNTRY SCOREBOARD_EVENT @@ -3824,6 +3884,9 @@ TOYCARSPACK1ROOT_TITLE TOYCARSPACK2ROOT_BLURB_LONG TOYCARSPACK2ROOT_BLURB_SHORT TOYCARSPACK2ROOT_TITLE +TOY_4x4_CAR_BLURB_LONG +TOY_4x4_CAR_BLURB_SHORT +TOY_4x4_CAR_TITLE TOY_BIKE_FIREHAWK_BLURB_LONG TOY_BIKE_FIREHAWK_BLURB_SHORT TOY_BIKE_FIREHAWK_TITLE From 97bbbdeb70f40c453264d4ca53a7d64aee6d4e01 Mon Sep 17 00:00:00 2001 From: burninrubber0 Date: Thu, 7 Dec 2023 16:41:16 -0500 Subject: [PATCH 2/3] Check for null cells --- LangEditor/LangEdit.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LangEditor/LangEdit.cs b/LangEditor/LangEdit.cs index 91fd470..3f3e19a 100644 --- a/LangEditor/LangEdit.cs +++ b/LangEditor/LangEdit.cs @@ -247,8 +247,8 @@ private void findToolStripMenuItem_Click(object sender, EventArgs e) foreach (DataGridViewRow row in dgvMain.Rows) { - if (((string)row.Cells[0].Value).Contains(value, StringComparison.CurrentCultureIgnoreCase) - || ((string)row.Cells[1].Value).Contains(value, StringComparison.CurrentCultureIgnoreCase)) + if ((row.Cells[0].Value != null && ((string)row.Cells[0].Value).Contains(value, StringComparison.CurrentCultureIgnoreCase)) + || (row.Cells[1].Value != null && ((string)row.Cells[1].Value).Contains(value, StringComparison.CurrentCultureIgnoreCase))) { dgvMain.ClearSelection(); dgvMain.CurrentCell = row.Cells[0]; From c8d78117f997cc9ee63d590a15068b43bf80e064 Mon Sep 17 00:00:00 2001 From: burninrubber0 Date: Thu, 7 Dec 2023 17:18:20 -0500 Subject: [PATCH 3/3] Handle empty keys and values --- LangEditor/LangEdit.cs | 22 ++++++++++++++++------ LangEditor/Language.cs | 3 ++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/LangEditor/LangEdit.cs b/LangEditor/LangEdit.cs index 3f3e19a..3f61030 100644 --- a/LangEditor/LangEdit.cs +++ b/LangEditor/LangEdit.cs @@ -113,10 +113,10 @@ public void UpdateDisplay() MessageBoxButtons.OK); } - public void RebuildLanguage() + public int RebuildLanguage() { if (_ignoreChanges) - return; + return 1; Dictionary data = new Dictionary(); @@ -124,6 +124,13 @@ public void RebuildLanguage() { string idString = (string)dgvMain.Rows[i].Cells[0].Value; + if (idString == null) + { + MessageBox.Show(this, "ID cannot be left blank", "Warning", + MessageBoxButtons.OK, MessageBoxIcon.Warning); + return 2; + } + uint id; if (idString.StartsWith("0x") && idString.Length == 10) // Hash { @@ -131,7 +138,7 @@ public void RebuildLanguage() { MessageBox.Show(this, "Failed to parse ID \"" + idString + "\"", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; + return 3; } } else // String @@ -144,7 +151,7 @@ public void RebuildLanguage() { MessageBox.Show(this, "ID " + idString + " already in use", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; + return 4; } data.Add(id, value); } @@ -152,6 +159,8 @@ public void RebuildLanguage() _lang.mpEntries = data; Changed?.Invoke(); + + return 0; } private void importToolStripMenuItem_Click(object sender, EventArgs e) @@ -232,9 +241,10 @@ private void exportToolStripMenuItem_Click(object sender, EventArgs e) private void applyChangesToolStripMenuItem_Click(object sender, EventArgs e) { - RebuildLanguage(); + int result = RebuildLanguage(); - MessageBox.Show(this, "Done!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); + if (result == 0) + MessageBox.Show(this, "Done!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void findToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/LangEditor/Language.cs b/LangEditor/Language.cs index 61cea35..a70b072 100644 --- a/LangEditor/Language.cs +++ b/LangEditor/Language.cs @@ -92,7 +92,8 @@ public bool Write(BundleEntry entry) bw.Write((uint)ms.Length); // String pointer lastPos = ms.Position; ms.Position = ms.Length; - bw.Write(langEntry.Value.ToCharArray()); // String data + if (langEntry.Value != null) + bw.Write(langEntry.Value.ToCharArray()); // String data bw.Write((byte)0); // Null terminator ms.Position = lastPos; }