Skip to content

Commit

Permalink
Fixed path for loading files (broken by new launcher)
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxgurugamer committed Dec 7, 2022
1 parent 6bfc823 commit 66be5e0
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 6 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ChangeLog

1.9.10.2
Fixed path for loading files (broken by new launcher)

1.9.10.1
Fixed small memory leak caused by not releasing callback from GameEvents

Expand Down
2 changes: 1 addition & 1 deletion GameData/ScienceAlert/ScienceAlert.version
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"KSP_VERSION": {
"MAJOR": 1,
"MINOR": 12,
"PATCH": 3
"PATCH": 4
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
Expand Down
25 changes: 25 additions & 0 deletions GameData/ScienceAlert/ScienceAlert.version.1-12-3
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"NAME": "ScienceAlert",
"URL": "http://ksp.spacetux.net/avc/ScienceAlert",
"DOWNLOAD": "https://spacedock.info/mod/1886/ScienceAlert%20ReAlerted",
"GITHUB": {
"USERNAME": "linuxgurugamer",
"REPOSITORY": "ScienceAlert"
},
"VERSION": {
"MAJOR": 1,
"MINOR": 9,
"PATCH": 10,
"BUILD": 1
},
"KSP_VERSION": {
"MAJOR": 1,
"MINOR": 12,
"PATCH": 3
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
"MINOR": 9,
"PATCH": 0
}
}
4 changes: 2 additions & 2 deletions ScienceAlert.version
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"MAJOR": 1,
"MINOR": 9,
"PATCH": 10,
"BUILD": 1
"BUILD": 2
},
"KSP_VERSION": {
"MAJOR": 1,
"MINOR": 12,
"PATCH": 3
"PATCH": 4
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
Expand Down
25 changes: 25 additions & 0 deletions ScienceAlert.version.1-12-3
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"NAME": "ScienceAlert",
"URL": "http://ksp.spacetux.net/avc/ScienceAlert",
"DOWNLOAD": "https://spacedock.info/mod/1886/ScienceAlert%20ReAlerted",
"GITHUB": {
"USERNAME": "linuxgurugamer",
"REPOSITORY": "ScienceAlert"
},
"VERSION": {
"MAJOR": 1,
"MINOR": 9,
"PATCH": 10,
"BUILD": 1
},
"KSP_VERSION": {
"MAJOR": 1,
"MINOR": 12,
"PATCH": 3
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
"MINOR": 9,
"PATCH": 0
}
}
2 changes: 1 addition & 1 deletion Source/ReeperCommon/ResourceUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static Texture2D as2D(this Texture tex)
public static Texture2D LoadImage(string textureName, bool relativeToGameData = true)
{
if (relativeToGameData)
textureName = "GameData/ScienceAlert/PluginData/Textures/" + textureName;
textureName = KSPUtil.ApplicationRootPath + "GameData/ScienceAlert/PluginData/Textures/" + textureName;
var texture2D = new Texture2D(2, 2);
if (!ToolbarControl.LoadImageFromFile(ref texture2D, textureName))
Log.Debug("[ScienceAlert]:Failed to find texture '{0}'", textureName);
Expand Down
4 changes: 2 additions & 2 deletions Source/ScienceAlert/ScienceAlert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void SliceAtlasTexture()
// Load textures for animation here
//
Texture2D sheet = ResourceUtil.LoadImage("sheet.png");
if (!ToolbarControl.LoadImageFromFile(ref sheet, "GameData/ScienceAlert/PluginData/Textures/sheet.png"))
if (!ToolbarControl.LoadImageFromFile(ref sheet, KSPUtil.ApplicationRootPath + "GameData/ScienceAlert/PluginData/Textures/sheet.png"))
{
Log.Error("Unable to ToolbarControl.LoadImageFromFile for sheet.png, falling back to ResourceUtil.LoadImage");
}
Expand Down Expand Up @@ -143,7 +143,7 @@ private void SliceAtlasTexture()

sheet = ResourceUtil.LoadImage("sheet-38.png");

if (!ToolbarControl.LoadImageFromFile(ref sheet, "GameData/ScienceAlert/PluginData/Textures/sheet-38.png"))
if (!ToolbarControl.LoadImageFromFile(ref sheet, KSPUtil.ApplicationRootPath + "GameData/ScienceAlert/PluginData/Textures/sheet-38.png"))
{
Log.Error("Unable to ToolbarControl.LoadImageFromFile for sheet-38, falling back to ResourceUtil.LoadImage");
}
Expand Down

0 comments on commit 66be5e0

Please sign in to comment.