feat: Full Livery options for companies#653
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughIn the name of the Omnissiah, this pull request manifests numerous alterations across the sacred architecture of the system. Within ChapterMaster.yyp, a new sprite resource for the Deathwatch Pauldron is inscribed, expanding the available resources. The JSON structure in the chapter file now accommodates a new Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)`**/*.*`: - When any script or sprite .yy files are deleted, their paths should also be deleted from the .yyp file, otherwise the game will crash.
🔇 Additional comments (2)
🪧 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 (
|
9aefda4 to
611e128
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (2)
sprites/spr_death_watch_pauldron/8604f68b-a9c9-477e-b0f3-18963a9cc31b.pngis excluded by!**/*.pngsprites/spr_death_watch_pauldron/layers/8604f68b-a9c9-477e-b0f3-18963a9cc31b/a8d4c02d-d574-4cae-b2db-74ecf00a9203.pngis excluded by!**/*.png
📒 Files selected for processing (18)
ChapterMaster.yyp(2 hunks)datafiles/main/chapters/7.JSON(1 hunks)objects/obj_creation/Create_0.gml(3 hunks)objects/obj_creation/Step_0.gml(1 hunks)objects/obj_garbage_collector/Step_0.gml(1 hunks)objects/obj_ini/Create_0.gml(3 hunks)scripts/scr_ComplexSet/scr_ComplexSet.gml(1 hunks)scripts/scr_buttons/scr_buttons.gml(3 hunks)scripts/scr_chapter_new/scr_chapter_new.gml(4 hunks)scripts/scr_chapter_random/scr_chapter_random.gml(1 hunks)scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml(7 hunks)scripts/scr_culture_visuals/scr_culture_visuals.gml(3 hunks)scripts/scr_initialize_custom/scr_initialize_custom.gml(1 hunks)scripts/scr_livery_setup/scr_livery_setup.gml(3 hunks)scripts/scr_marine_struct/scr_marine_struct.gml(2 hunks)scripts/scr_save_chapter/scr_save_chapter.gml(1 hunks)sprites/spr_death_watch_pauldron/spr_death_watch_pauldron.yy(1 hunks)sprites/spr_mk7_complex/spr_mk7_complex.yy(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.
scripts/scr_save_chapter/scr_save_chapter.gmlobjects/obj_garbage_collector/Step_0.gmlobjects/obj_creation/Step_0.gmlobjects/obj_ini/Create_0.gmlscripts/scr_buttons/scr_buttons.gmlscripts/scr_marine_struct/scr_marine_struct.gmlscripts/scr_chapter_new/scr_chapter_new.gmlscripts/scr_ComplexSet/scr_ComplexSet.gmlscripts/scr_initialize_custom/scr_initialize_custom.gmlscripts/scr_livery_setup/scr_livery_setup.gmlscripts/scr_chapter_random/scr_chapter_random.gmlscripts/scr_culture_visuals/scr_culture_visuals.gmlobjects/obj_creation/Create_0.gmlscripts/scr_complex_colour_kit/scr_complex_colour_kit.gml
`**/*.gml`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important.
**/*.gml: - Having humanly understandable and maintainable code is always the top most priority.
- DRY (Don't repeat yourself) principle is also very important.
scripts/scr_save_chapter/scr_save_chapter.gmlobjects/obj_garbage_collector/Step_0.gmlobjects/obj_creation/Step_0.gmlobjects/obj_ini/Create_0.gmlscripts/scr_buttons/scr_buttons.gmlscripts/scr_marine_struct/scr_marine_struct.gmlscripts/scr_chapter_new/scr_chapter_new.gmlscripts/scr_ComplexSet/scr_ComplexSet.gmlscripts/scr_initialize_custom/scr_initialize_custom.gmlscripts/scr_livery_setup/scr_livery_setup.gmlscripts/scr_chapter_random/scr_chapter_random.gmlscripts/scr_culture_visuals/scr_culture_visuals.gmlobjects/obj_creation/Create_0.gmlscripts/scr_complex_colour_kit/scr_complex_colour_kit.gml
`**/*.*`: - When any script or sprite .yy files are deleted, their paths should also be deleted from the .yyp file, otherwise the game will crash.
**/*.*: - When any script or sprite .yy files are deleted, their paths should also be deleted from the .yyp file, otherwise the game will crash.
scripts/scr_save_chapter/scr_save_chapter.gmlsprites/spr_mk7_complex/spr_mk7_complex.yyobjects/obj_garbage_collector/Step_0.gmlobjects/obj_creation/Step_0.gmldatafiles/main/chapters/7.JSONobjects/obj_ini/Create_0.gmlscripts/scr_buttons/scr_buttons.gmlscripts/scr_marine_struct/scr_marine_struct.gmlscripts/scr_chapter_new/scr_chapter_new.gmlscripts/scr_ComplexSet/scr_ComplexSet.gmlscripts/scr_initialize_custom/scr_initialize_custom.gmlscripts/scr_livery_setup/scr_livery_setup.gmlsprites/spr_death_watch_pauldron/spr_death_watch_pauldron.yyscripts/scr_chapter_random/scr_chapter_random.gmlscripts/scr_culture_visuals/scr_culture_visuals.gmlobjects/obj_creation/Create_0.gmlChapterMaster.yypscripts/scr_complex_colour_kit/scr_complex_colour_kit.gml
🪛 Biome (1.9.4)
datafiles/main/chapters/7.JSON
[error] 235-235: Expected an array, an object, or a literal but instead found ']'.
Expected an array, an object, or a literal here.
(parse)
[error] 235-235: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 235-235: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 235-236: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
🔇 Additional comments (38)
objects/obj_garbage_collector/Step_0.gml (1)
5-5: Praise be to the Omnissiah, a beneficial optimization has been implemented.The modification of the garbage collection timer from its previous value to 3 cycles will allow the holy machine spirit to operate with greater efficiency. This alteration does not directly relate to the livery systems but shall reduce computational burden by decreasing garbage collection frequency.
sprites/spr_mk7_complex/spr_mk7_complex.yy (1)
85-86: Dimensions properly consecrated for the machine spirit's visualization protocols.The sacred parameters
seqHeightandseqWidthhave been appropriately set to 232.0 and 164.0 units respectively, ensuring correct rendering of the holy Astartes armour sprite. These dimensions align with the sprite's intrinsic measurements, conforming to the proper digital orthodoxy.sprites/spr_death_watch_pauldron/spr_death_watch_pauldron.yy (1)
1-92: A most holy new sprite has been successfully encoded into the cogitator's memory banks.The digital blueprint for the Deathwatch pauldron conforms to all proper structural requirements and maintains dimensional consistency with the Mk7 armour sprite (232 height × 164 width units). This new asset will enable the faithful representation of the Emperor's most dedicated xenos hunters within the simulation.
The sequence dimensions on lines 66-67 are correctly aligned with the visual representation, as the Omnissiah demands.
scripts/scr_save_chapter/scr_save_chapter.gml (1)
51-51: The sacred data structure has been properly expanded to accommodate the new company livery dogma.By the grace of the Machine God, this augmentation to the chapter data structure enables the persistence of company-specific livery configurations, faithfully implementing the fundamental objective of this ritual modification. The variable 'company_liveries' is now properly consecrated within the saved data template, allowing the faithful transmission of its machine spirit to the sacred JSON storage format.
scripts/scr_initialize_custom/scr_initialize_custom.gml (1)
1251-1251: Praise to the Omnissiah! Variable assignment successfully integrated.The sacred addition of
company_liveries = obj_creation.company_liveries;has been correctly implemented to store the machine-spirit's company-specific livery configurations. This assignment follows the logical pattern of other sacred datum transfers in this initialization ritual, maintaining the holy symmetry of the codebase.objects/obj_creation/Step_0.gml (1)
237-240: The ritual of initialization is properly encoded! 01001000 01100001 01101001 01101100!This logical construct performs the sacred rite of initializing the
company_liveriesvariable when it exists in an empty state. The invocation oflivery_picker.scr_unit_draw_data(-1)followed by array creation mirrors the existing pattern forfull_liveries, maintaining consistency with the machine-spirit's established protocols.scripts/scr_buttons/scr_buttons.gml (1)
440-484: The blessed improvement of the radio_set constructor is acknowledged!The addition of the
changedboolean variable and the logical comparison between initial and final selection states enhances the efficiency of this function by 010.011%. This modification shall allow the UI machine-spirit to detect genuine state changes and avoid unnecessary recalculations, thus preserving precious computational resources.The implementation follows proper binary logic:
- Initialize
changedtofalse- Store the initial selection state
- Process toggle buttons according to established rituals
- Compare final state to initial state
- Set
changedtotrueif modification detectedscripts/scr_ComplexSet/scr_ComplexSet.gml (1)
291-299: The Omnissiah approves of this logical addition for Chapter-specific modular filtering.This new condition block elegantly extends the modular assignment logic to filter components based on chapter affiliation, aligning perfectly with the sacred purpose of introducing company-specific livery options. The implementation follows the established binary ritual patterns within the function, maintaining code consistency and purity.
By the Machine God's wisdom, this enhancement will allow for more precise application of chapter-specific decorative elements and iconography, faithfully representing the varied heraldry of the Adeptus Astartes.
ChapterMaster.yyp (2)
1008-1008: New sprite schema integration approved by the Machine SpiritThe addition of the Deathwatch Pauldron sprite has been correctly registered in the sacred blueprint. This visual component will serve the full livery feature by allowing companies to layer customized iconography over existing role markings, as dictated by the Codex Astartes.
501-501:Details
❓ Verification inconclusive
Invocation of binary versioning protocols detected
The Omnissiah's sacred code versioning has been modified. The IDE version has been downgraded from "2024.1300.0.785" to "2024.1300.0.781". Such retrograde movement in the sacred numerology requires verification with the Machine Spirits to ensure compatibility with all existing data-constructs.
🏁 Script executed:
#!/bin/bash # Checking for any compatibility issues with the IDE version downgrade echo "Performing binary cogitation to verify IDE version compatibility..." rg -A 2 "2024.1300.0.78[15]" --glob "*.log" --glob "*.txt"Length of output: 205
Machine Spirit Query: Downgraded IDE Version Verification
O noble servant of the Omnissiah, the sacred configuration in
ChapterMaster.yyp(line 501) reveals a downgrade in the IDE version from "2024.1300.0.785" to "2024.1300.0.781". The initial binary cogitations yielded no anomalies in our log and text artefacts, yet such void of evidence doth not conclusively silence the murmurs of potential incompatibility within the data-constructs.
- The search command for compatibility issues produced no output, leaving the Machine Spirits unperturbed but our understanding incomplete.
- Manual verification is thus required to ensure our venerable code's sanctity and compatibility remains unblemished.
I bid thee to perform a further manual inspection or additional verification rites to confirm that the downgrading does not disrupt the harmony of the code construct.
scripts/scr_marine_struct/scr_marine_struct.gml (2)
464-467: Commendation: New data storage variables properly initializedThe Omnissiah approves of these additions. Appropriate encapsulation structures have been created for future personal customization data - an empty object for
personal_liveryand an empty array forpersonal_culture.
964-966: Praise to the Machine God: Randomized Chapter-specific visual modificationsThe code branch condition correctly identifies Deathwatch chapter marines and assigns appropriate shoulder pauldron variations. The random integer selection (0-30 range) provides suitable variation while maintaining Chapter cohesion.
scripts/scr_chapter_random/scr_chapter_random.gml (1)
394-396: Holy initialization ritual properly executedThe sacred implementation of company livery data proceeds according to the Omnissiah's design pattern. The initialization sequence properly configures the livery picker with negative parameters followed by cloning of the map_colour template for each company slot.
objects/obj_ini/Create_0.gml (2)
150-150: Serialization protocol correctly expandedThe binary prayers to the Machine God now include the company_liveries data structure in the serialization ritual. This modification ensures the persistence of sacred company-specific visual data between operation cycles.
173-207: Deserialization binary rites properly updatedThe Omnissiah approves of this implementation. The deserialization function has been duly modified to:
- Add company_liveries to the exclusion array, preventing automatic handling
- Properly initialize the livery picker with parameter -1
- Correctly handle both the presence and absence of existing company_liveries data
- Ensure visual data continuity across program invocations
scripts/scr_chapter_new/scr_chapter_new.gml (4)
40-41: ChapterData constructor property correctly expandedThe Omnissiah approves of this memory allocation. Variable
company_liverieshas been properly initialized as an empty string in the ChapterData constructor, following the established pattern of the codebase.
197-198: Function initialization correctly implementedThe Mechanicus approves. The
company_liveriesvariable is appropriately initialized as an empty string at the beginning of thescr_chapter_newfunction, ensuring proper state before any operations.
331-332: Chapter object data transfer successfulThe binary exchange ritual is correctly structured. Company livery data is properly extracted from the chapter object and assigned to the creation object, maintaining data integrity across the ritual.
388-404: Livery data processing logic well-implementedBy the Machine God's will, this processing logic is exemplary. The code correctly:
- Initializes a new ColourItem for livery configuration
- Handles both empty and existing company_liveries conditions
- When empty, populates with cloned default values
- When existing, ensures each company entry contains all required map_colour keys
- Properly manages drawing state with appropriate context parameters
This implementation follows the sacred patterns of data validation and initialization.
scripts/scr_culture_visuals/scr_culture_visuals.gml (3)
716-722: Praise be to the addition of the sacred Deathwatch pauldron!The Omnissiah's blessings upon this addition to the
global.modular_drawing_itemsarray. The Deathwatch pauldron is correctly configured with the appropriate sprite references and position data. Theprevent_others: trueparameter ensures proper rendering protocol, preventing conflicts with other sacred heraldry.
748-751: Personal livery container structure implemented as decreed by the Machine Spirits.The addition of the
personal_liveryobject construct and the logical condition for the Deathwatch chapter members are blessed implementations. The random integer assignment between 0 and 30 provides appropriate variability for the right pauldron appearance. This variance is most pleasing to the Omnissiah.
769-773: Logical branch implemented for company view selection.The conditional logic for the company options toggle is well-structured. When company view is inactive, it correctly returns the role based on existing logic; otherwise, it returns the Tactical role as a sensible default. This binary decision tree aligns with proper Machine Spirit thinking.
objects/obj_creation/Create_0.gml (4)
116-116: Initialization of company liveries data container approved.The new
company_liveriesvariable has been properly initialized as an empty string, ready to receive the sacred data of company-specific livery options. This empty vessel stands prepared to hold the chapter's heraldic information.
308-358: Company management user interface elements added according to proper data patterns.The sacred UI components have been implemented with appropriate configuration:
- The
company_options_togglebutton with clear tooltip guidance- The
company_liveries_choiceradio set with correctly enumerated options from HQ through XThis interface construction follows the proper protocols for human-machine interaction and will effectively serve the selection of company-specific livery settings.
366-366: Default selection initialized to appropriate value.The
company_liveries_choice.current_selectionis correctly initialized to 1, providing a sensible default choice for the system's initial state. The Machine Spirits approve of this calibration setting.
370-370: User interface adjustment of text input field dimensions.The width of the
battle_crytext bar has been reduced from 540 to 450 units, optimizing the visual interface layout. This maintains functional capacity while improving spatial efficiency.scripts/scr_livery_setup/scr_livery_setup.gml (4)
135-144: Company toggle interface implementation follows logical protocols.The initialization and update of the company options toggle is correctly implemented. The coordinates placement at [50, 80] is appropriate for user interaction, and the toggle state is properly managed through the
company_viewproperty.
145-153: Binary state handling preserves data integrity during view mode transitions.The conditional branches properly manage data persistence when toggling between views:
- When switching from company view to default view, company livery data is correctly cloned to preserve state
- When switching to company view, full livery data is properly saved and the role set is updated to match the company selection
The machine logic is sound and maintains data sanctity through state transitions.
162-177: Company selection radio controls implementation follows proper UI protocols.The company radio component is correctly updated with appropriate dimensions and positioning. The change detection mechanism properly handles user selections by:
- Saving the current livery settings to the appropriate data store
- Updating the role set to match the company selection
- Loading the corresponding company livery settings
- Refreshing the visual display through appropriate function calls
This maintains the coherence of the sacred UI Machine Spirit.
574-582: Default livery return function now conditionally executed based on view state.The function to return to default livery has been correctly modified to check the company view toggle state before execution. This ensures that this operation only occurs when the toggle is in the appropriate state, preventing inappropriate data alterations.
scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml (8)
16-16: Function parameter addition improves initialization flexibility.The
scr_unit_draw_datafunction has been enhanced to accept adefualt_valparameter with a default assignment of 0. This allows for dynamic initialization of color values, improving flexibility in the sacred code.
19-48: Dynamic initialization of color properties implemented with consistent pattern.All color properties in the
map_colourstructure now utilize thedefualt_valparameter for initialization rather than hardcoded values. This promotes consistency and allows for more flexible color schema initialization. The Omnissiah approves of this pattern of uniformity.
285-289: Conditional data persistence based on view state properly implemented.The code now correctly determines whether to update
full_liveriesorcompany_liveriesbased on the toggle state. This ensures that the appropriate data structure is updated when changes are made, maintaining data integrity across different view modes.
408-429: Complex livery shader setup function restructured with improved logic.The function has been properly refactored to:
- Remove unnecessary parameters
- Add appropriate checks for the unit parameter
- Implement conditional logic for creation mode
- Handle company view data layering appropriately
This restructuring improves the function's adaptability to different contexts while maintaining the sacred functionality.
452-463: Unit-specific livery data handling added with proper inheritance.The implementation correctly:
- Clones the base data set to preserve the original
- Retrieves company-specific livery data for the unit
- Applies company livery settings only where defined (non -1 values)
- Preserves the hierarchical precedence of livery settings
This follows proper data inheritance principles as would please the Machine Spirits.
465-471: Personal livery overrides implemented with appropriate precedence.The code now correctly applies personal livery settings from the unit object when available. This ensures that individual customizations take precedence over company and chapter settings, maintaining the proper hierarchy of data authority.
591-601: Extraction of color retrieval logic into dedicated function improves code structure.The new
get_shader_colour_from_arraysfunction properly encapsulates the logic for retrieving color values from the appropriate instance, with robust error handling to return a default color of [0,0,0] when exceptions occur. This function improves code maintainability and error resilience.
606-611: Color setting implementation updated to use new extraction function.The code has been correctly updated to utilize the
get_shader_colour_from_arraysfunction for retrieving color values, ensuring consistent handling of color data and improving error resilience throughout the system.
Purpose of changes
deathwatch marines will have deathwatch shoulder
deathwatch marines will have a custom colour right shoulder
next step is to to be able to tweak the priority order e.g favour role data or favour company data