Skip to content

Unlink **Resource Sharing Tax** and **Disable Unit Sharing** - #4433

Merged
Ruwetuin merged 7 commits into
beyond-all-reason:masterfrom
keithharvey:unlink_tax
Mar 27, 2025
Merged

Unlink **Resource Sharing Tax** and **Disable Unit Sharing**#4433
Ruwetuin merged 7 commits into
beyond-all-reason:masterfrom
keithharvey:unlink_tax

Conversation

@keithharvey

@keithharvey keithharvey commented Mar 2, 2025

Copy link
Copy Markdown
Collaborator

closes #4415

Description

Decouples resource sharing tax from unit sharing restrictions. Previously, setting a non-zero resource sharing tax would automatically enable and lock both "Disable Unit Sharing" and "Disable Assist Ally Construction" settings. This change removes that forced coupling, allowing these settings to be configured independently.

Changes

  • Removed lock/unlock behavior from resource sharing tax
  • Removed forced state UI indicators
  • Settings remain functionally independent

Test steps

  1. Open game settings under Main tab
  2. Set Resource Sharing Tax to a non-zero value (e.g. 0.4)
  3. Verify that both settings remain independently configurable:
    • Disable Unit Sharing
    • Disable Assist Ally Construction

Before

image

After

image

Testers

This PR is contained in this branch and I would probably just test that once and then we can merge both PRs simultaneously.

Removes automatic enabling and locking of unit sharing and assist
construction settings when resource sharing tax is non-zero. Each
setting now operates independently.

gh beyond-all-reason#4415
@keithharvey keithharvey changed the title fix: unlink resource sharing from unit sharing Unit Sharing Improvements Mar 3, 2025
@keithharvey keithharvey changed the title Unit Sharing Improvements Unlink **Resource Sharing Tax** and **Disable Unit Sharing** Mar 3, 2025
- Remove redundant whitelist and AllowUnitTransfer implementation
- Remove unused disable_unit_sharing and unitSharingMode variables
- Rely solely on unitPrice unit rules parameter for transfer control
- Clean up code to use standardized Spring unit rules parameter system

This change simplifies the unit market code by removing redundant unit sharing
checks that were previously used alongside the whitelist system. Now the market
relies solely on the unitPrice unit rules parameter to handle unit transfers,
which is properly checked by game_disable_unit_sharing.lua. This makes the code
cleaner and removes potential conflicts between the two gadgets.
Comment thread modoptions.lua Outdated
Co-authored-by: sprunk <spr.ng@o2.pl>
@keithharvey

Copy link
Copy Markdown
Collaborator Author

@WatchTheFort would it be possible to review #4447 instead? That is a superset of this that and I think would make more sense to release both together.

@WatchTheFort

Copy link
Copy Markdown
Member

@WatchTheFort would it be possible to review #4447 instead? That is a superset of this that and I think would make more sense to release both together.

If #4447 depends on this PR, then this PR should be reviewed first.

Comment thread luarules/gadgets/game_disable_assist_ally.lua Outdated
Comment thread luarules/gadgets/game_disable_assist_ally.lua Outdated
keithharvey and others added 2 commits March 22, 2025 10:01
Co-authored-by: WatchTheFort <36827423+WatchTheFort@users.noreply.github.com>

@WatchTheFort WatchTheFort left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested rephrasing to reduce double negatives

Comment thread luarules/gadgets/game_disable_assist_ally.lua Outdated
Comment thread luarules/gadgets/game_disable_assist_ally.lua Outdated
keithharvey and others added 2 commits March 24, 2025 09:29
Co-authored-by: WatchTheFort <36827423+WatchTheFort@users.noreply.github.com>
Co-authored-by: WatchTheFort <36827423+WatchTheFort@users.noreply.github.com>
@Ruwetuin
Ruwetuin merged commit ca1f9f8 into beyond-all-reason:master Mar 27, 2025
@keithharvey keithharvey mentioned this pull request Apr 17, 2025
8 tasks
mr-maxo-PDG pushed a commit to mr-maxo-PDG/Beyond-All-Reason that referenced this pull request Jul 15, 2025
…all-reason#4433)

Decouples resource sharing tax from unit sharing restrictions.
Previously, setting a non-zero resource sharing tax would automatically
enable and lock both "Disable Unit Sharing" and "Disable Assist Ally
Construction" settings. This change removes that forced coupling,
allowing these settings to be configured independently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unlink **Resource Sharing Tax** and **Disable Unit Sharing**

4 participants