Skip to content

Commit

Permalink
Merge pull request #14 from mikolka9144/dev
Browse files Browse the repository at this point in the history
1.0.2 Update
  • Loading branch information
mikolka9144 authored Aug 15, 2024
2 parents 3fecc25 + 8f95f89 commit 42292a8
Show file tree
Hide file tree
Showing 13 changed files with 156 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/crash.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Crash report
description: Report bugs that cause the engine to crash here
labels: [bug]
labels: [crash]
body:
- type: textarea
id: description
Expand Down
108 changes: 108 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# This is a basic workflow to help you get started with Actions

name: Build


# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
buildLinux:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: krdlab/setup-haxe@master
with:
haxe-version: latest
# Runs a set of commands using the runners shell
- name: Install Haxelib
run: |
sudo apt-get install libvlc-dev
sudo apt-get install libvlccore-dev
haxelib setup ~/haxelib
haxelib install hxcpp > /dev/null --quiet
haxe -cp ./setup -D analyzer-optimize -main Main --interp
- name: Skip SScript setup mode
run: echo 'oy9:showMacroty8:loopCosti25y10:includeAllfg' >> ~/settings.cocoa
- name: Create Version Tag
run: echo "${{github.run_id}}" > VERSION
- name: Compile
run: |
haxelib fixrepo
haxelib run lime build Project.xml linux --app-version="4.0.0-${{ github.run_id}}"
- name: Publish Artifact
uses: actions/upload-artifact@v2.2.4
with:
name: linuxBuild
path: 'export/release/linux/bin'
buildWindows:
runs-on: windows-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2.3.0

- uses: krdlab/setup-haxe@master
with:
haxe-version: latest
# Runs a set of commands using the runners shell
- name: Install Haxelib
run: |
haxelib setup C:/haxelib
haxelib install hxcpp > /dev/null --quiet
haxe -cp ./setup -D analyzer-optimize -main Main --interp
shell: cmd
- name: Skip SScript setup mode
run: echo 'oy9:showMacroty8:loopCosti25y10:includeAllfg' >> %USERPROFILE%/settings.cocoa
shell: cmd
- name: Create Version Tag
run: echo "${{github.run_id}}" > VERSION
- name: Compile
run: haxelib run lime build windows --app-version="4.0.0-${{ github.run_id}}"
- name: Publish Artifact
uses: actions/upload-artifact@v2.2.4
with:
name: windowsBuild
path: export/release/windows/bin
buildMac:
runs-on: macos-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: krdlab/setup-haxe@master
with:
haxe-version: 4.2.5
# Runs a set of commands using the runners shell
- name: Install Haxelib
run: |
haxelib setup ~/haxelib
haxelib install hxcpp > /dev/null --quiet
haxe -cp ./setup -D analyzer-optimize -main Main --interp
- name: Skip SScript setup mode
run: echo 'oy9:showMacroty8:loopCosti25y10:includeAllfg' >> ~/settings.cocoa
- name: Create Version Tag
run: echo "${{github.run_id}}" > VERSION
- name: Compile
run: haxelib run lime build mac --app-version="4.0.0-${{ github.run_id}}"
- name: Publish Artifact
uses: actions/upload-artifact@v2.2.4
with:
name: macBuild
path: export/release/macos/bin
4 changes: 2 additions & 2 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<define name="ACHIEVEMENTS_ALLOWED" />
<define name="DISCORD_ALLOWED" />
<define name="PSYCH_WATERMARKS"/>
<define name="VIDEOS_ALLOWED" if="windows" unless="32bits"/>
<define name="VIDEOS_ALLOWED" if="windows || linux" unless="32bits"/>
<!-- DELETE THIS TO REMOVE WATERMARKS/DEV NAMES ON TITLE SCREEN -->

<section if="officialBuild">
Expand Down Expand Up @@ -63,7 +63,7 @@
<!-- __________________________ Game Assets & Etc. __________________________ -->

<!-- Turn on Crash Handler -->
<define name="CRASH_HANDLER" if="desktop release" />
<define name="CRASH_HANDLER" if="desktop" />

<!-- Assets -->
<assets path="assets/fonts" />
Expand Down
6 changes: 4 additions & 2 deletions hmm.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
},
{
"name": "hxCodec",
"type": "haxelib",
"version": null
"type": "git",
"dir": null,
"ref": "main",
"url": "https://github.com/polybiusproxy/hxCodec.git"
},
{
"name": "SScript",
Expand Down
3 changes: 2 additions & 1 deletion setup/setup-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ haxelib install flixel-addons
haxelib install flixel-ui
haxelib install flixel-tools
haxelib install SScript
haxelib install hxCodec
haxelib git hxCodec https://github.com/polybiusproxy/hxCodec.git
haxelib install tjson
haxelib git flxanimate https://github.com/ShadowMario/flxanimate dev
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit
haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc
haxelib git FlxPartialSound https://github.com/FunkinCrew/FlxPartialSound.git f986332ba5ab02abd386ce662578baf04904604a
3 changes: 2 additions & 1 deletion setup/setup-windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ haxelib install flixel-addons
haxelib install flixel-ui
haxelib install flixel-tools
haxelib install SScript
haxelib install hxCodec
haxelib git hxCodec https://github.com/polybiusproxy/hxCodec.git
haxelib install tjson
haxelib git flxanimate https://github.com/ShadowMario/flxanimate dev
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit
haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc
haxelib git FlxPartialSound https://github.com/FunkinCrew/FlxPartialSound.git f986332ba5ab02abd386ce662578baf04904604a
echo Finished!
pause
1 change: 1 addition & 0 deletions source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class Main extends Sprite
if (FlxG.game != null)
resetSpriteCache(FlxG.game);
});

}

static function resetSpriteCache(sprite:Sprite):Void {
Expand Down
6 changes: 6 additions & 0 deletions source/backend/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ class ClientPrefs {
}
reloadVolumeKeys();
}

// Additional checks
if(!keyBinds.exists('screenshot')) keyBinds.set('screenshot',[F3]);
if(!keyBinds.exists('favorite')) keyBinds.set('favorite',[F]);
if(!keyBinds.exists('bar_left')) keyBinds.set('bar_left',[Q]);
if(!keyBinds.exists('bar_right')) keyBinds.set('bar_right',[E]);
}

inline public static function getGameplaySetting(name:String, defaultValue:Dynamic = null, ?customDefaultValue:Bool = false):Dynamic
Expand Down
8 changes: 6 additions & 2 deletions source/psychlua/FunkinLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1048,9 +1048,13 @@ class FunkinLua {
return LuaUtils.addAnimByIndices(obj, name, prefix, indices, framerate, loop);
});

Lua_helper.add_callback(lua, "playAnim", function(obj:String, name:String, forced:Bool = false, ?reverse:Bool = false, ?startFrame:Int = 0)
Lua_helper.add_callback(lua, "playAnim", function(objName:String, name:String, forced:Bool = false, ?reverse:Bool = false, ?startFrame:Int = 0)
{
var obj:Dynamic = LuaUtils.getObjectDirectly(obj, false);
var obj:Dynamic = LuaUtils.getObjectDirectly(objName, false);
if(obj == null){
luaTrace('playAnim: Couldn\'t find "$objName" to play animation.',false,false,FlxColor.RED);
return false;
}
if(obj.playAnim != null)
{
obj.playAnim(name, forced, reverse, startFrame);
Expand Down
2 changes: 1 addition & 1 deletion source/states/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import options.OptionsState;
class MainMenuState extends MusicBeatState
{
public static var psychEngineVersion:String = '0.7.3'; // This is also used for Discord RPC
public static var pSliceVersion:String = '1.0.1';
public static var pSliceVersion:String = '1.0.2';
public static var funkinVersion:String = '0.4.1'; // Version of funkin' we are emulationg
public static var curSelected:Int = 0;

Expand Down
4 changes: 3 additions & 1 deletion source/states/ModsMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ class ModsMenuState extends MusicBeatState
TitleState.initialized = false;
TitleState.closedState = false;
FlxG.sound.music.fadeOut(0.3);
FlxG.camera.fade(FlxColor.BLACK, 0.5, false, FlxG.resetGame, false);
FlxG.camera.fade(FlxColor.BLACK, 0.5, false, ()->{
FlxG.resetGame();
}, false);
}
else MusicBeatState.switchState(new MainMenuState());

Expand Down
4 changes: 4 additions & 0 deletions source/states/freeplay/BPMCache.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class BPMCache {
return bpmMap[sngDataPath];
}
bpmMap[sngDataPath] = 0;
if(!FileSystem.exists(sngDataPath)){
trace('Missing data folder for $fileSngName in $sngDataPath for BPM scrapping!!'); //TODO
return 0;
}
var chartFiles = FileSystem.readDirectory(sngDataPath)
.filter(s -> s.toLowerCase().startsWith(fileSngName) && s.endsWith(".json"));
var chosenChartToScrap = '$sngDataPath/${chartFiles[0]}';
Expand Down
25 changes: 16 additions & 9 deletions source/states/freeplay/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2007,15 +2007,16 @@ class FreeplayState extends MusicBeatSubstate

try{
Mods.currentModDirectory = daSongCapsule.songData.folder;
instPath = Paths.modFolders('songs/${daSongCapsule.songData.songId.toLowerCase().replace(" ","-")}/Inst.${Paths.SOUND_EXT}');
instPath = Paths.modFolders('songs/${Paths.formatToSongPath(daSongCapsule.songData.songId)}/Inst.${Paths.SOUND_EXT}');
var future = FlxPartialSound.partialLoadFromFile(instPath, 0.05,0.25);
if(future == null){
trace('Internal failure loading instrumentals for ${daSongCapsule.songData.songName} "${instPath}"');
return;
}
future.future.onComplete(function(sound:Sound)
{
if(!daSongCapsule.selected) return;
if(!daSongCapsule.selected || busy) return;
trace("Playing preview!");
FlxG.sound.playMusic(sound,0);
var endVolume = dj.playingCartoon? 0.1 : FADE_IN_END_VOLUME;
FlxG.sound.music.fadeIn(FADE_IN_DURATION, FADE_IN_START_VOLUME, endVolume);
Expand Down Expand Up @@ -2222,15 +2223,21 @@ class FreeplaySongData
//if(sngDataPath == null) return;

if(this.songDifficulties.length == 0){
var chartFiles = FileSystem.readDirectory(sngDataPath)
if(FileSystem.exists(sngDataPath)){
var chartFiles = FileSystem.readDirectory(sngDataPath)
.filter(s -> s.toLowerCase().startsWith(fileSngName) && s.endsWith(".json"));

var diffNames = chartFiles.map(s -> s.substring(fileSngName.length+1,s.length-5));
// Regrouping difficulties
if(diffNames.remove(".")) diffNames.insert(1,"normal");
if(diffNames.remove("easy")) diffNames.insert(0,"easy");
if(diffNames.remove("hard")) diffNames.insert(2,"hard");
this.songDifficulties = diffNames;
var diffNames = chartFiles.map(s -> s.substring(fileSngName.length+1,s.length-5));
// Regrouping difficulties
if(diffNames.remove(".")) diffNames.insert(1,"normal");
if(diffNames.remove("easy")) diffNames.insert(0,"easy");
if(diffNames.remove("hard")) diffNames.insert(2,"hard");
this.songDifficulties = diffNames;
}
else{
trace('Directory $sngDataPath does not exist! $songName has no charts (difficulties)!');
}

}
if (!this.songDifficulties.contains(currentDifficulty))
currentDifficulty = songDifficulties[0]; // TODO
Expand Down

0 comments on commit 42292a8

Please sign in to comment.