Skip to content

Commit d465fd5

Browse files
committed
more mac\linux fixes
1 parent 7941654 commit d465fd5

File tree

7 files changed

+28
-6
lines changed

7 files changed

+28
-6
lines changed

source/Main.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ class Main extends Sprite
124124
hxvlc.util.Handle.init(#if (hxvlc >= "1.8.0") ['--no-lua'] #end);
125125
#end
126126

127+
#if windows
127128
backend.window.CppAPI._setWindowLayered();
128129
backend.window.CppAPI.darkMode();
129130
backend.window.CppAPI.allowHighDPI();
130131
backend.window.CppAPI.setOld();
132+
#end
131133
Toolkit.init();
132134
Toolkit.theme = 'dark'; // don't be cringe
133135
backend.Cursor.registerHaxeUICursors();

source/archipelago/APPlayState.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class APPlayState extends PlayState {
7878
public var effectArray:Array<String> = [
7979
'colorblind', 'blur', 'lag', 'mine', 'warning', 'heal', 'spin', 'songslower', 'songfaster', 'scrollswitch', 'scrollfaster', 'scrollslower', 'rainbow',
8080
'cover', 'ghost', 'flashbang', 'nostrum', 'jackspam', 'spam', 'sever', 'shake', 'poison', 'dizzy', 'noise', 'flip', 'invuln',
81-
'desync', 'mute', 'ice', 'randomize', 'randomizeAlt', 'opponentPlay', 'bothplay', 'fakeheal', 'spell', 'terminate', 'lowpass', 'notif'
81+
'desync', 'mute', 'ice', 'randomize', 'randomizeAlt', 'opponentPlay', 'bothplay', 'fakeheal', 'spell', 'terminate', 'lowpass', #if windows 'notif' #end
8282
];
8383
var notifs:Array<String> = [
8484
"You're crazy...",
@@ -361,7 +361,7 @@ class APPlayState extends PlayState {
361361
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon, alwaysEnd, 'scrollfaster');
362362
},
363363
'notif' => function() {
364-
backend.window.CppAPI.sendWindowsNotification("Archipelago", notifs[FlxG.random.int(0, notifs.length-1)]);
364+
#if windows backend.window.CppAPI.sendWindowsNotification("Archipelago", notifs[FlxG.random.int(0, notifs.length-1)]); #end
365365
},
366366
'scrollslower' => function() {
367367
var changeAmount:Float = FlxG.random.float(0.1, 0.9);

source/backend/MusicBeatState.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class MusicBeatState extends FlxState
5555
super.create();
5656

5757
// if (backend.window.CppAPI.getWindowOpacity()!=1)
58+
#if windows
5859
if (emergencyOpacityFix) {
5960
CppAPI.setWindowOppacity(1);
6061
}
@@ -74,6 +75,7 @@ class MusicBeatState extends FlxState
7475
CppAPI.setWindowOpacity(num);
7576
});
7677
}
78+
#end
7779

7880
if (!skip)
7981
{

source/backend/TransitionState.hx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ class TransitionState {
246246
case "instant":
247247
switchState(targetState, onComplete, args);
248248
case 'transparent fade':
249+
#if windows
249250
FlxTween.num(1, 0, 2, {ease: FlxEase.sineInOut, onComplete:
250251
function(twn:FlxTween)
251252
{
@@ -255,6 +256,7 @@ class TransitionState {
255256
{
256257
CppAPI.setWindowOppacity(num);
257258
});
259+
#end
258260
case 'transparent close':
259261
if (FlxG.sound.music != null && FlxG.sound.music.playing)
260262
{
@@ -266,6 +268,7 @@ class TransitionState {
266268
FlxG.sound.play(Paths.music('gameOverEnd'));
267269
}
268270
if (ClientPrefs.data.flashing) FlxG.camera.flash(FlxColor.WHITE, 2);
271+
#if windows
269272
FlxTween.num(1, 0, 2, {ease: FlxEase.sineInOut, onComplete:
270273
function(twn:FlxTween)
271274
{
@@ -275,6 +278,7 @@ class TransitionState {
275278
{
276279
CppAPI.setWindowOppacity(num);
277280
});
281+
#end
278282
}
279283
//trace("Transition complete!");
280284
}
@@ -323,7 +327,7 @@ class TransitionState {
323327
}
324328
});
325329
case "transparent fade":
326-
CppAPI.setWindowOppacity(1);
330+
#if windows CppAPI.setWindowOppacity(1); #end
327331
trace("Post-switch transparent fade complete.");
328332
default:
329333
trace("Unknown post-switch transition type: " + transitionType);
@@ -479,6 +483,7 @@ class TransitionState {
479483
processNextObject();
480484
case 'transparent fade':
481485
MusicBeatState.emergencyOpacityFix = true;
486+
#if windows
482487
FlxTween.num(1, 0, 2, {ease: FlxEase.sineInOut, onComplete:
483488
function(twn:FlxTween)
484489
{
@@ -489,6 +494,7 @@ class TransitionState {
489494
{
490495
CppAPI.setWindowOppacity(num);
491496
});
497+
#end
492498
case 'transparent close': var psPause = states.PlayState.instance?.paused;
493499
if (FlxG.sound.music != null && FlxG.sound.music.playing)
494500
{
@@ -508,6 +514,7 @@ class TransitionState {
508514
}
509515
MusicBeatState.emergencyOpacityFix = true;
510516
if (ClientPrefs.data.flashing) FlxG.camera.flash(FlxColor.WHITE, 2);
517+
#if windows
511518
FlxTween.num(1, 0, 2, {ease: FlxEase.sineInOut, onComplete:
512519
function(twn:FlxTween)
513520
{
@@ -524,6 +531,7 @@ class TransitionState {
524531
{
525532
CppAPI.setWindowOppacity(num);
526533
});
534+
#end
527535
}
528536
}
529537

source/stages/Desktop.hx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,34 @@ class Desktop extends BaseStage
1414
bg.makeGraphic(FlxG.width, FlxG.height, 0xff000000);
1515
add(bg);
1616

17+
#if windows
1718
CppAPI.setTransparency("Mixtape Engine", 0xff000000);
1819
if (!FlxG.fullscreen)
1920
{
2021
FlxG.fullscreen = true;
2122
}
23+
#end
2224

2325
super.create();
2426
}
2527

2628
override function update(elapsed:Float)
2729
{
30+
#if windows
2831
if (!FlxG.fullscreen)
29-
{
30-
FlxG.fullscreen = true;
31-
}
32+
{
33+
FlxG.fullscreen = true;
34+
}
35+
#end
3236
super.update(elapsed);
3337
}
3438

3539
override function destroy()
3640
{
41+
#if windows
3742
CppAPI.setTransparency("Mixtape Engine", 0x00000001);
3843
FlxG.fullscreen = wasFullscreen;
44+
#end
3945
super.destroy();
4046
}
4147
}

source/states/FreeplayState.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ class FreeplayState extends MusicBeatState
128128
var ticketCounter:FlxText = null;
129129
override function create()
130130
{
131+
#if windows
131132
backend.window.CppAPI.resetAffixes();
132133
backend.window.CppAPI.resetTitle();
134+
#end
133135
Cursor.cursorMode = Default;
134136
instance = this; // For Archipelago
135137

source/states/PlayState.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,10 @@ class PlayState extends MusicBeatState
732732
new MallXmasErect(); // Week 5 Special
733733
case 'phillyStreetsErect':
734734
new PhillyStreetsErect(); // Weekend 1 Special
735+
#if windows
735736
case 'desktop':
736737
new Desktop(); // Literally your desktop as a stage lmao
738+
#end
737739
}
738740
if (isPixelStage) introSoundsSuffix = '-pixel';
739741

0 commit comments

Comments
 (0)