#Space Warp

1 messages · Page 6 of 1

timber cedar
#

i think your not beliving enough

little bay
#

(it doesn't compile btw)

timber cedar
#

xdd

#

just dont belive enough

timber cedar
sacred jasper
#

We cant change the newtonsoft version

#

We are stuck with what ksp uses

sacred jasper
#

A bit too shrunk

#

@gilded kettle This is what you wanted somewhat?

#

How did the blank space at the top get added back @timber cedar?

gilded kettle
#

btw what field is that? Plugin_Name?

#

or is it the swinfo?

sacred jasper
#

I might actually play some KSP2 for a bit

gilded kettle
#

lmao havent done that in a while ngl

sacred jasper
#

I still don't know what to work on w/ space warp rn, nobody makes feature requests ree

gilded kettle
#

I'll make one

#

Ability to reload files

#

i want that to be able to reload textures on TUX so that artists dont have to reopen the game everytime they change a texture

#

Maybe only allow reloading textures that have already been loaded, so you only have to look at a limited number of paths

#

also the ability to load .cfg files, my plan is to make TUX export .cfg with the textures and settings that the artists set, this would work with configuration manager (i think)
Also the ability to get .jsons!!

#

and when present in the Mod/assets/images/partName/shader.cfg it would be loaded by TUX (or Colors) with the right configuration

#

this would also allow for part configuration out of the json i believe, but still have to dive into that

#

want me to put all this on a feature request?

#

Also would be nice to be able to get assets by their name, ignoring the rest of the path since thats how KSP2 does too(mostly), right now Colors has to store the modGUID in order to find the textures

sacred jasper
#

Only problem w/ that is if 2 mods define an asset by the same name

gilded kettle
#

hmm true, well i can always get the modguids on the SpaceWarp so its all good

#

but the .cfg and .json is a must!

#

and the Reload or ReImport

sacred jasper
gilded kettle
sacred jasper
#

Broken for the moment?

gilded kettle
#

loc is quite annoying tbh

#

what are u using to edit the csv?

sacred jasper
#

Excel, but the CSV looks fine?

Key,Type,Description,English
SpaceWarp/ModList/Header,Text,,spacewarp.modlist
SpaceWarp/ModList/SpaceWarpMods,Text,,SpaceWarp Mods
SpaceWarp/ModList/UnmanagedMods,Text,,Unmanaged Mods
SpaceWarp/ModList/Version,Text,,Version
SpaceWarp/ModList/Author,Text,,Author
SpaceWarp/ModList/outdated,Text,,outdated
SpaceWarp/ModList/Source,Text,,Source
SpaceWarp/ModList/Description,Text,,Description
SpaceWarp/ModList/KSP2Version,Text,,KSP2 Version
SpaceWarp/ModList/Dependencies,Text,,Dependencies
SpaceWarp/ModList/OpenConfigManager,Text,,Open Configuration Manager
SpaceWarp/ModList/unsupported,Text,,unsupported
SpaceWarp/Mods,Text,,Mods
#

@gilded kettle it's loading the terms it seems?

#

But why isn't it localizing them

gilded kettle
#

hmm yeah everything seems fine, thats very wierd, probably you need to acess them differently

#

these are custom fields, only tried to loc KSP2 fields

sacred jasper
#

This is how I access them

#

Localization sus?

#

Cool, got it to show the missing translation warning

sacred jasper
#

Are you kidding me

lime plaza
sacred jasper
#

That worked

#

@lime plaza thank you for reminding me

#

@timber cedar can you do russian localization of Space Warps UI text?
Or was someone else doing russian

gilded kettle
#

I can do portuguese

#

wheres the spreadsheet?

#

also, i wonder whats the language name... Cuz theres Portuguese, Portuguese-PT and portuguese-BR

sacred jasper
gilded kettle
#

okdoki, any idea where i can find the correct language name?

sacred jasper
#

Just try each one?

#

Ive no clue

gilded kettle
#

ig, works too lmao

sacred jasper
#

Xd

gilded kettle
#

semiComma Separated Values

#

thx microsoft .D

sacred jasper
#

bruh

gilded kettle
#

i dont think that in Excel 2022 you can change this wtf

sacred jasper
#

Is this what you have?

gilded kettle
#

mine doesnt show that

#

it goes straight to the windows file manager when i click on the path

#

I really hate that microsfot defaults all my programs with portuguese

#

im not used to this at all

#

i'll use notepad++ for now ig

wicked wyvern
#

I'll be sitting in the office for another two hours in case anyone needs something but I'm bored af so might as well try to finish the mod toggling lol

gilded kettle
#

bro why didnt they use the gobally used pt-pt, en-us, en-gb format????

sacred jasper
#

@hard ruin why

#

I did not mean to ping

gilded kettle
#

LMAO

sacred jasper
#

I didn't select anyone to ping

gilded kettle
#

he is all the devs at the same time

sacred jasper
#

discord why

wicked wyvern
wicked wyvern
#

Instead of just English you can use English[en-US] etc

sacred jasper
#

They aren't even in the IG server

#

lol

gilded kettle
wicked wyvern
#

It should

gilded kettle
#

lol ok

wicked wyvern
#

If you don't use CRLF

gilded kettle
#

just copy what it says on the settings

#

ok i'll pr the loc

wicked wyvern
#

Oops

gilded kettle
#

cries in çõ

wicked wyvern
#

Dumb font with no international support

#

But since it's just the SpaceWarp font, it can be changed

gilded kettle
#

or dumb language with stupid chars thinkaboutit

#

i'll pr like this, its still readable

wicked wyvern
#

*cries in UITK being a buggy mess*

#

If we could get it to work properly it would make things so much easier lol

gilded kettle
#

whats the current problem?

#

iirc it has color selection and i'd like to add that to TUX

wicked wyvern
#

Basically the UI seems to be taking on colors from the background (probably some shader issue?) and fonts are either rendering as rectangles or not rendering at all

gilded kettle
#

doesnt it use a material for the font?

#

hmm thats such a wierd bug tho

#

i wonder whats the default uitk shader

wicked wyvern
#

When you export a prefab with a UITK UIDocument into a bundle, it includes the font and the shaders

#

The shaders it uses are called Hidden/UIE-Runtime, Hidden/UIE-RuntimeWorld and Hidden/UIE-AtlasBlit

gilded kettle
#

have u tried exporting it as an addressable?, doenst make that much sense but idk

#

Since KSP shader are also in addressables ie

#

and fonts too iirc

wicked wyvern
#

Still, the prefab can be loaded just fine from the bundle and it should contain references to all those things

gilded kettle
#

references are clearly broken tho

wicked wyvern
#

Actually

gilded kettle
#

or either referencing another thing

wicked wyvern
#

I know for a fact that the shaders are loaded

gilded kettle
#

font seems to be getting a camera shader

wicked wyvern
#

Because I even load them manually

#

Since I want to enable using just pure UXML and USS to render the UIs (without any bundles), I have a bundle with all three of the shaders exported and load them all manually, then I Harmony patch all the methods in the UITK namespace which try to Shader.Find(...) these shaders and instead inject the manually loaded ones

#

Since as far as I know, there's no way to allow shaders that are loaded at runtime dynamically to be found using Shader.Find(...)

#

And I'm sure that these shaders are being used since I can see their names in the UIDocument properties in UnityExplorer

gilded kettle
#

hmmm

#

Shaders do have properties, i think shader.find just gives a default one

#

so maybe you'd need to do material.set[etc...]

wicked wyvern
#

Well i just patched the already existing code in the UITK assembly

#

And they don't seem to be doing any of it

#

So idk

gilded kettle
#

can you decompile the shader?

#

i can do it too if you show me where it is

wicked wyvern
#

Well there are some shader disassembly not supported on DXBC messages in there

gilded kettle
#

my guess is that the font shader points to a 2d coordinate where the leter is, no 2d coordinate it just uses the whole camera and tahts what were seeing in the fonts

gilded kettle
wicked wyvern
#

Sure, can send you those

gilded kettle
#

as for background, it either is average color or color under a pixel, but i couldnt figure out what pixel it was getting it from......

wicked wyvern
#

Yeah it seems to be from a specific pixel but can't tell where

gilded kettle
#

my guess is, if its not set its 0,0, so left bottom

wicked wyvern
#

That makes sense

gilded kettle
#

the OAB has the green lines and the yellow lines

wicked wyvern
#

Since on the main menu screen it would change color pretty much only when a Kerbal starts flying in from the bottom left corner

gilded kettle
#

yes then i think we found the problem

#

shader properties have to be set

#

Font uses a 2d coordinate, and height and width probably on the font texture, no font texture it just uses default

#

Background color probably has some shenanigan for getting the color, maybe a texture with all the used colors? idk

#

its possible that this is all done inside unity editor thus u not finding it on the UITK source

wicked wyvern
#

Yeah it is

#

I was testing it in an empty Unity project with just UITK installed

#

Made a UI with UXML, ran the scene, looked just fine

#

Then i exported the prefab and tried to load it in KSP

#

And the result is what you saw

gilded kettle
#

probably decompile the editor, and search for Shader.Find(UITK shader)

#

i'm heading out but i can help you figure out the values once im back

#

in about 2h

wicked wyvern
#

Works fine from me, that's around when I'll be getting home from work

gilded kettle
#

also look at #1087665539264020540 source code, i already have a shader editing base there, you can copy it for tests

#

all in Patch.cs and TUXPlugin.cs iirc

#

repo is on my profile btw, idk if it is on the forum here on disc

sacred jasper
#

@gilded kettle did you ever get portuguese translations to work

gilded kettle
#

Yup, didnt i pr it?

#

Its Portuguese BR

sacred jasper
gilded kettle
#

Btw if u need i can also help on spacewarp development in general not just colors

gilded kettle
#

Great! Ill see what i can do!

gilded kettle
#

#1088215385490333706 message
should we add a message if the player as an outdated spacewarp?

#

Using the url for the swinfo of the most recent one

sacred jasper
#

Space Warp version checks itself post 1.0.0

gilded kettle
#

Oh ok so 0.4 it doenst hmm

#

Welp 🤷‍♂️

timber cedar
#

it’s right above the GUILayout.Button(“SpaceWarp Mods”)

#

i think ^
that’s just from memory

sacred jasper
#

I fixed ity

timber cedar
#

ye

wicked wyvern
#

I can confidently say that I don't look forward to merging all these changes into my current code

timber cedar
#

forgive me my lord

timber cedar
gilded kettle
#

should this happen?

[Info :sorry/images/t-38_v1.rar] registering path "sorry/images/t-38_v1.rar"

#

it loaded a .rar

sacred jasper
#

It doesnt check image extensions

timber cedar
#

why would it?
that would prevent you from doing anything :D

gilded kettle
#

so in theory the "load .cfg and .json" is already implemented, great work guys :D

#

oh yeah, @timber cedar config manager cant really load it from custom paths right?

timber cedar
#

it’s the bepinex confit manger :D

#

so i mean, in what way

#

do you want a drag and drop files

#

i guess you could give it an absolute path

gilded kettle
#

hmmm, idk if would be optimal, will look into it tho

#

cuz suposedly, every parts would have a config for their shader settings

#

well no need to be every part obviouslyt

#

only if the artist desires so

timber cedar
#

theres an "advanced" tab for the config manager, i guess you could use that :D idk

sacred jasper
#

@wicked wyvern do you wanna look into creating UITK UIs for space warp
As that would be a great feature to release 1.1.0 w/

wicked wyvern
#

I can try

#

just need to finish the toggle feature first

#

quick q: would it be bad to straight up copy one method from BIE source code?

#

I'd rather not have to do a transpiler

wicked wyvern
#

it's not even MIT right

#

well, time to learn IL lol

sacred jasper
#

@little bay can help ya w/ this one

little bay
#

wha

little bay
#

6 is lgpl

wicked wyvern
#

oooh

#

does that help my case?

little bay
#

but what method are you thinking of copying

wicked wyvern
#

I'll need to most likely patch Chainloader.Start

little bay
#

yeah thought so

wicked wyvern
#

and do lots of stuff there

little bay
#

I can do it in like an hour or two

#

just tell me what you need and where

wicked wyvern
#

oh damn, thanks

#

I'll quickly put together the resulting "patched" method I need until then

little bay
#

just try to keep the number of "blocks" you add fairly low to make it easier on me 😅

#

a block being like

#

if you add three statements between two lines, I can emit all of those at once really easy

wicked wyvern
#

yep, got it, will try my best

little bay
#

if you put 3 statements in completely different places, I have to jump around to emit them

#

yeah

little bay
#

yes

wicked wyvern
#

@little bay actually the patch might be as simple as this:

#
foreach (var plugin in pluginInfos)
{
    if (File.ReadAllLines(DisabledPluginsFilepath).Contains(plugin.Metadata.GUID))
    {
        DisabledPlugins.Add(plugin);
        pluginInfos.Remove(plugin);
    }
}
#

I don't think I actually need it to do anything else, just need it to prevent plugins with GUIDs from that file from being loaded and to instead get their PluginInfos into my own property

sacred jasper
#

Where is the disabled plugins list?

#

Wait brain dumb

wicked wyvern
#

it's just a public static property in the patch's class

#

which I then fetch in SpaceWarp

#

I just wrote the code inside the actual BIE file to be able to inspect the code more easily

sacred jasper
#

That looks like an easy enough patch

#

I think I could maybe take a look at how to do that for you

#

@wicked wyvern what function is that?

wicked wyvern
#

Chainloader.Start()

sacred jasper
#

So here

wicked wyvern
#

yep between the first two lines should be it

#

but doesn't really matter

#

can be below any of them

#

all the way up to the first foreach that follows, really

sacred jasper
#

Actually wait I can just go to an index, as BIEs dll will not update

wicked wyvern
#

oh yeah actually that's true

#

lol

#

to be fair I expected the patch to be much more complex but then I kinda just built the rest of the feature around it to make it as simple as possible

#

so I might have as well just done it myself in the end without annoying everyone else here to help

#

😅

sacred jasper
#

I'm getting close

#

@little bay this should work?

#

I'm doing it before, so it modifies the item on the stack just before storing it

#

I think I need to return it though

#

@wicked wyvern

using System;
using System.Collections.Generic;
using System.IO;
using BepInEx;
using BepInEx.Bootstrap;
using HarmonyLib;
using MonoMod.Cil;

namespace SpaceWarp.Patching;
[HarmonyPatch]
public static class ExampleHarmonyPatchMunix
{
    const int BepinexChainloaderIndex = 116;
    public static List<PluginInfo> DisabledPlugins = new();
    public static string DisabledPluginsFilepath = "";
    [HarmonyILManipulator]
    [HarmonyPatch(typeof(Chainloader), nameof(Chainloader.Start))]
    private static void PatchInitializationsIL(ILContext ilContext, ILLabel endLabel)
    {
        ILCursor ilCursor = new(ilContext);

        // ilCursor.Goto(BepinexChainloaderIndex, MoveType.After);
        ilCursor.GotoNext(MoveType.Before, instruction => instruction.MatchStloc(3));
        ilCursor.EmitDelegate<Func<List<PluginInfo>,List<PluginInfo>>>(static (pluginInfos) =>
        {
            foreach (var plugin in pluginInfos)
            {
                if (File.ReadAllLines(DisabledPluginsFilepath).Contains(plugin.Metadata.GUID))
                {
                    DisabledPlugins.Add(plugin);
                    pluginInfos.Remove(plugin);
                }
            }
            return pluginInfos;
        });
    }
}

Try this

#

Modify it to reference the correct things, but this should be correct

wicked wyvern
#

It's entirely possible I'm just being dumb again, but the patch doesn't seem to be doing anything

#

as in, I can see the Harmony patch loading in the preloader section in console

#

but can't actually get the code to do anything, including logging

timber cedar
#

hm klueless

wicked wyvern
timber cedar
#

^ yes

wicked wyvern
#

even though I haven't even merged it into my branch

timber cedar
#

always blame the healer husK

wicked wyvern
#

well actually

#

I have like the first one you did

#

and there are some exceptions because of it

#

so who knows munley

timber cedar
#

...

#

the first one was broken

#

xdd

#

you need to get the current one

wicked wyvern
#

most stuff works and I need to test this code and make it work before I break it again completely with another batch of conflicts munley

timber cedar
#

need this one

#

can we please switch the console font to the rounded

#

like jetbrains mono

#

because the pixel one is fucking unreadable xdd

wicked wyvern
#

I just use the BepInEx console tbh

timber cedar
#

for the rest of us mortals

#

@sacred jasper

#

why use worst font in console

wicked wyvern
#

well

#

the whole SpaceWarp UI will (hopefully) soon be rewritten using UITK

timber cedar
#

:hope:

wicked wyvern
#

(I'll be attempting to do it)

#

so you better pray

timber cedar
#

i wanna help

#

xd

#

what is uitk

wicked wyvern
#

Unity UI Toolkit

#

you write the UI using XML and something similar to CSS

timber cedar
#

:D

#

lets goooo

#

WOOOOOOO

#

YEAHHHHHHHH

#

i get to channel my frontend coding ability

wicked wyvern
#

thanks to cheese noticing one dumb mistake of mine, I finally managed to get it working within KSP2

timber cedar
#

lol

sacred jasper
timber cedar
#

asked why such bad font

#

in console

wicked wyvern
sacred jasper
timber cedar
#

i think shbox choice

wicked wyvern
#

heh

timber cedar
#

in the metaverse

storm quail
#

Cheese, ill send you the youtube link tommarow once the 1080p version is odne processing to youtube

wicked wyvern
storm quail
#

its taking forever to process the 1080p

timber cedar
storm quail
#

apparently 40 minute long 1080p video is too good for youtube

timber cedar
#

im quite the meatverse enjoyer

wicked wyvern
#

omg noo

#

I just rebased my branch to the current 1.1.0

#

just kill me now

#

so many conflicts

#

🥲

timber cedar
#

how many

#

:D

#

i think you should force merge right

sacred jasper
#

this is irrelevant to the channel

timber cedar
#

good point

wicked wyvern
#

well

#

I think most of it is done but the transpiler just doesn't seem to be doing anything

timber cedar
#

i mean if there was a specific pr that i could see the dif in klueless

wicked wyvern
#

there's 1 commit

#

you can see the diff there

timber cedar
#

ah okok

wicked wyvern
#

(just check the only one from me at the end of the list)

timber cedar
#

it looks p good :D

wicked wyvern
#

but it doesn't work

timber cedar
#

oh

#

:C

#

oh

wicked wyvern
#

that's the issue lol

little bay
#

@wicked wyvernyou could try this instead

using System;
using System.Collections.Generic;
using System.IO;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using HarmonyLib;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;

namespace SpaceWarpPatcher;

public sealed class Patcher
{
    public static IEnumerable<string> TargetDLLs
    {
        get
        {
            Harmony.CreateAndPatchAll(typeof(ChainloaderPatch), "SpaceWarpChainloaderPatch");
            ChainloaderPatch.DisabledPlugins = File.ReadAllLines("some path here");
            ChainloaderPatch.Logger = Logger.CreateLogSource("SpaceWarp Disabled Plugins");
            return Array.Empty<string>();
        }
    }

    public static void Patch(AssemblyDefinition unused) { }
}

[HarmonyPatch]
internal static class ChainloaderPatch
{
    public static string[] DisabledPlugins;
    public static ManualLogSource Logger;
    
    [HarmonyILManipulator]
    [HarmonyPatch(typeof(Chainloader), nameof(Chainloader.Start))]
    private static void DisablePluginsIL(ILContext il)
    {
        ILCursor c = new(il);

        c.GotoNext(MoveType.Before,
            x => x.MatchLdcI4(0),
            x => x.MatchStloc(24)
        );

        c.Emit(OpCodes.Ldloc, 24); // current plugin guid
        c.Emit(OpCodes.Ldloc, 5); // set of denied plugins so far
        // false means skip to this plugin, true means continue loading it
        c.EmitDelegate(static bool(string pluginGuid, HashSet<string> deniedSet) =>
        {
            if (Array.IndexOf(DisabledPlugins, pluginGuid) != -1)
            {
                deniedSet.Add(pluginGuid);
                Logger.LogInfo($"{pluginGuid} was disabled, skipping loading...");
                return false;
            }
            return true;
        });
        var continueLabel = c.DefineLabel();
        c.Emit(OpCodes.Brfalse, continueLabel);

        ILLabel realContinueLabel = default;
        c.GotoNext(
            x => x.MatchLdloc(29), // some log message, just need this to find where to branch to
            x => x.MatchCall(AccessTools.DeclaredMethod(typeof(Logger), "LogWarning")),
            x => x.MatchBr(out realContinueLabel)
        );

        continueLabel.Target = realContinueLabel.Target;
    }
}

#

no idea what you guys want the path for this file to be, or its format

wicked wyvern
#

alright, will try, thanks!

little bay
#

nevermind sad

#

it doesnt work

wicked wyvern
#

😆

timber cedar
little bay
#

debugging at its finest

wicked wyvern
#

looks familiar munley

little bay
#

oh

#

i'm stupid

#

i used the wrong local index

#

10/10

timber cedar
wicked wyvern
#

file localization, index localization, term localization klueless

little bay
#

oh well its simpler now anyway

little bay
#

i think my game is now failing to load

#

but like

#

not because of this?

wicked wyvern
timber cedar
#

i should make a discord bot for this server

little bay
timber cedar
#

virus

little bay
#

you literally have a decompiler

#

its 64 lines

timber cedar
#

you obfuscated it to look like real code

#

it breaks sw if i launch with it

little bay
#

oh, also

#

make a random file called test.txt in your game directory

#

it can be empty

#

just needs to exist

timber cedar
#

ok

little bay
#

i was lazy and just did

ChainloaderPatch.DisabledPlugins = File.ReadAllLines(Path.Combine(Paths.GameRootPath, "test.txt"));

lmao

timber cedar
#

xd what

#

thats the disable part?

little bay
#

thats how it reads them

#

because i'm lazy

timber cedar
#

should be .csv

#

^ .xml

little bay
#

okay sure

wicked wyvern
#

it's literally just a file with one BIE GUID per line

wicked wyvern
timber cedar
#

.o file

little bay
#

i mean

timber cedar
#

.d

little bay
#

i guess that is technically a csv

timber cedar
#

for disabled

wicked wyvern
wicked wyvern
little bay
#

anyway, does that freeze your game

timber cedar
#

no

#

wiat

#

wait

#

didnt relaunch the game

#

yes

little bay
#

lovely

timber cedar
#

is that good xd

little bay
#

no

#

lmao

timber cedar
#

xd

wicked wyvern
#

yep, stuck on preloader finished

little bay
#

which is really weird

#

it should at least get to chainloader ready

wicked wyvern
timber cedar
#

aaron not using __result

little bay
timber cedar
#

xdd

#

wtf is that

wicked wyvern
#

it's beautiful that's what that is

little bay
#

what method is missing

wicked wyvern
#

I need it here kekw

timber cedar
wicked wyvern
little bay
#

fun

wicked wyvern
#

logs don't even get written into

little bay
#

i can try to attach a debugger

timber cedar
#

rider moment

#

🤔

#

what branch is that

wicked wyvern
#

that's a different thing

#

this is in 1.1.0

#

and I haven't even made a PR

timber cedar
#

i think ghost branch

wicked wyvern
#

wdym?

timber cedar
#

where spacewarp-1.1.0

#

1.0.1

wicked wyvern
#

well, merged into main

timber cedar
#

but.

#

why is it

#

showign

little bay
#

thats nice

wicked wyvern
#

not a branch

timber cedar
#

oh

#

i see

#

blind

timber cedar
#

oh wait im poor

timber cedar
#

munix can you buy me nitro

wicked wyvern
#

why does everything I work on end up like this with 86746815 people debugging it and it not working

#

🥲

timber cedar
timber cedar
#

oprah

wicked wyvern
#

EVERYBODY GETS NITRO

timber cedar
#

you get a car

#

and

#

you

#

get

#

a

#

car

little bay
#

ahhhhh

#

i see now

#

i think

#

i think i'm making BepInEx.dll load too early?

#

or at least i'm forcing it to compile Start too early

wicked wyvern
#

would removing the reference to BIE in the patcher and changing typeof(Chainloader) and nameof(Chainloader.Start) to literals help?

little bay
#

no, harmony would force it to compile

#

i just need to delay patching start

wicked wyvern
#

oh alright

little bay
#

yep, that fixed it

#

or, at least

#

the game now loads?

wicked wyvern
#

is that good news or bad news? lol

#

my experience with Harmony has so far been "if the game breaks, at least you know the patch is being run" munley

timber cedar
little bay
#

i am currently very confused

timber cedar
#

i think thats why munix is not sw dev

little bay
#

i mean

wicked wyvern
timber cedar
#

correct.

#

i eat my shame with pride

wicked wyvern
timber cedar
#

💀 aaron

#

he was never seen again

wicked wyvern
#

the Chainloader consumed him

little bay
#

i'm dying, sorry

#

okay

timber cedar
little bay
#

i have a new way to make this work

timber cedar
#

thats what they all say

wicked wyvern
timber cedar
#

^

#

guys here me out

#

omg

#

ok

#

so

#

we should make a mod

#

that skips loading screens

#

???? GENUIS

wicked wyvern
#

make a mod that gives everyone +300 fps

#

5head move

timber cedar
#

AWDAWIJDIOAWDIOJ

#

OGM

wicked wyvern
#

"Game studios hate this simple trick"

timber cedar
#

frfr

#

hear me otu

#

like fr

#

make mod

#

that gives the game 10ms

#

if it takes longer it just cuts it and breaks the update loop

#

🧠

#

i think klueless is the best thing ever made

#

its the pinicle of human creation

wicked wyvern
#

it's definitely up there

timber cedar
#

munix why no vc

wicked wyvern
timber cedar
#

neither do i o-o

#

but i vc

maiden abyssBOT
wicked wyvern
#

and I'm extremely insecure about my spoken English lol

timber cedar
#

i can barely speak it

little bay
#

you speak it fine

timber cedar
wicked wyvern
timber cedar
#

munix we can speak insert your language here

little bay
wicked wyvern
#

I mean I used to go to all sorts of competitions during elementary and high school and would usually win or at least place in the top 3, but I haven't been speaking for quite a while now and it's just getting worse and worse

timber cedar
#

u should vc

little bay
#

all it took was

public static class Patcher
{
    public static IEnumerable<string> TargetDLLs => new[] { "UnityEngine.CoreModule.dll" };

    public static void Patch(AssemblyDefinition asm)
    {
        var targetType = asm.MainModule.GetType("UnityEngine.Application");
        var targetMethod = targetType.Methods.Single(x => x.Name == ".cctor");
        
        using var thisAsm = AssemblyDefinition.ReadAssembly(typeof(Patcher).Assembly.Location);
        var delayer = thisAsm.MainModule.GetType("SpaceWarpPatcher.Delayer");
        var patchMethod = delayer.Methods.Single(m => m.Name == "PatchChainloaderStart");
        
        ILContext il = new(targetMethod);
        ILCursor c = new(il);
        c.GotoNext(MoveType.Before,
            x => x.MatchCall("BepInEx.Bootstrap.Chainloader", "Start")
        );

        c.Emit(OpCodes.Call, il.Module.ImportReference(patchMethod));
    }
}

internal static class Delayer
{
    public static void PatchChainloaderStart()
    {
        ChainloaderPatch.Logger = Logger.CreateLogSource("SpaceWarp Disabled Plugins");
        ChainloaderPatch.DisabledPlugins = File.ReadAllLines(Path.Combine(Paths.GameRootPath, "test.txt"));
        Harmony.CreateAndPatchAll(typeof(ChainloaderPatch));
    }
}
wicked wyvern
#

huh

#

interesting

little bay
#

basically inserting myself in the same place bepinex does

#

immediately in between Chainloader.Initialize and Chainloader.Start

#

patching Start immediately before it runs

timber cedar
#

^^ i almost had him vc
and you distracted him

wicked wyvern
#

awesome, thanks a lot!

wicked wyvern
#

so there was no chance anyway munley

timber cedar
#

i couldnt see a better time

wicked wyvern
timber cedar
#

i need to make a discord bot for the server

little bay
#

for what

timber cedar
#

to truly track the munley and klueless counts

wicked wyvern
#

better include MunixApproved

little bay
#

anyway how does this file work

#

where does it go

#

what is it called

timber cedar
#

which

#

who

#

what

little bay
#

the disabled plugins file

timber cedar
#

just put it in the plugins folder

wicked wyvern
little bay
#

i think it would make more sense in the main bepinex folder

timber cedar
#

you should put it in the downloads folder

wicked wyvern
#

would it? even if it's SpaceWarp that creates/uses it?

little bay
#

the spacewarp plugin doesnt use it

wicked wyvern
#

it does

little bay
#

the patcher does

wicked wyvern
#

that's where I set the values from

timber cedar
#

a stale mate

little bay
#

well since its used by both, might as well go to the common place between them, the main folder :p

wicked wyvern
#

from SpaceWarp's ModListUI class

little bay
#

but i'll put it there for now

sacred jasper
#

put it in the common place

little bay
#

at least give it a .txt extension though

sacred jasper
#

easier for users

little bay
#

so its openable in a text editor (easily)

wicked wyvern
#

that's what I kinda wanted to prevent with the no-extension thing

timber cedar
#

dont give it extension

#

be a linux man

wicked wyvern
#

ok what about like .cfg or something then?

timber cedar
#

.conf

wicked wyvern
#

to make it obvious it's important and not just a random text file

timber cedar
#

.bat

wicked wyvern
#

.mp4

timber cedar
#

xdd

#

.nap

little bay
#

cfg should be fine, i suppose

#

just files with no extension are annoying on windows

#

so

wicked wyvern
sacred jasper
#

eww

little bay
#

that would make it hidden by default on linux

wicked wyvern
#

oh yeah lol

#

nvm, I'll do cfg

timber cedar
#

on windows to

wicked wyvern
#

seems like a good compromise

timber cedar
#

yeah

little bay
#

no, windows doesnt use that rule

timber cedar
#

call it cfg.cfg

little bay
#

anyway i'll let you change it

#

can i PR this somewhere

timber cedar
#

1.1.0

#

???

#

?.?.?

wicked wyvern
little bay
#

i thought munix had his own branch he was working on

#

yeah

#

i'll PR into that

timber cedar
#

munix trying to take over spacewarp

wicked wyvern
#

thanks again

sacred jasper
timber cedar
#

Saint

wicked wyvern
#

true and real

little bay
#

i'm going to do some other random things real quick

#

now that this has multiple projects in it

wicked wyvern
#

sure thing

timber cedar
#

all this coding stuff is too hard for me

#

im gonna go back to scratch

wicked wyvern
timber cedar
#

esolang ^

#

🤮

wicked wyvern
#

you could say you're both a programmer and a linguist

timber cedar
#

why dosth thou not learnth it thy self

#

idk

sacred jasper
#

munix could get org inv tbh

timber cedar
#

maybe 🤔

#

jk y ^

sacred jasper
#

theyve done a lot

wicked wyvern
#

well, not really that much on the actual code of SpaceWarp

#

but I'll happily accept and contribute more

timber cedar
#

i think bride ^

sacred jasper
#

Invitation sent

timber cedar
#

:O

wicked wyvern
#

time to get started on that new KSP2 UITK stylesheet

sacred jasper
#

Pog

timber cedar
#

pog

little bay
#

immediately

wicked wyvern
#

I haven't even tried to import .uss into the game yet, so this might be fun

sacred jasper
#

Just use asset bundles :3

wicked wyvern
#

also first I need to figure out whether UITK now works with all three of my methods

#
  1. complete UITK prefab in a bundle (we know this works)
  2. UXML and USS in a bundle
  3. UXML and USS loaded from disk
#

since the goal is to allow modders to write the UI without using Unity

sacred jasper
#

Fair
But at some point I feel like using unity is going to be inevitable

#

Honestly, I just realized an idea that might be useful ... making our own editor scripts for unity

#

like for part definitions

wicked wyvern
#

Yeah that would be really helpful

#

Like a SpaceWarp mini-SDK vaultpeter

timber cedar
#

we should just write a ui library

#

munix where to start on this

wicked wyvern
#

well UITK already is a UI library basically

#

but I want to make a default KSP2 theme for it to include with SpaceWarp

#

like it already has a skin for IMGUI

timber cedar
#

u gonna make a new branch for this?

#

or which branch

wicked wyvern
#

first I just want to finish the plugin itself, it's pretty barebones and without any API

timber cedar
#

i just wanna push all 425k lines of code i wrote for this

wicked wyvern
little bay
#

this is the new spacewarp csproj btw

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <Version>$(SpaceWarpVersion)</Version>
    </PropertyGroup>
    <ItemGroup>
        <Reference Include="Assembly-CSharp" Private="false" Publicize="true" />
        <Reference Include="Unity.TextMeshPro" Private="false" />
        <Reference Include="UnityEngine.UI" Private="false" />
        <Reference Include="Unity.Addressables" Private="false" />
        <Reference Include="Unity.ResourceManager" Private="false" />
        <Reference Include="KSPLogging" Private="false" />
        <Reference Include="BepInEx.ConfigurationManager" Private="false" Publicize="true">
            <HintPath>..\ThirdParty\ConfigurationManager\ConfigurationManager.dll</HintPath>
        </Reference>
    </ItemGroup>
    <ItemGroup>
        <PackageReference Include="BepInEx.BaseLib" Version="5.4.21" Publicize="true"/>
        <PackageReference Include="HarmonyX" Version="2.10.1"/>
        <PackageReference Include="BepInEx.PluginInfoProps" Version="2.1.0" PrivateAssets="all"/>
        <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.5.0"/>
        <PackageReference Include="Newtonsoft.Json" Version="12.0.1"/>
        <PackageReference Include="UnityEngine.Modules" Version="2020.3.33"/>
        <PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.0" PrivateAssets="all"/>
    </ItemGroup>
</Project>
wicked wyvern
#

does that even work without the lang version specified?

little bay
#

it is specified

#

just in a different place

wicked wyvern
#

oh

little bay
#

this file applies to all projects in the solution

sacred jasper
#

Damnn

wicked wyvern
#

ooh nice

sacred jasper
#

Someone should remake configmanager with UITK /hj

little bay
#

i just wanted to move the SpaceWarp version into it at first

#

since i wanted the patcher to have the same version

#

but... if i'm already here... might as well

wicked wyvern
little bay
#

also this file

#

which is why the HintPaths disappeared

#

it now just knows to look in external_dlls

wicked wyvern
#

very nice

#

project wizard over here

little bay
#

you see enough nice projects and pick up a thing or two

wicked wyvern
#

there are so many overlapping/similar properties and files to set them etc

#

it gives me anxiety how little standardized it feels

#

in .NET

little bay
#

its kinda hard to find documentation too

wicked wyvern
#

yeah

little bay
#
#

and that's just for properties, not even items

sacred jasper
#

I head sleep now

timber cedar
#

👀

#

cya

wicked wyvern
timber cedar
#

looks cool

wicked wyvern
#

awesome, thanks

wicked wyvern
#

yeah yeah munley just tested that UITK works even without the markup being loaded through a bundle

timber cedar
#

thats good right??

wicked wyvern
#

yep

timber cedar
#

YAY

#

WOO

#

5head

#

where is some of the uitk code?

#

i wanna read through some of it

wicked wyvern
#

uh oh

#

did SpaceWarp switch from referencing Unity dlls in 0.4 to using its nuget package in 1.0 by any chance

#

because that kinda broke my test project after I updated the SpaceWarp dependency

#

is there any way to force the project use the referenced .dlls instead of a dependency of a dependecy?

#

I can just stick with the 0.4 nuget package for testing purposes, since I don't use any 1.0 APIs anyway

#

but it complicates things just a little

#

nice, so all my methods seem to work fine for rendering

#

this is the method that creates that UI with just C#

#
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements"
        xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements"
        noNamespaceSchemaLocation="../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
    <ui:VisualElement style="flex-grow: 1;">
        <ui:Label text="This is a Label" display-tooltip-when-elided="true"/>
        <ui:Button text="This is a Button" display-tooltip-when-elided="true" name="button"/>
        <ui:Toggle label="Display the counter?" name="toggle"/>
        <ui:TextField picking-mode="Ignore" label="Text Field" text="filler text" name="input-message" />
    </ui:VisualElement>
</ui:UXML>

and this is the equivalent UXML

#

now that I know it's all working well, time for bed

#

and in the morning, I'm making waffles time to finish up the KSP2UITK library and then finally make some actual UI with it

#

🥳

little bay
#

what dependency are you trying to fix

wicked wyvern
#

I'm referencing custom versions (the ones from the UITK package) of UnityEngine.UIElements.dll and a few other related assemblies

#

And when I add a nuget reference to Unity, they don't get picked up, UIDocument and other types can't be found and can't build

#

Same when I switched SpaceWarp nuget package from 0.4 to 1.0.1

#

And when I removed it, UITK stuff was working again

timber cedar
#

removing = good

#

its the golden rule

wicked wyvern
#

Less SpaceWarp less trouble munley

#

Too bad it's a SpaceWarp mod

wicked wyvern
#

I just got into the org I'm not about to f around and find out munley

timber cedar
#

:D

#

the third sentinel of syntax allows it

wicked wyvern
#

Alright, really time to sleep now, the sun is up

timber cedar
#

plz sleep

#

uwu :3 pwease slep

mossy kraken
#

Sorry I been away this whole week, got Covid 🤒

wicked wyvern
#

Aw that sucks, hope you're doing better

mossy kraken
#

Starting to feel better now 😄

sacred jasper
#

Damn that sucks, glad your feeling better

timber cedar
#

💀

#

that sucks

#

hope you feel even better

sacred jasper
#

Damn ewy, I just looked at your curseforge page and that is impressive

mossy kraken
#

😄 Thanks

#

I been doing Minecraft modding for way over 10 years now 😄
Here are some numbers

sacred jasper
#

That is hella impressive

mossy kraken
#

Thank you!
One of the main reasons I wanted to mod KSP2 is because I am kinda burned out on modding MC right now and wanted to try something else

sacred jasper
#

Thats completely fair

mossy kraken
#

But I also quickly found out that it was way more fun to work on Space Warp instead of my own mods 😛

sacred jasper
#

Got tired of Java?

#

/j

mossy kraken
#

Been doing java for 15 years now and I have not really got tired of it.
But I much more prefer C# over it

wicked wyvern
#

who wouldn't 👀

#

there are definitely worse languages than Java but that doesn't mean I like it tbh

mossy kraken
#

I am mostly tired of the JVM itself

wicked wyvern
#

understandable

mossy kraken
#

The lang itself it pretty nice.

sacred jasper
#

Java to CIL compiler? /hj

wicked wyvern
#

Java.NET sounds like the stuff of nightmares

sacred jasper
#

Why does it actually exist

#

It's latest release was on february seventh

mossy kraken
sacred jasper
#

Nope it is

#
using java.util;

That is cursed

wicked wyvern
#

🤮

sacred jasper
#

Should I add this to space warp so people can make java mods for KSP2?

#

For legal reasons thats a joke

wicked wyvern
#

I'd rather just write mods in brainfuck

sacred jasper
#

Imagine you go to a github repository for a KSP2 mod and it's written in fucking Java

wicked wyvern
#

Scala mods when

sacred jasper
#

Nononono

import cli.System.IO.*;

public class ShowDir{

   public static void main(String[] args){
       String[] files = Directory.GetFiles(".");
       for(String file : files){
           System.out.println(file);
       }
   }
}
mossy kraken
#

Kotlin plz

wicked wyvern
#

"Your scientists were so preoccupied with whether they could, they didn’t stop to think if they should."

sacred jasper
#

I can't find much IKVM documentation

timber cedar
#

wtf

little bay
#

I know that nexus generally pays fairly little, but I've never gotten to ask anyone on curse

mossy kraken
#

Let me check

#

Its around 500$ USD /month ish

#

for 1 million monthly downloads

gilded kettle
#

good

mossy kraken
#

So around $0.50 per 1000 downloads ish

late condor
#

Thats not bad

#

Especially considering it must be mostly passive income at this point

mossy kraken
#

Ohh yes it definitely is just passive income at this point.
I just do general maintenance work like critical bug fixes etc

alpine tendon
#

@sacred jasper how is it going with the GUI skin? I haven't been able to keep track of development recently

sacred jasper
alpine tendon
#

ah good idea

#

can you create UIs programmatically with that?

alpine tendon
#

sweet

sacred jasper
#

@wicked wyvern can confirm and/or give an example

wicked wyvern
#

Will be able to be helpful in ~an hour

#

Connection is almost nonexistent at this point in the train ride

timber cedar
#

where example

#

i’ve been watching channel for an hour

#

:(

wicked wyvern
#

Just got to my computer

timber cedar
#

i’m extremely disappointed

wicked wyvern
#

had to first say hi to the ratties and doggo munley

timber cedar
#

munley can i have one rat plz

#

u can send by mail

wicked wyvern
#

two at least, they need a companion 👀

timber cedar
#

ofc

#

^^^^

wicked wyvern
#

keeping a single rat is cruel tbh

timber cedar
#

can i have two rattos plz

#

needs friends ^^^

#

he was woked

late condor
timber cedar
#

@sacred jasper we need donate button on github readme klueless

sacred jasper
#

what

timber cedar
#

donate button

#

so people can give money to hard working devs

timber cedar
sacred jasper
late condor
#

You really need to come up with a well thought out thorough plan for that kind of thing

#

You want to remove as much possible abuse as you can to avoid bad feelings

#

Opencollective is built for that kind of thing

sacred jasper
#

Yeah, if this were an individual project, I'd slap my kofi link in there and be done

#

but nope

alpine tendon
#

it's okay you can just put my donation link and have that be the only one

#

that way everyone's happy

sacred jasper
#

@wicked wyvern I was gonna add the open mods folder button, then I just realized its gonna be changed w/ UITK so

wicked wyvern
#

oh yeah, good call to just wait for that

sacred jasper
#

honestly all my next plans are dependent on it

wicked wyvern
#

I'll try to prioritize it then

#

guides and other stuff can come later

timber cedar
sacred jasper
timber cedar
#

xdddd

#

u got the reference

#

could be 1:7 klueless

#

/j

sacred jasper
#

@timber cedar getting called out

timber cedar
#

?

#

called out for what

sacred jasper
#

look in #🟣space-warp-dev

timber cedar
#

xd

wicked wyvern
#

Also someone (Sinon) removed all the braces from all the if and foreach statements. This just ends up looking like shit. This is not python. We have braces for a reason. 😅 So I added them all back.
THANK YOU @mossy kraken

timber cedar
#

nooooo

#

braces bad

#

indentation matters

wicked wyvern
#

go program in python

#

you heathen

timber cedar
#

:D

mossy kraken
#

😄

timber cedar
#

braces < indentation

sacred jasper
#

Did you see my comment about not liking my programming language then @mossy kraken lol

wicked wyvern
#

if the language is designed around it then sure

#

but not in C-like syntax languages ffs

timber cedar
#

c# supports indentation for a reason

mossy kraken
#

I did 😄
But if it is its own language I prob like it.

I like python. But I can't mix python and C#. I need my own style for both of em

#

So I don't like mixing the two

timber cedar
#

valid

late condor
#

balance in all things

mossy kraken
#

Its either all indents or all braces

wicked wyvern
#

that's just nasty

late condor
alpine tendon
#

One line if statement 🤩

timber cedar
#

i write in apple basic so idk

sacred jasper
#
if true then doSomething()

or

if true
  doSomething
timber cedar
#

we should just make spacewarp a one liner

sacred jasper
#

or

if true
{
  doSomething()
  doSomethingElse()
}
timber cedar
wicked wyvern
#

but not in C#

#

pls

timber cedar
#

okok

#

fineeeeee

#

not very minimalistic klueless

wicked wyvern
#

verbose and readable > minimalistic

sacred jasper
#

minimalistic isn't always good

#

brainfuck is minimalistic

wicked wyvern
#

lmao

#

just write in 0s and 1s

#

that's minimalistic af

timber cedar
#

just write in

#

there’s a white space esolang

#

i forgot what it’s called

wicked wyvern
late condor
timber cedar
#

maybe yeah

wicked wyvern
#

not that difficult to find klueless

sacred jasper
#

Should add a whitespace interface to space warp

timber cedar
#

yes

sacred jasper
#

Or a white space implementation of CIL

timber cedar
#

white space os

wicked wyvern
wicked wyvern
timber cedar
#

:o

#

video tutorial example

wicked wyvern
#

it's nowhere near finished so nope

#

I'm not adding a release for now (and the two pre-releases don't work fully), I want to finish making an API first

#

but you can download and compile the stuff in master

timber cedar
#

gogo

#

when i get home

wicked wyvern
#

and it will work

timber cedar
#

nice exit

#

how to rest

wicked wyvern
timber cedar
#

munix are you french

#

i forgor

wicked wyvern
#

Czech

#

lol

timber cedar
#

potato potato

#

i should visit czechland

#

i was in vienna a month ago :(

wicked wyvern
#

oh damn, I've never actually been in Austria, other than passing through it

#

even though it's one of our neighboring countries

#

weird

timber cedar
#

skiing is 😎 there

wicked wyvern
#

I don't ski munley

#

never have been once

timber cedar
#

i think you hate happiness

wicked wyvern
#

I'd rather go somewhere warm than in the mountains, thanks

timber cedar
timber cedar
#

you should go mountain biking

#

in austria

timber cedar
#

do u not excerise

#

are u 300lbs

#

get it american units for fat ^^^

wicked wyvern
#

I don't speak freedom units

timber cedar
#

idk either do i

#

i think 300 a lot

wicked wyvern
#

when I'm done with all this UI stuff, the next thing I want to do it add more templates to the SpaceWarp.Template package

#

so far it only has one with some basic examples of doing stuff like IMGUI, app bar buttons, using SW's API extensions, etc

#

I'd like to have at least three

#

empty project, basic project (the current one), part mod project

timber cedar
#

sounds good

wicked wyvern
#

oh I forgot to mention

#

I pushed my testing UITK mod to GitHub just for you 😛

timber cedar
#

lol

#

i’m on ski lift 👀 can’t really look

sacred jasper
#

is still waiting for UITK stuff

timber cedar
#

do we not have install instructions on the wiki

#

or on the github

#

???

sacred jasper
#

For space warp specifically

timber cedar
#

yes

#

we need to add to the spacedock

wicked wyvern
timber cedar
#

#1088988819266740224 message

wicked wyvern
#

for the love of all that is holy how many times am I going to have to rebase that fork

#

🥲

sacred jasper
#

Blame Ewy this time

#

He undid some of Sinon's changes