Ahli / sc2xml

11 stars 1 forks source link

Shield Battery hotkey menu shows 2 Recharge buttons & unset hotkey warning #99

Closed Ahli closed 11 months ago

Ahli commented 1 year ago

Shield Battery has two Recharge buttons in the hotkeys menu (but only there)

You can still right click the battery, so this is probably only annoying with its undefined hotkey warning

image

Shield Battery's command card is buggy in the engine for some reason. It looks differently in the editor than in game and in the hotkey menu it apparently looks different again...

Ahli commented 1 year ago

When you look at it online, the cancel button is missing as well in hotkey menu and during gameplay. image

Also, the stop button does not exist online.

I do not know why editor tests and online gameplay have these different behaviors, but that is really strange.

The only strange thing with Shield Battery is that it uses abilities and effects that use @ character in their IDs... potentially that breaks something...

Ahli commented 1 year ago

TLDR:

Ahli commented 1 year ago

Fix

Tested offline and online. I do not understand the root issue, but this fixes it online and in the editor tests.

    <CUnit id="ShieldBattery">
        <CardLayouts index="0">
            <LayoutButtons index="0" Face="Stop" AbilCmd="stop,Stop" Row="0" Column="1"/>
            <LayoutButtons index="1" Face="CancelBuilding" AbilCmd="BuildInProgress,Cancel" Row="2" Column="4"/>
            <LayoutButtons index="2" Face="ShieldBatteryRecharge" AbilCmd="ShieldBatteryRechargeEx5,Execute" Row="0" Column="0"/>
            <LayoutButtons Face="ShieldBatteryRecharge" AbilCmd="ShieldBatteryRechargeEx5,Execute" Row="0" Column="0"/>
            <LayoutButtons Face="CancelBuilding" Type="AbilCmd" AbilCmd="BuildInProgress,Cancel" Row="2" Column="4"/>
            <LayoutButtons Face="Stop" Type="AbilCmd" AbilCmd="stop,Stop" Row="0" Column="1"/>
        </CardLayouts>
    </CUnit>

The Stop button is online only showing during Recharge, not before. I guess that is good enough since the functionality is all there

image image image image