[Highly Customized] Distribution click action mode#1949
[Highly Customized] Distribution click action mode#1949CrimRecya wants to merge 45 commits intoPhobos-developers:developfrom
Conversation
…tion # Conflicts: # CREDITS.md # docs/Whats-New.md # src/Commands/Commands.cpp # src/Phobos.INI.cpp # src/Phobos.h
…tion # Conflicts: # CREDITS.md # docs/Whats-New.md
Metadorius
left a comment
There was a problem hiding this comment.
Partially reviewed for the command bar buttons part, sorry, busy with CnCNet YR's new update troubleshooting and client at the moment so not a lot of reviewing from me.
| class ShapeButtonHelper | ||
| { | ||
| public: | ||
| static constexpr int MaxButtonCount = 25; | ||
| static constexpr int InUseButtonCount = 11; | ||
| static constexpr int UnusedButtonCount = 1; | ||
| static constexpr int OldButtonCount = InUseButtonCount + UnusedButtonCount; | ||
| static constexpr int NewButtonCount = std::min(1, (MaxButtonCount - OldButtonCount)); | ||
| // 1. Team01 | ||
| // 2. Team02 | ||
| // 3. Team03 | ||
| // 4. TypeSelect | ||
| // 5. Deploy | ||
| // 6. AttackMove | ||
| // 7. Guard | ||
| // 8. Beacon | ||
| // 9. Stop | ||
| // 10. PlanningMode | ||
| // 11. Cheer | ||
| // 12. MoveToDeploy | ||
| static constexpr const char* NewButtonNames[NewButtonCount] = | ||
| { | ||
| /* 13. */ "DistributionMode" | ||
| /* New button name here */ | ||
| }; | ||
| static constexpr const char* NewButtonTipNames[NewButtonCount] = | ||
| { | ||
| "Tip:DistributionMode" | ||
| // New button tip here | ||
| }; | ||
| static int NewButtonIndexes[NewButtonCount]; | ||
| }; |
There was a problem hiding this comment.
This has to be refactored, and it is important as it's a framework code and it is going to be used for other buttons as well.
Per @tomsons26 who is well into the engine(s), the bottom bar is called Advanced Command Bar. I propose to transform those static array fields into fields of AdvancedCommandBarButtonClass and use a similar approach with registering as with CommandClass.
Maybe it would also be beneficial to place commands and command buttons separately.
There was a problem hiding this comment.
Courtesy of @tomsons26
TabClass_CommandBar_from_name 006CFCC0
TabClass_CommandBar_set_index 006CFD20
TabClass_CommandBar_get_index 006CFD30
TabClass_CommandBar_get_button 006CFD40
TabClass_CommandBar_get_dimensions 006CFD60
TabClass_CommandBar_set_count 006CFDB0
TabClass_CommandBar_inrange 006CFDF0
TabClass_CommandBar_getoffset 006CFE10
TabClass_CommandBar_unload_shapes 006D0270
TabClass_CommandBar_add_buttons 006D04A0
TabClass_CommandBar_remove_buttons 006D04D0
TabClass_CommandBar_Link_Tooptip 006D09C0
TabClass_CommandBar_load_buttons_shapes 006D0F10
TabClass_CommandBar_unload_buttons_shapes 006D0F70
TabClass_CommandBar_set_id 006D0FB0
TabClass_CommandBar_init_io 006D0FD0
TabClass_CommandBar_init_thumb 006D1130
TabClass_CommandBar_activate 006D1200
TabClass_CommandBar_deinit 006D14F0
TabClass_CommandBar_add_thumb 006D1570
TabClass_CommandBar_remove_thumb 006D15F0
TabClass_CommandBar_activate_thumb 006D1610
TabClass_CommandBar_deactivate_thumb 006D1660
char * const RulesClass::int AdvancedCommandBar(CCINIClass &)::.0::AdvancedCommandBar 007F0CE8
char * const RulesClass::int MultiplayerAdvancedCommandBar(CCINIClass &)::.0::MultiplayerAdvancedCommandBar 007F0CEC
CommandBar_invalid_id 008427CC
CommandBar_button_names 008427D0
CommandBar_do_subtract_in_do_blit 00884D2E
CommandBar_shapes 00B0C148
CommandBar_chear_id 00B0C1B8
CommandBar_button_shapes 00B0C1C0
CommandBar_deploy_id 00B0CB20
CommandBar_type_select_id 00B0CB38
CommandBar_beacon_id 00B0CB3C
CommandBar_first_button_h 00B0CB50
CommandBar_count 00B0CB54
CommandBar_guard_id 00B0CB68
CommandBar_stop_id 00B0CB6C
CommandBar_index_lookup 00B0CB78
CommandBar_shapes_is_allocated 00B0CBDC
CommandBar_planning_id 00B0CC1C
CommandBar_team_1_id 00B0CC20
CommandBar_yoff 00B0CC24
CommandBar_team_2_id 00B0CC28
CommandBar_max_xpos 00B0CC2C
CommandBar_xoff 00B0CC38
CommandBar_thumb_shape_deactivated 00B0CC40
CommandBar_thumb_shape_activated 00B0CCB0
CommandBar_some_width 00B0CD10
CommandBar_attackmove_id 00B0CD24
CommandBar_team_3_id 00B0CD28
CommandBar_first_button_w 00B0CD38
CommandBar_cap_shape 00B0FA90
CommandBar_main_rect 00B0FC58
CommandBar_rect2 00B0FC60
CommandBar_BTTNBKGD_SHP_rect 00B0FC68
CommandBar_RENDCAP_SHP_rect 00B0FC6C
Reopen #1453.
Previously mentioned that the remaining items in TODO can be considered in the future, so I will not make any changes before merging this.