Skip to content

Exclusive SuperWeapon Sidebar #1384

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

Merged

Conversation

NetsuNegi
Copy link
Contributor

@NetsuNegi NetsuNegi commented Sep 18, 2024

  • It is possible to put sw cameos on the left of screen like C&C3 when SuperWeaponSidebar is true. Cameos arranged in a pyramid shape. In theory, it should be compatible with Ares.
  • SuperWeaponSidebar 为true时,可以把超级武器的图标排列在屏幕左侧了,就像命令与征服3中那样。图标按照金字塔形状排列。理论上它应该是兼容Ares的。
    • SuperWeaponSidebar.Interval controls the distance between two column cameos (excluding the background). When you need to make a background, the width of the background should be (SuperWeaponSidebar.Interval + cameo fixed width 60).
    • SuperWeaponSidebar.Interval 控制两列图标之间的横向间距(图标背景不包含在内)。如果你需要制作图标的背景,那么背景的宽度应该是 SuperWeaponSidebar.Interval + 图标的宽度(60像素)。
    • SuperWeaponSidebar.LeftOffset controls the distance between the left side of cameo and the left side of its column (background). This will not be greater than SuperWeaponSidebar.Interval.
    • SuperWeaponSidebar.LeftOffset 控制图标距离背景左边缘的距离,这将不会超过 SuperWeaponSidebar.Interval 的值。
    • SuperWeaponSidebar.CameoHeight controls the distance from the top of the previous cameo to the top of the next cameo. That is, the space between the upper and lower cameos is (SuperWeaponSidebar.CameoHeight - cameo fixed height 48). This will not be less than 48. When you need to make a background, this is the height of the background.
    • SuperWeaponSidebar.CameoHeight 控制图标顶部到下一个图标顶部的距离(也就是每两个背景之间的纵向间距),图标的顶部到其背景的上边缘的距离即为 SuperWeaponSidebar.CameoHeight - 图标高度(48)像素。如果你需要制作图标的背景,那么背景的高度应该是 SuperWeaponSidebar.CameoHeight 的值。
    • SuperWeaponSidebar.Max controls the maximum number of cameos on the leftmost column, which also depends on the current game resolution.
    • SuperWeaponSidebar.Max 控制最左侧一列最多能有多少个图标,这也会受到当前游戏分辨率的影响。
    • SuperWeaponSidebar.MaxColumns controls that maximum count of columns.
    • SuperWeaponSidebar.MaxColumns 控制最多能显示多少列。
    • Only sw with SuperWeaponSidebar.Significance not lower than SuperWeaponSidebar.RequiredSignificance are allowed to be added to the sw sidebar.
    • 只有 SuperWeaponSidebar.Significance 值不低于 SuperWeaponSidebar.RequiredSignificance 的超级武器才允许被加入超级武器侧边栏。
  • SuperWeaponSidebarKeysEnabled should be true that you can use hotkeys about superweapon sidebar.
  • SuperWeaponSidebarKeysEnabled 设为true时你才可以使用超级武器侧边栏的热键。
  • You can also launch first 10 SW by hotkey in INTERFACE category.
  • 你还可以设置10个快捷键来释放对应图标的超级武器。
    • For localization of hotkey, add TXT_FIRE_TACTICAL_SW_XX, TXT_FIRE_TACTICAL_SW_XX_DESC, TXT_TOGGLE_SW_SIDEBAR and TXT_TOGGLE_SW_SIDEBAR_DESC into your .csf file.
    • 如果需要本地化快捷键,只需要在你的 csf 文件中添加对应的 TXT_FIRE_TACTICAL_SW_XX, TXT_FIRE_TACTICAL_SW_XX_DESC, TXT_TOGGLE_SW_SIDEBAR and TXT_TOGGLE_SW_SIDEBAR_DESC 条目。

In uimd.ini:

[Sidebar]
SuperWeaponSidebar=false              ; boolean
SuperWeaponSidebar.Interval=0         ; integer, pixels
SuperWeaponSidebar.LeftOffset=0       ; integer, pixels
SuperWeaponSidebar.CameoHeight=48     ; integer, pixels
SuperWeaponSidebar.Max=0              ; integer
SuperWeaponSidebar.MaxColumns=        ; integer

In rulesmd.ini

[GlobalControls]
SuperWeaponSidebarKeysEnabled=false    ; boolean

[AudioVisual]
SuperWeaponSidebar.AllowByDefault=false   ; boolean

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

[SOMESW]
SuperWeaponSidebar.Allow=             ; boolean
SuperWeaponSidebar.PriorityHouses=    ; list of house types
SuperWeaponSidebar.RequiredHouses=    ; list of house types
SuperWeaponSidebar.Significance=0     ; integer

In ra2md.ini

[Phobos]
SuperWeaponSidebar.RequiredSignificance=0   ; integer

sw_sidebar-01-on
sw_sidebar-02-on

Copy link

github-actions bot commented Sep 19, 2024

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.

@NetsuNegi
Copy link
Contributor Author

looks like nobody interested for this, so it won't change again until somebody notice it.

@FS-21
Copy link
Contributor

FS-21 commented Sep 20, 2024

Looks nice but due to the large list of SW that can stack in that side of the screen can be added a button for show/hide this SuperWeapon Sidebar ?

@Metadorius
Copy link
Member

looks like nobody interested for this, so it won't change again until somebody notice it.

That's not really true, we're just yet to give feedback, and the situation with you and @CrimRecya working on the same feature is a bit... odd

  1. Maybe you and @CrimRecya could cooperate and implement a unified way which includes best of both worlds? Your implementation looks better in terms of internal, but his is more feature-full.
  2. Is there a reason you don't inherit from ControlClass? Per @ZivDero ToggleClass has different functionality that is not useful to your implementation.

@Starkku
Copy link
Contributor

Starkku commented Sep 20, 2024

As useful as this may seem to some I still think both this and #1379 are infinitely less desirable than an additional sidebar tab for superweapons. I know there are some potential challenges in trying to implement that but maybe there's some sort of shortcut to 'fake it' rather than trying to plug it into the existing tab system e.g a button that changes the tab display to something that looks like it but isn't and only display's SW's. If I had more time and energy I would help you guys in the research but alas no can do.

@Metadorius
Copy link
Member

I think that a separate sidebar can also be an alternative option, doesn't have to choose either or.

@NetsuNegi
Copy link
Contributor Author

看起来不错,但由于屏幕那一侧可以堆叠的大量软件可以添加一个按钮来显示/隐藏这个 SuperWeapon 侧边栏?

of course

@NetsuNegi
Copy link
Contributor Author

looks like nobody interested for this, so it won't change again until somebody notice it.

That's not really true, we're just yet to give feedback, and the situation with you and @CrimRecya working on the same feature is a bit... odd

  1. Maybe you and @CrimRecya could cooperate and implement a unified way which includes best of both worlds? Your implementation looks better in terms of internal, but his is more feature-full.
  2. Is there a reason you don't inherit from ControlClass? Per @ZivDero ToggleClass has different functionality that is not useful to your implementation.

There's no special reason, it's just because I don't know it well enough

@NetsuNegi NetsuNegi marked this pull request as draft September 22, 2024 00:09
Copy link
Contributor

@ZivDero ZivDero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I am happy with this implementation. Looking at the new button, it looks well implemented to me. Kudos.

It's a shame we have to reimplement all this Ares crap, but eh, not much that can be done.

Copy link
Contributor

@ZivDero ZivDero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you wanna make it even better, maybe take out the static stuff outside of TacticalButtonClass, and into some new "SWSidebarClass". It's a bit weird to have it in the button itself, even if this is the only purpose of the button.
Just don't forget to resolve conflics and update docs.

@NetsuNegi
Copy link
Contributor Author

If you wanna make it even better, maybe take out the static stuff outside of TacticalButtonClass, and into some new "SWSidebarClass". It's a bit weird to have it in the button itself, even if this is the only purpose of the button. Just don't forget to resolve conflics and update docs.

Actually, I don't know how to handle conflicts outside of the browser

@ZivDero
Copy link
Contributor

ZivDero commented Sep 25, 2024

If you wanna make it even better, maybe take out the static stuff outside of TacticalButtonClass, and into some new "SWSidebarClass". It's a bit weird to have it in the button itself, even if this is the only purpose of the button. Just don't forget to resolve conflics and update docs.

Actually, I don't know how to handle conflicts outside of the browser

You need to rebase your branch onto the latest develop. Then you'll get conflicts inside the files, and you can resolve them in VS/VS Code/other diff program.

@NetsuNegi
Copy link
Contributor Author

If you wanna make it even better, maybe take out the static stuff outside of TacticalButtonClass, and into some new "SWSidebarClass". It's a bit weird to have it in the button itself, even if this is the only purpose of the button. Just don't forget to resolve conflics and update docs.

Actually, I don't know how to handle conflicts outside of the browser

You need to rebase your branch onto the latest develop. Then you'll get conflicts inside the files, and you can resolve them in VS/VS Code/other diff program.

idk how to do it :(

@ZivDero ZivDero force-pushed the origin/branch/exclusive-sw-sidebar branch from e4c0b68 to 54ec5e9 Compare September 25, 2024 15:40
@NetsuNegi NetsuNegi marked this pull request as ready for review September 25, 2024 15:41
@CrimRecya
Copy link
Contributor

Thank you very much for your creation and for putting in so much effort to improve this implement.
Since I am currently unable to conduct direct testing, I plan to ask you a few questions based on my previous PR #1379 :

  1. Can the mouse operations on the background be blocked, not responded to by various other operations.
  2. Can the keys directly display on the cameo to replace "ready" text when the SW is ready.
  3. Is there an another button that can be clicked besides the shortcut key switch.
  4. Can the SW be released directly at the mouse position by pressing the shortcut key (may not need to be directly included in this feature, but is indeed related)

Praise You!

I see that you are also a Chinese contributor, so I directly write the original Chinese version for your understanding :

非常感谢你的创作,并花费如此精力改进这个功能。
由于我现在没有办法直接进行测试,所以我想基于 pr #1379 的已有功能,询问几个问题:

1、对于图标后的背景,鼠标在其之上进行的操作是否能够被屏蔽,也就是说不会被各种其他操作所响应。
2、在超级武器准备完毕的时候,也就是图标上会显示“就绪”文本的时候,能否将这个文本改成其快捷键的键位。
3、除了快捷键开关之外,是否能有一个可以点击的图标开关。
4、(可能并不需要直接包含在这个功能里,但确实相关的功能)能否通过直接按下快捷键,让超级武器直接在鼠标所在的位置释放

称赞.gif

@NetsuNegi
Copy link
Contributor Author

Thank you very much for your creation and for putting in so much effort to improve this implement. Since I am currently unable to conduct direct testing, I plan to ask you a few questions based on my previous PR #1379 :

  1. Can the mouse operations on the background be blocked, not responded to by various other operations.
  2. Can the keys directly display on the cameo to replace "ready" text when the SW is ready.
  3. Is there an another button that can be clicked besides the shortcut key switch.
  4. Can the SW be released directly at the mouse position by pressing the shortcut key (may not need to be directly included in this feature, but is indeed related)

Praise You!

I see that you are also a Chinese contributor, so I directly write the original Chinese version for your understanding :

非常感谢你的创作,并花费如此精力改进这个功能。 由于我现在没有办法直接进行测试,所以我想基于 pr #1379 的已有功能,询问几个问题:

1、对于图标后的背景,鼠标在其之上进行的操作是否能够被屏蔽,也就是说不会被各种其他操作所响应。 2、在超级武器准备完毕的时候,也就是图标上会显示“就绪”文本的时候,能否将这个文本改成其快捷键的键位。 3、除了快捷键开关之外,是否能有一个可以点击的图标开关。 4、(可能并不需要直接包含在这个功能里,但确实相关的功能)能否通过直接按下快捷键,让超级武器直接在鼠标所在的位置释放

称赞.gif

Question 1: The background area outside the icon currently does not affect mouse movements, but I will work on resolving it immediately.
Question 2: This should be achievable.
Question 3: I will add a new button.
Question 4: The shortcut key to release a super weapon is equivalent to clicking once. It will not be released directly at the mouse position, but only requires you to click the mouse once in place.

问题1:图标以外的背景区域目前尚且不能影响鼠标动作,但我会马上着手解决。
问题2:这应当是可以做到的。
问题3:我将会新增一个按钮。
问题4:释放超武的快捷键本就是等同于点击了一次的操作,它不会直接在鼠标位置释放但也只需要你原地点击一次鼠标即可。

@Metadorius
Copy link
Member

A bit off-topic, but I appreciate you guys providing both English version of messages for understanding of others and Chinese to understand each other better, this is optimal for everyone participating 👍

@NetsuNegi
Copy link
Contributor Author

TODO:
Make the keys directly display on the cameo to replace "ready" text when the SW is ready.
Add a button that can be clicked besides the shortcut key switch.

@NetsuNegi
Copy link
Contributor Author

NetsuNegi commented Sep 28, 2024

It's too hard for me to deal with S/L...
Completely I didn'y know how to do it.

@NetsuNegi NetsuNegi closed this Sep 28, 2024
@NetsuNegi NetsuNegi reopened this Sep 28, 2024
@Metadorius
Copy link
Member

Metadorius commented Sep 28, 2024

I don't think you ever need to save/load anything in the sidebar. The game just recreates the sidebar on each load, so you could do the same.

@NetsuNegi
Copy link
Contributor Author

TODO: Make the keys directly display on the cameo to replace "ready" text when the SW is ready. Add a button that can be clicked besides the shortcut key switch.

I will do that in next 2 days.

@NetsuNegi
Copy link
Contributor Author

I don't think you ever need to save/load anything in the sidebar. The game just recreates the sidebar on each load, so you could do the same.

But I still need to save/load the superIndex per buttons I think.

@Metadorius
Copy link
Member

But I still need to save/load the superIndex per buttons I think.

I don't think you need to. Just treat loading as you will treat starting a new game.

I haven't looked in depth at how you implemented it, but what I would do is add the superweapon to the SuperWeapon Sidebar when the same superweapon is added to the main sidebar, so you will automatically keep them in sync.

Keep in mind that I didn't check in depth how it works, so this is only in theory.

@NetsuNegi
Copy link
Contributor Author

But I still need to save/load the superIndex per buttons I think.

I don't think you need to. Just treat loading as you will treat starting a new game.

I haven't looked in depth at how you implemented it, but what I would do is add the superweapon to the SuperWeapon Sidebar when the same superweapon is added to the main sidebar, so you will automatically keep them in sync.

Keep in mind that I didn't check in depth how it works, so this is only in theory.

It seems that the game did not re add cameos after reading the save file.
Or I just didn't find it.

@NetsuNegi
Copy link
Contributor Author

Thank you very much for your creation and for putting in so much effort to improve this implement. Since I am currently unable to conduct direct testing, I plan to ask you a few questions based on my previous PR #1379 :

  1. Can the mouse operations on the background be blocked, not responded to by various other operations.
  2. Can the keys directly display on the cameo to replace "ready" text when the SW is ready.
  3. Is there an another button that can be clicked besides the shortcut key switch.
  4. Can the SW be released directly at the mouse position by pressing the shortcut key (may not need to be directly included in this feature, but is indeed related)

Praise You!

I see that you are also a Chinese contributor, so I directly write the original Chinese version for your understanding :

非常感谢你的创作,并花费如此精力改进这个功能。 由于我现在没有办法直接进行测试,所以我想基于 pr #1379 的已有功能,询问几个问题:

1、对于图标后的背景,鼠标在其之上进行的操作是否能够被屏蔽,也就是说不会被各种其他操作所响应。 2、在超级武器准备完毕的时候,也就是图标上会显示“就绪”文本的时候,能否将这个文本改成其快捷键的键位。 3、除了快捷键开关之外,是否能有一个可以点击的图标开关。 4、(可能并不需要直接包含在这个功能里,但确实相关的功能)能否通过直接按下快捷键,让超级武器直接在鼠标所在的位置释放

称赞.gif

It should be finished now.
应该都完成了。

Copy link
Contributor

@CrimRecya CrimRecya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The main function is working well.

@Coronia Coronia requested a review from Metadorius May 27, 2025 03:33
@NetsuNegi NetsuNegi requested a review from Thrifinesma May 28, 2025 03:57
@Speederovsky
Copy link

Speederovsky commented May 31, 2025

Availability of Toggle Super Weapon Sidebar in hotkeys shouldn't be controlled by the SuperWeaponSidebarKeysEnabled tag. It should just always be available when the exclusive SW sidebar is used, completely separate from the SW launch hotkeys.

Anchoring of the tooltips on the left sidebar looks good to me now.

@CrimRecya CrimRecya added Tested Fix and merge this ⚙️T2 T2 maintainer review is sufficient and removed Needs testing labels Jun 5, 2025
@CrimRecya CrimRecya merged commit 722eb64 into Phobos-developers:develop Jun 5, 2025
18 checks passed
@NetsuNegi NetsuNegi deleted the origin/branch/exclusive-sw-sidebar branch June 5, 2025 04:55
DeathFishAtEase added a commit to DeathFishAtEase/Phobos that referenced this pull request Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix and merge this Major Big stuff to do ❓New feature ⚙️T2 T2 maintainer review is sufficient Tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants