Timberborn

Timberborn

200 ratings
TimberUi
   
Award
Favorite
Favorited
Unfavorite
Mod
Mod compatibility: Update 1.0, Update 0.7
Mod content: Miscellaneous
File Size
Posted
Updated
437.400 KB
Feb 19, 2025 @ 2:29pm
Mar 2 @ 7:33pm
28 Change Notes ( view )

Subscribe to download
TimberUi

In 2 collections by Luke ✞ Jesus Saves ✞
Luke's U7 Compatible Mods
100 items
Luke's 1.0.0 Compatible Mods
92 items
Description
(Yet another) UI Library for Timberborn. Docs incoming.

This mod is a library for other developers. It does nothing by itself.

TimberUi is intended to provide very simple helps to recreate elements that already exist in the game for simple mods. This is not a replacement of other big libraries. The design philosophy of this library:

- Provide most functions through extension methods and pre-built classes. Avoid Builder classes.
- If there is a way to add it through the existing game code, this mod will likely provide guides on how to do that instead of remaking it.
- If the game does not have 'X' visible somewhere, it likely won't add 'X'.

There're still plenty of elements missing and I will probably add it on the "How do you add this?" basis.

Mod source code and donation: https://github.com/datvm/TimberbornMods
17 Comments
Luke ✞ Jesus Saves ✞  [author] Jan 13 @ 10:27am 
Thanks for confirming. Yes can confirm TimberUI is working on my side without any problem.
蓝翎雨菲 Jan 13 @ 2:48am 
Sorry, I double-checked and it turns out the issue is with a different mod. Since it’s supported by TimberUI, there’s no problem when TimberUI isn’t loaded.
蓝翎雨菲 Jan 13 @ 2:31am 
After the game updated on January 12, I can’t get in anymore when loading TimberUi.
Ton Wolfe Jan 9 @ 1:25pm 
Awesome, thanks much! I’ll take a look at the changes later this evening.
Luke ✞ Jesus Saves ✞  [author] Jan 9 @ 9:15am 
v10.0.3: https://github.com/datvm/TimberbornMods/commit/0713af27bbe331ca8e07b54b7fb6574b114ebc60
- Progress Bar now has a convenient struct reference to keep the label.
- Helpers to Save/Load KeyValuePair<TKey, TValue> where they are IConvertible.
- Added MinMaxSlider support (note that it needs an Initialize call due to being dependent on a dedicated IVisualElementInitializer).

Please see if this helps. If you need anything feel free to contact me on Discord, there is a channel for this mod: https://discord.com/channels/558398674389172225/1064825134348763209/threads/1433299764799213588
Luke ✞ Jesus Saves ✞  [author] Jan 8 @ 11:47pm 
One day™️ I will write docs for it 😅
Ton Wolfe Jan 8 @ 11:16pm 
Ah, cool. I’ll have to take a peek at the actual library code sometime. ^^

And yeah, that’s how I’ve been trying to use the sliders, but they won’t display. It’s probably some silly mistake somewhere and I just need to learn more of how the UI system works.
Luke ✞ Jesus Saves ✞  [author] Jan 8 @ 10:04pm 
Ooohhh! that Demo project is super old, there're tons of new features in TimberUI now that's not documented anywhere except maybe reading my mods' code 😅 As for the MinMaxSlider, yeah I think it's just a built-in Unity's UIElement and use it normally
var slider = parent.AddChild<MinMaxSlider>(); // ...

https://docs.unity3d.com/2022.3/Documentation/Manual/UIE-uxml-element-MinMaxSlider.html
Ton Wolfe Jan 8 @ 2:18pm 
Your demo code does a good job showing how to use it.

And no, I don’t think the base game has MinMaxSliders anywhere. It is a Unity class, and you can create them and add them as a child of other elements. They will show up in the PrintVisualTree dump, but they don’t display in-game.

I was hoping there was something simple I’d missed. But I guess I’ll just have to reverse-engineer harder. ^^
Luke ✞ Jesus Saves ✞  [author] Jan 8 @ 1:54am 
Hi, I am actually amazed you made a few mods with it without any documentation, great work! About the MinMaxSlider, do you know anywhere in the game that uses it? I haven't seen it so I think it should probably use a standard Unity's Slider with the game's USS classes similar to SliderInt.