Skip to content

fix: marine profiles not showing in squad view#964

Merged
OH296 merged 1 commit intoAdeptus-Dominus:mainfrom
OH296:marine_profiles
Aug 4, 2025
Merged

fix: marine profiles not showing in squad view#964
OH296 merged 1 commit intoAdeptus-Dominus:mainfrom
OH296:marine_profiles

Conversation

@OH296
Copy link
Copy Markdown
Collaborator

@OH296 OH296 commented Aug 4, 2025

Purpose and Description

  • Self-descriptive.

Testing done

  • None, and I understand the risks.

Related things and/or additional context

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 4, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of game state checks to ensure correct behaviour when certain instances exist or are missing.
    • Ensured the unit profile is always displayed when viewing squads, providing a more consistent user interface.

Walkthrough

By the Omnissiah's will, the logic for instance existence checks in Mouse_50.gml has been separated into two discrete verifications, refining control flow. Additionally, the unit_profile variable is now set to true when rendering the squad view in scr_ui_manage.gml, ensuring its activation under specific conditions.

Changes

Cohort / File(s) Change Summary
Popup Instance Checks
objects/obj_popup/Mouse_50.gml
Refactored conditional logic: now exits if any obj_fleet exists, or if no obj_controller exists, splitting prior combined check.
Squad View UI Handling
scripts/scr_ui_manage/scr_ui_manage.gml
Ensures unit_profile is set to true before drawing squad view when appropriate conditions are met.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Suggested labels

Type: Fix, Size: Tiny

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 858eef3 and eb86ca1.

⛔ Files ignored due to path filters (8)
  • sprites/spr_gear_combat_shield/350bde68-1664-48e8-97c4-7cff3c59b4ae.png is excluded by !**/*.png
  • sprites/spr_gear_combat_shield/587d63a4-32c8-4617-9c28-59a8a099c2c1.png is excluded by !**/*.png
  • sprites/spr_gear_combat_shield/layers/350bde68-1664-48e8-97c4-7cff3c59b4ae/5cc2322f-a426-43f4-bc78-5cc25edf9210.png is excluded by !**/*.png
  • sprites/spr_gear_combat_shield/layers/587d63a4-32c8-4617-9c28-59a8a099c2c1/5cc2322f-a426-43f4-bc78-5cc25edf9210.png is excluded by !**/*.png
  • sprites/spr_helm_decorations/3dbaa400-5fe2-498d-abd8-9cc4b2bda693.png is excluded by !**/*.png
  • sprites/spr_helm_decorations/61531cde-cd44-4806-ae39-3c63f51d65de.png is excluded by !**/*.png
  • sprites/spr_helm_decorations/layers/3dbaa400-5fe2-498d-abd8-9cc4b2bda693/4ff43f57-b34a-4219-8298-0399265c623b.png is excluded by !**/*.png
  • sprites/spr_helm_decorations/layers/61531cde-cd44-4806-ae39-3c63f51d65de/4ff43f57-b34a-4219-8298-0399265c623b.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • objects/obj_popup/Mouse_50.gml (1 hunks)
  • scripts/scr_ui_manage/scr_ui_manage.gml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml

⚙️ CodeRabbit Configuration File

**/*.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.

Files:

  • objects/obj_popup/Mouse_50.gml
  • scripts/scr_ui_manage/scr_ui_manage.gml
**/*.*

⚙️ CodeRabbit Configuration File

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

Files:

  • objects/obj_popup/Mouse_50.gml
  • scripts/scr_ui_manage/scr_ui_manage.gml
🧠 Learnings (6)
📓 Common learnings
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-04-05T20:54:45.813Z
Learning: EttyKitty requested a rework of the vehicle and marine recovery system in ChapterMaster. The current system allows guaranteed recovery with enough recovery points, while the proposed system would use random chance modified by techmarine skill and item bonuses.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from GameMaker's visual Drag and Drop system. It checks if image_index equals -500. In ChapterMaster, this was being used as a special flag for enemy unit movement, but wasn't triggering consistently, causing enemies to move only every other turn. The refactored code replaced this with direct function calls at specific combat stages.
Learnt from: OH296
PR: Adeptus-Dominus/ChapterMaster#646
File: objects/obj_pnunit/Alarm_5.gml:84-91
Timestamp: 2025-03-31T23:32:30.003Z
Learning: In obj_pnunit/Alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric value (at minimum 0), making null/undefined checks unnecessary.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#562
File: scripts/scr_marine_struct/scr_marine_struct.gml:0-0
Timestamp: 2025-03-07T01:56:40.971Z
Learning: Marines' ages should be incremented at the year transition in obj_turn_end/Alarm_1.gml rather than calculated dynamically based on the current year and recruitment date. This ensures proper aging without retroactive application.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#864
File: scripts/scr_star_ownership/scr_star_ownership.gml:119-119
Timestamp: 2025-06-07T01:10:34.642Z
Learning: In GML files, the preferred syntax for logical AND operations is `&&` instead of the older `and` keyword for better code consistency and readability.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-04-16T09:51:55.065Z
Learning: In obj_ingame_menu/Step_0.gml, the line "if (effect=14){instance_create(0,0,obj_fade);fading=0.1;}" must not be commented out, as it's critical for menu button transitions. When clicking the Exit button, it sets effect=14, but without this handler creating the fade effect object, no transition occurs.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#647
File: scripts/scr_en_weapon/scr_en_weapon.gml:24-928
Timestamp: 2025-03-29T10:30:25.598Z
Learning: A data-driven approach for weapon management in `scripts/scr_en_weapon/scr_en_weapon.gml` is planned for a future PR, not within the scope of PR #647.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#474
File: scripts/scr_buttons/scr_buttons.gml:153-201
Timestamp: 2025-02-24T17:50:27.583Z
Learning: For consistency in GML code, prefer multi-line conditions with brackets over single-line conditions.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` was part of an old enemy movement system in ChapterMaster. This syntax is auto-generated from GameMaker's Drag-and-Drop interface and checks if image_index is greater than or equal to -500. In the refactored code, enemy movement is triggered directly through function calls rather than relying on this conditional check.
📚 Learning: in obj_ingame_menu/step_0.gml, the line "if (effect=14){instance_create(0,0,obj_fade);fading=0.1;}" ...
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-04-16T09:51:55.065Z
Learning: In obj_ingame_menu/Step_0.gml, the line "if (effect=14){instance_create(0,0,obj_fade);fading=0.1;}" must not be commented out, as it's critical for menu button transitions. When clicking the Exit button, it sets effect=14, but without this handler creating the fade effect object, no transition occurs.

Applied to files:

  • objects/obj_popup/Mouse_50.gml
📚 Learning: gamemaker studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from g...
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from GameMaker's visual Drag and Drop system. It checks if image_index equals -500. In ChapterMaster, this was being used as a special flag for enemy unit movement, but wasn't triggering consistently, causing enemies to move only every other turn. The refactored code replaced this with direct function calls at specific combat stages.

Applied to files:

  • objects/obj_popup/Mouse_50.gml
  • scripts/scr_ui_manage/scr_ui_manage.gml
📚 Learning: in obj_pnunit/alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric ...
Learnt from: OH296
PR: Adeptus-Dominus/ChapterMaster#646
File: objects/obj_pnunit/Alarm_5.gml:84-91
Timestamp: 2025-03-31T23:32:30.003Z
Learning: In obj_pnunit/Alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric value (at minimum 0), making null/undefined checks unnecessary.

Applied to files:

  • objects/obj_popup/Mouse_50.gml
  • scripts/scr_ui_manage/scr_ui_manage.gml
📚 Learning: in scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain ...
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.

Applied to files:

  • scripts/scr_ui_manage/scr_ui_manage.gml
📚 Learning: a data-driven approach for weapon management in `scripts/scr_en_weapon/scr_en_weapon.gml` is planned...
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#647
File: scripts/scr_en_weapon/scr_en_weapon.gml:24-928
Timestamp: 2025-03-29T10:30:25.598Z
Learning: A data-driven approach for weapon management in `scripts/scr_en_weapon/scr_en_weapon.gml` is planned for a future PR, not within the scope of PR #647.

Applied to files:

  • scripts/scr_ui_manage/scr_ui_manage.gml
🔇 Additional comments (2)
objects/obj_popup/Mouse_50.gml (1)

6-11: By the Omnissiah's logic circuits, this separation pleases the machine spirit.

The instance existence checks have been properly segregated into discrete conditions, improving code clarity and maintainability. Each exit condition now serves a distinct purpose in the control flow.

scripts/scr_ui_manage/scr_ui_manage.gml (1)

906-906: The machine spirit's vision is restored! This sacred fix ensures proper profile display.

Setting unit_profile = true explicitly before drawing the squad view directly addresses the PR objective of fixing marine profiles not showing in squad view. This targeted solution ensures proper UI state management.


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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 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.

@github-actions github-actions bot added Area: Sprites Changes to sprites/images or their under-the-hood functionality Size: Tiny Type: Fix This is a fix for a bug labels Aug 4, 2025
@OH296 OH296 merged commit 691c526 into Adeptus-Dominus:main Aug 4, 2025
3 checks passed
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: Tiny Type: Fix This is a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant