Skip to content

Commit dd581a2

Browse files
authored
Revert "[Highly Customized] Distribution click action mode (#1453)"
This reverts commit caf18a0.
1 parent caf18a0 commit dd581a2

File tree

15 files changed

+2
-745
lines changed

15 files changed

+2
-745
lines changed

CREDITS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ This page lists all the individual contributions to the project by their author.
555555
- Fix an issue that units' `LaserTrails` will always lags behind by one frame
556556
- Fix an issue that the currently hovered planning node not update up-to-date, such as using hotkeys to select technos
557557
- Allow the aircraft to enter area guard mission and not crash immediately without any airport
558-
- Distribution click action mode
559558
- **Ollerus**:
560559
- Build limit group enhancement
561560
- Customizable rocker amplitude

Phobos.vcxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
<ClCompile Include="src\Commands\ToggleDesignatorRange.cpp" />
5959
<ClCompile Include="src\Commands\ToggleDigitalDisplay.cpp" />
6060
<ClCompile Include="src\Commands\SaveVariablesToFile.cpp" />
61-
<ClCompile Include="src\Commands\DistributionMode.cpp" />
6261
<ClCompile Include="src\Ext\Anim\Body.cpp" />
6362
<ClCompile Include="src\Ext\Anim\Hooks.cpp" />
6463
<ClCompile Include="src\Ext\Anim\Hooks.AnimCreateUnit.cpp" />
@@ -243,7 +242,6 @@
243242
<ClInclude Include="src\Commands\ToggleDesignatorRange.h" />
244243
<ClInclude Include="src\Commands\ToggleDigitalDisplay.h" />
245244
<ClInclude Include="src\Commands\SaveVariablesToFile.h" />
246-
<ClInclude Include="src\Commands\DistributionMode.h" />
247245
<ClInclude Include="src\Ext\Bullet\Trajectories\BombardTrajectory.h" />
248246
<ClInclude Include="src\Ext\Bullet\Trajectories\PhobosTrajectory.h" />
249247
<ClInclude Include="src\Ext\Bullet\Trajectories\StraightTrajectory.h" />

YRpp

docs/User-Interface.md

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -502,57 +502,6 @@ For this command to work in multiplayer - you need to use a version of [YRpp spa
502502
- These vanilla CSF entries will be used: `TXT_SAVING_GAME`, `TXT_GAME_WAS_SAVED` and `TXT_ERROR_SAVING_GAME`.
503503
- The save should be looks like `Allied Mission 25: Esther's Money - QuickSaved`.
504504

505-
### `[ ]` Distribution Mode Spread / Filter / Enable
506-
507-
- Now you can change the click action by using `AllowSwitchNoMoveCommand` hotkey. If the behavior to be executed by the current techno is different from the behavior displayed by the mouse, and the behavior to be executed will make the techno move near the target, the behavior will be replaced with area guard. Regardless of whether or not switch hotkey is used, default behavior can be changed through `DefaultApplyNoMoveCommand`.
508-
- Now you can also change the click action when hold down the specific hotkey if enabled `AllowDistributionCommand`. The new behavior is like using the selected objects one by one to click on each target within the range.
509-
- `AllowDistributionCommand.SpreadMode` & `AllowDistributionCommand.FilterMode` allow you to set spread range and target filter by hotkeys, which default to `DefaultDistributionSpreadMode` and `DefaultDistributionFilterMode`.
510-
- When the range is 0, it is the original default behavior of the game. The range can be adjusted to 4, 8 or 16 cells by another shortcut key. You can also adjust this by using the mouse wheel while holding down the specific hotkey if `AllowDistributionCommand.SpreadModeScroll` set to true;
511-
- The targets within the range will be allocated equally to the selected technos. Only when the behavior to be performed by the current techno is the same as that displayed by the mouse will it be allocated. Otherwise, it will return to the original default behavior of the game (it will not be effective for technos in the air). This will display a range ring.
512-
- When the filter is `None`, it is the default behavior of the game. If the range is not zero at this time, a green ring will be displayed. You can adjust the filter mode to:
513-
- `Like` - only targets with the same armor type (Completely identical `Armor`) will be selected among the targets allocated in the range. At this time, a blue ring will be displayed.
514-
- `Type` - only targets of the same type (like infantries, vehicles or buildings) will be selected among the targets allocated in the range. At this time, a yellow ring will be displayed.
515-
- `Name` - only targets of the same name (or with the same `GroupAs`) will be selected among the targets allocated in the range. At this time, a red ring will be displayed.
516-
- `AllowDistributionCommand.AffectsAllies` & `AllowDistributionCommand.AffectsEnemies` allow the distribution command to work on allies (including owner) or enemies target. If picking a target that's not eligible, it'll fallback to vanilla command.
517-
- It's possible to add a button for distribution mode in the bottom bar by adding `DistributionMode` in the `ButtonList` of `AdvancedCommandBar` and `MultiplayerAdvancedCommandBar`.
518-
- The positions of each button are hardcoded, so it'll only decide whether enable this button or not. Distribute Mode button is now always listed after all the vanilla ones.
519-
- The asset of these buttons should be added in `sidec0x.mix` files which correspond to different sides, with the name `button12.shp`.
520-
- For localization add `TXT_SWITCH_NOMOVE`, `TXT_DISTR_SPREAD`, `TXT_DISTR_FILTER`, `TXT_DISTR_HOLDDOWN`, `TXT_SWITCH_NOMOVE_DESC`, `TXT_DISTR_SPREAD_DESC`, `TXT_DISTR_FILTER_DESC`, `TXT_DISTR_HOLDDOWN_DESC`, `MSG:DistributionModeOn`, `MSG:DistributionModeOff`, `TIP:DistributionMode` into your `.csf` file.
521-
522-
In `rulesmd.ini`:
523-
```ini
524-
[GlobalControls]
525-
AllowSwitchNoMoveCommand=false ; boolean
526-
AllowDistributionCommand=false ; boolean
527-
AllowDistributionCommand.SpreadMode=true ; boolean
528-
AllowDistributionCommand.SpreadModeScroll=true ; boolean
529-
AllowDistributionCommand.FilterMode=true ; boolean
530-
AllowDistributionCommand.AffectsAllies=true ; boolean
531-
AllowDistributionCommand.AffectsEnemies=true ; boolean
532-
533-
[AudioVisual]
534-
StartDistributionModeSound= ; sound entry
535-
EndDistributionModeSound= ; sound entry
536-
AddDistributionModeCommandSound= ; sound entry
537-
```
538-
539-
In `ra2md.ini`:
540-
```ini
541-
[Phobos]
542-
DefaultApplyNoMoveCommand=true ; boolean
543-
DefaultDistributionSpreadMode=2 ; integer, 0 - r=0 , 1 - r=4 , 2 - r=8 , 3 - r=16
544-
DefaultDistributionFilterMode=2 ; integer, 0 - None , 1 - Like , 2 - Type , 3 - Name
545-
```
546-
547-
In `uimd.ini`:
548-
```ini
549-
[AdvancedCommandBar]
550-
ButtonList=[Button1],DistributionMode,[ButtonX] ; List of button entry
551-
552-
[MultiplayerAdvancedCommandBar]
553-
ButtonList=[Button1],DistributionMode,[ButtonX] ; List of button entry
554-
```
555-
556505
### `[ ]` Toggle Message Label
557506

558507
- Switches on/off [Task subtitles' label in the middle of the screen](#task-subtitles-display-in-the-middle-of-the-screen).

docs/Whats-New.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ New:
457457
- Fast access structure (by FlyStar)
458458
- Toggle off laser trail and shake effects (by Ollerus)
459459
- [Dehardcode the `ZAdjust` of warhead anim](Fixed-or-Improved-Logics.md#dehardcode-the-zadjust-of-warhead-anim) (by TaranDahl)
460-
- Distribution click action mode (by CrimRecya)
461460
462461
Vanilla fixes:
463462
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)

src/Commands/Commands.cpp

Lines changed: 1 addition & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,16 @@
99
#include "ToggleDigitalDisplay.h"
1010
#include "ToggleDesignatorRange.h"
1111
#include "SaveVariablesToFile.h"
12-
#include "DistributionMode.h"
1312
#include "ToggleSWSidebar.h"
1413
#include "FireTacticalSW.h"
1514
#include "ToggleMessageList.h"
1615

1716
#include <CCINIClass.h>
18-
#include <ShapeButtonClass.h>
1917

2018
#include <Utilities/Macro.h>
2119
#include <Ext/Sidebar/SWSidebar/SWSidebarClass.h>
2220
#include <Misc/MessageColumn.h>
2321

24-
#pragma region HotkeyCommand
25-
2622
DEFINE_HOOK(0x533066, CommandClassCallback_Register, 0x6)
2723
{
2824
// Load it after Ares'
@@ -48,20 +44,6 @@ DEFINE_HOOK(0x533066, CommandClassCallback_Register, 0x6)
4844
SWSidebarClass::Commands[9] = MakeCommand<FireTacticalSWCommandClass<9>>();
4945
}
5046

51-
if (Phobos::Config::AllowSwitchNoMoveCommand)
52-
MakeCommand<SwitchNoMoveCommandClass>();
53-
54-
if (Phobos::Config::AllowDistributionCommand)
55-
{
56-
if (Phobos::Config::AllowDistributionCommand_SpreadMode)
57-
MakeCommand<DistributionModeSpreadCommandClass>();
58-
59-
if (Phobos::Config::AllowDistributionCommand_FilterMode)
60-
MakeCommand<DistributionModeFilterCommandClass>();
61-
62-
MakeCommand<DistributionModeHoldDownCommandClass>();
63-
}
64-
6547
if (Phobos::Config::DevelopmentCommands)
6648
{
6749
MakeCommand<DamageDisplayCommandClass>();
@@ -79,24 +61,14 @@ DEFINE_HOOK(0x533066, CommandClassCallback_Register, 0x6)
7961
return 0;
8062
}
8163

82-
#pragma endregion
83-
84-
#pragma region MouseScroll
85-
8664
static void MouseWheelDownCommand()
8765
{
88-
if (DistributionModeHoldDownCommandClass::Enabled && Phobos::Config::AllowDistributionCommand_SpreadModeScroll)
89-
DistributionModeHoldDownCommandClass::DistributionSpreadModeReduce();
90-
9166
if (MessageColumnClass::Instance.IsHovering())
9267
MessageColumnClass::Instance.ScrollDown();
9368
}
9469

9570
static void MouseWheelUpCommand()
9671
{
97-
if (DistributionModeHoldDownCommandClass::Enabled && Phobos::Config::AllowDistributionCommand_SpreadModeScroll)
98-
DistributionModeHoldDownCommandClass::DistributionSpreadModeExpand();
99-
10072
if (MessageColumnClass::Instance.IsHovering())
10173
MessageColumnClass::Instance.ScrollUp();
10274
}
@@ -115,92 +87,11 @@ DEFINE_HOOK(0x777998, Game_WndProc_ScrollMouseWheel, 0x6)
11587

11688
static inline bool CheckSkipScrollSidebar()
11789
{
118-
return DistributionModeHoldDownCommandClass::Enabled
119-
|| MessageColumnClass::Instance.IsHovering();
90+
return MessageColumnClass::Instance.IsHovering();
12091
}
12192

12293
DEFINE_HOOK(0x533F50, Game_ScrollSidebar_Skip, 0x5)
12394
{
12495
enum { SkipScrollSidebar = 0x533FC3 };
12596
return CheckSkipScrollSidebar() ? SkipScrollSidebar : 0;
12697
}
127-
128-
#pragma endregion
129-
130-
#pragma region ShapeButton
131-
132-
int ShapeButtonHelper::NewButtonIndexes[ShapeButtonHelper::NewButtonCount] =
133-
{
134-
-1 // DistributionMode
135-
// New button initialize here
136-
};
137-
138-
DEFINE_HOOK(0x6CFD08, ShapeButtonClass_FindIndex_FindNewButton, 0x5)
139-
{
140-
enum { SetButtonIndex = 0x6CFD0D };
141-
142-
GET(const char*, name, ECX);
143-
144-
for (int i = 0; i < ShapeButtonHelper::NewButtonCount; ++i)
145-
{
146-
if (_strcmpi(name, ShapeButtonHelper::NewButtonNames[i]) == 0)
147-
{
148-
R->EAX(i + ShapeButtonHelper::OldButtonCount);
149-
return SetButtonIndex;
150-
}
151-
}
152-
153-
return 0;
154-
}
155-
156-
DEFINE_HOOK(0x6D0233, TabClass_Init_InitNewButtonIndex, 0x6)
157-
{
158-
for (int i = 0; i < ShapeButtonHelper::NewButtonCount; ++i)
159-
ShapeButtonHelper::NewButtonIndexes[i] = ShapeButtonClass::FindIndex(ShapeButtonHelper::NewButtonNames[i]);
160-
161-
return 0;
162-
}
163-
164-
DEFINE_HOOK(0x6D0827, TabClass_Update_UpdateNewButton, 0x6)
165-
{
166-
GET(const int, index, EAX);
167-
168-
if (ShapeButtonHelper::NewButtonIndexes[0] == index)
169-
{
170-
if (ShapeButtonClass::GetButton(index)->IsOn)
171-
DistributionModeHoldDownCommandClass::DistributionModeOn();
172-
else
173-
DistributionModeHoldDownCommandClass::DistributionModeOff();
174-
}
175-
176-
// New button trigger here
177-
178-
return 0;
179-
}
180-
181-
DEFINE_HOOK(0x6D10DF, TabClass_InitButtonIO_InitNewHoldDownButton, 0x6)
182-
{
183-
const int distributionModeButtonIndex = ShapeButtonHelper::NewButtonIndexes[0];
184-
185-
if (distributionModeButtonIndex != -1)
186-
{
187-
if (const auto pButton = ShapeButtonClass::GetButton(distributionModeButtonIndex))
188-
{
189-
// Clicking the button is different from holding down the hotkey
190-
pButton->ToggleType = 1;
191-
pButton->UseFlash = true;
192-
}
193-
}
194-
195-
return 0;
196-
}
197-
198-
DEFINE_HOOK(0x6D14DD, TabClass_InitToolTip_InitNewButtonToolTip, 0x5)
199-
{
200-
for (int i = 0; i < ShapeButtonHelper::NewButtonCount; ++i)
201-
ShapeButtonClass::SetToolTip(ShapeButtonClass::GetButton(ShapeButtonHelper::NewButtonIndexes[i]), ShapeButtonHelper::NewButtonTipNames[i]);
202-
203-
return 0;
204-
}
205-
206-
#pragma endregion

src/Commands/Commands.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,6 @@ T* MakeCommand()
1414
return command;
1515
};
1616

17-
class ShapeButtonHelper
18-
{
19-
public:
20-
static constexpr int MaxButtonCount = 25;
21-
static constexpr int InUseButtonCount = 11;
22-
static constexpr int UnusedButtonCount = 1;
23-
static constexpr int OldButtonCount = InUseButtonCount + UnusedButtonCount;
24-
static constexpr int NewButtonCount = std::min(1, (MaxButtonCount - OldButtonCount));
25-
// 1. Team01
26-
// 2. Team02
27-
// 3. Team03
28-
// 4. TypeSelect
29-
// 5. Deploy
30-
// 6. AttackMove
31-
// 7. Guard
32-
// 8. Beacon
33-
// 9. Stop
34-
// 10. PlanningMode
35-
// 11. Cheer
36-
// 12. MoveToDeploy
37-
static constexpr const char* NewButtonNames[NewButtonCount] =
38-
{
39-
/* 13. */ "DistributionMode"
40-
/* New button name here */
41-
};
42-
static constexpr const char* NewButtonTipNames[NewButtonCount] =
43-
{
44-
"Tip:DistributionMode"
45-
// New button tip here
46-
};
47-
static int NewButtonIndexes[NewButtonCount];
48-
};
49-
5017
#define CATEGORY_TEAM StringTable::LoadString(GameStrings::TXT_TEAM)
5118
#define CATEGORY_INTERFACE StringTable::LoadString(GameStrings::TXT_INTERFACE)
5219
#define CATEGORY_TAUNT StringTable::LoadString(GameStrings::TXT_TAUNT)

0 commit comments

Comments
 (0)