Skip to content

Commit ec6db2f

Browse files
Updated to add large icon to the toolbar.BigTexturePath (new in toolbar 1.7.20)
Added InstallChecker Updated AssemblyVersion.tt Changed the message about: WARNING: RegisterMod to only show when debugmode is true Removed the unBlur mod as a hard dependency. It will use UnBlur if it's there, otherwise will fall back to reading the file Removed dependency check for unBlur
1 parent a8db504 commit ec6db2f

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

ChangeLog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
0.1.8
1+
0.1.8.1
22
Updated to add large icon to the toolbar.BigTexturePath (new in toolbar 1.7.20)
33
Added InstallChecker
44
Updated AssemblyVersion.tt

GameData/001_ToolbarControl/ToolbarControl.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"VERSION": {
1010
"MAJOR": 0,
1111
"MINOR": 1,
12-
"PATCH": 7,
12+
"PATCH": 8,
1313
"BUILD": 0
1414
},
1515
"KSP_VERSION": {

ToolbarControl.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"MAJOR": 0,
1111
"MINOR": 1,
1212
"PATCH": 8,
13-
"BUILD": 0
13+
"BUILD": 1
1414
},
1515
"KSP_VERSION": {
1616
"MAJOR": 1,

ToolbarControl/AssemblyVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

1111
using System.Reflection;
1212

13-
[assembly: AssemblyVersion("0.1.7.0")]
13+
[assembly: AssemblyVersion("0.1.8.0")]

ToolbarControl/IntroWindow.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,11 @@ private bool Load(string fileName)
128128
bool loaded = false;
129129
void ProcessLine(string line)
130130
{
131-
Log.Debug(ConfigInfo.debugMode, "ProcessLine, line: " + line);
132131
if (line.Length >= 7 && line.Substring(0, 7) == "<IMAGE=")
133132
{
134133
string s = line.Substring(7, line.Length - 8);
135-
Log.Debug(ConfigInfo.debugMode, "Process line, image: " + s);
136-
Texture2D image;
137-
if (ToolbarControl.LoadImageFromFile(out image, KSPUtil.ApplicationRootPath + "GameData/" + s))
134+
Texture2D image= null;
135+
if (ToolbarControl.LoadImageFromFile(ref image, KSPUtil.ApplicationRootPath + "GameData/" + s))
138136
{
139137
images.Add(image);
140138
lines.Add(line);

ToolbarControl/ToolbarControl.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Collections.Generic;
55
using KSP.UI;
66
using KSP.UI.Screens;
7-
7+
using DDSHeaders;
88

99
namespace ToolbarControl_NS
1010
{
@@ -607,7 +607,7 @@ private void UpdateToolbarIcon(bool firstTime = false)
607607
// easier to specify different cases than to change case to lower. This will fail on MacOS and Linux
608608
// if a suffix has mixed case
609609
static string[] imgSuffixes = new string[] { ".png", ".jpg", ".gif", ".PNG", ".JPG", ".GIF", ".dds", ".DDS" };
610-
#if false
610+
#if true
611611
public static Boolean LoadImageFromFile(ref Texture2D tex, String fileNamePath)
612612
{
613613

@@ -670,7 +670,7 @@ public static Boolean LoadImageFromFile(ref Texture2D tex, String fileNamePath)
670670
catch (Exception ex)
671671
{
672672
Log.Error("Failed to load the texture: " + path);
673-
Log.Error(ex.Message);
673+
Log.Error("Error: " + ex.Message);
674674
}
675675
}
676676
else
@@ -831,7 +831,7 @@ Texture2D GetTextureViaUnBlur(string path, bool asNormalMap)
831831

832832
Texture2D GetTexture(string path, bool asNormalMap)
833833
{
834-
Texture2D tex;
834+
Texture2D tex = new Texture2D(16, 16, TextureFormat.ARGB32, false); ;
835835
if (RegisterToolbarBlizzyOptions.unBlurPresent)
836836
{
837837
// ask unBlur to look for the texture in GameDatabase, remove mipmaps if necessary, and return it
@@ -840,8 +840,21 @@ Texture2D GetTexture(string path, bool asNormalMap)
840840
}
841841

842842
// texture not found in GameDatabase
843-
LoadImageFromFile(out tex, TexPathname(path));
844-
return tex;
843+
//LoadImageFromFile(out tex, TexPathname(path));
844+
//return tex;
845+
846+
if (LoadImageFromFile(ref tex, TexPathname(path)))
847+
return tex;
848+
if (GameDatabase.Instance.ExistsTexture(path))
849+
{
850+
tex = GameDatabase.Instance.GetTexture(path, false);
851+
return tex;
852+
}
853+
854+
855+
Log.Error("Cannot find texture to load:" + path);
856+
857+
return null;
845858
}
846859
#endif
847860

0 commit comments

Comments
 (0)