Skip to content

Commit

Permalink
Merge branch 'Yoshubs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ImCodist authored Sep 18, 2021
2 parents 2af3ea3 + 5cdd5fd commit 703376a
Show file tree
Hide file tree
Showing 20 changed files with 344 additions and 74 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/buildlinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This is a basic workflow to help you get started with Actions

name: BuildLinux

# 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 ]
pull_request:
branches: [ master ]

# 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:
runs-on: ubuntu-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.1.5
# Runs a set of commands using the runners shell
- name: wow its building how
run: |
sudo add-apt-repository ppa:haxe/releases -y
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib haxe -y
mkdir "%HAXELIB_ROOT%"
haxelib setup "%HAXELIB_ROOT%"
haxelib install hxcpp
haxelib install lime 7.9.0
haxelib install openfl
haxelib install flixel
haxelib install flixel-ui
haxelib run lime setup flixel
haxelib run lime setup
haxelib install flixel-tools
haxelib install flixel-addons
haxelib install hscript
haxelib install newgrounds
haxelib git polymod https://github.com/larsiusprime/polymod.git
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
haxelib list
haxelib run lime build linux
- uses: actions/upload-artifact@v2
with:
name: linuxBuild
path: export/release/linux/bin

55 changes: 55 additions & 0 deletions .github/workflows/buildmac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This is a basic workflow to help you get started with Actions

name: BuildMac

# 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 ]
pull_request:
branches: [ master ]

# 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"
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.1.5
# Runs a set of commands using the runners shell
- name: Install Haxelib
run: |
haxelib setup ~/haxelib
haxelib install hxcpp > /dev/null
haxelib install lime 7.9.0
haxelib install openfl
haxelib install flixel
haxelib install flixel-ui
haxelib run lime setup flixel
haxelib run lime setup
haxelib install flixel-tools
haxelib install flixel-addons
haxelib install hscript
haxelib install newgrounds
haxelib git polymod https://github.com/larsiusprime/polymod.git
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
haxelib list
- name: Create APIStuff
run: echo "package;class APIStuff{public static var API:String = '';public static var EncKey:String = '';}" > source/APIStuff.hx
- name: Compile
run: haxelib run lime build mac
- name: Publish Artifact
uses: actions/upload-artifact@v2
with:
name: macBuild
path: export/release/macos/bin
55 changes: 55 additions & 0 deletions .github/workflows/buildwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This is a basic workflow to help you get started with Actions

name: BuildWin

# 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 ]
pull_request:
branches: [ master ]

# 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"
buildWindows:
runs-on: windows-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.1.5
# Runs a set of commands using the runners shell
- name: Install Haxelib
run: |
haxelib setup C:/haxelib
haxelib install lime 7.8.0
haxelib install openfl
haxelib install flixel 4.8.1
haxelib install flixel-ui
haxelib git flixel-addons https://github.com/HaxeFlixel/flixel-addons
haxelib install hscript
haxelib install newgrounds
haxelib run lime setup
haxelib install flixel-tools
haxelib run flixel-tools setup
haxelib git polymod https://github.com/larsiusprime/polymod.git
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
haxelib list
shell: cmd
- name: Create APIStuff
run: echo "package;class APIStuff{public static var API:String = '';public static var EncKey:String = '';}" > source/APIStuff.hx
- name: Compile
run: haxelib run lime build windows
- name: Publish Artifact
uses: actions/upload-artifact@v2
with:
name: windowsBuild
path: export/release/windows/bin
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/UI/forever/base/chart editor/ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions source/Init.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import flixel.FlxG;
import flixel.FlxState;
import flixel.graphics.FlxGraphic;
import flixel.input.keyboard.FlxKey;
import gameFolder.meta.CoolUtil;
import gameFolder.meta.InfoHud;
Expand Down
26 changes: 17 additions & 9 deletions source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Main extends Sprite

public static var gameVersion:String = '0.2.3.1';

public static var loadedAssets:Array<Dynamic> = [];
public static var loadedAssets:Array<FlxBasic> = [];

var zoom:Float = -1; // If -1, zoom is automatically calculated to fit the window dimensions.
var skipSplash:Bool = true; // Whether to skip the flixel splash screen that appears in release mode.
Expand Down Expand Up @@ -201,19 +201,21 @@ class Main extends Sprite
/* This is used to switch "rooms," to put it basically. Imagine you are in the main menu, and press the freeplay button.
That would change the game's main class to freeplay, as it is the active class at the moment.
*/
public static var lastState:FlxState;

public static function switchState(curState:FlxState, target:FlxState)
{
// this is for a dumb feature that has no use except for cool extra info
// though I suppose this could be of use to people who want to load things between classes and such

// save the last state for comparison checks
lastState = curState;

// credit for the idea and a bit of the execution https://github.com/ninjamuffin99/Funkin/pull/1083
mainClassState = Type.getClass(target);

// load the state
FlxG.switchState(target);

// this dont work yet but maybe soon
// dumpCache(curState);
}

public static function updateFramerate(newFramerate:Int)
Expand All @@ -231,14 +233,20 @@ class Main extends Sprite
}
}

public static function dumpCache(curState:FlxState)
public static function dumpCache()
{
///*
for (asset in loadedAssets)
///* SPECIAL THANKS TO HAYA
@:privateAccess
for (key in FlxG.bitmap._cache.keys())
{
loadedAssets.remove(asset);
var obj = FlxG.bitmap._cache.get(key);
if (obj != null)
{
Assets.cache.removeBitmapData(key);
FlxG.bitmap._cache.remove(key);
obj.destroy();
}
}

// */
}

Expand Down
11 changes: 1 addition & 10 deletions source/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,11 @@ class Paths

inline static public function getSparrowAtlas(key:String, ?library:String)
{
return cacheGet(FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library)));
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));
}

inline static public function getPackerAtlas(key:String, ?library:String)
{
return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library));
}

// WIP STUFFS GONNA GO HERE, HI FLIPPY AND SMOKEY LMAO

static function cacheGet(theAsset:Dynamic):Dynamic
{
if (!Main.loadedAssets.contains(theAsset))
Main.loadedAssets.push(theAsset);
return Main.loadedAssets[Main.loadedAssets.indexOf(theAsset)];
}
}
100 changes: 98 additions & 2 deletions source/gameFolder/gameObjects/userInterface/menu/DebugUI.hx
Original file line number Diff line number Diff line change
@@ -1,12 +1,108 @@
package gameFolder.gameObjects.userInterface.menu;

import flash.geom.Rectangle;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.ui.FlxUI9SliceSprite;
import flixel.addons.ui.FlxUIAssets;
import flixel.addons.ui.FlxUIButton;
import flixel.addons.ui.FlxUIGroup;
import flixel.addons.ui.FlxUITabMenu;
import flixel.addons.ui.FlxUITypedButton;
import flixel.addons.ui.interfaces.IFlxUIButton;
import flixel.group.FlxGroup;
import flixel.group.FlxSpriteGroup;
import flixel.math.FlxPoint;
import flixel.system.FlxAssets.FlxGraphicAsset;
import flixel.util.FlxStringUtil;

/**
HEAVILY BASED ON FLIXEL UI SHIT
check that out lol its in the same library youre using rn
**/
class DebugCheckmark extends FlxSprite
class UIBox extends FlxUITabMenu
{
//
public static inline var STACK_FRONT:String = "front"; // button goes in front of backing
public static inline var STACK_BACK:String = "back"; // buton goes behind backing

public function new(?back_:FlxSprite, ?tabs_:Array<IFlxUIButton>, ?tab_names_and_labels_:Array<{name:String, label:String}>, ?tab_offset:FlxPoint,
?stretch_tabs:Bool = false, ?tab_spacing:Null<Float> = null, ?tab_stacking:Array<String> = null)
{
super();

if (back_ == null)
{
// default, make this:
back_ = new FlxUI9SliceSprite(0, 0, FlxUIAssets.IMG_CHROME_FLAT, new Rectangle(0, 0, 200, 200));
}

_back = back_;
add(_back);

if (tabs_ == null)
{
if (tab_names_and_labels_ != null)
{
tabs_ = new Array<IFlxUIButton>();

// load default graphic data if only tab_names_and_labels are provided
for (tdata in tab_names_and_labels_)
{
// set label and name
var fb:FlxUIButton = new FlxUIButton(0, 0, tdata.label);

// default style:
fb.up_color = 0xffffff;
fb.down_color = 0xffffff;
fb.over_color = 0xffffff;
fb.up_toggle_color = 0xffffff;
fb.down_toggle_color = 0xffffff;
fb.over_toggle_color = 0xffffff;

fb.label.color = 0xFFFFFF;
fb.label.setBorderStyle(OUTLINE);

fb.name = tdata.name;

// load default graphics
var graphic_names:Array<FlxGraphicAsset> = [
FlxUIAssets.IMG_TAB_BACK,
FlxUIAssets.IMG_TAB_BACK,
FlxUIAssets.IMG_TAB_BACK,
FlxUIAssets.IMG_TAB,
FlxUIAssets.IMG_TAB,
FlxUIAssets.IMG_TAB
];
var slice9tab:Array<Int> = FlxStringUtil.toIntArray(FlxUIAssets.SLICE9_TAB);
var slice9_names:Array<Array<Int>> = [slice9tab, slice9tab, slice9tab, slice9tab, slice9tab, slice9tab];
fb.loadGraphicSlice9(graphic_names, 0, 0, slice9_names, FlxUI9SliceSprite.TILE_NONE, -1, true);
tabs_.push(fb);
}
}
}

_tabs = tabs_;
_stretch_tabs = stretch_tabs;
_tab_spacing = tab_spacing;
_tab_stacking = tab_stacking;
if (_tab_stacking == null)
{
_tab_stacking = [STACK_FRONT, STACK_BACK];
}
_tab_offset = tab_offset;

var i:Int = 0;
var tab:FlxUITypedButton<FlxSprite> = null;
for (t in _tabs)
{
tab = cast t;
add(tab);
tab.onUp.callback = _onTabEvent.bind(tab.name);
i++;
}

distributeTabs();

_tab_groups = new Array<FlxUIGroup>();
}
}
4 changes: 4 additions & 0 deletions source/gameFolder/meta/MusicBeat.hx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class MusicBeatState extends FNFUIState
// class create event
override function create()
{
// dump the cache if you're going elsewhere
if (Main.lastState != this)
Main.dumpCache();

if (transIn != null)
trace('reg ' + transIn.region);

Expand Down
4 changes: 1 addition & 3 deletions source/gameFolder/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class PlayState extends MusicBeatState
// at the beginning of the playstate
override public function create()
{
Main.dumpCache(this);
super.create();

// reset any values and variables that are static
songScore = 0;
Expand Down Expand Up @@ -343,8 +343,6 @@ class PlayState extends MusicBeatState
songIntroCutscene();
else
startCountdown();

super.create();
}

var staticDisplace:Int = 0;
Expand Down
Loading

0 comments on commit 703376a

Please sign in to comment.