RimWorld
412 평점
Float Sub-Menus
   
어워드
즐겨찾기
즐겨찾기됨
즐겨찾기 해제
Mod, 1.3, 1.4, 1.5
파일 크기
게시일
업데이트일
949.574 KB
2022년 9월 17일 오전 2시 37분
2024년 5월 3일 오후 5시 23분
변경 사항 13개 ( 보기 )

다운로드 위해 구독하기
Float Sub-Menus

설명
Adds support for having sub-menus in float menus.
Update: Now also includes a search field and divider bar for float menus.

This is intended as a library mod, allowing any mod developer to add sub-menus to their float menus.

For players
You only need this mod if another mod has a dependency on it.

If you get errors
If an error in the log mentions FloatMenu, FloatMenuOption or FloatMenuMakerMap, that does not mean that it is related to this mod. They are from vanilla, and you need to look further down in the error message. Only it the error mentions FloatSubMenu, FloatMenuSearch or FloatMenuFilter does it point to having anything to do with this mod.

For mod developers
Sub menus
Add an instance of the FloatSubMenu class in the list of FloatMenuOptions when creating a FloatMenu, and that option will open up a sub-menu when the mouse enters it. They can also be nested, by adding it to the list of options for another FloatSubMenu.

Search field
To add a quick search field that filters the menu items on the label, add an instance of the FloatMenuSearch class in the list of FloatMenuOptions when creating a FloatMenu. The constructor takes a bool, with true meaning that it does a tree search down into any sub-menus and false meaning that it only filters based on items at the same level.

Menu divider
To add menu dividers, add an instance of the FloatMenuDivider class in the list of FloatMenuOptions. The constructor takes an optional label string.

If you use the mod, please drop a comment - I would love to see what you have done with it. :)

Compatibility
The FloatSubMenu class has static factory methods that create either a FloatSubMenu or a normal FloatMenuOption that opens the sub menu when selected, depending on if any incompatible mods are loaded.
Use the CompatMMMCreate when adding sub-menus to the menu created by FloatMenuMakerMap, and CompatCreate otherwise.

Vanilla UI Expanded
Currently does not play nice with Vanilla UI Expanded in 1.3. I have contributed code to VUIE, and the maintainer has said they will incorporate it in their next update. Unfortunately that update will take a while. Since it won't be updated to 1.4 before that, it should be fairly future-proof to use this mod in 1.4.
The specific issues are that using dialog for menus does not work for menus using sub-menus, and the menu option to switch to dialog mode can appear multiple times in sub-menus.

For 1.3, I for now suggest detecting if VUIE is active, and falling back to opening a second menu instead if it is.
For 1.4, there should not be a problem.
Using the factory methods gives this behavior.

Achtung!
Achtung rewites the float menu shown when right-clicking on something on the map in a way that is not compatible with Float Sub-Menus. It should be compatible when used in other menus, though.

When adding menu items to the map right-click menu (the one generated by FloatMenuMakerMap), I suggest detecting if Achtung! is active, and falling back to opening a second menu instead if it is.
Using the (CompatMMMCreate variants of) the factory methods gives this behavior.

RimWorld 1.4
The constructors of the FloatMenuOption class have changed a little in 1.4. I have tried to make it compatible in way that lets the same source code using FloatSubMenu work for both 1.3 & 1.4. The arguments that were added in 1.4 can be passed in the 1.3 version, but will not have any effect.

Source
Source code at Github[github.com]
It is under a BSD license, so feel free to grab the source code if you prefer that to adding a dependency. Do note that if you do that, the compatibility issues with VUIE will not be resolved for you as it stands now. I could not figure out a way to make them compatible from my end that did not require invasive patching into VUIE. The plan is instead to contribute code to VUIE to add compatibility with this mod from there.
댓글 24
Kathanon  [작성자] 2024년 7월 24일 오후 8시 51분 
A bunch of my mods, and I have no idea if anyone else has used it in their mods.
NuanKi 2024년 7월 24일 오후 4시 57분 
What mods use this?
Kathanon  [작성자] 2024년 5월 3일 오후 5시 26분 
Update:
- Added FloatMenuToggleOption - a menu option that does not close the menu, but instead toggles on/off.
Elroa 2024년 4월 14일 오후 3시 15분 
For those who are currently not eligible for this mod, you can unsubscribe and subscribe again. I checked!
Kathanon  [작성자] 2024년 4월 8일 오후 2시 25분 
Updated for RimWorld 1.5.
Kathanon  [작성자] 2024년 3월 26일 오후 3시 56분 
Hi!

First, see the "If you get errors" section in the description.

I would not recommend using Achtung!, as it is badly out of date. As I understand it, the author does not really have time to support it any more.
「Brainiac」 2024년 3월 26일 오전 11시 14분 
Hello! I have an issue when play with these mods:
Vanilla Psycasts Expanded
Achtung!
Float Sub-Menus

When I choose steel construct and trying to order him move some where error occurs.

https://pastebin.com/Fvi79CDf

Can you help me please? Or I should contact with Achtung! author?
Big Boss 2022년 12월 28일 오후 2시 44분 
i dont know if this is the mod that causes the problem tho i suspect so, when i right click a baby i get this message :
https://github.com/Szkielet0r/rimworld-/blob/main/well%2C%20this%20clearly%20doesnt%20work
Kathanon  [작성자] 2022년 12월 2일 오후 4시 45분 
@Zane
Thanks for telling me. :) Hope you find the problem.
FloatMenu and FloatMenuOption are from vanilla, this mod adds FloatSubMenu. I can understand the confusion.
Low Intelligence Specimen 2022년 12월 2일 오후 4시 37분 
nevermind, I just disabled it and still getting the errors. I guess float menus are seperate things