chore: Custom icons user folder and error prevention#622
chore: Custom icons user folder and error prevention#622EttyKitty merged 2 commits intoAdeptus-Dominus:mainfrom
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughSummary by CodeRabbit
WalkthroughThe sacred data has undergone a transformation. This pull request entails the removal of an entry from the Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (9)
ChapterMaster.yyp(0 hunks)datafiles/README.md(1 hunks)datafiles/icons/custom_icons_help.txt(0 hunks)objects/obj_cuicons/Alarm_0.gml(1 hunks)objects/obj_cuicons/Alarm_1.gml(1 hunks)objects/obj_cuicons/Alarm_2.gml(1 hunks)objects/obj_cuicons/Destroy_0.gml(1 hunks)scripts/__init_external/__init_external.gml(1 hunks)scripts/scr_creation_draw_slides/scr_creation_draw_slides.gml(1 hunks)
💤 Files with no reviewable changes (2)
- datafiles/icons/custom_icons_help.txt
- ChapterMaster.yyp
🔇 Additional comments (11)
scripts/__init_external/__init_external.gml (1)
21-23: Praise be to the Omnissiah! A sacred directory structure is now ensured.The code augmentation implements a critical check for the existence of the "Custom Files\Custom Icons" directory, creating it when absent. This modification ensures the proper housing of user iconography, preventing data loss during system purges or reinstallations.
+ if (!directory_exists("Custom Files\\Custom Icons")) { + directory_create("Custom Files\\Custom Icons"); + }datafiles/README.md (2)
6-6: Binary encoding compatibility warning preserved.The sacred warning regarding MS Paint's binary encoding incompatibility has been correctly maintained, though it now stands as its own paragraph. This information is crucial for users attempting to create their own iconography.
10-11: Updated cogitation-path for the storage of sacred iconography.The documentation has been properly updated to reflect the new storage location for custom chapter icons. This change aligns with the implementation in the code and provides clear instruction for the faithful on where to place their chapter symbology.
The path
C:\Users\<UserName>\AppData\Local\ChapterMaster\Custom Files\Custom Icons\custom*.pngcorrectly directs users to the persistent storage location, which will survive system reinstallation rituals.objects/obj_cuicons/Destroy_0.gml (2)
1-4: Logical formatting improvements detected.Praise be to the Omnissiah, for these variable declarations have been refined to improve code readability. The spacing between operators and operands follows the sacred patterns of machine consistency. The binary cogitation patterns are now properly aligned.
8-8: Path modification implements machine spirit relocation protocol.By the Machine God's wisdom, the file path has been updated to reference the new user-specific sacred repository (
Custom Files\\Custom Icons\\custom). This modification aligns with the holy objective of protecting custom icon data from being purged during reinstallation rituals of the main program.objects/obj_cuicons/Alarm_1.gml (4)
1-9: Logical structure optimized for enhanced ritual processing.The binary cogitation patterns have been refined with proper spacing, improving the clarity of the machine spirit's logic flow. The variable initialization and conditional evaluation now follow a more consistent pattern that pleases the Omnissiah. The condition
> 0has been appropriately simplified to>when evaluating the presence of "custom" in the icon_name.
11-22: File path realignment and initialization value modification implemented.The Machine God approves of the revised file path that now directs the cogitator to search for icons in the user's sacred data repository (
Custom Files\\Custom Icons\\custom). Most significantly, line 18 now initializesspr_custom_icon[i]to-1instead of0, which enables the fallback mechanism to display the default "?" icon when the specified icon fails to load. This change implements the divine solution specified in the holy technical specifications.
24-41: Custom icon processing logic correctly preserves machine spirit integrity.The binary rituals for loading custom icons have been preserved while updating the file paths to the new location. The Omnissiah is pleased with the consistent use of
-1as the default value at line 34, which will trigger the fallback icon display mechanism when loading fails. The spacing and formatting improvements enhance the logical flow of the code and please the machine spirits.
43-56: Secondary conditional branch appropriately updated.The redundant icon cleanup logic has been correctly modified to use the new file path. The initialization of
spr_custom_icon[i]to-1at line 51 properly supports the error handling protocol. These changes maintain consistency with the modifications in other sections, ensuring that the machine spirit remains balanced and harmonious.objects/obj_cuicons/Alarm_2.gml (2)
1-12: Initial cleanup routine properly reconfigured.By the grace of the Omnissiah, the sprite cleanup logic has been updated to reference the new file path and maintain consistent formatting. The use of
-1as the initialization value forspr_custom_icon[i]at line 8 correctly implements the error-handling protocol as specified in the technical doctrine.
14-38: Icon loading ritual updated to use sanctified paths.The machine spirit will now search for and load custom icons from the user's personal data repository, protecting these sacred images from accidental deletion during reinstallation rituals. The initialization of
spr_custom_icon[i]to-1at line 24 properly prepares the array for the icon loading ritual and enables the fallback mechanism.The commented debugging rituals have been preserved, maintaining historical documentation of the binary priest's debugging incantations. These may be useful for future tech-adepts who must maintain this sacred code.
Purpose of changes
Describe the solution
C:\Users\<UserName>\AppData\Local\ChapterMaster\Custom Files\Custom Icons\.icons\\custom, so I can only hope that there are no more places with the old path)Describe alternatives you've considered
None
Testing done
Dropped a custom icon into the new folder - seems to show up in the game.
Related links
https://discord.com/channels/714022226810372107/1353320065214320761
Custom player notes entry
Use the PR title.