Skip to content

Conversation

@EttyKitty
Copy link
Owner

@EttyKitty EttyKitty commented Nov 4, 2024

Done:

The welcome message:

  • Fixed wrong names due to wrong array indices.
  • Added units that were missed from the listing: Champions, Librarians, Sergeants, Veteran Sergeants.
  • Edited bits of text a little and changed some formatting, so it's more nice and readable (I hope).
  • Increased the amount of info on each page after the first, removing the need for the 4th page.
  • Fixed equipment list starting at index 1, causing it to skip items at 0 index (bolt pistols, most of the time).
  • Various fixes to words using/not using plural forms when required.

Code:

  • Various minor refactors, style edits, etc.
  • Replaced a lot of string concentration with interpolation.
  • Extremely prevalent use of string_plural.

Functions:

  • Moved all string functions into one file, "scr_string_functions", just like "scr_array_functions".
  • Placed handle_exception into all (most?) catch. Should work like a light version of try_and_report.
  • string_plural now supports a second argument - variable to check to decide whenever to convert a string to plural form or not.
  • New function integer_to_letters - converts an integer to a string word. Supports 2 additional arguments - capitalize the first letter of the resulting word; output an ordinal form of the word.

Notes:

  • Originally tried using int to word function, but decided that while more immersive, it's a bit less readable. Still not sure about it.

TODO:

  • Fill documentation on all string functions.
  • Rename integer_to_letters into integer_to_word.
  • Fix total page count showing 4 pages, even though there are 3.

@EttyKitty EttyKitty added PR: Enhancement Makes something better PR: Fix This is a fix for a bug PR: Refactor Rewriting/restructuring code, while keeping general behaviour labels Nov 4, 2024
@EttyKitty EttyKitty added this to the Next Minor Version milestone Nov 4, 2024
@EttyKitty EttyKitty changed the title feat: welcome message edits feat: welcome message and string functions edits Nov 4, 2024
Copy link

@OH296 OH296 left a comment

Choose a reason for hiding this comment

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

made one point but probably outside of scope for pr

//TODO almost all of this can be handled in the gui layer
try{
scr_ui_manage();
} catch(_exception){
Copy link

Choose a reason for hiding this comment

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

in general while messing around would be best to sling these in try_and_report_loop maybe?

Copy link
Owner Author

Choose a reason for hiding this comment

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

in general while messing around would be best to sling these in try_and_report_loop maybe?

I think try/catch and handle_exception combo should do the same thing.
I've created handle_exception as a light version of try_and_report_loop, for cases where you don't need custom functions to run on catch. It's just more compact, but works mostly the same way, I think?

Copy link

Choose a reason for hiding this comment

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

i guess that's true, i suppose i was mostly just thinking that try_and_report_loop("ui Manage"), scr_ui_manage) is just less lines and coudl have as you say a custom catch function, but it's probably outside of scope for this pr

@EttyKitty EttyKitty marked this pull request as ready for review November 4, 2024 18:54
@EttyKitty EttyKitty merged commit af638e9 into compile/main Nov 4, 2024
@EttyKitty EttyKitty deleted the feat/welcome-message branch November 4, 2024 22:44
@EttyKitty EttyKitty removed this from the Next Minor Version milestone Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Enhancement Makes something better PR: Fix This is a fix for a bug PR: Refactor Rewriting/restructuring code, while keeping general behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants