Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit f1fd083

Browse files
authored
Merge pull request #16456 from crowplexus/patch-8
Fix Chart Saving in Linux and MacOS, Display App Icon in MacOS
2 parents ebdbd76 + f8110c0 commit f1fd083

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Project.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189

190190
<!-- _________________________________ Custom _______________________________ -->
191191

192-
<assets path='art/icons/iconOG.png' rename='icon.png' if="linux" />
192+
<assets path='art/icons/iconOG.png' rename='icon.png' if="linux || mac" />
193193

194194
<icon path="art/icons/icon16.png" size='16'/>
195195
<icon path="art/icons/icon32.png" size='32'/>

source/Main.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import crowplexus.iris.Iris;
2323
import psychlua.HScript.HScriptInfos;
2424
#end
2525

26-
#if linux
26+
#if (linux || mac)
2727
import lime.graphics.Image;
2828
#end
2929

@@ -192,7 +192,7 @@ class Main extends Sprite
192192
}
193193
#end
194194

195-
#if linux
195+
#if (linux || mac) // fix the app icon not showing up on the Linux Panel / Mac Dock
196196
var icon = Image.fromFile("icon.png");
197197
Lib.current.stage.window.setIcon(icon);
198198
#end

source/backend/Song.hx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ class Song
126126
if(folder == null) folder = jsonInput;
127127
PlayState.SONG = getChart(jsonInput, folder);
128128
loadedSongName = folder;
129-
chartPath = _lastPath.replace('/', '\\');
129+
chartPath = _lastPath;
130+
#if windows
131+
// prevent any saving errors by fixing the path on Windows (being the only OS to ever use backslashes instead of forward slashes for paths)
132+
chartPath = chartPath.replace('/', '\\');
133+
#end
130134
StageData.loadDirectory(PlayState.SONG);
131135
return PlayState.SONG;
132136
}
@@ -179,4 +183,4 @@ class Song
179183
}
180184
return songJson;
181185
}
182-
}
186+
}

0 commit comments

Comments
 (0)