linuxgurugamer / FilterExtension

Extensions to KSP's stock editor part filters
Other
12 stars 11 forks source link

UniversalStorage2 not shown as own category #47

Open Gordon-Dry opened 2 years ago

Gordon-Dry commented 2 years ago

But it should, as the config is crystal clear: GameData\000_FilterExtensions_Configs\Default\Mod_UniversalStorage.cfg

CATEGORY:NEEDS[UniversalStorage]
{
    name = UniversalStorage
    icon = UniversalStorage
    colour = #FFF0F0F0
    all = true

    FILTER
    {
        CHECK
        {
            type = folder
            value = UniversalStorage
        }
    }

    SUBCATEGORIES
    {
        list = 0,Pods
        list = 1,Fuel Tanks
        list = 2,Engines
        list = 3,Command and Control
        list = 4,Structural
        list = 5,Aerodynamics
        list = 6,Utility
        list = 7,Science
        list = 8,Undefined
    }
}

CATEGORY:NEEDS[UniversalStorage2]
{
    name = UniversalStorage2
    icon = UniversalStorage
    colour = #FFF0F0F0
    all = true

    FILTER
    {
        CHECK
        {
            type = folder
            value = UniversalStorage2
        }
    }

    SUBCATEGORIES
    {
        list = 0,Pods
        list = 1,Fuel Tanks
        list = 2,Engines
        list = 3,Command and Control
        list = 4,Structural
        list = 5,Coupling
        list = 6,Payload
        list = 7,Aerodynamics
        list = 8,Electrical
        list = 9,Science
        list = 10,Utility
        list = 11,Undefined
    }
}

Could it be that the code just sees the "UniversalStorage" and ignores the following "2" and so ignores the existance of the folder "UniversalStorage2"?

As far as I can remember it worked flawless before my last hiatus, about a year ago.

Gordon-Dry commented 2 years ago

I try by splitting the config to two, so GameData\000_FilterExtensions_Configs\Default\Mod_UniversalStorage.cfg GameData\000_FilterExtensions_Configs\Default\Mod_UniversalStorage2.cfg

Gordon-Dry commented 2 years ago

Didn't work.

I also tried to check for those ominous hidden Unix-characters that become visible by changing the encoding to Window CR LF, but that also didn't do it.

Gordon-Dry commented 2 years ago

Wait ... I guess I found something... At the end of list = 11,Undefined? is a ? Well, testing...

Gordon-Dry commented 2 years ago

Okay, I got it somehow - but as the style of config creation always was weird at UniversalStorage it's hard to pinpoint why the result is not filtered into subcategories: Screen-2021-12-02_18-56-04

Now I need to know how to check for single entries inside a MODULE USFuelSwitch which looks like this

            MODULE
            {
                name = USFuelSwitch
                SwitchID = 0
                resourceNames = LiquidFuel,Oxidizer;LiquidFuel,Oxidizer;LiquidFuel,Oxidizer;LiquidFuel,Oxidizer
                resourceAmounts = 10,12;20,24;30,36;40,48
                initialResourceAmounts = 10,12;20,24;30,36;40,48
                tankCost = 0;35;70;105
                tankMass = 0;0.014;0.028;0.042
                hasGUI = False
                availableInEditor = False
                displayCurrentTankCost = True
                ShowInfo = False
            }

because the field resourceNames is an array - is FilterExtensions capacle of parsing such a field?

Gordon-Dry commented 2 years ago

btw the check for "type = field" is even not mentioned if the FilterExtension wiki.

Gordon-Dry commented 2 years ago

It seems that over the years and several older FE threads people tried it again and again to create proper working filter definitons for UniversalStorage and then UniversalStorage2 - those mods are just so much outside of common logic and syntax that it's impossible with the "default" rules FE provides.

But at least the subcategory is shown for now ...