#Space Warp

1 messages · Page 7 of 1

wicked wyvern
#

Imma do the merging one more time and then just PR it and let someone else deal with it

#

👀

sacred jasper
timber cedar
#

yes

#

i like this

#

do that

wicked wyvern
#

am I just totally dumb

#

where the hell is that from?

sacred jasper
#

Huh

wicked wyvern
#

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?

sacred jasper
#

@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

timber cedar
wicked wyvern
#

i just finished merging though

timber cedar
#

sinon refactor best

wicked wyvern
#

🥲

#

I'll just test with the three lines that are affected commented out for now

sacred jasper
#

Debug console wont work but doesnt matter

wicked wyvern
#

yeah I use BepInEx console anyway

timber cedar
#

interface python into console

#

alt + p

sacred jasper
#

Why so many troll suggestions

timber cedar
#

because bored out of my mind

#

no laptop

#

sry :(

#

no troll though

#

i’m gonna make a mod for hay

#

that

wicked wyvern
#

@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

timber cedar
#
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

wicked wyvern
#

just no more refactoring 🥲 I'm going to push tonight and then you can rewrite the code to Shakespeare for all I care

timber cedar
#

xd

#

where console ui go

#

uhhh

wicked wyvern
#

had the same question

timber cedar
#

ewy commit

#

ill stick to my fork for now

wicked wyvern
#

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

timber cedar
#

🤔

#

🧐

wicked wyvern
#

it's easy to miss

timber cedar
#

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

wicked wyvern
#

what does it do/not do?

timber cedar
#

i just want it to print Toggled KSPython when i press alt + p

#

or yk

#

toggle window

#

either or

wicked wyvern
#

and the mod loads fine and your window shows up by default when game loads?

timber cedar
#

no.

#

there arent any errors

#

it just doesnt work

wicked wyvern
#

that's very helpful munley

timber cedar
#

munley yes

wicked wyvern
#

and your message from OnInitialized doesn't get logged?

timber cedar
#

no.

#

i think im being dumb

#

but like

#

idk

wicked wyvern
#

could you just zip the project up and send it to me so I can try to test it?

timber cedar
#

sure

wicked wyvern
#

(preferably without the Assembly-CSharp.dll)

timber cedar
#
if (GUILayout.Button("Send", GUILayout.ExpandWidth(false)))
        {
            _outputText += _inputText + "\n";
            _inputText = "";
        }
#

@wicked wyvern is this a crime?

wicked wyvern
#

it might be

#

somewhere

timber cedar
#

we dont need arrays were we're going

#

gui u good bro?

wicked wyvern
#

just use UITK

timber cedar
#

where

#

give

wicked wyvern
#

I already posted both munley lemme go grab the links again

timber cedar
#

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

#

...

wicked wyvern
#

how in the... did you manage to do that

timber cedar
#

xdddddddd

#

what did you dooooo

wicked wyvern
#

well to be fair I only deleted the file and ran the game

#

didn't try to build

timber cedar
#

fr ^

wicked wyvern
#

I'm never getting this PR done am I klueless

#

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

timber cedar
#

...

#

you should clean

#

i think its your fault

wicked wyvern
#

that wouldn't fix this

timber cedar
#

\s thx

wicked wyvern
#

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

timber cedar
#

oh damn

#

thats p nice ngl

#

im gonna switch to that

wicked wyvern
#

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

timber cedar
#

so is there a difference between

#

KSP2uitk patcher

#

and just

#

uitkpatcher

#

i guess they have different code obv

wicked wyvern
#

oh you mean KSP2UITKProject

timber cedar
#

my brain just died

wicked wyvern
#

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

timber cedar
#

i wanna just like use this in my project already

#

what files do i need

#

i transfer over the assets

wicked wyvern
#

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

timber cedar
#

how to do that xd

wicked wyvern
#

literally just open your .csproj and copy that section over

timber cedar
#

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

wicked wyvern
#

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

timber cedar
#

you need to make an empty folder external_dlls for the ksp2uitk repo

wicked wyvern
#

indeed

#

like I said, it's not finished

timber cedar
#

ye ye

#

ah i see

#

its just a plugin

wicked wyvern
#

if you mean it's not a SpaceWarp mod then yeah

timber cedar
#

or should i only use the dll from it

wicked wyvern
#

hm?

#

where

#

which dll

timber cedar
#

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

wicked wyvern
#

yes, because it uses some static properties from that plugin

timber cedar
#

which is this

wicked wyvern
#

but it also needs to be loaded in the game

timber cedar
#

so do i actually need to use this "mod" in bepinex?

#

yes

#

ok

wicked wyvern
#

otherwise I wouldn't make a BepInEx/plugins folder with it and add swinfo.json

timber cedar
#

ill just change the proj path to be in the extrenal dlls folder

timber cedar
#

UIDocument is undefined?

#

where is that supposed to be

#

same with PanelSettings

wicked wyvern
#

did you reference the lib folder dlls and remove Unity nuget package like I said?

timber cedar
#

how to remove?

wicked wyvern
#

just open the .csproj and delete the line with it

timber cedar
#

idk the command in junget

#

uh

#

ik im dumb

#

but which line

wicked wyvern
#

or just right click the reference in VS and click delete or remove or whatever

timber cedar
#
using UnityEngine;
#

this one ^?

wicked wyvern
#

the one that's called something like unityengine.modules

wicked wyvern
timber cedar
#

o

wicked wyvern
#

that's definitely not in a .csproj file

timber cedar
#

<Reference Include="UnityEngine.UIElementsModule">
<HintPath>..\external_dlls\UnityEngine.UIElementsModule.dll</HintPath>
<Publicize>true</Publicize>
<Private>false</Private>
</Reference>

#

this?

wicked wyvern
#

nope

timber cedar
#

<Reference Include="UnityEngine.UIModule">
<HintPath>..\external_dlls\UnityEngine.UIModule.dll</HintPath>
<Publicize>true</Publicize>
<Private>false</Private>
</Reference>

#

this?

wicked wyvern
#

those are obviously dlls and not nuget packages

timber cedar
#

idk i dont read csproj

#

but yeah

#

ok...

#

which

#

csproj

wicked wyvern
#

the one of your mod

timber cedar
#

im trying to run the testmod rn

wicked wyvern
#

oh lol

timber cedar
#

xdd

wicked wyvern
#

well then just the other question

#

did you replace the game's dlls with the ones from the KSP2UITK folder?

timber cedar
#

how?

#

oh

#

uhhhhh

#

w d y m

wicked wyvern
#

KSP2UITK/ksp2_uitk/lib/

#

there's dlls

#

copy them into the project's external_dlls folder

timber cedar
#

OH

#

AWHDADHUAWHDUHAWDAW

#

LETS GOOOOo

#

ok

wicked wyvern
#

yes, I'm aware I'll have to either streamline this stuff somehow or document it extremely well

timber cedar
#

now if it even makes window

wicked wyvern
#

🥲

timber cedar
#

im just fucking dumb xdd

#

i just had a 12 hour drive for skiing

wicked wyvern
wicked wyvern
timber cedar
#

holdon

#

it builedded

#

now i launch

#

is there a key to open the window 💀

wicked wyvern
#

nope

timber cedar
#

...

wicked wyvern
#

it should just be there

timber cedar
wicked wyvern
#

and KSP2UITK doesn't show up?

timber cedar
#

no

wicked wyvern
#

then you did something wrong with it munley

timber cedar
wicked wyvern
#

and the patcher is in the patchers folder?

timber cedar
#

...

#

bro

#

there is a patcher???

#

oh...

wicked wyvern
#

||THAT'S WHY I BUILD THE WHOLE BEPINEX FOLDER STRUCTURE FOR YOU||

#

so you can just copy BepInEx over to your game folder

timber cedar
#

...

#

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

timber cedar
#

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

wicked wyvern
#

would have to investigate a bit more first to figure out styling in C#

timber cedar
#

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

wicked wyvern
#

I can take a look at it tomorrow, but now i just got into bed

timber cedar
#

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

timber cedar
#

xd i just realized we were in sw thread not uitk

gilded kettle
#

Will colors update this weekend? Or during the week?

#

Colors needs feroucious updates but wont be able to do them in ze weeknd

timber cedar
#

... just compile 1.1.0 sw it should have color patch

#

if the question is when 1.1.0 release is

#

🤷

timber cedar
mossy kraken
#

That sick Sinon!

Sorry! 😅 I did not know the word debug was banished to the shadow realms by the .gitignore file

wicked wyvern
#

forgot to submit the PR yesterday, even had the comment filled out and just didn't click the button to create it lol

sacred jasper
#

Headaches are fun :3

gilded kettle
#

Hihi :3

sacred jasper
#

confusion

gilded kettle
#

OwO?

sacred jasper
#

Whats this

gilded kettle
#

I aint going firther on this conversation for my sanity 🙏

sacred jasper
#

Sanity is a myth, but underatandable

wicked wyvern
sacred jasper
#

Make a lua console using ksps built in lua interpreter

#

So @wicked wyvern you said to release 1.1.0 w/o UITK?

wicked wyvern
#

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

sacred jasper
wicked wyvern
#

sure, like I said, just need someone here to take a look at it

sacred jasper
#

ohh, I missed "someone"

wicked wyvern
#

since I couldn't figure out how to do it for some reason

#

and the method used previously didn't seem to work

sacred jasper
wicked wyvern
#

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

sacred jasper
#

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

wicked wyvern
#

huh

#

I just tested that this morning

sacred jasper
#

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

wicked wyvern
#

well, back to the drawing board then

sacred jasper
#

I'll see what I can do about the toggling issue

#

like the centering

wicked wyvern
#

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

sacred jasper
#

@wicked wyvern I honestly think we had a reversion in the asset bundle for the project

#

lemme fix that

#

Yep @wicked wyvern that asset bundle fixes it

wicked wyvern
#

alright, awesome, at least one thing fixed

#

thanks

wicked wyvern
#

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

timber cedar
#

i would like to note

#

that

#

"making it movable"

#

is impossible

#

i tried for 15 minutes and couldnt do it

#

aka impossible

sacred jasper
#

bruh

#

not true

wicked wyvern
#

seems like it needs to be done using events

timber cedar
#

does that work ^

wicked wyvern
#

well

#

you have to try

#

that's from unity forums

timber cedar
#

can you maybe

#

paste the code

#

or give me a link

#

???

#

im not gonna transcribe it xdd

wicked wyvern
timber cedar
#

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

wicked wyvern
#

@sacred jasper hopefully everything in the feature-mod-toggles branch should be working now

timber cedar
#

oo

wicked wyvern
#

been testing it and fixed some other small bugs I noticed

#

now to finally start on the UI

timber cedar
#

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

wicked wyvern
#

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

timber cedar
#

nice

timber cedar
#

i think i did it right, and yeah it doesnt work

timber cedar
#

?

#

where to get this

wicked wyvern
#

huh?

timber cedar
#

yeah i have that folder

wicked wyvern
#

I just cloned the branch into an empty folder and everything is working fine

#

not sure why you have that

timber cedar
#

e

#

i did a full rebase

#

why isnt the patch in the patching folder?

#

why is it in a seperate folder

wicked wyvern
#

because it's a preloader patch and needs to be its own separate assembly

timber cedar
#

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

sacred jasper
#

Now we need to add localization to those messages

wicked wyvern
#

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

sacred jasper
#

@gilded kettle looks like theres slightly more for you to translate

wicked wyvern
#

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

timber cedar
#

where are the localization files rn?

#

i can add another one :D

#

probably in assets dum

wicked wyvern
#

SpaceWarp/SpaceWarpBuildTemplate/localizations

timber cedar
#

ye

timber cedar
#

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

wicked wyvern
#

yeah ofc

timber cedar
#

kk

wicked wyvern
#

just pushed the one additional localization

little bay
wicked wyvern
#

also true

little bay
#

it could be anywhere in some other language

wicked wyvern
#

yep

#

knew it made sense to do it the way I did munley

timber cedar
#

how do we test them tho

#

just change the ingame lang?

wicked wyvern
#

probably?

timber cedar
#

xd have u not tested the localizations??

wicked wyvern
#

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

timber cedar
#

kk just asking

#

im not gonna translate spacewarp.modlist

#

cuz its the name

wicked wyvern
#

yeah, makes sense

timber cedar
#

is there a reason its lowercase?

#

should i keep it that way?

sacred jasper
#

Mostly cuz its in parentheses

timber cedar
#

shouldnt the portegese one also be lowercase?
idk the language so maybe not

sacred jasper
#

Like its meant to be
Version: 6.9.4.20 (outdated)

timber cedar
#

^ funi

sacred jasper
#

Munix do you have a preview of what your stylesheets look like?

timber cedar
#

Allow Space Warp to check versions for mods over the network?

#

...

#

over the network

#

are we using dial up

#

the internet

wicked wyvern
#

is the internet not a network?

wicked wyvern
#

semantics all over the place

timber cedar
#

not semantics beacuse its wrong

#

network could be lan

#

internet is more specific

wicked wyvern
#

this is such a non-issue lol

timber cedar
#

xd im just gonna switch it to internet

wicked wyvern
#

smh my head

sacred jasper
#

Whs

#

Why

#

Why not just keep it

timber cedar
#

cuz im here already
why not revise it?

wicked wyvern
#

it doesn't make sense to change though

#

if you want, you can check mod versions through LAN

sacred jasper
#

^^^

wicked wyvern
#

there's no reason to but you can

timber cedar
#

alright alright jesus

#

ok

#

ok

#

ok

sacred jasper
#

🚲 shed

timber cedar
#

Разрешить Space Warp проверять версии модов по сети?

#

there you happy

wicked wyvern
timber cedar
#

its on the network

wicked wyvern
sacred jasper
wicked wyvern
#

nope

sacred jasper
#

Bikeshedding

timber cedar
#

what

wicked wyvern
#

TIL

#

had to google it

timber cedar
#

ah

#

i think

#

its all in the details

sacred jasper
#

I am boredom right now
Maybe I should try to get IKVM to work with space warp

wicked wyvern
#

dear lord

timber cedar
#

no

wicked wyvern
#

even the python interpreter thing sounds less cursed

timber cedar
#

i got it working

timber cedar
sacred jasper
#

Is off really that long in russian

timber cedar
#

lol kinda yeah

wicked wyvern
#

damn

timber cedar
#

the word is like an adjective that means off

wicked wyvern
#

Zapnuto/vypnuto is not the shortest but still much shorter than that

timber cedar
#

xd yeah

sacred jasper
#

This is literally used in the autoscroll button for the console

timber cedar
#

oh im sorry

wicked wyvern
timber cedar
#

you dont have a dedicated word for autoscroll?

#

xd i guess i could just put "off"

#

im sure people understand it xd

wicked wyvern
#

or we can just make it a checkbox or toggle or something?

sacred jasper
#

Yep its settled Im making a space warp mod that allows people to make mods in Java

#

Im too bored

timber cedar
#

die

#

no

#

no

sacred jasper
#

Honestly might need a preload patcher to load IKVM early, then build the mod in Java

timber cedar
#

wait

#

is it going to be a jit

sacred jasper
#

No its java ... compiled to CIL

timber cedar
#

or precompile

#

can u make it

#

rosyln style

#

for rapid development

sacred jasper
#

So its java compiled to a dll

wicked wyvern
#

can you unmake it husK

timber cedar
#

^ just dont

wicked wyvern
#

honestly getting lua functional would be much better

#

since there will actually be people who'd use that

timber cedar
#

so where is cheese support for this?

#

i want to make mods in cheese

sacred jasper
wicked wyvern
#

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

timber cedar
#

racist vscode

sacred jasper
#

So a preload patcher that transpiles lua into c# for spacewarp to load

wicked wyvern
#

sounds like a fun challenge

sacred jasper
#

It kinda does

little bay
#

or, hear me out

#

you could... not do that

sacred jasper
#

Or we can see how the normal game is going to use lua and yknow

little bay
#

MoonSharp, probably?

sacred jasper
#

For sure

timber cedar
#

welp

#

i guess no cyrllic

wicked wyvern
timber cedar
#

bad font

#

i told u

#

remmeber

#

bad font

wicked wyvern
#

but the solution they're using will require API wrappers and what not it seems

#

that's why I suggested transpiling directly to C#

timber cedar
#

in the game when you swtich to russian
it literally changes fonts

little bay
#

I don't think you need to transpile

wicked wyvern
timber cedar
#

alr alr

little bay
#

you could probably cook something up with reflection, some kind of uhhh

#

generic api wrapper thing

wicked wyvern
#

I guess, yeah

little bay
#

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

sacred jasper
#

Metatables would be hell

wicked wyvern
little bay
#

For these reasons MoonSharp by default requires an explicit registration of the types which will be available to scripts.

sacred jasper
#

UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic;

wicked wyvern
#

interesting munley

#

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

timber cedar
#

@wicked wyvern

wicked wyvern
#

yeah?

timber cedar
#

💀

#

oh wait

wicked wyvern
#

what?

timber cedar
#

aiwjdioAIODIOWDJIOAWJDIOAWDI

little bay
#

to be honest, I don't see much reason to implement lua right now at all

wicked wyvern
#

well cheese was bored

#

so I was making suggestions

sacred jasper
#

This is not something space warp specifiv

#

Will be a new mod

little bay
#

I mean, even outside of spacewarp

sacred jasper
#

Rapid development?

#

Something closer to what KSP2 will do internally

little bay
#

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#

sacred jasper
#

Okay, boredom

#

That's why

little bay
#

see now that's a good reason

timber cedar
#

xd

#

the true motivation

#

{0} changes detected, please restart to apply them

#

@wicked wyvern how to translate this

#

do i keep the {0}

wicked wyvern
#

yes

timber cedar
#

k thx

wicked wyvern
#

that's for string.Format

timber cedar
#

yeah i saw

#

just wondeirng

sacred jasper
#

@little bay can you patch an abstract method with harmony?

little bay
#

no, even if you could, nothing ever calls it

timber cedar
#

:c

sacred jasper
#

alright time to do a funny then, if I can't do that

little bay
#

what is the funny

sacred jasper
little bay
#

what did you originally want to patch

#

OnInit?

sacred jasper
#

the basespacewarpplugins onpreinitialized

little bay
#

that method is British

#

fuck

#

one hand glide typing

#

virtual

#

that method is virtual

sacred jasper
#

meaning?

#

I know what virtual means, but does it mean I can patch it?

little bay
#

yes

#

well

#

okay

#

if you patch a virtual method

#

it will be called for one of two reasons

#
  1. they didn't override
#
  1. they override and call base.OnPreInitialzed()
wicked wyvern
little bay
#

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!

sacred jasper
#

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

wicked wyvern
#

not a fan of ____field arguments?

timber cedar
#

you dont enjoy writing ________________?

#

oh

#

xd

#

thx discord

wicked wyvern
#
  • 1 _ that most private members already start with
timber cedar
#

i need more

wicked wyvern
#

btw you can prepend the special chars such as * and _ with a backslash to escape them

#

on discord

timber cedar
#

______________________________________________________________

#

/___________________________________--

#

____________________________________________________--

sacred jasper
#

Fun times

timber cedar
#

.DoFile

#

thats some instense code tbh

#

very cool tho 👍

sacred jasper
#

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

wicked wyvern
#

now code ascent guidance in it

#

PVG or bust

sacred jasper
#

I still have to add GUI stuff to it

#

as static functions aren't immediately registered

wicked wyvern
#

UITK in Lua when

timber cedar
sacred jasper
#
[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

gilded kettle
#

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

wicked wyvern
#

you can edit files on GitHub in the browser, too

wicked wyvern
#

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

sacred jasper
sacred jasper
#

lookin good

wicked wyvern
#

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 munley

#

example

#

🤮

#

why do they have their default theme written with so much specificity if they're expecting people to make their own styles

sacred jasper
#

ive no clue

#

At least itll look nice and be easy to use

wicked wyvern
#

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 buh

#

for this testing i just exported the font file from the game and made the asset the way it works

timber cedar
#

i just modified the background image to add a border

wicked wyvern
#

but I don't think the game uses that method

#

so we might need to use just the default font within the TextField

timber cedar
#

or use jetbrains mono nf

#

so you can use full icon library

wicked wyvern
#

well I want to use the game's own fonts wherever possible

#

to look as close to the stock UI as possible

timber cedar
#

i think the console is a terrrible place to enforce that rule munley

wicked wyvern
#

I'm not talking about the console at all

timber cedar
#

💀

#

nvm

#

i’m ded rn

wicked wyvern
#

I'm making the UITK theme for KSP

timber cedar
#

please keep this

#

except use jetbrains mono nf

#

for icon support

wicked wyvern
#

you can have more fonts you know

#

one for text and another one for icons if you want

timber cedar
#

:O

#

omg

#

do that plz

#

i have no clue how xdd

wicked wyvern
#

is that font even open-source or anything like that?

timber cedar
#

yes

#

it is

#

its the best thing ever made

#

have you seen the ligeratures

wicked wyvern
#

need to read the license

timber cedar
#

its open font liscenes

wicked wyvern
#

I mean I use only JetBrains IDEs

timber cedar
wicked wyvern
#

so I have the font everywhere

timber cedar
#

yes

wicked wyvern
#

so yeah I've seen the ligatures 😆

timber cedar
#

sexy af

#

i belive liscnese only applies on fonts forked from it

#

not on products

#

@little bay need a laywer

sacred jasper
#

We should be using fonts the game uses

#

Dont need to bring in a random font

timber cedar
#

they are unreadable xdd

#

also they dont support non-latin

#

the game switches fonts when you go to cyrillic

sacred jasper
timber cedar
#

i think they are

wicked wyvern
#

license looks good afaik

timber cedar
#

yep

#

thats what i said ^^

#

for other stuff idc

#

game font is fine, if unreadable

#

but console there is so much text packed together

wicked wyvern
#

we'll need to look into the non-latin fonts thing

timber cedar
#

i love this

#

1 pixel per letter

wicked wyvern
#

but just opening the default game font on my pc, I see that it supports at least czech characters

#

like ěščřžýáíé

timber cedar
little bay
timber cedar
#

it just switches fonts

little bay
#

but whats the question

timber cedar
#

if we can use this font

#

in the project

little bay
#

you can read the license you know

sacred jasper
#

Yeah no need to randomly ping aaron

timber cedar
#

:c sowy

little bay
#

tl;dr though, yes

#

just say where the font is from/what it is licensed to you under

timber cedar
#

thx senpai ^

wicked wyvern
#

@timber cedar type something in cyrillic

#

I want to test it in the project that I have

timber cedar
#

uh

#

привет

wicked wyvern
#

yeah that's... not ideal

timber cedar
#

not too readable

#

jetbrains mono ^

wicked wyvern
#

the image is the game font

#

honestly I can barely tell them apart

#

the "l" is the biggest difference

timber cedar
#

yeah

#

its the better l

#

not the il

#

Il

#

look at that ^

#

🤮

wicked wyvern
#

honestly @sacred jasper I'm for trying to use the JetBrains font

timber cedar
#

^

wicked wyvern
#

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

timber cedar
wicked wyvern
sacred jasper
#

Well shit @wicked wyvern I might be able to get UITK in the next space warp release

wicked wyvern
#

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

sacred jasper
#

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

wicked wyvern
#

hm, yeah

sacred jasper
#

Honestly might be worth looking into

gilded kettle
#

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

sacred jasper
#

@wicked wyvern do you have the stylesheet you are working on, I want to start working on mockups of SW UI in UITK

wicked wyvern
#

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

sacred jasper
#

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

wicked wyvern
#

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

sacred jasper
#

me not understanding styling that well

#

I am not a web dev

wicked wyvern
sacred jasper
#

The toggle is somewhat light in editor as well?

wicked wyvern
#

that looks ok to me

#

this is from the game

#

(screenshot from Action Group Manager)

sacred jasper
#

oh so it is just that light

wicked wyvern
#

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

sacred jasper
#

they should've just put a full HTML5+CSS implementation in unity

wicked wyvern
#

it is very barebones

#

they probably assume people will just use custom textures for most things

sacred jasper
#

Anyways ripped the font

#

Cyrillic somewhat works

wicked wyvern
#

it does show up, but it looks like it's just a fallback font if anything

sacred jasper
#

unfortunate

#

Is there a way to title a window with this

wicked wyvern
#

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)

sacred jasper
#

Looks a bit better yeah

#

I'm about to ask a newbie question
How center label?

wicked wyvern
#

-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

sacred jasper
#

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

wicked wyvern
#

> means that the selector on the left is the direct parent of what's on the right

#

you want .unity-label.center probably

sacred jasper
#

So this

.unity-label.center {
    -unity-text-align: middle-center;
}
wicked wyvern
#

should do the job

sacred jasper
#

That it did

#

Alright, then how to do the 2 side by side boxes like in the modlist?

late condor
#

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

wicked wyvern
#

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

late condor
#

Keep in mind UIBuilder and hand edits don't always play well together

sacred jasper
#

I don't see a UI builder?

wicked wyvern
#

you have to install it separately from UI Toolkit, from the package com.unity.ui.builder

sacred jasper
#

oh

late condor
#

it will be under the Window/UItoolkit menu once installed

sacred jasper
#

Just gave me a bunch of errors

#

Imma create a new project

wicked wyvern
#

and then you can play around with their flex-basis, flex-grow and flex-shrink properties

#

why no grid though @unity 👀

late condor
#

I like grids, but I've found it to be not much of an issue

wicked wyvern
#

I mean you can achieve most of the same stuff with flexbox, but grid is just much more concise to use

sacred jasper
#

@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

wicked wyvern
#

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

sacred jasper
#

How do I set the root visual elements class in this as well then?

wicked wyvern
#

huh, that still looks like the styles aren't in there, even without the root class

sacred jasper
wicked wyvern
#

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

wicked wyvern
sacred jasper
#

This is what it shows me for the uss preview

wicked wyvern
#

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

sacred jasper
#

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

wicked wyvern
#

oh you need to create the font asset through Text, not TextMeshPro

sacred jasper
#

Looking better but way too big

wicked wyvern
#

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

sacred jasper
#

Getting there, just have some odd artifacts

#

And they disappeared

wicked wyvern
#

looking good

sacred jasper
#

@wise swift this is what UITK will look like somewhat, you like it?

wise swift
#

nice

#

can we get the correct fonts

sacred jasper
#

That is the correct font

wise swift
#

title fonts are wrong

wicked wyvern
#

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

sacred jasper
#

Unfortunately I have to be afk for the rest of the day or thereabouts

wicked wyvern
#

see you later then

gilded kettle
#

Shouldnt be hard

wise swift
wicked wyvern
#

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

inland lichen
#

gross

sacred jasper
#

@wicked wyvern the first part of Cheese's KSP2 SDK is coming together