Jump to content

[1.3.0] Filter Extensions 3.0.4 (Jul 11)


Crzyrndm

Recommended Posts

The auto-generated listing should require no cfg (if it's not showing I've screwed up the release...). It'll show up as a red icon in the advanced menu (and once you click any category it'll have the same icon texture as the manufacturer tab. I may have forgotten to refresh it :sealed:)

To add a mod check for the "Filter by Function" category you would add the following check node


SUBCATEGORY
{
//// other subcategory stuff
FILTER
{
//// other filter stuff
CHECK
{
type = folder
value = *insert mod folder name here*
pass = true
}
}
}

PS

Any opposition to making the default parts list mode to be advanced (ie. all categories and filters displayed by default)?

Edited by Crzyrndm
Link to comment
Share on other sites

Hrmm... I appear to be getting the auto generated Mod filter list, and all the tabs (question marks like you said) are there with all the mod folders, but none of them filter anything, And it also breaks the part selector whenever i select the Filter by mod button.

The debug log is saying "KeyNotFoundException: The given key was not present in the dictionary." when the Filter by mod button is clicked.

Link to comment
Share on other sites

Alright, just to be 100% sure, you can try this (it's the .dll direct from github, just overwrite the existing one), but I'd say that your output.log would be more productive

The debug log is saying "KeyNotFoundException: The given key was not present in the dictionary." when the Filter by mod button is clicked.

Er, ok...

I know where that originates from, but I'd like to know why it has occured so I can fix the root cause. I'll include some logging with the fix so if you wouldn't mind uploading the output.log after the next version that would be much appreciated :)

EDIT

Probable fix for rabidninjawombat's issue here (If that doesn't resolve it, I need logs)

Edited by Crzyrndm
Link to comment
Share on other sites

@wombat

Can you try the .dll in my previous post and attach the log from that. The one you uploaded doesn't appear to have Filter Extensions installed at all and I added some extra logging as well as a fix that should let it handle the errors properly.

@BrutalRIP

Can you add this to a cfg anywhere in gamedata and let me know if the category "TestAND" shows up in Filter by Function. I think I know what your problem is (linux/windows derp), but just in case ;)

EDIT

BrutalRIP, your issue may actually be compunded by an error in NF Solar's part filter. Somehow it's getting itself all crossed up trying to load the icons and that results in Filter Extensions failing

Edited by Crzyrndm
Link to comment
Share on other sites

This should resolve any possibility of a platform issue, could you try that without Near Future Solar (just to make sure that is the issue)

not sure what fixed it either removing near future solar or the .dll but its working now :) will test more in morning need sleep 3:30 am here in uk lol

Link to comment
Share on other sites

I tried with the updated .dll , I had the same problem. I could see the red icons with question marks but clicking them didn't show any parts. I deleted near future solar and rebooted, it worked. I can now sort by Mod. What is it about near future solar that it doesn't play well with it?

Edit: That was before you Ninja posted on me. Is there another new .dll now?

Edit2: I see it now, downloading and trying with Near Future Solar.

EDIT: YAY! It works with Near Future Solar now!

Edited by Ziff
Link to comment
Share on other sites

EDIT: YAY! It works with Near Future Solar now!

NF Solar seems to be having an intermittent error that's crashing functionality that Filter Extensions relies on. The problem *probably* still exists, but there's not much I can do about it

Link to comment
Share on other sites

I tried with the updated .dll , I had the same problem. I could see the red icons with question marks but clicking them didn't show any parts. I deleted near future solar and rebooted, it worked. I can now sort by Mod. What is it about near future solar that it doesn't play well with it?

Edit: That was before you Ninja posted on me. Is there another new .dll now?

Edit2: I see it now, downloading and trying with Near Future Solar.

EDIT: YAY! It works with Near Future Solar now!

Just loaded up the new DLL and Near Future Solar by themselves on a test install and it seems to work just fine and dandy =D

Still not working on my main install, When clicking on the Filter by mod button, no folder show up. So i must have another conflict i cant find. :( (dont wanna delete NFS as i have lots of ships out there with the panels lol)

If it makes a diffrence my test install is in the to level C:\ drive and my Main install is in the steam folder.

I updated the output log with the latest one

https://dl.dropboxusercontent.com/u/19908938/output_log.txt

Only thing that popped out at me while looking at the output log.


AddonLoader: Instantiating addon 'Core' from assembly 'FilterExtensions'

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)


ArgumentException: An element with the same key already exists in the dictionary.
at System.Collections.Generic.Dictionary`2[System.String,System.String].Add (System.String key, System.String value) [0x00000] in <filename unknown>:0


at FilterExtensions.Core.Awake () [0x00000] in <filename unknown>:0
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
AddonLoader:StartAddons(Startup)
AddonLoader:OnLevelWasLoaded(Int32)

Edit: Just saw you last post =) Thanks for looking into it.

Link to comment
Share on other sites

Nice Extension, but is there a way to access the filters by source, like the "PartCategorizer.SetPanel_FunctionScience();" otherwise scrolling throught them will be a bit difficult.

I will have a look and see what I can do.

Link to comment
Share on other sites

Nice Extension, but is there a way to access the filters by source, like the "PartCategorizer.SetPanel_FunctionScience();" otherwise scrolling throught them will be a bit difficult.

This is how I would scroll through subcategories (tested and working generally, still need to handle list end and other non-standard stuff). It finds the selected subcategory, and then sets the previous or next subcategory selected on a button press.

int index = 0;
foreach (PartCategorizer.Category c in PartCategorizer.Instance.filters)
{
if (c.button.activeButton.State == RUIToggleButtonTyped.ButtonState.TRUE)
{
print(c.button.categoryName);
foreach (PartCategorizer.Category sC in c.subcategories)
{
if (sC.button.activeButton.State == RUIToggleButtonTyped.ButtonState.TRUE)
{
print(sC.button.categoryName);
print(index = c.subcategories.FindIndex(sC2 => sC2.button.categoryName == sC.button.categoryName));
}
}
if (Input.GetKeyDown(KeyCode.DownArrow))
{
c.subcategories[index + 1].button.activeButton.SetTrue(c.subcategories[index + 1].button.activeButton, RUIToggleButtonTyped.ClickType.FORCED);
c.button.activeButton.SetTrue(c.button.activeButton, RUIToggleButtonTyped.ClickType.FORCED);
}
else if (Input.GetKeyDown(KeyCode.UpArrow))
{
c.subcategories[index - 1].button.activeButton.SetTrue(c.subcategories[index + 1].button.activeButton, RUIToggleButtonTyped.ClickType.FORCED);
c.button.activeButton.SetTrue(c.button.activeButton, RUIToggleButtonTyped.ClickType.FORCED);
}
break;
}
}

It's messy, incomplete (dealing with the ends of the list, doesn't work for the subassemblies and custom categories), and entirely unoptimised (index doesn't need to be found unless the relevant keys are pressed) but the method is sound.

Edited by Crzyrndm
Link to comment
Share on other sites

This is how I would scroll through subcategories (tested and working generally, still need to handle list end and other non-standard stuff). It finds the selected subcategory, and then sets the previous or next subcategory selected on a button press.

int index = 0;
foreach (PartCategorizer.Category c in PartCategorizer.Instance.filters)
{
if (c.button.activeButton.State == RUIToggleButtonTyped.ButtonState.TRUE)
{
print(c.button.categoryName);
foreach (PartCategorizer.Category sC in c.subcategories)
{
if (sC.button.activeButton.State == RUIToggleButtonTyped.ButtonState.TRUE)
{
print(sC.button.categoryName);
print(index = c.subcategories.FindIndex(sC2 => sC2.button.categoryName == sC.button.categoryName));
}
}
if (Input.GetKeyDown(KeyCode.DownArrow))
{
c.subcategories[index + 1].button.activeButton.SetTrue(c.subcategories[index + 1].button.activeButton, RUIToggleButtonTyped.ClickType.FORCED);
c.button.activeButton.SetTrue(c.button.activeButton, RUIToggleButtonTyped.ClickType.FORCED);
}
else if (Input.GetKeyDown(KeyCode.UpArrow))
{
c.subcategories[index - 1].button.activeButton.SetTrue(c.subcategories[index + 1].button.activeButton, RUIToggleButtonTyped.ClickType.FORCED);
c.button.activeButton.SetTrue(c.button.activeButton, RUIToggleButtonTyped.ClickType.FORCED);
}
break;
}
}

It's messy, incomplete (dealing with the ends of the list, doesn't work for the subassemblies and custom categories), and entirely unoptimised (index doesn't need to be found unless the relevant keys are pressed) but the method is sound.

Nice, my try is a lot more stuff, and not as generic as yours.

Link to comment
Share on other sites

v1.4 released

  • Added category types. Currently only allows the stock Filter by Function subcategories to be automatically added to a mod category
  • Changed part list to default to advanced mode (categories visible). One less unnecesary click ;)
  • Filter by Manufacturer tab now sorts parts by mod instead of manufacturer. Filter by Mod category removed

I'm leaving the Filter by Manufacturer Category alone for the most part to avoid conflicts with other mods. It just clears out all the "manufacturers" and replaces it with the mod folders.

To generate a "mod category" which has all the stock filter by function subcategories already visible, just add the "type = mod" and "value = *insert folder name*" keys


CATEGORY
{
title = TestSQUAD
icon = R&D_node_icon_experimentalmotors
colour = #FF00FF00
type = mod
value = Squad
}

NOTE: Any subcategories added will NOT be subject to this limitation. You still need to add a folder CHECK if you want it to be for a specific mod.

There is a part category type CHECK coming with the next version (I forgot to add a reference to it, it can wait), so you can check for parts by which tab they would show up in the stock parts list ;)

Finally, the next release should include support for specifying multiple categories per subcategory (ie. category = Category1, Category2, ...) and multiple mods per "Mod Category" so you can group a whole bunch of smaller ones together.

Edited by Crzyrndm
Link to comment
Share on other sites

Great Mod.

Rigth now I'm just playing with it. I really like the autotag equivalent function you have made so each mod has it's own category. For most small mods works great (with USI i will have to made some filters i guess). Anyway, my main issue rigth now is that I'm not able to load any icons excep the ones located in the squad folder. I'm trying to create custom icons for all the mods I have (mostly modifications from the icon I have for the old part catalog). I simply don't know where to put the icons so they work. the only place seems to work for autoicons is the squad folder (so the icons are automaticaly selected if they have the same name as the folder). Tried the filterIcon folder you named, and it doesn't work.

Does the folder only work with cfg files? am I missing something?

Link to comment
Share on other sites

Does the folder only work with cfg files? am I missing something?

Er, It's always possible that I *may* have managed to break something, I'll run a few tests

Icons don't have to be located anywhere specific anymore, they just have to be dimensions < 40 pixels (ie. 40x40 is the maximum).

To use an icon in a config, you just specify the image name with no extension or filepath (eg. Filter Extensions / Icons / icon.png would specified in a cfg by just: icon)

To use an icon with the auto loader, you just have to match the names of the icon and the category/subcategory. It only applies to auto generated subcategories and all categories, not any subcategories specified by cfg.

Anyway, sounds like I need to go and make sure that's all working as intended :wink:

EDIT

Looks like I broke something...

EDIT2

So the breakage seems to have originated somewhere in the actual texture loading mechanism. It'll be fixed in the next release or you can pull the dll from github

While I was at it, I also found and fixed several issues with editing and deleting the generated subcategories so if you were having any issues with that, pulling latest will also help :D (oh, and a slipup in my hex => colour routine that was causing everything except 0xFF to fail horribly. Also fixed)

EDIT3

Got icons loading from anywhere again. Those little mistakes really make you pay :(. Should be a release shortly, just got to touch up the CSV subcategories

Edited by Crzyrndm
Link to comment
Share on other sites

v1.5 released

  • Mod Categories now support groups of mods. Specify folders with comma's between them (eg. value = Mod1, Mod2, Mod3, ...)
  • Subcategories now support adding to multiple categories. Specify categories with comma's between them (eg. category = cat1, cat2, cat3, ...)
  • Icon loader is working again. All images/textures inside GameData with dimensions less than 40x40 are accessible by autoloader or cfg
  • Fixed github issue #1 with category colour that made any value less than 0xFF read as 0x00
  • Fixed edit and delete cfg handling

And now, I *think* everything should be working as intended again. ​*Waits for barrage of bugs* (random logging I forgot to remove doesn't count)

Edited by Crzyrndm
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...