Skip to content

Add direct unsellable override and SellingAnim support - #2370

Open
frg2089 wants to merge 10 commits into
Phobos-developers:developfrom
ShimakazeProject:feat/unit-sellable
Open

Add direct unsellable override and SellingAnim support#2370
frg2089 wants to merge 10 commits into
Phobos-developers:developfrom
ShimakazeProject:feat/unit-sellable

Conversation

@frg2089

@frg2089 frg2089 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What kind of change is this?

  • New feature, vanilla bugfix or enhancement of a released feature - changelog, docs and credits entries are needed.
  • Improvement to a new (unreleased) feature - docs and credits entries are needed; no changelog entry (Skip Changelog).
  • Bugfix to a new (unreleased) feature - credits entry is needed; no changelog or docs entries (Skip Changelog, Skip Docs).
  • Bugfix to an old (released) feature - changelog and credits entries are needed; no docs entry (Skip Docs).
  • Completely minor change (e.g. a typo fix) - no entries are needed (Skip Changelog, Skip Docs, Skip Credits).

Description

Directly sellable TechnoTypes

  • Unsellable.Direct can be set to true to directly allow the TechnoType to be sold and ensure that the sell cursor is displayed in sell mode.

In rulesmd.ini:

[SOMETECHNO]             ; TechnoType
Unsellable.Direct=false  ; boolean

Custom animation when selling TechnoTypes

  • SellingAnim can be used to play an additional custom animation when a TechnoType is sold.

In artmd.ini:

[SOMETECHNO]       ; TechnoType image section
SellingAnim=       ; AnimationType
Using this tag for BuildingTypes is not recommended. Buildings already play the game's built-in reversed `Buildup` animation when sold, so this feature is unnecessary for them.

Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
@frg2089
frg2089 marked this pull request as ready for review August 26, 2026 01:14
Copilot AI lite review requested due to automatic review settings August 26, 2026 01:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends Phobos’s TechnoType selling behavior by adding (1) a per-type sell animation hookable via artmd.ini and (2) a rulesmd.ini flag to allow “direct” selling (including sell cursor support) for TechnoTypes beyond the default docked/unit-sell constraints. It also updates the user-facing documentation and zh_CN localization to describe the new tags.

Changes:

  • Added SellingAnim (art tag) to optionally spawn a custom AnimType when a techno is sold.
  • Added Unsellable.Direct (rules tag) to permit direct selling and force the sell cursor action in sell mode.
  • Updated docs, credits, and zh_CN translations to reflect the new features.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Misc/Hooks.BugFixes.cpp Implements sell eligibility override, sell-cursor action override hook, and sell animation spawn on event execution.
src/Ext/TechnoType/Body.h Adds new TechnoTypeExt fields for SellingAnim and Unsellable_Direct.
src/Ext/TechnoType/Body.cpp Reads the new INI tags and serializes them for save/load persistence.
docs/Whats-New.md Adds release notes entries referencing the new features and tags.
docs/New-or-Enhanced-Logics.md Documents SellingAnim and Unsellable.Direct usage and placement.
docs/locale/zh_CN/LC_MESSAGES/Whats-New.po Adds zh_CN translations for the new Whats-New entries.
docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po Adds zh_CN translations for the new documentation sections.
docs/locale/zh_CN/LC_MESSAGES/CREDITS.po Updates (partially) zh_CN credits translation strings impacted by the new feature credit entries.
CREDITS.md Adds credits for the new features (with formatting changes to the contributor block).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Misc/Hooks.BugFixes.cpp Outdated
Comment thread src/Misc/Hooks.BugFixes.cpp Outdated
Comment thread CREDITS.md Outdated
Comment thread docs/locale/zh_CN/LC_MESSAGES/CREDITS.po Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@TaranDahl TaranDahl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do not use AI description on the main page.
You can simply copy the doc.

Comment thread docs/New-or-Enhanced-Logics.md Outdated
Comment thread src/Misc/Hooks.BugFixes.cpp
-
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Comment on lines +3199 to +3209
auto location = pTechno->Location;
if (rtti == AbstractType::Infantry)
{
location.X -= 128;
location.Y -= 128;
}
else
{
location.X &= ~0xFF;
location.Y &= ~0xFF;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It make the infantry at here (yellow point)

Image

Comment thread src/Misc/Hooks.BugFixes.cpp
…hno\Hooks.Misc.cpp

Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
-
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants