Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Diplomacy and advisor icon refactor to new image system #363

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

VanWeapon
Copy link
Contributor

@VanWeapon VanWeapon commented Jan 1, 2025

Description of changes

  • Adds diplomacy and advisor icons to new scr_image system
  • adds ability to define image ids in chapter json for custom advisors, this could be expanded in future to allow custom role names and such but not a priority in this PR

Reasons for changes

  • continued implementation of refactored image handling logic

Related links

Summary by Sourcery

Refactor diplomacy and advisor icons to use the new image system. Allow custom image IDs for advisors in chapter JSON files.

New Features:

  • Added support for custom advisor role names and images in chapter configuration.

Enhancements:

  • Updated image handling for diplomacy and advisor icons.

updated advisors to new image handler
added ability to define custom advisor images through chapter json
Copy link
Contributor

sourcery-ai bot commented Jan 1, 2025

Reviewer's Guide by Sourcery

This pull request refactors the diplomacy and advisor icons to use the new image system. It also adds the ability to define custom image IDs for advisors in the chapter JSON files.

File-Level Changes

Change Details Files
Updated diplomacy icons to use the new image system.
  • Replaced draw_sprite calls with scr_image calls for diplomacy icons.
  • Changed the image ID parameter to use new image system format.
  • Added handling for male and female Eldar diplomacy icons.
  • Updated image sprite sheet indices to match the new image system.
  • Added eFACTION enum usage for faction indexing.
scripts/scr_ui_diplomacy/scr_ui_diplomacy.gml
Updated advisor icons to use the new image system.
  • Replaced draw_sprite calls with scr_image calls for advisor icons.
  • Added support for custom advisor images defined in chapter JSON files.
  • Updated image sprite sheet indices to match the new image system.
  • Added conditional logic to use custom advisor images if defined, otherwise fallback to default images.
scripts/scr_ui_advisors/scr_ui_advisors.gml
scripts/scr_apothecarium/scr_apothecarium.gml
scripts/scr_librarium/scr_librarium.gml
scripts/scr_fleet_advisor/scr_fleet_advisor.gml
scripts/scr_recruit_data/scr_recruit_data.gml
scripts/scr_draw_armentarium/scr_draw_armentarium.gml
Added support for custom advisor image IDs in chapter JSON files.
  • Added custom_advisors struct to the ChapterData struct.
  • Added logic to load custom advisor image IDs from chapter JSON files.
  • Added logic to initialize custom advisor image IDs during chapter creation.
  • Updated chapter JSON schema to include the custom_advisors field.
scripts/scr_chapter_new/scr_chapter_new.gml
scripts/scr_initialize_custom/scr_initialize_custom.gml
ChapterMaster.yyp
datafiles/main/chapters/3.JSON

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions bot added PR: Sprites Changes to sprites/images PR: Feature Adds something new labels Jan 1, 2025
sourcery-ai[bot]
sourcery-ai bot previously approved these changes Jan 1, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @VanWeapon - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@VanWeapon VanWeapon changed the title feat: Diplomacy and advisor icon refactor to new image system refactor: Diplomacy and advisor icon refactor to new image system Jan 1, 2025
@VanWeapon VanWeapon added the PR: Refactor Rewriting/restructuring code, while keeping general behaviour label Jan 1, 2025
@OH296
Copy link
Collaborator

OH296 commented Jan 1, 2025

also just because this is a potential annoyance change (cm code being as it is) will hold back for 10.1 just to help push 0.10.0 over the line

@OH296 OH296 added this to the v0.10.1 milestone Jan 1, 2025
@VanWeapon VanWeapon mentioned this pull request Jan 1, 2025
@OH296 OH296 changed the base branch from release/0.10.0.0 to main January 12, 2025 21:24
@OH296 OH296 dismissed sourcery-ai[bot]’s stale review January 12, 2025 21:24

The base branch was changed.

@OH296
Copy link
Collaborator

OH296 commented Jan 12, 2025

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @VanWeapon - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Feature Adds something new PR: Refactor Rewriting/restructuring code, while keeping general behaviour PR: Sprites Changes to sprites/images
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants