forked from allista/GroundConstruction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GCFilterManager.cs
37 lines (34 loc) · 1012 Bytes
/
GCFilterManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// CategoryFilter.cs
//
// Author:
// Allis Tauri <[email protected]>
//
// Copyright (c) 2017 Allis Tauri
using AT_Utils;
namespace GroundConstruction
{
[KSPAddon(KSPAddon.Startup.EditorAny, false)]
public class GCFilterManager : SimplePartFilter
{
public GCFilterManager()
{
SUBCATEGORY = "Global Construction";
FOLDER = "GroundConstruction/Icons";
ICON = "GC-category";
}
protected override bool filter(AvailablePart part)
{
if(part.category != PartCategories.none)
{
if(part.partPrefab != null)
{
if(check_module(part.partPrefab.FindModuleImplementing<IKitContainer>() as PartModule))
return true;
if(check_module(part.partPrefab.FindModuleImplementing<WorkshopBase>()))
return true;
}
}
return false;
}
}
}