-
-
Notifications
You must be signed in to change notification settings - Fork 124
Exclusive Sidebar for Superweapons #1379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
|
I have 2 questions: is it scrollable and what's with Techno's positioned behind it? |
|
Does the custom stuff like floating numbers, digital display etc. get properly excluded from the SW sidebar? |
|
I think you don't need scrolling though, you can just make the pyramid shape as it is in C&C3. |
|
I'm just thinking about possibility of exploiting it to hide troops from enemy. |
src/Misc/TacticalButtons.h
Outdated
| // universal functionality can be achieved. - CrimRecya | ||
|
|
||
| // It would be great if it could be modularized | ||
| // TODO TacticalButtonClass::TacticalButtonGroup::TacticalButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's cool to have this implemented from scratch, but please use the tools the game already has built in first.
I recommend that you inherit your button from ControlClass (it already has functions called when it's hovered on/off), and look at SelectClass to see how it should work in regards to the actual execution.
You can also refer to my code here:
https://github.com/Rampastring/Vinifera/blob/ceba7041a1c6a376a4733e1024e0b8adcd8abf7c/src/extensions/sidebar/sidebarext.h#L74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the principle behind this. May I ask if every button is a ControlClass object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. Not sure, maybe we even have the class for unit icons ingame even, I remember something like this being ingame.
src/Misc/TacticalButtons.h
Outdated
| // Button index 1-9 : Super weapons buttons | ||
| static void DrawButtonForSW(); | ||
| static void RecheckButtonForSW(); | ||
| static bool InsertButtonForSW(int& superIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insert/Move seems redundant. You should do it closer to the way the sidebar does.
Have an vector of SW button data (maybe store their global type heap id as well?).
Then when time has come to update the sw list (something has been added/removed), add/remove to the vector, then just call sort on it.
src/Misc/TacticalButtons.h
Outdated
| // It would be great if it could be modularized | ||
| // TODO TacticalButtonClass::TacticalButtonGroup::TacticalButton | ||
|
|
||
| class TacticalButtonClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is SW_specific, then maybe SpecialAbilityButtonClass?
And then remove all the "ForSw" postfixed on function names
src/Misc/TacticalButtons.h
Outdated
| static bool CheckMouseOverBackground(const Point2D* pMousePosition); | ||
|
|
||
| public: | ||
| inline bool MouseOverButtons(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ControlClass capabilities
Metadorius
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Are you currently able to have no new graphics apart from just the icons? Like them just floating on the side.
- It would be cool to be able to hide the superweapons that are displayed that way from the main sidebar tab, if that is not too much effort.
- The biggest nitpick here is what @ZivDero said about using an already existing class. You have done a great job of making it work, but I think inheriting from the existing class will cut down on a lot of code for this.
src/Ext/House/Body.h
Outdated
| int SuperWeaponButtonData[9]; | ||
| int SuperWeaponButtonCount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
At present, there is too little information known about |
|
You don't need to close the PR. How can we help you figure it out? I've sent the IDA definitions of the relevant classes and vtable layouts, so you can insert them in IDA and read the codes. |
|
I only set one SW.InScreen.Show=yes on a major SW for a quick test so far, and what it seems to be doing (at least in a singleplayer mission test map) is: when it's not scrolled to the top of the Armory tab, it wants to launch the SW that is in the top-right corner just 1 row beyond the visible range (the first cameo on the right "hidden" by the sidebar tab buttons). Depending on how positioned your Armory tab is, it will want to launch a different SW. The same thing happened for additionally defined SWs on the left side when I added 2 more: these cameos all wanted to launch the SW "hidden to the right" when Armory tab was not scrolled to the top. Game resolution was 1400x900 for this test, if it matters. These new icons only want to launch the properly defined SW when the Armory tab is scrolled to the top. EDIT: Oh, if my tab is set to something else than SWs and scrolled down, clicking on an icon on the left results in starting production of whatever object is "located/hidden" at the same spot rather than firing the intended SW. |
Thank you so much for your feedback. I think I have some preliminary ideas about this issue and I will fix it soon. |
|
@CrimRecya as you see we now have two pull requests open that implement the same feature. From what I see, your pull request is more feature-rich but @NetsuNegi's pull request is based on YR's I suggest that you and @NetsuNegi cooperate and produce a unified pull request which would include the best work from you both. Maybe take his pull feature as a base and bring on all the nice features that your sidebar has, but ultimately that is up to you how you want to deal with this. What do you think of this? |
|
For reference, I am talking about this PR if you haven't seen it: #1384 |
Oh, I saw his great implement. However, although I am willing to collaborate to create a better implement, in fact, I am currently busy with my daily work and limited to small modifications and fixes for all my implements I have made. I don't have enough time to make drastic changes to this implement right now, at least until next year. In addition, this implement also laid the foundation for another implement that I have public but not pull request yet. |




SWSidebarBackgroundcontrols whether to draw the background shape of the exclusive sidebar.SWSidebarBackground.OnPCXandSWSidebarBackground.OffPCXcontrolled the shapes of this exclusive sidebar's switch displaying, respectively used in non-hidden and hidden. Required sizes are all10 * 50.SWSidebarBackground.TopPCX,SWSidebarBackground.CenterPCXandSWSidebarBackground.BottomPCXcontrolled the materials that were combined to create the entire exclusive sidebar background shape. Their required sizes are respectively80 * 20,80 * 50and80 * 20. InSWSidebarBackground.CenterPCX, the position of the superweapon'sSidebarPCXis 5 pixels away from the left contour of this background, 15 pixels away from the right contour, and 1 pixel away from both the upper and lower contours.SW.InScreen.Showcontrols whether the superweapon should be displayed first in the exclusive sidebar. If the exclusive sidebar is full (up to 10 are displayed), the overflowing superweapon's cameo will be added back to the original sidebar. If there is an empty space in the exclusive sidebar afterwards, it will no longer return to the exclusive sidebar, unless the permission to use the superweapon is regained (lost and gained again). Therefore, it is not recommended to place all superweapons in the exclusive sidebar.SW.InScreen.PriorityHousescontrols if the superweapon is displayed first in the exclusive sidebar, players belonging to these houses will have priority in placing the superweapon cameo in the exclusive sidebar.SW.InScreen.RequiredHousescontrols if the superweapon is displayed first in the exclusive sidebar, players must belong to these houses in order to have superweapon a real chance of being displayed in the exclusive sidebar. The default is empty, which means this condition will always be met.SW.QuickFireAtMousecontrols whether the superweapon which is command by keyboards will forcibly launch to the mouse position without all Ares conditions check except charging and funds. If the mouse is not in the tactical map now, the superweapon will launch likeSW.QuickFireInScreen=truedo.SW.QuickFireInScreencontrols whether the superweapon will forcibly launch to the center position of the current screen without all Ares conditions check except charging and funds.In
rulesmd.ini: