#UITK for KSP 2
1 messages · Page 3 of 1
yeah, should be easy enough
which...
for (int i = 0; i < m_glyphInfoList.Count; i++)
{
TMP_Glyph oldGlyph = m_glyphInfoList[i];
Glyph glyph = new Glyph();
uint glyphIndex = (uint)i + 1;
//#if UNITY_EDITOR
//if (m_SourceFontFile_EditorRef != null)
// glyphIndex = FontEngine.GetGlyphIndex((uint)oldGlyph.id);
//#endif
glyph.index = glyphIndex;
glyph.glyphRect = new GlyphRect((int)oldGlyph.x, m_AtlasHeight - (int)(oldGlyph.y + oldGlyph.height + 0.5f), (int)(oldGlyph.width + 0.5f), (int)(oldGlyph.height + 0.5f));
glyph.metrics = new GlyphMetrics(oldGlyph.width, oldGlyph.height, oldGlyph.xOffset, oldGlyph.yOffset, oldGlyph.xAdvance);
glyph.scale = oldGlyph.scale;
glyph.atlasIndex = 0;
m_GlyphTable.Add(glyph);
TMP_Character character = new TMP_Character((uint)oldGlyph.id, glyph);
if (oldGlyph.id == 32)
isSpaceCharacterPresent = true;
m_CharacterTable.Add(character);
}
ah I didn't get that far... 
maybe the glyph rects are stored tho, probably are
since they need to acess them to get the chars

chatgpt will tell us to go f ourselves lmao
lmao
I don't understand why they have one font as a literal .otf font file in the assets and then two are just TMP monobehaviors with a material and texture

probably they dont use that font often
oh they do, it's the one used for most text in the game
actually it can be the font they use for the console
it also has the TMP assets
oh ok
Probably AssetStudio is not able to reverse engineer them
I don't think it does with realtime rounded either
tho have u tried just putting the font name.otf on Resource.Load?
they just literally include the .oft file in the addressables, but not the other two
ngl they probably just forgot them there xD
yeah lmao
since it's not needed in the game for anything afaik
they only need the TMP assets
only needed if they use it in things like the console or any other UI thats not TMP
probably for the Debug windows
since they dont seem to use TMP
I mean they could just use the default Unity fonts for that
if it's not user-facing UI
well if they're smart they put the game's font as the default font
for easier game dev
well they do also include all this
and when ur making a prototype its easier to use the normal text since its faster to interate
which are the Unity defaults iirc
oh that probably is from assets that are not being used in game
actually that seems like a translation test
they probably were testing l2
i wonder how much mb of junk is in the game
i'd say maybe 5-10% of the game's size
they is an awful amount of duplication
tbf i dont think thats actual duplication
just the SB Liquid font assets are duplicated like 5 times lmao
if you're talking about what i think
in different addressables and in Resources
cuz the way ddressables work, thats just the address
and AssetStudio displays it as an actual Asset
but in the files its actually just a reference to the original
interesting, so when you go to "Show original file", it doesn't show you the file that actually contains it, but just references it in any way?
Thats my guess, because most parts dont have all the files on the addressable
but if you load the whole folder
the missing files are there
a lot of parts are missing meshes in asset studio ie
doesn't that speak against what you're saying? 😅
it would mean that if Asset Studio was showing references and the parts were scattered across multiple files, you'd see most part assets multiple times, no?
You'd see it multiple times IF you have the reference's target loaded
else you wont see it
ie, if you have a prefab on your part, the prefab wont show fully on AssetStudio
let me see if i can show u a sec
and if I have the full game folder loaded and still don't see duplicates for parts?
I don't think I've ever even used that tab once 
lmao its good for part modding cuz u see the structure
the game a lot of times uses the structure and gameObject's names for things
ie, the game keeps a list of all colliders and models in the PartBehaviour
it gets it by iterating through every gameObject under a gameObject named "model"
and it has to be directly on the root of the part
thats how i figured the convention of the game's parts
this was my example of that
no two files here are the same
and it's across many bundles
well a lot of those are unity automatic conversions from what i can see
but then some other assets I see a lot of just 1:1 duplicates
for example many fonts are loaded in both Resources and in multiple addressable bundles
oh i was thinking it was the font asset lmao
lmao
i was like why tf does every engine need a font?
from what i know, and i might be wrong, thats unity's addressable packing
if you dont add a needed resource to the addressables
nah, the type is either Font for the actual .ttf/.otf, or MonoBehavior for the FontAsset classes (referring to the TextAsset thing)
it will automatically load that for you
i did not include any of the textures on the addressables window
but it was loaded through the material
nor i included the shaders
yeah I know about that, that's how the UIE-Runtime etc shaders end up in the kerbalui bundle even without me specifically including them
if you reference anything in an asset that gets bundled, it bundles it as well
so basically theres no duplicates
its just asset studio loading everything that it sees
but in game, and for unity, they are all just references to the same file
thats what catalog.json is for
thats why theres only 1 per addressables build
it tells, "hey this file already exists no need to save it again, just reference x id"
yeah I see, well, that's just dumb 
since when I import and export the SORRY folder in AS, it correctly exports all the files only once
i mean it saves tons of disks space
it doesnt xD
if there's multiple of the same it exports like this
they are all the same but from different addressables bundles
but again in game its all the same reference
oh lmao
well the SORRY folder that I loaded just has no multiple references then I guess

yeah the current version of sorry doesnt have duplicates i think
since there's not much to prefab and instantiate there
Indeed xD
yeah lmao, i mean i do like the current font so 
and maybe the devs will make it easier for us in the future
at least i hope @ dakota
hm this sucks
I'm having trouble finding any LCD dotted fonts which support more than the basic english character set
probably wouldnt be hard to make one font procedurally for that
basically get a good pixelated font and turn every pixel into a dot
try to find a pixelated font and i'll try to do it 🙏
like that one u sent earlier
oh lmao
also we could for now have only the english one
and other languages we would show the defaults
while we cant find an universal one
most people have the game in english either way (for now at least)
is there an easy way to default to a different font altogether if a character doesn't exist in the current one?
or do you just mean manually switching them out when the language changes
l2 already has support for that tbh i think we could use it maybe?
like l2.GetCurrentFont or smth
does that work with UITK TextCore fonts?
im pretty sure it does
its just a matter of actually updating the style sheet probably
hm
alright, let me actually test the custom elements first and then I'll get into this
lmao
ABC!
btw I made the factory loading from assembly an API method so that you can register controls from any assembly you dynamically load as well
so now the patch is just this
[HarmonyPatch(typeof(VisualElementFactoryRegistry), nameof(VisualElementFactoryRegistry.RegisterUserFactories))]
[HarmonyPostfix]
public static void VisualElementFactoryRegistry_RegisterUserFactories()
{
foreach (var plugin in Chainloader.Plugins)
{
CustomControls.RegisterFromAssembly(plugin.GetType().Assembly);
}
}
oh ok thats cool nice
@stuck jasper the UI is being scaled
having to do this to even get that on screen
is normally 1.5f and 4
thats on a 4k display
links to this issue as well #1079614817083600906 message
yep, I changed the PanelSettings to not be absolutely sized but to automatically resize with resolution, like the game's UI
the reference resolution is 1080p
thats why its wanting a *2
I think it's much better this way since you don't have to jump through hoops to rescale things for different resolutions and calculate lengths from screen size
now you can just assume any screen is 1920x1080
and work from there
The easiest way to fix this is to make some constants
const float REFERENCE_WIDTH = 1920f;
const float REFERENCE_HEIGHT = 1080f;
And use those instead of screen.width and screen.height
im going to not do that and just revert the changes in the mod.
everything I do is based on the players screensize not some arbitrary limitation
fixed
That will break every mod
that will not break every mod
Panelsettings are global
also im the only one who uses this stuff anyway
every mod is using the same panel settings
and you're not
SpaceWarp is using UITK
Space warp literally uses this
so if you do this, we'll just have to mark SpaceWarp as incompatible with your mods
this is false. since that gets applied to the UIdoc that im using.
There is only one panel settings object
each ui has its own doc
Every ui document references the same
Its hella inadvisable and non performant to use multiple
Last lind
yes, exactly
lind
The last line shows that it is referencing the global one, it doesnt copy it
if you're so hellbent on going against the flow and making things harder for yourself, make your own PanelSettings and don't reference mine
the only one making stuff harder is you. by changing stuff that does not need changing.
are you aware of the fact that the library was in ** experimental ** state, and that things usually change between major versions? I warned you about this when you started using it, telling you that it's still in early stages and none of it is final
stuff like referenceResolution should not be set.
so everyone has to go insane going and manually rescaling all elements and their borders, text, etc, just because you specifically feel like doing it?
I don't think so
if spacewarp wants to scale based on 1080p then it should have its own PanelSettings, instead of making everyone else be limited to that.
Umm no
um yes
fine I will
Multiple panel settings are not recommended by unity
this is my mod and that's how I want it, and how most sensible people want it
make your own incompatible one
🤨🤨🤨🤨🤨🤨🤨🤨🤨🤨🤨🤨
You know that not everyone has a 4k monitor
So you want everything to be scaled to 4k?
Or wtv you make your uis?
I dont need to scale based on anything.
It has to be based on something
you end up with stuff like this #1079614817083600906 message
You made it in a certain size
if you do it wrong, yeah
Bet, you should do your panel settings 🤞
already have added my own into shadowlib
Great add more lag to your mods 😍
my mods are not laggy thank you.
anyway this has gone on way too long here, please go discuss this in your own thread somewhere
That reminds me @stuck jasper you can wait for the size of a window to be calculated
#🔴mod-dev message linking this here for future reference
Theres a event for that
oh that sounds good
awesome, thanks
am a bit confused on how to put the window in game
oh ok, that makes more sense
@stuck jasper i think that RegisterCallback<ClickEvent> isnt working
i'll upload my spacewarp changes to a branch so you can test yourself, but i registered it in 3 diffrent places and no luck
also for some reason im getting 2x logs? lmao
the grey time logs are the right ones btw
the other idk where they're from
@stuck jasper https://github.com/LuxStice/SpaceWarp/tree/new-console
btw fixed the double logging, and as an alternative, since the event isnt working, im just showing the whole log
The ClickEvent only works on some specific elements like the Button when you actually run it in the game and not in the editor, I was dealing with that issue in the mod list as well
this is what you end up needing to do
as you can see, Unity adds this to Button automatically:
so if you're having issues with a custom element not being clickable, you can just use this
oh but like in the UI Builder i could use an ClickEvent on a visual element
thats how i was testing it
Yeah, i don't know why it works there
tho AddManipulator is a public method maybe i can just add one?
It shouldn't as far as I know lmao
also, theres PointerDown, have u tried that?
lmao
theres like PointerDownEvent PointerUpEtc
probably its the same as Click event tho
I remember reading that that works, but I'd rather just use the actual Clickable since it's made for this purpose
but I guess it's up to you
no yeah it makes more sense to use clickables
tho i might leave the console as is, its pretty good tbh
but didn't you already code everything for the messages to be toggleable?
oh its literally just a bool that when you set disables the visual element xD
the thing is mostly that theres only a few logs that are extensive on KSP2
the toggle thing was mostly to hide those
i'll maybe still leave that on the class so its easy to add in the future if needed
https://github.com/jan-bures/UitkForKsp2/pull/1 @ebon seal I just noticed this, it is still relevant?
i dont think so? since they are already working
yeah, I thought so, just wanted to ask before I close it
np :)
UitkForKsp2.Controls
same for UITK
abbreviations are always in PamelCase
never fully capitalized

in pretty much every C-like programming language
it's disgusting
don't ever do it pls
it looks better tho 🙄
I beg you
imagine you were trying to turn it into a human-readable string
it would turn into like "U I T Kfor K S P 2"
based on the CamelCase rules that are everywhere else in the language
"UitkForKsp2" -> "Uitk for ksp2" makes so much more sense than "UITKforKSP2" -> "U i t kfor k s p 2"
yes, but for all intents and purposes it is a single word when written together like that, so it should use the same rules as other words in C#
look I know how to solve this argument
UnityUserInterfaceToolKitForKerbalSpaceProgramTwo.UserInterfaceControls
I mean its the only logical answer
Long ass class names
.uitkforksp2-base-control__label-container
seems like i can just inherit the .uss of the custom controls and it works
@stuck jasper
so no need to change the .tss
tho, any new theme that we make we gotta remind to also put the custom controls .uss on the Style Sheets
yeah, I mean you can import as many .uss files as you want in the .tss file
but the question is
how do you easily let mods choose whether to use KerbalUI or not
since it's set on the panel settings common for all mods
so change it for all mods at once?
but im pretty sure thats how the editor ie would change
mods that are not using KerbalUI.uss wont be affected
idgi
all mods are using the same panel settings by default
and one panel can only have one theme
across the board
and by default that theme is kerbalui
the theme only applies as a fallback for the uss
so if you have an UI with an uss that overrides every item, it wont be affected by theme changes
Yeah, it is lmao
Tho thats what themes are
also we can make every theme fallback to KerbalUI if you so desire
#1085537097714245662 message
just set it as an inherited Theme
it's not a "fallback", it is the theme
and mods can build on top of it with their own styles
I keep saying
you can't have multiple themes
i do understand what ur saying
in UitkForKsp2
hmm
then I don't get what you mean by saying "inherited theme"
yeah maybe for UITK for KSP2 in general might not be viable
there's no inheritance, there's 1 theme only
you'd need to create custom panel settings for each window that wants a custom theme
but we should at least give players the uss "themes" (parts manager, settings replicas etc)
yeah i see what ur saying
ill look into it in more detail tho cuz that seems a bit dumb
but tbf unity is dumb most of the times
if we do this, players can add their own theme selection if they want
tho yeah, its not a good idea to have a global theme
user themes make sense, but only to a very limited degree
like some colors etc
in general, mods should decide their layouts and styles
hmm, maybe we should give 2 types of themes... Colors only and a full rewrite
tho thats a fuck ton of work
so players can either just match the Flight UI colors, or if they desire, use the actual Flight UI replica
for some mods/windows it makes more sense to emulate the game's Settings style (SW mod list), for some it makes sense to emulate the VAB window style (STAGE for example)
etc
yeah, thus we giving the option by only changing colors, or the actual element's size/padding etc
but again, that'll require us to write it like that
need you to do that game UI rewrite first, so they can style not just mod windows but all windows

we can have the colors and UI style be separate and non-overlapping

when i feel like the game's UI is more stable i will 🤞
but yeah this whole idea is something for the future
im happy that i can have the controls looking decent w/o having to make a new .tss
I'm adding it to my to-do
something like a general UitkForKsp2-level theme framework
which does not rely on the Unity .tss files
yeah thats a great way to put it
something like Color-UI Style pair
where u can select both to replicate the game's ui
Or
select each and just affect the colors or the UI style
my general idea for it is to have basically something like this:
var myUiDocument = Window.CreateFromUxml(...);
myUiDocument.SetStyle(UitkForKsp2.Styles.SettingsStyle);
which would set the general layout and style of a specific window, and then something like a dropdown with separate themes (mostly minor things like colors, rounded/straight borders, etc, maybe later something like different icon packs?) in the BepInEx configuration of UitkForKsp2
yeah, that works great too
we probably could so something like SettingsStyle.Color SettingsStyle.UILayout SettingsStyle.Borders
but for that we'll need to segregate the changes very well
SettingsStyle being a UITK for KSP2 class with an implicit conversion to UITK StyleSheet
you can just make it if you want, since you have the controls anyway
it should just be as easy as putting a package.json in a folder with the .cs files
and then we can probably just import those as a git submodule into a new project in the UitkForKsp2 solution
to build them for release
just put them in the UitkForKsp2.Controls namespace
it already is! okok i'll do it then
tho just UitkForKsp2 stuff or do you also want to include template stuff (ie and example window?)
probably just UitkForKsp2 right=
not really for the Unity package
should probably just be the controls
you can make the repo if you want since I'm assuming you'll be using it the most, or ofc I can make it if you want and you can PR
up to you
better to keep it with u since u have the UITK for KSP2 one
tho is it not possible to give me commit perms? or thats only with an organization?
either way im ok with doing PRs
sent you an invite
now i have an "add file" button so i guess i can just commit to it
i'll do that in a bit tho! 🤞
whenever you want
I'll set up the integration into the main UitkForKsp2 repo a bit later
@stuck jasper embeded or local package? i feel like embeded would be better to avoid users modifying the controls
they can still look at the code tho
also embeded can be packaged with the template
and will (almost) always stay updated
what difference does it even make? The end result is the same, your package gets installed into Library/PackageCache/package.name.version, afaik it's just about the process of how you make the package
(i misread add as adhd for some reason)
lmao a button that changes your screen every 30 seconds
what the actual fuck
why would the code need to be embedded in a Unity project to support being added from a git url
as opposed to loading the .unitypackage from a local file
embeded just means that it will be in here instead of your assets folder i think
yeah I just mean
why the hell would it even be an option for it not to be there
????
cuz unity packages are like that :3
probably cuz embeded they can control the source code more?
and that way can have at least some security control over the packages
why are all packages not considered "embedded"

the only difference is that they're wrapped in an unnecessary Unity project folder structure
which adds 0 security or control
also you have a direct link to their github
so you can see the source code
that makes 0 sense
I mean just distribute the package as source????
exactly
I don't get this as all
if you just put some .cs files and a package.json in a github repo and install it from there, vs. if you put the .cs files and package.json inside a Packages folder inside an empty Unity project, what the fuck does that change for anyone
Unity be iike
each time when I encounter another one of their dumb design decisions, I tell myself that their stupidity can't suprise me anymore
and then they do it again
and I'm surprised once again
LMAO
dw it gets worse if you go into the unity tools
like the Grid system that they have, or their vegetation system, or their terrain sculpting system
the list goes on
also dont forget their HDRP settings
or the fact that until 2019 (i think) Dark Mode was under a paywall
I hacked unity to add it while it was
heh i got used to it lmao
I couldn't so I literally used a decompiler, found the function address I wanted, used an online assembler and changed the code for it by editing the EXE (I was following a tutorial)
I am so glad I never had to deal with Unity before, and I just hope I never will outside of KSP modding
and even that is already too much Unity for my taste
Ehh unity is fine to me
yeah tbf unity for like most part is a pretty good tool
in a very accessible language (C#)
and you have a lot of freedom w it as for example Unreal not so much
huh actually
don't even need a separate repo for the package it seems
can just make it a subfolder in UitkForKsp2
if you want, but we need to first set up the new C# project, the whole post-build pipeline for it etc
btw I just tested just installing this from a repo:
and it does work but
lol
it needs meta files
@!#$
@stuck jasper should i include the curve editor?
its functional as of now (tho i forgot the Add/remove keyframes)
but i dont see many people using it besides me
I mean why not
If someone wants to say remake the KAL controller for example it could be useful
okidoki
its a big buggy but thats literally unity's curves being buggy lmao
if you move a key past another, both will "merge" and only way to fix that is by deleting one of them lmao
you cant separate them (afaik)
Will definitely be useful when part and planetary mods start being made
deal then, i'll also include this
im guessing there's demand for float and int only textfields right?
i put that on my todolist for the unityPackage
if not i'll just release as is
yes
and while you're taking requests: ListView, Vector2/3/4, SliderInt, Color 😁
also, I've seen you somewhere using dropdowns. Are those already ready?
they are actually already in UITK
we just didn't know before
because in its eternal wisdom, Unity didn't document most of the controls that it had until like version 2022
https://docs.unity3d.com/Manual/UIE-ElementRef.html 2021.3, pardon me
oh yes, shadow discovered them for runtime, ok
and to get them for editor, what would be needed?
nothing
just use them in your UXML
like <ui:DropdownField>
and they'll appear in the UI Builder preview like usual
shush, you were talking about the foldout
rare munix L
i felt it in the force
but, but... I'd like to drag and drop it 😛
drag and drop what
where Vector4IntField?
rip
yeah, you just need to look whether they're in the UnityEngine or UnityEditor namespace, but those are available at runtime since they are in UnityEngine

it's unbelievable that they just straight up don't have them in the documentation for older versions when they're available there too
my docs is decompiled dlls
yeah but i remember that there was a issue
yeah there was
that u couldnt add things to it?
so wait the thing in the editor is not working but the things hidden are?
I mean I was testing that whole thing in the game

just not via code
no it was working just as intended
but the intended usage was dumb as fuck
you have to have a fixed height for the template item
ur ok with me making these available in the editor with UITK for KSP2?
which makes no fucking sense
actually that how these lists work on IMGUI to
when ur working on the editor, iirc let me test
anyway, the list view was never meant for the thing I tried to use it for
it's only meant for lists of like millions of items that need to be virtualized
^
its pretty much just an empty class that exposes it to the UI Builder
literally this is all the code
sure, I was going to suggest that to Falki anyway
but why the hell aren't they already
they already have those defined
they have
Wait i think that i've tried w/o them fro the dropdown and it didnt work
let me try again tho? it was in the very start of my UITK journey
I just mean, how come they don't show up in the Builder as is?
since they have all the necessary stuff to be exposed to it
like that should be it
i'd say they filter what appears on the Controls list
mfers
it makes sense to, probably its still not how they like it to be
(tho its a bit dumb since the whole package is experiemntal)
why would you purposefully hide most of the available controls
if you don't want them to be used, don't put them inside the package
like cmon
because not ready, like list view ie
But again
the package was experimental in this version
so, don't add them yet
so????
make a build w/o them while ur working in it?
box is probably the most useless control you could ever want wtf
literally just a background
also maybe this answers your question munix
These are BoundsField and BoundsIntField
different names
you can't change the labels
??
what question?
"Why not make them available"
.
BoundsField on top
BoundsIntField on the bottom
you can't change those labels
probably only works at runtime
why does that mean DropdownField can't be in the builder?

to be fair I still don't understand exactly what I'm supposed to be seeing in the image
what labels can't I change? x,y,z?
or the ones on the left?
am confusion
i mean those is just dumb yeah
probably they have like code standards to follow before releasing things? 
i imagine Unity being quite strict about their code
\j
so that's why they release them for everyone to use but just hide them from the builder

Lmao
tbf the builder is pretty buggy so i wouldnt be surprise if this was one of the first versions of the builder
just another common Unity L
Lmao yeah
also wtf is groupbox for?
This is an enclosing container for a group of IGroupBoxOption. All group options within this container will interact together to allow a single selection, using the DefaultGroupManager. Default options are RadioButton, but users can provide other implementations. If no IGroupBox is found in the hierarchy, the default container will be the panel.
ok so basically a tab manager?
it's basically the same thing as <fieldset> in HTML
one thing that they should have is a tab manager
Like TabGroup and u put TabControllers on it
eh that's a bit advanced for a "simple" UI control
it seems to me like they were mostly inspired by the scope of elements in HTML
heh fair
and you can relatively easily build a tab system out of the already existing elements
yeah that one is like outta nowhere lmao
it's even a runtime one, not just editor-only
why
oh great obviously they have a Image deidcated thing
BUT DONT MAKE IT PUBLIC
LIKE
i've been using visual elements w background images 😭
asfsgdjkh
<ui:Image style="--unity-image: url('path/to/image');"/>
it doesn't even have a "src" attribute
you literally just style it
😭
The Image element is typically used to display an image within a specific area of a UI, such as an image gallery or an avatar
in a user profile. It provides more fine-grained control over the appearance of the image, including options for resizing, scaling, and cropping. Use Image when you want the size of an image to drive the size of an element in the layout. You can also add additional elements to the Image element to create overlays or add interactivity. However, for performance reasons, specify a fixed width and height if you use many instances of Image.
Unity u good?
so BASICALLY
ok why
WHY
I was like half a day trying to make a texture always be a certain size
(like 256x256 so downsize or upsize it)
😭
well this will be fun
each 1 is one control that unity doesnt have
i already did 7 
fortunatelly is just copying the name
well... you see...
YEah the game's UI is so much going to be remade in UITK https://docs.unity3d.com/Manual/UIE-uxml-element-ProgressBar.html
even progress bars
which they dont even have available in IMGUI
you literally have to make a custom IMGUI object for that
and add it to the context menu
for you to be able to use one the editor

Actually its an integer not an int 
MEANWHILE ON VECTOR3 THEY USE INT
😭
doesnt even fit in a max sized window 
imma need to make custom UxmlTraits for some of these
IE image you cant pick the image in the builder
but thats light work
also some of them have visual bugs when u use 
make sure to use dots
I prefer semicolons
imma start to use this shit its actually pretty funny
imma vomit
ngl most of these are useless lmao
only the (TypeHere)Fields, radio button group, dropdown and message box
tho i need to find a way to fix this
i suspect that its just a couple of .uss classes that are missing tho
cuz on the unity theme it works
I feel like those could all be sort of useful?
UR FUCKING KIDING ME THAT THE FLOAT/INT FIELD ALLOW FOR OPERATIONS
yeah it's just because they have elements inside them that are styled by KerbalUI partially
I'll need to add KerbalUI styling for all of them
HelpBox, i mean sure, RepeatButton is useless from what i see, Progres and RadioButton gruop are the only ones actually usefull there
PopUp window is a subElement of the dropdown
this cant go wrong at all
it instantiates a popup window when pressed
RadioButton only works if inside a RadioButtonGroup
(sure its useful but i wouldnt consider it a Control, more a subElement of RadioButtonGroup)
maybe you can disable it? let me check
not on the builder
I mean popups seem generally useful even for non-dropdowns?
afaik dropdown is just basically the UXML equivalent of a <select>
you open it, and select 1 item from a list
popup can contain anything
dropdown yes, popup should only close when you click outside of it/press esc or something
though I see that you need to implement that functionality yourself
and if repeatbutton works the same way as in IMGUI, it's also pretty useful
some mods use them
(the IMGUI version)
repeat button is what?
when you hold it, the action gets repeated
probably yeah, seems like it
thats cool
i cant test that w/o a code tho 🙃
so for example holding "+" or "-" repeatbuttons
to continuously increase or decrease a value
yeah makes sense
to be fair I have no clue how much of their functionality all these elements have implemented in the preview package
Hmm i'll try to sort these into namespaces
but if they do what they're supposed to, then they seem useful to me
basically namespaces=folder in the UIBuilder
and either hide or create a Experimental namespace for the ones not usable as of now
also i'll make them either private or internal so no one mistakenly uses them in code
yeah im looking at you shadow
This way when you look for the class it wont appear on the auto-complete

oh dont worry. I will still get access to them.
lmao is your package publicized?
yeah I mean you're just wrapping them for use with the builder
the base controls will still be there and public
yeah you dont need it for anything
also will help when making the WindowControllers because you can just cast the it to its base so Q<IntegerField>("intField") == Q<IntegerInputField>("intField")
(yeah the naming is dumb)
didnt want to put Control on everything 
maneuver node controller uses repeat buttons, they're very usefull
Yeah that makes sense
also maybe remove controls?
as in the namespace, or the suffix?
tho this will also make the namespace for most controls be just UitkForKsp2
the suffix has to be there because the base name is IE Box>BoxControl
i cant have the same name unfortuantely
yeah nah, it should not be in UitkForKsp2
that'd put them on the same level as the UitkForKsp2Plugin
yeah better not, tbf its just 1 more click on the builder, and it stays open so 
seems good
i did have to do this for the dropdown control to look KerbaUI-esque
so maybe its just the same for the others?
just added base to the uss class and all fixed @stuck jasper
awesome
Oh fuck
most of these
are UnityEditor on this version
we loose every input and the progress bar
Repeat button maintains tho
@stuck jasper would it not be possible to update to an earlier version (given that it doesnt use any method from Unity that was added past 2020.3.33f1?)
Huh? Earlier?
Dont ya mean later @ebon seal
we are using the last available version of the actual package
if we wanted to go newer, we'd have to extract it straight from the core UnityEngine
not sure how feasible that is
@stuck jasper
https://i.imgur.com/UXMVbfq.png
i dont even have the old console 
actually, its bertter if you upload munix bcuz i dont have an acc
also about this, yeah, i forgot that UITK got merged with the engine... hmm well lets keep it like this ig 
btw funny ahah from unity
i'll have to write every field myself :D
(the ones that are editor onyl)
@stuck jasper can i just copy the body of the UnityEditor's stuff and paste on UitkForKsp2 changing the namespace?
for most this will work
I mean, sure, the Unity companion license should still apply to that
well might be harder than expected since 90% of the methods are protected and private
FUCK UNITY 🙏
@stuck jasper is UITK publicized on your nuget?
no, I was publicizing UnityEngine.Modules and UnityEngine.UITK by default at first but I updated it not to be
because the BepInEx assembly publicizer got recently updated to 0.4.1
i seem to be able to access more stuff on LFO (that has the nuget) than on the unity proj?
and that fixes the issue where Nuget packages didn't get publicized
are you on version 2020.3.33.1?
(of the Nuget)
yup
wait not .1
just 2020.3.33
internal virtual bool AcceptCharacter(char c)
{
return !isReadOnly && base.enabledInHierarchy;
}
method on the base class
im a bit confused
maybe somehow i can access internals with the nuget?
let me check the UITK for KSP2 project
version 1.2 should have PrivateAssets="all", so you shouldn't be getting access to UITK through it in your project at all
oh wait
it has that for KSP2.GameLibs
not for UITK
huh
which is probably publicized in the UitkForKsp2 project
jeez
need to update it again
nah it breaks things like that
well not impossible but i'll quite literally have to rewrite everything 
when you want to override a method
that's internal in the original but public in the publicized version
and stuff like that
oh i see
you can always just actually include the UnityEngine.UITK package yourself and publicize it
but it's for the best when that's not the default
but this is suposed to go in uitkforksp2 
i'll see what i can fuck
god FUCK unity for not making things protected internal
why would you want that.
specially the one im trying to target
basically you could make a input field for anything you'd like with it
by setting the Accepted characters and controlling pretty much anything that the user iallows to do while the Input is selected
btw @stuck jasper do the newer version of UITK still fall under that license?
I guess not 🤷♂️
great fuck me then 😭
illegal munix
IM GOING CRAZY WITH FUCKING UINITY UITK
bro
imma just do like scholsrat and display the text as red if it can't be parsed
GOD FUCKING DAMMIT UNITY
I mean 2022 LTS only just now got released
im sure that on the fucking rewrite that they did 2021LTS was already out
they usually release it sooner
but this is the 1st time that DOTS is on LTS
so it delayed
and I don't think jumping from 2020 to 2021 would be such a big benefit for them
2021 already has UITK on it
- 2021 already has float fields and int fields
- 2021 already has dropdowns native
etc etc
2021's unity editor is also so much better
They should jump to 22
PLEASE
unity should lend some devs to big games who want to upgrade their unity proj
its dumb that big unity games have to stay on older unity projs
and its mostly unity's fault
i upgraded like 12 games (albeit they were mobile games) from 2019 to 2021 LTS when i worked as a gamedev
yeah but they'd have to completely rewrite the entire game UI from scratch if they were going to use UITK
all i had to do was fix 1 dumb error, and the error was basically just re-creating the project settings
not rlly cuz IMGUI is still available
I don't think it makes much sense for a large game already in development
Whats stopping you?
so basically im using TextField as a base
since i cant use TextInputBaseField, bcuz unity uses internal
and i add a RegisterCallback<ChangedValue<string>>
and on that i check if its a float
but i can only seem to get up to 10 chars
Okay, why can't you publicize UITK?
@stuck jasper
for use within the editor
Publicize it in the editor?
as in, make a custom package where you rewrite all the .cs files to be public?
I mean ... a roslyn code rewriter could make short work of it
tbf im ok with having just the EditorFields in game and not on the editor
at least is something
(that being if we can publicize the UITK package)
tho i think there's problems with doing it even at runtime right?
well then all you need to do is add Publicize="true" like I said
no, nothing checks acesses at runtime afaik
it's only for compile-time
tho these controls are suposed to be going into uitkforksp2
There is no security manager for Mono, and also security managers are deprecated
if uitkforksp2 is not publicized they wont work on it
sorry, UITK in uitkforksp2 needs to be publicized
it already is
how else do you think I would be setting all the private shaders and stuff
A bunch of slow reflection magic
hell nah
i might be going actually dumb i think i was working on the wrong project all along

this override wasnt working earlier wtf
#1085537097714245662 message
im dumb 
@stuck jasper you should add an extension method to UITK For KSP2 that does the following
public static void SetAsDragDeadzone(this VisualElement @this) {
@this.RegisterCallback<PointerDownEvent>(evt => evt.StopPropagation());
@this.RegisterCallback<PointerUpEvent>(evt => evt.StopPropagation());
@this.RegisterCallback<PointerMoveEvent>(evt => evt.StopPropagation());
}
It'll prevent an element from sending drag events up
So that the windows don't get stuck on like text fields and such
Oh yeah I've been meaning to do that for a pretty long time now but I kinda forgot because I was focusing on other stuff
Thanks
I wrote that w/o even opening any uitk project lol and it just worked for schloshrat lol
thought it might also be a good idea to include it by default in the DragManipulator at least for the regular TextFields
Por que no los dos
yep
@stuck jasper this should be all you need
🙏
also @stuck jasper the selector, its functional and production ready
same deal as the other unity things
choices, are, separated, by, commas
and just realized i need to clean my usings 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TMPro;
oh by the way, I just wanted to ask - why is Image in "zExperimental"?
Experimental are those who you can't use in the Builder on their own
ie you cant set the image on the builder
oh, because of the "--unity-image" style thing?
i need to make custom UxmlAttributes for those
yeah gotcha
its more so they dont have a way to set on the builder natively
i left them exposed so that you can add them and later use Q<Image>("name") if you want, instead of having to instantiate them at runtime
ok so I got the ExposedControls file to work and the controls show up in the Project tab
but the Selector file has a shit ton of errors in Unity
I'm assuming it's runtime-only?
since it seems to need publicized UITK?
oh i gotta check that
huh wierd, i though i had made it right 🙃
ig its an easy fix
i dont even use InputContainer lmao
OHHHHH
okok
i made a BaseControl
that has a bit more customizeability than the Unity's
oh lmao that makes a lot of sense
also this way we can target only our stuff if needed on the uss
also im pretty sure you can remove the using TMPro;, thats what the first thing is about
usually im trying things and vs auto adds usings but doesnt remove them 
yeah already did, all errors are now gone, thanks

the bool on the UI Builder is the "ToFirst" and "ToLast" buttons
and if you change the enum from Loop to Clamp it wont allow for you to go past max and min values
and will block the buttons 🙏
Oh also, im pretty sure it looks wrong for you
thats because of that whole thing with being able to override code set styles
you need to add this, and on the panel settings add it as an inherited
it also references some icon files
oh yeah
for me they were on Assets/
let me zip them a sec
so its easier for you ot download
of forget, forgot that discord also has right click save
got it, thanks
mind if I move RadioButtonControl out of the zHelpers namespace since it can actually be used manually like I showed you?
sure
also, is there a reason for them to start with the "z", since they show up at the start anyway?
it was because i had a group called Vectors, which were the MultiInput fields
like vectors and bounds
ah yeah

