Skip to content

Refactor Error Handling, UI Controls, and Localization Tables for Enhanced Clarity#108

Merged
remyCases merged 5 commits intoModShardTeam:mainfrom
altairwei:fix-InjectTableDialogLocalization
Mar 21, 2025
Merged

Refactor Error Handling, UI Controls, and Localization Tables for Enhanced Clarity#108
remyCases merged 5 commits intoModShardTeam:mainfrom
altairwei:fix-InjectTableDialogLocalization

Conversation

@altairwei
Copy link
Collaborator

  1. Throw error when there are no matches

    • In ModInfos.xaml.cs and ModSourceInfos.xaml.cs, the error prompt has been updated from displaying static text to outputting detailed exception information (ex.ToString()), which facilitates debugging and error tracking.
    • Methods like MatchFrom, MatchBelow, and MatchFromUntil have been adjusted:
      • When no matching lines are found in the input data, an exception is thrown instead of returning an expected empty collection. The tests now verify that the exception message clearly includes an error prompt (such as “MatchFrom: No matching lines found” and the relevant matching string).
  2. Fixed UIComponentType.Slider

    • In ModMenuUtils.cs, the logic for adding slider controls has been updated:
      • The corresponding object identifier has been corrected from “o_music_slider” to “o_slider”.
  3. Fixed InjectTableItemLocalization and InjectTableDialogLocalization

    • In LocalizationUtils.cs:
      • The table name has been corrected: “gml_GlobalScript_table_consumables” has been changed to “gml_GlobalScript_table_items”.
      • Similarly, “gml_GlobalScript_table_NPC_Lines” has been updated to “gml_GlobalScript_table_lines”.
      • The identification condition for specific text lines has also been updated, changing “NPC - GREETINGS;” to “[NPC] GREETINGS;” to ensure consistency in localization processing.

@altairwei altairwei requested review from Nylux and remyCases March 19, 2025 04:18
{
throw new Exception("MatchFromUntil: No matching lines found. Items to match: " + string.Join(", ", otheruntil));
}
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe removing comented code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@remyCases remyCases merged commit 4720c4d into ModShardTeam:main Mar 21, 2025
1 check passed
@altairwei altairwei deleted the fix-InjectTableDialogLocalization branch March 21, 2025 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants