#Space Warp
1 messages · Page 7 of 1
dw not much more will be done until your done w/ ur stuff
Huh
looking into the 1.1 branch in the main repo, I don't see the namespace in there either, and it has the using statement as well
so it can't be me who fucked it up right?
@mossy kraken did you add a file and forget to add it to git
Just go back a commit for now @wicked wyvern
Dont worry about rebasing until this is fixed

i just finished merging though
sinon refactor best
Debug console wont work but doesnt matter
yeah I use BepInEx console anyway
Why so many troll suggestions
because bored out of my mind
no laptop
sry :(
no troll though
i’m gonna make a mod for hay
that
@sacred jasper I assume I should not let the users disable SpaceWarp and Config Manager right?
(since SW has a dependency on CM)
also honestly, might just want to push 1.1 with colors patch and mod toggling
I imagine the new UI is going to take a while
and this other stuff is ready and people want to use it
private void Update()
{
if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKeyDown(KeyCode.C))ToggleVisible(!_drawUI);
where brackets
no brackets
ewy bad
wait
i wasnt updated
hm
just no more refactoring 🥲 I'm going to push tonight and then you can rewrite the code to Shakespeare for all I care
had the same question
ok I'll just restore them in my commit then
aaand I figured out the issue
when I was trying to replicate those changes
Ewy moved them from SpaceWarp/UI to SpaceWarp/UI/Debug
and Debug is excluded from git in .gitignore

it's easy to miss
ikik
namespace KSPython;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]
public class KSPythonPlugin : BaseSpaceWarpPlugin
{
public const string ModGuid = MyPluginInfo.PLUGIN_GUID;
public const string ModName = MyPluginInfo.PLUGIN_NAME;
public const string ModVer = MyPluginInfo.PLUGIN_VERSION;
private bool _isWindowOpen = true;
private Rect _windowRect;
public static KSPythonPlugin Instance { get; set; }
public override void OnInitialized()
{
base.OnInitialized();
Instance = this;
Harmony.CreateAndPatchAll(typeof(KSPythonPlugin).Assembly);
Logger.LogInfo($"Loaded KSPython");
}
private void OnGUI()
{
GUI.skin = Skins.ConsoleSkin;
if (_isWindowOpen)
{
_windowRect = GUILayout.Window(
GUIUtility.GetControlID(FocusType.Passive),
_windowRect,
FillWindow,
"KSPython",
GUILayout.Height(350),
GUILayout.Width(350)
);
}
}
private void Update()
{
if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKeyDown(KeyCode.P))
{
_isWindowOpen = !_isWindowOpen;
Logger.LogInfo("Toggled KSPython");
}
}
private static void FillWindow(int windowID)
{
GUILayout.Label("KSPython - A python console GUI for KSP2");
GUI.DragWindow(new Rect(0, 0, 10000, 500));
}
}
@wicked wyvern can you explain why this doesnt work
what does it do/not do?
i just want it to print Toggled KSPython when i press alt + p
or yk
toggle window
either or
and the mod loads fine and your window shows up by default when game loads?
that's very helpful 
and your message from OnInitialized doesn't get logged?
could you just zip the project up and send it to me so I can try to test it?
sure
(preferably without the Assembly-CSharp.dll)
if (GUILayout.Button("Send", GUILayout.ExpandWidth(false)))
{
_outputText += _inputText + "\n";
_inputText = "";
}
@wicked wyvern is this a crime?
I already posted both
lemme go grab the links again
also @wicked wyvern it wasnt me
it i swear to god it builds with the extra dll
AIDJAIOWJDIOAWJIOJAWIOD
@wicked wyvern
@wicked wyvern
it builds
with
both
bro
...
how in the... did you manage to do that
fr ^
I'm never getting this PR done am I 
smh my head
it's because you put that dll into the ksp_python_console folder in the root
that gets copied as a whole into the build folders
that wouldn't fix this
\s thx

the error is between your chair and your computer
the first one is the library and the second one just has examples on how to use it
when I clean the library up a bit, I'll make a release, but for now you need to build it
and for the test mod, just copy all of the game dlls into external_dlls and then copy over the ones from KSP2UITK's lib folder and replace the game ones with them
need a better process for that but for now it is what it is
so is there a difference between
KSP2uitk patcher
and just
uitkpatcher
i guess they have different code obv
my brain just died
the patcher project is what loads the new dlls from the lib folder into the game, and it has to be a separate assembly because it's a preloader patch
it runs before BepInEx does anything else
even before it launches the game
i wanna just like use this in my project already
what files do i need
i transfer over the assets
just use the UitkTestMod as an example
you'll need to remove the unity nuget package though, since that seems to break it for now
and manually reference the files
the same ones that are referenced in UitkTestMod.csproj
how to do that xd
.
literally just open your .csproj and copy that section over
ah ok
i mean
i just opened the uitktestmod.sln
<Reference Include="com.github.jan-bures.KSP2UITK">
<HintPath>....\KSP2UITK\Debug\BepInEx\plugins\ksp2_uitk\ksp2_uitk.dll</HintPath>
<Publicize>true</Publicize>
<Private>false</Private>
nice
yeah you need a reference to the library ofc
I have all mod projects in the same folder so I just reference it from there
you need to make an empty folder external_dlls for the ksp2uitk repo
if you mean it's not a SpaceWarp mod then yeah
or should i only use the dll from it
well
you have this
<Reference Include="com.github.jan-bures.KSP2UITK">
<HintPath>....\KSP2UITK\Debug\BepInEx\plugins\ksp2_uitk\ksp2_uitk.dll</HintPath>
<Publicize>true</Publicize>
<Private>false</Private>
in the test mod
yes, because it uses some static properties from that plugin
which is this
but it also needs to be loaded in the game
otherwise I wouldn't make a BepInEx/plugins folder with it and add swinfo.json
ill just change the proj path to be in the extrenal dlls folder
yeah i figured
UIDocument is undefined?
where is that supposed to be
same with PanelSettings
did you reference the lib folder dlls and remove Unity nuget package like I said?
how to remove?
just open the .csproj and delete the line with it
or just right click the reference in VS and click delete or remove or whatever
the one that's called something like unityengine.modules
whut
o
that's definitely not in a .csproj file
.
<Reference Include="UnityEngine.UIElementsModule">
<HintPath>..\external_dlls\UnityEngine.UIElementsModule.dll</HintPath>
<Publicize>true</Publicize>
<Private>false</Private>
</Reference>
this?
nope
<Reference Include="UnityEngine.UIModule">
<HintPath>..\external_dlls\UnityEngine.UIModule.dll</HintPath>
<Publicize>true</Publicize>
<Private>false</Private>
</Reference>
this?
the one of your mod
im trying to run the testmod rn
oh lol
well then just the other question
did you replace the game's dlls with the ones from the KSP2UITK folder?
KSP2UITK/ksp2_uitk/lib/
there's dlls
copy them into the project's external_dlls folder
yes, I'm aware I'll have to either streamline this stuff somehow or document it extremely well
now if it even makes window
🥲
dw this is already amazing
im just fucking dumb xdd
i just had a 12 hour drive for skiing

so I presume it's working?
nope
...
it should just be there
and KSP2UITK doesn't show up?
no
then you did something wrong with it 
and the patcher is in the patchers folder?
||THAT'S WHY I BUILD THE WHOLE BEPINEX FOLDER STRUCTURE FOR YOU||

so you can just copy BepInEx over to your game folder
...
i did
and there isnt anything
oh
wiat
no i didnt
AWDIJPAWDIAIWDJIAWD
WOOOOOOOOO
YEAHHHHHHHH
@wicked wyvern add ksp2_uitk into the dependicies of testmod
obv
alr
now to make it work in my mod
:c
minux
it uh
its not working again
the uidocument is undefined
even though i have good csproj
and all dlls
@wicked wyvern :C
yessss
ok
lookin good
munix i see the dynamic function example
but how do i actually apply css to all of this
or whatever the equivalent is
or is it in built
would have to investigate a bit more first to figure out styling in C#
i thought it was like this
private void CreateDynamicGUI()
{
var window = new VisualElement();
window.style.backgroundColor = Color.black;
window.style.flexGrow = 1;
var outputContainer = new ScrollView();
outputContainer.style.flexGrow = 1;
var outputLog = new Label();
outputLog.style.color = Color.white;
outputLog.style.whiteSpace = WhiteSpace.Normal;
outputLog.style.flexGrow = 1;
outputContainer.Add(outputLog);
var inputContainer = new VisualElement();
inputContainer.style.flexDirection = FlexDirection.Row;
inputContainer.style.marginBottom = 5;
var inputField = new TextField();
inputField.style.flexGrow = 1;
inputField.RegisterCallback<KeyDownEvent>(evt =>
{
if (evt.keyCode == KeyCode.Return && !string.IsNullOrWhiteSpace(inputField.value))
{
AddToOutputLog(inputField.value);
inputField.value = "";
}
});
var sendButton = new Button(() =>
{
if (!string.IsNullOrWhiteSpace(inputField.value))
{
AddToOutputLog(inputField.value);
inputField.value = "";
}
});
sendButton.text = "Send";
sendButton.style.width = 50;
inputContainer.Add(inputField);
inputContainer.Add(sendButton);
window.Add(outputContainer);
window.Add(inputContainer);
var uiRenderer = GetComponent<UIDocument>().rootVisualElement;
uiRenderer.Add(window);
}
but it doesnt work
so ig not
no errors though
it stopped working
just like
for no reason
I can take a look at it tomorrow, but now i just got into bed
gogo sleep
makes uitk lib
shows how to use it (thx)
leaves without explaining how to make the bundles
nvmmmm
i got
it
to
work
woooo
gonna make it moveable
xd i just realized we were in sw thread not uitk
Will colors update this weekend? Or during the week?
Colors needs feroucious updates but wont be able to do them in ze weeknd
... just compile 1.1.0 sw it should have color patch
if the question is when 1.1.0 release is
🤷
yeee
That sick Sinon!
Sorry! 😅 I did not know the word debug was banished to the shadow realms by the .gitignore file
forgot to submit the PR yesterday, even had the comment filled out and just didn't click the button to create it lol
Headaches are fun :3
Hihi :3
confusion
OwO?
Whats this
I aint going firther on this conversation for my sanity 🙏
Sanity is a myth, but underatandable
that sucks 🙁
Make a lua console using ksps built in lua interpreter
So @wicked wyvern you said to release 1.1.0 w/o UITK?
might be for the best
it will take some time
just need someone to take a quick look at the mod toggles not being vertically centered like I described in the pull request
(for 1.1)
other than that, everything seems to work fine from my testing
aight, ping me when that is done
sure, like I said, just need someone here to take a look at it
ohh, I missed "someone"
since I couldn't figure out how to do it for some reason
and the method used previously didn't seem to work
Odd, the 0.3 method is exactly the same
I don't think we changed that part of the bundle?
honestly I could have just goofed up something
by method I don't mean method as in code btw
the way that the centering was done previously didn't work for me
which was by adding a GUIStyle with a specific height iirc
anyway I copied that part over and it didn't do anything
also tried adding flexible spaces above and below the toggle itself and wrapping that whole thing in GUILayout.BeginVertical and GUILayout.EndVertical but that completely messed up the whole layout
the version of SpaceWarp you have is a bit older than the current one?
It brings back the trimming issue
And the unsupported issue?
And I didn't see any toggles
Oh im on the wrong branch
duh
Well I have a few issues currently with yours
The revert changes button does nothing
It does not "detect" changes
It does update the output file at least
@wicked wyvern
Actually it only detects them when you reenable it?
It's acting strange for me
Like I enabled mods I had previously enabled w/o restarting, and it says there were changes
I mostly just re-integrated the 0.3 code for the toggles and made it work with the patcher
it's possible I missed something somewhere
also
I'm dumb
enable all/disable all toggles SW and CM when it shouldn't
just noticed that
@wicked wyvern I honestly think we had a reversion in the asset bundle for the project
lemme fix that
Use this bundle instead maybe
Yep @wicked wyvern that asset bundle fixes it
oh duh
I had _toggles = _initialToggles instead of _toggles = new List<(string, bool)>(_initialToggles)
in Start()
alright that might finally be everything with the toggles fixed
I'll test it again a few times and then I'll push the fixes
i would like to note
that
"making it movable"
is impossible
i tried for 15 minutes and couldnt do it
aka impossible
does that work ^
can you maybe
paste the code
or give me a link
???
im not gonna transcribe it xdd
thx
// Register mouse events for dragging
_window.RegisterCallback<MouseDownEvent>(evt =>
{
_isDragging = true;
_previousMousePosition = evt.mousePosition;
});
_window.RegisterCallback<MouseUpEvent>(evt =>
{
_isDragging = false;
});
_window.RegisterCallback<MouseMoveEvent>(evt =>
{
if (_isDragging)
{
var delta = evt.mousePosition - _previousMousePosition;
_window.style.left = _window.layout.x + delta.x;
_window.style.top = _window.layout.y + delta.y;
_previousMousePosition = evt.mousePosition;
}
});
munix this was my solution before
(it doesnt work)
just opened rider to check what i did yesterday :D
@sacred jasper hopefully everything in the feature-mod-toggles branch should be working now
oo
been testing it and fixed some other small bugs I noticed
now to finally start on the UI
It seems to be working from testing it with a few mods and disabling/enabling some of them.
The toggles are once again not centered vertically, and I tried multiple methods (including the 30px thing that was in original 0.3) and failed, so I'll gladly leave it to someone else to deal with, since I'll soon be attempting to rewrite the whole UI in UITK anyway
i had the exact same issue when i made the mod toggle
cheese somehow fixed it 🧠
no clue how
and did again: #1079531175380521043 message
turns out the fixed bundle from 0.3 had been reverted to the old one for some reason
replacing it worked
nice
doesnt work either
i think i did it right, and yeah it doesnt work
You can just pull it in then
huh?
yeah i have that folder
I just cloned the branch into an empty folder and everything is working fine
not sure why you have that
e
i did a full rebase
why isnt the patch in the patching folder?
why is it in a seperate folder
because it's a preloader patch and needs to be its own separate assembly
ah ok
makes sense
If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore.
its the build error ^
ok
so basiccly
you cant open the SpaceWarp folder thats inside the repo seperatly
you need to open the entire repo folder
nice ui you got there

@wicked wyvern it works!!
very niceee
quite pog
Now we need to add localization to those messages
yep, I added them into the localization file, just need to be translated
and just into Portuguese for now I think so just 4 quick translations
I could have just google translated it because it's really simple, but I just left the english variants
@gilded kettle looks like theres slightly more for you to translate
oh yeah but I forgot the "x changes detected" message, I just realized
that one is a literal
Should I use something like "{0} changes detected, please restart to apply them" and String.Format?
in this case it's not really needed since it's at the beginning of the string, but still feels like good practice to do when the text contains a variable
where are the localization files rn?
i can add another one :D
probably in assets dum
SpaceWarp/SpaceWarpBuildTemplate/localizations
ye
no actually
yeah
ok
bro these are some wild translations
ah
they're the new ones
nvm
:d
can i just add another row?
or how does this work
yeah ofc
kk
just pushed the one additional localization
it's at the beginning of the string in English
also true
it could be anywhere in some other language
probably?
xd have u not tested the localizations??
works
happy?
and I was not the one who added portuguese
so I don't know if the person who did tested it
I just added a few more rows
yeah, makes sense
Mostly cuz its in parentheses
shouldnt the portegese one also be lowercase?
idk the language so maybe not
Like its meant to be
Version: 6.9.4.20 (outdated)
^ funi
Munix do you have a preview of what your stylesheets look like?
Allow Space Warp to check versions for mods over the network?
...
over the network
are we using dial up
the internet
is the internet not a network?
and is dial up not the internet?
semantics all over the place
this is such a non-issue lol
xd im just gonna switch it to internet
smh my head
cuz im here already
why not revise it?
it doesn't make sense to change though
if you want, you can check mod versions through LAN
^^^
there's no reason to but you can
🚲 
haven't managed to do almost anything yet, was fixing the toggles thing and then making dinner, so I'm just now getting back to it
its on the network
Does anyone get what I meant by this?
nope
Bikeshedding
what
I am boredom right now
Maybe I should try to get IKVM to work with space warp
dear lord
even the python interpreter thing sounds less cursed
i got it working
Is off really that long in russian
lol kinda yeah
damn
the word is like an adjective that means off
Zapnuto/vypnuto is not the shortest but still much shorter than that
xd yeah
This is literally used in the autoscroll button for the console
oh im sorry

you dont have a dedicated word for autoscroll?
xd i guess i could just put "off"
im sure people understand it xd
or we can just make it a checkbox or toggle or something?
Yep its settled Im making a space warp mod that allows people to make mods in Java
Im too bored
Honestly might need a preload patcher to load IKVM early, then build the mod in Java
No its java ... compiled to CIL
So its java compiled to a dll
can you unmake it 
^ just dont
honestly getting lua functional would be much better
since there will actually be people who'd use that
Might not be impossible
some sort of a transpiler from it to C# and then running it in C# (roslyn) perhaps? so that you can use the full API
So a preload patcher that transpiles lua into c# for spacewarp to load

sounds like a fun challenge
It kinda does
Or we can see how the normal game is going to use lua and yknow
MoonSharp, probably?
For sure
can confirm
but the solution they're using will require API wrappers and what not it seems
that's why I suggested transpiling directly to C#
I don't think you need to transpile
well honestly, it might just be easier to wait for the UI rewrite
alr alr
you could probably cook something up with reflection, some kind of uhhh
generic api wrapper thing
I guess, yeah
which you would need when transpiling anyway
because you can't do a lot of the things you can in lua in C#
metatables in particular might be hell
Metatables would be hell
here's some tutorials on interop https://www.moonsharp.org/objects.html
For these reasons MoonSharp by default requires an explicit registration of the types which will be available to scripts.

UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic;
interesting 
technically it should be possible to just patch that in the game's code and be done with it then?
there is already (at least some part of) support for loading Lua through the stock modloader
@wicked wyvern
yeah?
what?
aiwjdioAIODIOWDJIOAWJDIOAWDI
to be honest, I don't see much reason to implement lua right now at all
I mean, even outside of spacewarp
the benefit of lua mods is that they're easier (debatable) to make
and that they provide a sandbox
you likely wouldn't do the second
and the first requires extensive documentation and support
if they're not easier to make and they don't sandbox anything, you might as well use C#
see now that's a good reason
xd
the true motivation
{0} changes detected, please restart to apply them
@wicked wyvern how to translate this
do i keep the {0}
yes
k thx
that's for string.Format
@little bay can you patch an abstract method with harmony?
no, even if you could, nothing ever calls it
:c
alright time to do a funny then, if I can't do that
No problemo!
what is the funny
To patch spacewarps own OnPreInitialized method with this mod :3
the basespacewarpplugins onpreinitialized
that method is British
fuck
one hand glide typing
virtual
that method is virtual
yes
well
okay
if you patch a virtual method
it will be called for one of two reasons
- they didn't override
- they override and call base.OnPreInitialzed()
I was like "wait is it actually called OnPreInitialised??" lol
they have the option to override and not call the base method though
in which case your patch will not run
but there's a better option you haven't considered
patch the loading flow action instead!
wait I'm being a dumbass
thank you
I can just completely replace it IIRC?
just prefix it and return false?
Cuz I'd rather not do IL Manip
just gonna quickly publicize the SpaceWarp package :3
@little bay is this not how you publicize a nuget package?
<PackageReference Include="SpaceWarp" Version="1.0.1">
<Publicize>true</Publicize>
</PackageReference>
Had to manually copy over the dll, fun
- 1 _ that most private members already start with
i need more
btw you can prepend the special chars such as * and _ with a backslash to escape them
on discord
______________________________________________________________
/___________________________________--
____________________________________________________--
Fun times
I might have actually made a lua mod for KSP2
I have to test it ofc
Lua has been loaded into KSP2
Now time to do something less trivial w/ it
This was that code by the way
Logger.LogInfo("Hello from Lua!!")
That was all it was
now time to test with the following
I still have to add GUI stuff to it
as static functions aren't immediately registered

[Error :Lua for KSP2] MoonSharp.Interpreter.ScriptRuntimeException: cannot access field RegisterMenuButton of userdata<System.RuntimeType>
at MoonSharp.Interpreter.Execution.VM.Processor.ExecIndex (MoonSharp.Interpreter.Execution.VM.Instruction i, System.Int32 instructionPtr) [0x0011c] in <661463f476824bc5b21937f8da6297a2>:0
at MoonSharp.Interpreter.Execution.VM.Processor.Processing_Loop (System.Int32 instructionPtr) [0x00772] in <661463f476824bc5b21937f8da6297a2>:0
at MoonSharp.Interpreter.Execution.VM.Processor.Call (MoonSharp.Interpreter.DynValue function, MoonSharp.Interpreter.DynValue[] args) [0x00075] in <661463f476824bc5b21937f8da6297a2>:0
at MoonSharp.Interpreter.Script.Call (MoonSharp.Interpreter.DynValue function, MoonSharp.Interpreter.DynValue[] args) [0x0009c] in <661463f476824bc5b21937f8da6297a2>:0
at MoonSharp.Interpreter.Script.Call (MoonSharp.Interpreter.DynValue function) [0x00000] in <661463f476824bc5b21937f8da6297a2>:0
at MoonSharp.Interpreter.Script.Call (System.Object function) [0x00008] in <661463f476824bc5b21937f8da6297a2>:0
at LuaForKSP2.PreinitializePatch.LoadLuaPlugin (SpaceWarp.Patching.LoadingActions.PreInitializeModAction __instance) [0x00104] in C:\Users\arall\source\repos\LuaForKSP2\LuaForKSP2\LuaForKSP2Project\PreinitializePatch.cs:109
at LuaForKSP2.PreinitializePatch.OnPreInitializedPostfix (SpaceWarp.Patching.LoadingActions.PreInitializeModAction& __instance, System.Action resolve, System.Action`1[T] reject) [0x0000f] in C:\Users\arall\source\repos\LuaForKSP2\LuaForKSP2\LuaForKSP2Project\PreinitializePatch.cs:19
When I don't get errors like this
Doing anything more useful would not be that easy atm
I'd have to create a full Lua API to interact with space warp and KSP2
Here is what I had
Also
@gilded kettle since we arent adding uitk to 1.1 just yet, we will release 1.1 with the colors patch after portuguese translations are don
Ok, i wonder if i can do it on the phone
I’ll obly have acess to a pc tomorrow
Let me download github here it might be possible
you can edit files on GitHub in the browser, too
I hate Unity's default theme so much
if you want to get rid of an ugly border, you have to override the base selector, the active selector, the focus selector, the hover selector
wtf is even this
and had to find a workaround for a bug with font assets
it's nowhere near done but it's starting to take shape I think
ooo
lookin good
I was so furious when I realized I had the base style set to the default editor one, instead of the runtime one
the editor one is much more forgiving and has way less defaults set
so it totally messed up the whole thing
so now I've been rewriting the selectors so that it does what I already thought it did 
example
🤮
why do they have their default theme written with so much specificity if they're expecting people to make their own styles
hopefully
fonts still may be an issue, at least within the TextField
for some reason if the font asset that's used in it does not have a dynamic atlas, you can't input anything into the TextField manually (but still can paste text??)
it's apparently a bug they fixed in 2022.1+
lucky us 
for this testing i just exported the font file from the game and made the asset the way it works
i just modified the background image to add a border
but I don't think the game uses that method
so we might need to use just the default font within the TextField
well I want to use the game's own fonts wherever possible
to look as close to the stock UI as possible
i think the console is a terrrible place to enforce that rule 
I'm not talking about the console at all
this is super clean
please keep this
except use jetbrains mono nf
for icon support
you can have more fonts you know
one for text and another one for icons if you want
is that font even open-source or anything like that?
yes
it is
its the best thing ever made
have you seen the ligeratures
need to read the license
its open font liscenes
I mean I use only JetBrains IDEs
so I have the font everywhere
yes
so yeah I've seen the ligatures 😆
sexy af
i belive liscnese only applies on fonts forked from it
not on products
@little bay need a laywer
they are unreadable xdd
also they dont support non-latin
the game switches fonts when you go to cyrillic
They arent a lawyer?
i think they are
tbf having a custom font for the console for example isn't the worst idea
license looks good afaik
yep
thats what i said ^^
for other stuff idc
game font is fine, if unreadable
but console there is so much text packed together
we'll need to look into the non-latin fonts thing
but just opening the default game font on my pc, I see that it supports at least czech characters
like ěščřžýáíé
not in the slightest
it just switches fonts
but whats the question
if we can use this font
in the project
Yeah no need to randomly ping aaron
:c sowy
thx senpai ^
@timber cedar type something in cyrillic
I want to test it in the project that I have
the image is the game font
honestly I can barely tell them apart
the "l" is the biggest difference
honestly @sacred jasper I'm for trying to use the JetBrains font
^
if it means we wouldn't have to worry about switching fonts at runtime for different languages
it's worth it
plus it would most likely solve my issue with not being able to use the stock font in text fields

#1085537097714245662 message demo of all the UITK controls using the new skin
Well shit @wicked wyvern I might be able to get UITK in the next space warp release
I didn't expect to get the stylesheet done in one evening, so yeah, it might be doable
it might still have some issues but it's a good start
I just realized at some point we are gonna wanna make our own uitk based configuration manager
Or add settings for mods in the main menu
The latter of which is gonna be decently more difficult
But will look better
hm, yeah
Honestly might be worth looking into
Btw colors (on space warp) has an issue with normal textures, i have that fix on TUX and SORRY but still havent ported it over to SpaceWarp, as soon as i get home ill fix it and make a pr
Ill get home in about 10h
@wicked wyvern do you have the stylesheet you are working on, I want to start working on mockups of SW UI in UITK
you need to extract the realtimerounded-bold.oft font from the game, put it into Assets, right click it and do Create->Text->Font Asset
for it to correctly work in the editor
Just gonna quickly comment out the font definition as I don't wanna do that just cuz yeah
Toggle still be lookin like this?
Fine I'll grab the thing
oh yeah, if I styled the thing in general, it was messing up the Foldable since it uses a Toggle as well
and USS is sorely lacking any sort of stuff like :not and :has
so you need to use the ".toggle" class
for regular toggles
and ideally the .root class for your root element
since :root also seems a bit buggy
that looks ok to me
this is from the game
(screenshot from Action Group Manager)
oh so it is just that light
I also really wish that their border implementation supported dashed and dotted styles
since the game uses those heavily
but there's no way to switch border styles at all
would most likely have to be solved with custom background images
they should've just put a full HTML5+CSS implementation in unity
it is very barebones
they probably assume people will just use custom textures for most things
it does show up, but it looks like it's just a fallback font if anything
that's the one thing I want to add as a custom element
well, the first thing, rather
for comparison, this is JetBrains Mono (medium)
-unity-text-align USS property
there's a basic USS plugin for Rider, idk if you're using that
but it at least shows the possible properties and what values they can have
this no work though
.center > .unity-label {
-unity-text-align: middle-center;
}
<ui:Label text="spacewarp.console" class ="center"/>
Unless I don't understand how css works
> means that the selector on the left is the direct parent of what's on the right
you want .unity-label.center probably
So this
.unity-label.center {
-unity-text-align: middle-center;
}
should do the job
Why even have it restricted to .unity-label, I assume you're just applying the style to the root element of the content yuo're working on
I don't know if you're using it, but the UI Builder in Unity is pretty useful for quick edits to see how properties work and for hot-reload previews of your uxml
Keep in mind UIBuilder and hand edits don't always play well together
I don't see a UI builder?
you have to install it separately from UI Toolkit, from the package com.unity.ui.builder
oh
it will be under the Window/UItoolkit menu once installed
probably have a container VisualElement and set its flex-direction to row and add the two children
and then you can play around with their flex-basis, flex-grow and flex-shrink properties
why no grid though @unity 👀
I like grids, but I've found it to be not much of an issue
I mean you can achieve most of the same stuff with flexbox, but grid is just much more concise to use
@wicked wyvern how do I use the style sheet in the editor
As stuff just comes out looking like this
And this is what the preview looks like
in Assets, create a new TSS file (it's under UI Toolkit)
and set its stylesheet to the USS
then in your PanelSettings, set the theme to the TSS file
in the Builder, you can set the active theme in the top right corner
I'm cleaning up the unity project I have to push it to GitHub
How do I set the root visual elements class in this as well then?
huh, that still looks like the styles aren't in there, even without the root class
which you can add by clicking the root VisualElement in your hierarchy panel on the left and the adding the class in the StyleSheet section in the Inspector
hm, that's weird
This is what it shows me for the uss preview
btw you should not need the <Style> element if you set the theme in PanelSettings
but I don't think that's what's wrong
That ain't right
lemme reimport the uss
Assets/kerbal-ui.uss (line 5): error: Unsupported type TMP_FontAsset for asset at path 'Assets/realtimerounded-bold SDF.asset' ; only Font, FontAsset, Sprite, Texture2D and VectorImage are supported
Suggestion: verify the import settings of this asset.
Oh I might've made the wrong type of font
oh you need to create the font asset through Text, not TextMeshPro
Looking better but way too big
yeah I already changed the default size from 16 to 14 for JetBrains Mono
to be fair I was trying to stay as close to the game as possible, including font sizes etc
looking good
@wise swift this is what UITK will look like somewhat, you like it?
That is the correct font
title fonts are wrong
I looked into what Dakota said were the fonts the game uses but he only mentioned this one (Realtime Rounded), and the two extremely pixelated ones
the game uses another font as well
which I couldn't even find a .ttf/.otf file for in the game's assets
so it's probably just available as a texture
Unfortunately I have to be afk for the rest of the day or thereabouts
see you later then
Maybe add presets that you can save?
Shouldnt be hard
as far as I know it only uses 3 fonts.
yeah you're right, i was looking into it now and noticed SB Liquid has a dotted variant
that's what I couldn't find at first
gross
@wicked wyvern the first part of Cheese's KSP2 SDK is coming together