Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Vortex2Oblivion committed Feb 11, 2024
1 parent 688e01c commit 58e9685
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 55 deletions.
5 changes: 0 additions & 5 deletions assets/preload/data/event data/create custom shader.lua

This file was deleted.

5 changes: 5 additions & 0 deletions assets/preload/data/event data/init shader.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function onEventLoaded(name, position, argument1, argument2)
if string.lower(name) == "init shader" then
initShader(tostring(argument1), tostring(argument2))
end
end
6 changes: 0 additions & 6 deletions assets/preload/data/event data/no shader.lua

This file was deleted.

13 changes: 13 additions & 0 deletions assets/preload/data/event data/remove camera shader.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

function onEvent(name, position, value1, value2)
if string.lower(name) == "set camera shader" then
if value2 == "hud" then
setCameraShader("hud", value1)
elseif value2 == "game" then
setCameraShader("game", value1)
else
setCameraShader("game", value1)
setCameraShader("hud", value1)
end
end
end
5 changes: 0 additions & 5 deletions assets/preload/data/event data/set actor custom shader.lua

This file was deleted.

5 changes: 0 additions & 5 deletions assets/preload/data/event data/set actor no custom shader.lua

This file was deleted.

10 changes: 0 additions & 10 deletions assets/preload/data/event data/set camera custom shader.lua

This file was deleted.

10 changes: 0 additions & 10 deletions assets/preload/data/event data/set camera no custom shader.lua

This file was deleted.

13 changes: 13 additions & 0 deletions assets/preload/data/event data/set camera shader.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

function onEvent(name, position, value1, value2)
if string.lower(name) == "set camera shader" then
if value2 == "hud" then
setCameraShader("hud", value1)
elseif value2 == "game" then
setCameraShader("game", value1)
else
setCameraShader("game", value1)
setCameraShader("hud", value1)
end
end
end
12 changes: 5 additions & 7 deletions assets/preload/data/eventList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ Set Camera Zoom~Game Camera Zoom (default is defaultCameraZoom)~Hud Camera Zoom
Add Camera Zoom~Game Camera Add (default = 0.015)~Hud Camera Add (default = 0.03)
Screen Shake~Camera Shake (duration, intensity)~Hud Shake (duration, intensity)
Camera Flash~Color (example: 'red')~Duration
Add Trail~Object Name (dad, boyfriend, girlfriend, etc)~Properties, formatted like: '10,3,0.4,0.05' (sprite count, frame delay, alpha, alpha diff)
Remove Trail~Object Name (dad, boyfriend, girlfriend, etc)~Nothing
3D Shader~Character (BF, Dad, GF)~Properties formated like: '3,10,0.25' (speed, frequency, amplitude)
No Shader~Character (BF, Dad, GF)~Nothing
Create Custom Shader~Id~Filename
Set Actor Custom Shader~Id~Actor
Set Actor No Custom Shader~Actor~Nothing
Set Camera Custom Shader~Id~Camera - "game" for camGame, "hud" for camHUD, anything else for both.
Set Camera No Custom Shader~Camera - "game" for camGame, "hud" for camHUD, anything else for both.~Nothing
Add Trail~Object Name (dad, boyfriend, girlfriend, etc)~Properties, formatted like: '10,3,0.4,0.05' (sprite count, frame delay, alpha, alpha diff)
Remove Trail~Object Name (dad, boyfriend, girlfriend, etc)~Nothing
Init Shader~Id~Filename Shaders must be created before using in other events and scripts
Set Camera Shader~Id~Camera (hud, game, or both) Adds a shader to a camera.
Remove Camera Shader~Id~Camera (hud, game, or both) Removes a shader fro, a camera.
6 changes: 3 additions & 3 deletions source/game/StrumNote.hx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class StrumNote extends FlxSkewedSprite

noteData = leData;

var localKeyCount = (isPlayer == 1) ? PlayState.SONG.playerKeyCount : keyCount;
var localKeyCount = (isPlayer == 1) ? (FlxG.state == PlayState.instance ? PlayState.SONG.playerKeyCount : keyCount) : keyCount;

this.ui_Skin = ui_Skin;
this.ui_settings = ui_settings;
Expand All @@ -79,7 +79,7 @@ class StrumNote extends FlxSkewedSprite

var charColors;

if(affectedbycolor){
if(affectedbycolor && FlxG.state == PlayState.instance){
if(Options.getData("middlescroll")){
charColors = (isPlayer == 1) ? PlayState.dad : PlayState.boyfriend;
}
Expand All @@ -98,7 +98,7 @@ class StrumNote extends FlxSkewedSprite
colorSwap.r = noteColor[0];
colorSwap.g = noteColor[1];
colorSwap.b = noteColor[2];
}
}
}

override function update(elapsed:Float)
Expand Down
4 changes: 3 additions & 1 deletion source/ui/Option.hx
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ class ChangeModOption extends FlxTypedGroup<FlxSprite> {
FlxG.resetState();
lime.utils.Assets.cache.clear();
openfl.utils.Assets.cache.clear();
CoolUtil.changeWindowIcon("mods/"+Options.getData("curMod")+"/_polymod_icon.png");
#if windows
//utilities.Windows.setWindowIcon("mods/"+Options.getData("curMod")+"/_polymod_icon.png");
#end
}
}else {
Alphabet_Text.alpha = 0.6;
Expand Down
6 changes: 3 additions & 3 deletions source/utilities/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import lime.utils.Assets;

using StringTools;



class CoolUtil {
public static function boundTo(value:Float, min:Float, max:Float):Float {
var newValue:Float = value;
Expand Down Expand Up @@ -302,9 +304,7 @@ class CoolUtil {
}


public static function changeWindowIcon(path:String){
if(#if sys sys.FileSystem.exists(path) || #end Assets.exists(path)) FlxG.stage.window.setIcon(Image.fromBitmapData(path));
}



/**
Expand Down

0 comments on commit 58e9685

Please sign in to comment.