Skip to content

Conversation

@xezon
Copy link

@xezon xezon commented Sep 17, 2025

This change makes the opacity and shadows of build placement preview objects customizable. It adds new fields ObjectPlacementOpacity=0..1 and ObjectPlacementShadows=Yes/No to GameData.ini.

By default, user facing nothing changes.

I put the mod fields into GameData.ini instead of InGameUI.ini because thematically it does not fit in InGameUI, despite being referenced there.

I have chosen the new fields names because there is precedent in Object: PlacementViewAngle.

Example Modification

ObjectPlacementOpacity = 0.60
ObjectPlacementShadows = No

shot_20250914_191345_1

TODO

  • Replicate in Generals

@xezon xezon added Enhancement Is new feature or request Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Mod Relates to Mods or modding labels Sep 17, 2025
Copy link

@Skyaero42 Skyaero42 left a comment

Choose a reason for hiding this comment

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

Ok

…ects customizable

Adds new fields ObjectPlacementOpacity=0..1 and ObjectPlacementShadows=Yes/No to GameData.ini
@xezon xezon force-pushed the xezon/impl-placement-object-customizations branch from 25216e6 to 5e91a58 Compare September 20, 2025 18:11
@xezon
Copy link
Author

xezon commented Sep 20, 2025

Replicated in Generals with conflicts

D:\Projects\TheSuperHackers\GeneralsGameCode>FOR /F "delims=" %b IN ('git merge-base --fork-point main') DO git diff %b  1>changes.patch

D:\Projects\TheSuperHackers\GeneralsGameCode>git diff c0f8b79f1e2df7435f48fffaa443d9046279fe4e  1>changes.patch

D:\Projects\TheSuperHackers\GeneralsGameCode>git apply -p2 --directory=Generals --reject --whitespace=fix changes.patch
Checking patch Generals/Code/GameEngine/Include/Common/GlobalData.h...
Hunk #1 succeeded at 425 (offset -11 lines).
Checking patch Generals/Code/GameEngine/Source/Common/GlobalData.cpp...
error: while searching for:

        { "SpecialPowerViewObject",                     INI::parseAsciiString,  NULL,                   offsetof( GlobalData, m_specialPowerViewObjectName ) },

        { "StandardPublicBone", INI::parseAsciiStringVectorAppend, NULL, offsetof(GlobalData, m_standardPublicBones) },
        { "ShowMetrics",                                                                INI::parseBool,
                   NULL,                offsetof( GlobalData, m_showMetrics ) },
  { "DefaultStartingCash",                              Money::parseMoneyAmount, NULL,          offsetof( GlobalData, m_defaultStartingCash ) },

error: patch failed: Generals/Code/GameEngine/Source/Common/GlobalData.cpp:457
Hunk #3 succeeded at 487 (offset -5 lines).
Hunk #4 succeeded at 868 (offset -11 lines).
Checking patch Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp...
Hunk #1 succeeded at 87 (offset -4 lines).
error: while searching for:

                                                                                                         BuildAssistant::IGNORE_STEALTHED,

                                                                                                         builderObject,

                                                                                                         NULL );
                        if( lbc != LBC_OK )
                                m_placeIcon[ 0 ]->colorTint( &illegalBuildColor );
                        else
                                m_placeIcon[ 0 ]->colorTint( NULL );


error: patch failed: Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp:1523
Hunk #3 succeeded at 1527 (offset -57 lines).
Hunk #4 succeeded at 1555 (offset -57 lines).
Hunk #5 succeeded at 3041 (offset -81 lines).
Hunk #6 succeeded at 3064 (offset -81 lines).
Applied patch Generals/Code/GameEngine/Include/Common/GlobalData.h cleanly.
Applying patch Generals/Code/GameEngine/Source/Common/GlobalData.cpp with 1 reject...
Hunk #1 applied cleanly.
Rejected hunk #2.
Hunk #3 applied cleanly.
Hunk #4 applied cleanly.
Applying patch Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp with 1 reject...
Hunk #1 applied cleanly.
Rejected hunk #2.
Hunk #3 applied cleanly.
Hunk #4 applied cleanly.
Hunk #5 applied cleanly.
Hunk #6 applied cleanly.

@xezon xezon merged commit 568a162 into TheSuperHackers:main Sep 20, 2025
18 checks passed
@xezon xezon deleted the xezon/impl-placement-object-customizations branch September 20, 2025 18:26
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
…ects customizable (TheSuperHackers#1592)

Adds new fields ObjectPlacementOpacity=0..1 and ObjectPlacementShadows=Yes/No to GameData.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Mod Relates to Mods or modding ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants