Phobos-developers / Phobos

Ares-compatible C&C Red Alert 2: Yuri's Revenge engine extension
GNU Lesser General Public License v3.0
300 stars 95 forks source link

Exclusive Sidebar for Superweapons #1379

Closed CrimRecya closed 1 month ago

CrimRecya commented 2 months ago

In rulesmd.ini:

[AudioVisual]
SWSidebarBackground=true         ; boolean

[SOMESIDE]                       ; Side
SWSidebarBackground.OnPCX=       ; filename - including the .pcx extension
SWSidebarBackground.OffPCX=      ; filename - including the .pcx extension
SWSidebarBackground.TopPCX=      ; filename - including the .pcx extension
SWSidebarBackground.CenterPCX=   ; filename - including the .pcx extension
SWSidebarBackground.BottomPCX=   ; filename - including the .pcx extension

[SOMESW]                         ; SuperWeapon
SW.InScreen.Show=false           ; boolean
SW.InScreen.PriorityHouses=      ; list of house types
SW.InScreen.RequiredHouses=      ; list of house types
SW.QuickFireAtMouse=false        ; boolean
SW.QuickFireInScreen=false       ; boolean
github-actions[bot] commented 2 months ago

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.

Fryone commented 2 months ago

I have 2 questions: is it scrollable and what's with Techno's positioned behind it?

Metadorius commented 2 months ago

Does the custom stuff like floating numbers, digital display etc. get properly excluded from the SW sidebar?

CrimRecya commented 2 months ago

No, it's not scrollable yet. At least not now. This image should be able to illustrate the drawing well. It will be drawn after all map content is completed, before the several timers. display

Metadorius commented 2 months ago

I think you don't need scrolling though, you can just make the pyramid shape as it is in C&C3.

Fryone commented 2 months ago

I'm just thinking about possibility of exploiting it to hide troops from enemy.

CrimRecya commented 2 months ago

At present, there is too little information known about ControlClass and SelectClass, and I cannot meet these requirement. I will close this PR.

Metadorius commented 2 months ago

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.

CrimRecya commented 2 months ago

cameo Now supports SW.UseAITargeting and can be hidden. I won't redo it through SelectClass, for me, this is already a complete feature.

Speederovsky commented 2 months ago

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.

CrimRecya commented 2 months ago

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.

Metadorius commented 1 month ago

@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 ControlClass, which is more preferable from the code standpoint, so both implementations have their strengths and weaknesses.

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?

Metadorius commented 1 month ago

For reference, I am talking about this PR if you haven't seen it: https://github.com/Phobos-developers/Phobos/pull/1384

CrimRecya commented 1 month ago

@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 ControlClass, which is more preferable from the code standpoint, so both implementations have their strengths and weaknesses.

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?

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. select So in the current stable state, I think I will temporarily put this on hold here. Of course, if necessary, I can also close it or convert it into a draft.