Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
V0.23.0.0
V0.23.1.0
Compile for KSP 1.2.1
Fix Editor customer Filter for DeepFreeze parts.
Fix problem with EC and Heat settings being disabled in new game difficulty settings. https://github.com/JPLRepo/DeepFreeze/issues/63
Fix problem with CRY-0300 Doors opening/closing with JSI Advanced Transparent Pods showing an empty Internal until fully open, unfortunately
it does mean you can no longer see the doors animate open/closed correctly. This is a limitation of the JSI Advanced Transparent Pods and camera setup for KSP.
Performance improvement pass on the code.
Fixed Difficulty Settings.
Fixed incorrect use of Blizzy ToolBar on game startup even if user has set to use Stock Icon in difficulty settings.
Implemented inter-mod GameEvents - better integration possible with other mods.
Fixed bug when Comatose Kerbal dies.
Fixed Vessel Switching to unloaded vessel when Low EC or overheat warning occurs.
Removed CRY-0300 door sound when JSI Advanced Transparent Pods mod shuts the door (not the user).
V0.23.0.0
Update for KSP 1.2
Fix Coma Kerbals to register/unregister their traits at the correct time and handle Tourist kerbals.
Added Setting in the menu that allows you to turn on/off the VAB/SPH Deepfreeze Parts Category Icon.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"NAME":"DeepFreeze Continued...",
"URL":"http://ksp-avc.cybutek.net/version.php?id=183",
"DOWNLOAD":"http://spacedock.info/mod/142/DeepFreeze%20Continued...",
"VERSION":{"MAJOR":0,"MINOR":23,"PATCH":0,"BUILD":0},
"KSP_VERSION":{"MAJOR":1,"MINOR":2,"PATCH":0},
"VERSION":{"MAJOR":0,"MINOR":23,"PATCH":1,"BUILD":0},
"KSP_VERSION":{"MAJOR":1,"MINOR":2,"PATCH":1},
"KSP_VERSION_MIN":{"MAJOR":1,"MINOR":2,"PATCH":0},
"KSP_VERSION_MAX":{"MAJOR":1,"MINOR":2,"PATCH":0}
"KSP_VERSION_MAX":{"MAJOR":1,"MINOR":2,"PATCH":1}
}
63 changes: 27 additions & 36 deletions Source/DFEditorFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
*/

using System.Collections.Generic;
using System.IO;
using KSP.UI.Screens;
using RUI.Icons.Selectable;
using UnityEngine;
using System.Reflection;
using System.Linq;

namespace DF
{
Expand All @@ -31,7 +28,7 @@ public class DFEditorFilter : MonoBehaviour
// This class ass a Filter Icon to the Editor to show DeepFreeze Parts
// which currently consist of any partprefab that has component DeepFreezer (All the freezer parts)
// and the GlykerolTankRadial.
private static List<AvailablePart> avPartItems;
private static List<AvailablePart> avPartItems = new List<AvailablePart>();
public static DFEditorFilter Instance;
internal string category = "Filter by Function";
internal string subCategoryTitle = "DeepFreeze Items";
Expand All @@ -54,39 +51,24 @@ public void Awake()
DontDestroyOnLoad(this);
}

public void Setup(bool FilterOn)
public void Setup()
{
Debug.Log("DFEditorFilter Start");
avPartItems = new List<AvailablePart>();
//icon_DeepFreeze_Editor = new Texture2D(32, 32, TextureFormat.ARGB32, false);

RemoveSubFilter();
AddPartUtilitiesCat();
GameEvents.onGUIEditorToolbarReady.Remove(SubCategories);


DFMMCallBack();

if (!FilterOn)
if (!HighLogic.CurrentGame.Parameters.CustomParams<DeepFreeze_SettingsParms_Sec3>().EditorFilter)
{
Debug.Log("EditorFilter Option is Off");
PartCategorizer.Category Filter =
PartCategorizer.Instance.filters.Find(f => f.button.categoryName == category);
if (Filter != null)
{
PartCategorizer.Category subFilter =
Filter.subcategories.Find(f => f.button.categoryName == subCategoryTitle);
if (subFilter != null)
{
//MethodInfo subFilterDeleteMethod =
// typeof(PartCategorizer.Category).GetMethod("DeleteSubcategory",
// BindingFlags.Instance | BindingFlags.NonPublic);
//subFilterDeleteMethod.Invoke(subFilter, null);
subFilter.DeleteSubcategory();
}
}
GameEvents.onGUIEditorToolbarReady.Remove(SubCategories);
AddPartUtilitiesCat();
return;
}


Debug.Log("EditorFilter Option is On");
DFMMCallBack();
RemovePartUtilitiesCat();
GameEvents.onGUIEditorToolbarReady.Add(SubCategories);
/*
//Attempt to add Module Manager callback - find the base type
Expand All @@ -108,9 +90,6 @@ public void Setup(bool FilterOn)

}*/
//DFMMCallBack();
//load the icons
//icon_DeepFreeze_Editor.LoadImage(File.ReadAllBytes("GameData/REPOSoftTech/DeepFreeze/Icons/DeepFreezeEditor.png"));
RemovePartUtilitiesCat();
Debug.Log("DFEditorFilter Awake Complete");
}

Expand All @@ -131,11 +110,26 @@ public bool DFMMCallBack()
return true;
}

private void RemoveSubFilter()
{
if (PartCategorizer.Instance != null)
{
PartCategorizer.Category Filter = PartCategorizer.Instance.filters.Find(f => f.button.categoryName == category);
if (Filter != null)
{
PartCategorizer.Category subFilter = Filter.subcategories.Find(f => f.button.categoryName == subCategoryTitle);
if (subFilter != null)
{
subFilter.DeleteSubcategory();
}
}
}
}

private void RemovePartUtilitiesCat()
{
foreach (AvailablePart avPart in avPartItems)
{
//PartCategorizer.Instance.subcategoryFunctionUtility.RemovePart(avPart);
avPart.category = PartCategories.none;
}
}
Expand All @@ -144,7 +138,6 @@ private void AddPartUtilitiesCat()
{
foreach (AvailablePart avPart in avPartItems)
{
//PartCategorizer.Instance.subcategoryFunctionUtility.AddPart(avPart);
avPart.category = PartCategories.Utility;
}
}
Expand All @@ -160,12 +153,10 @@ private bool EditorItemsFilter(AvailablePart avPart)

private void SubCategories()
{
RemoveSubFilter();
Icon filterDeepFreeze = new Icon("DeepFreezeEditor", Textures.DeepFreeze_Editor, Textures.DeepFreeze_Editor, true);
PartCategorizer.Category Filter = PartCategorizer.Instance.filters.Find(f => f.button.categoryName == category);
PartCategorizer.AddCustomSubcategoryFilter(Filter, subCategoryTitle, filterDeepFreeze, p => EditorItemsFilter(p));
//RUIToggleButtonTyped button = Filter.button.activeButton;
//button.SetFalse(button, RUIToggleButtonTyped.ClickType.FORCED);
//button.SetTrue(button, RUIToggleButtonTyped.ClickType.FORCED);
}
}
}
Loading