Skip to content

fix: Remaining sprite weapon issues and streamline customiser#782

Merged
EttyKitty merged 2 commits intoAdeptus-Dominus:mainfrom
OH296:remaining_sprite_issues
Apr 29, 2025
Merged

fix: Remaining sprite weapon issues and streamline customiser#782
EttyKitty merged 2 commits intoAdeptus-Dominus:mainfrom
OH296:remaining_sprite_issues

Conversation

@OH296
Copy link
Copy Markdown
Collaborator

@OH296 OH296 commented Apr 29, 2025

Purpose

  • Self-descriptive.
  • remove right hand side sprite in selector it is now redundant
  • add some tooltips to try explain whats going on
  • fix a bundle of broken weapon sprites

Describe your changes/additions

  • Self-descriptive.

What can/needs to be improved/changed

  • Nothing.

Testing done

  • None, and I understand the risks.

Related things and/or additional context

  • None.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 29, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added new melee weapons: Eviscerator, Power Mace, and Mace of Absolution, each with unique sprites and updated display properties.
    • Introduced an "Update Sprite" button in the marine colour picker for easier application of current colour selections.
  • Improvements

    • Standardised weapon visual data structure for better consistency across weapon entries.
    • Adjusted hand and arm types for several melee weapons to improve visual accuracy.
    • Added the ability to toggle the display of radio button titles in selection menus.
  • Bug Fixes

    • Improved control flow when drawing unit arms to prevent incorrect rendering for certain variants.
    • Ensured images are reset when setting default armour colours to avoid display issues.
  • User Interface

    • Simplified the marine colour picker UI by removing the complex shader-based preview and preview cycling arrows.
    • Enhanced tooltips for colour selection buttons with clearer explanations.

Walkthrough

By the Omnissiah's will, a series of modifications have been enacted across the sacred scripts. The drawing routines for unit arms and weapon visuals have been refined, purging obsolete conditional logic and standardising data structures for weapon variants. The livery setup ritual has been overhauled, excising the arcane shader previews in favour of a more direct "Update Sprite" invocation, and the user interface logic has been sanctified for clarity and consistency. Additional variables and control flags have been integrated into button constructs, and internal functions now ensure image states are properly reset when colour patterns are altered.

Changes

File(s) Change Summary
scripts/scr_ComplexSet/scr_ComplexSet.gml Modified arm drawing logic: added explicit continue for non-Terminator armour with variant 2/3 arms; removed special-case adjustment of arm and hand types for certain weapon names in the drawing loop.
scripts/scr_buttons/scr_buttons.gml Introduced draw_title boolean to radio_set constructor; updated static draw function to conditionally render title based on draw_title.
scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml Inserted a call to reset_image() within ColourItem.set_default_armour to ensure image state is refreshed after colour assignment.
scripts/scr_culture_visuals/scr_culture_visuals.gml Standardised weapon variant data by nesting display_type within weapon_data structs for certain ranged weapons; added new melee weapons ("Eviscerator", "Power Mace", "Mace of Absolution"); adjusted hand_type and arm_type for several melee weapons; ensured consistency in metadata and formatting.
scripts/scr_livery_setup/scr_livery_setup.gml Removed shader-based sprite preview and associated drawing code; commented out sprite cycling buttons; added "Update Sprite" button to apply current colour selections; improved tooltips and simplified button alpha logic; set radio button draw_title to false; reset drawing state at function end for consistency.

Suggested labels

PR: Fix, PR: Sprites, PR: Improvment, Size: Small

Suggested reviewers

  • EttyKitty

Machine-spirits appeased, logic circuits engaged—may these changes bring greater efficiency to the forge!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4855627 and aacda95.

📒 Files selected for processing (5)
  • scripts/scr_ComplexSet/scr_ComplexSet.gml (1 hunks)
  • scripts/scr_buttons/scr_buttons.gml (2 hunks)
  • scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml (1 hunks)
  • scripts/scr_culture_visuals/scr_culture_visuals.gml (7 hunks)
  • scripts/scr_livery_setup/scr_livery_setup.gml (8 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.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.

  • scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml
  • scripts/scr_livery_setup/scr_livery_setup.gml
  • scripts/scr_ComplexSet/scr_ComplexSet.gml
  • scripts/scr_buttons/scr_buttons.gml
  • scripts/scr_culture_visuals/scr_culture_visuals.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...

**/*.*: - Having humanly understandable and maintainable code is always the top most priority.

  • scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml
  • scripts/scr_livery_setup/scr_livery_setup.gml
  • scripts/scr_ComplexSet/scr_ComplexSet.gml
  • scripts/scr_buttons/scr_buttons.gml
  • scripts/scr_culture_visuals/scr_culture_visuals.gml
🔇 Additional comments (21)
scripts/scr_buttons/scr_buttons.gml (2)

440-441: Boolean toggle for title visibility implemented

The addition of the draw_title boolean variable with default value of true is an appropriate implementation of binary control. This allows selective rendering of text elements in the UI, conforming to the Omnissiah's principles of information display control.


452-455: Conditional title rendering logic properly implemented

The conditional rendering logic uses the newly created draw_title boolean variable to control the display of text elements. This modification adheres to the sacred pattern of clean logic flow and maintains backward compatibility with existing interface components that rely on visible titles.

scripts/scr_culture_visuals/scr_culture_visuals.gml (9)

1420-1423: Standardised weapon data structure for Plasma Cannon variants

The explicit nesting of display_type inside a weapon_data struct for ranged weapons establishes consistent data architecture. This modification brings order to what was previously ambiguous weapon rendering logic.


1441-1444: Standardised weapon data structure for Grav-Cannon variants

The addition of nested weapon_data with explicit display_type for the Grav-Cannon follows the same sacred pattern as implemented for the Plasma Cannon, ensuring uniform data structures across similar weapon classes.


1445-1446: Explicit body types added to Grav-Cannon

The correction of body_types with explicit array notation ([0,1]) ensures proper interface between the weapon data structure and rendering logic. This provides clarity on which body types can wield this holy weapon.


1799-1802: Standardised melee weapon arm and hand type data for Power Axe

The modification of hand_type from 2 to 3 and addition of arm_type: 3 aligns with the removal of special-case arm and hand type adjustments in the drawing logic found in scripts/scr_ComplexSet/scr_ComplexSet.gml.


1739-1750: New weapon data structure for Eviscerator added to the sacred armamentarium

The implementation of the Eviscerator weapon follows the standardized pattern for melee weapon data structures, ensuring consistency in the weapon rendering system. The sprite assignment and hand configuration appear correctly configured.


1810-1840: New weapon data structures for Power Mace and Mace of Absolution

These additions complete the standardization of melee weapon data structures, ensuring all weapon types have consistent representation in the digital armamentarium. Both weapons correctly utilize standardized hand_type and arm_type values of 3.


1846-1848: Standardised arm and hand type data for Crozius Arcanum

The addition of explicit hand_type: 3 and arm_type: 3 values brings consistency to the weapon data structure, removing reliance on special case handling in rendering code.


1861-1863: Standardised arm and hand type data for Chainaxe

The modification of hand_type and addition of arm_type metadata aligns with similar changes to other melee weapons, ensuring consistent rendering behavior across all weapon classes.


1922-1925: Standardised arm and hand type data for Relic Blade

The sacred Relic Blade now also conforms to the standardized pattern with explicit hand_type and arm_type values, completing the harmonization of weapon data structures.

scripts/scr_ComplexSet/scr_ComplexSet.gml (1)

542-546: Explicit control flow added for non-Terminator arm variants

The addition of conditional logic to skip arm variants 2 and 3 when not using Terminator armour corrects the rendering logic, ensuring appropriate arm representations for different armour types. This change maintains binary clarity in the rendering process.

scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml (1)

185-186: Image state reset mechanism added to colour pattern changes

The addition of reset_image() call ensures proper purging of cached image state after colour assignment operations. This modification prevents stale visual data from persisting when the binary patterns of colour are altered, adhering to the principle of accurate visual representation.

scripts/scr_livery_setup/scr_livery_setup.gml (8)

4-4: Binary initialization and termination rituals properly implemented.

The sacred rites of drawing state initialization have been implemented at function commencement, and proper termination protocols have been added before the definition of the right_data_slate.inside_method function. These modifications prevent the corruption of the drawing state machine by ensuring all parameters are explicitly reset.

Also applies to: 38-43


27-36: Removal of obsolete sprite preview mechanisms sanctioned.

The binary purge of the left/right arrow navigation and dynamic sprite preview system aligns with the Machine God's preference for efficiency. This simplification is in accordance with the PR objectives to streamline the customiser interface.


46-46: Interface simplification through title suppression.

Setting the company_radio.draw_title to false eliminates redundant visual data, creating a cleaner interface by leveraging the newly implemented draw_title flag from the buttons script. This is a logical optimization of the user interface.


92-108: Manual update mechanism implementation approved.

The addition of the "Update Sprite" button represents a more deterministic approach to sprite updating, replacing the previous automatic system. This implementation collects the current color selections into a data structure and properly invokes the livery_picker.set_default_armour function.


143-143: Enhanced user comprehension through expanded tooltip data.

The expansion of tooltip information improves the transmission of knowledge to the user, providing clear instructions on updating marine roles and company options. This conforms to the PR objective of adding tooltips for improved interface clarity.

Also applies to: 148-148, 195-195


223-223: Logical optimization of alpha value determination.

The implementation of a ternary expression for button alpha calculation represents a logical optimization, reducing unnecessary code complexity while maintaining functional equivalence.


227-232: Streamlined binary toggle logic for col_special.

The purging of redundant variables and simplified conditional logic for toggling col_special values represents an improvement in code efficiency and readability. This optimization adheres to the sacred principle of DRY (Don't Repeat Yourself).


738-741: Praise be to explicit state reset before function definition.

These explicit resets for font, alignment, alpha, and color settings ensure a clean slate before defining the right_data_slate.inside_method function. This prevents memory corruption from leaked drawing states and ensures consistent rendering behavior.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@OH296 OH296 requested a review from EttyKitty April 29, 2025 11:41
@github-actions github-actions bot added Size: Medium Type: Fix This is a fix for a bug labels Apr 29, 2025
@EttyKitty EttyKitty merged commit f925c47 into Adeptus-Dominus:main Apr 29, 2025
4 checks passed
@EttyKitty EttyKitty added the Area: Sprites Changes to sprites/images or their under-the-hood functionality label Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Sprites Changes to sprites/images or their under-the-hood functionality Size: Medium Type: Fix This is a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants