mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-11-25 21:55:55 +00:00
Merge branch 'rewrite/master' into input-offsets
This commit is contained in:
commit
c3d03011cc
|
|
@ -108,7 +108,7 @@
|
||||||
<haxelib name="flixel-text-input" /> <!-- Improved text field rendering for HaxeUI -->
|
<haxelib name="flixel-text-input" /> <!-- Improved text field rendering for HaxeUI -->
|
||||||
<haxelib name="polymod" /> <!-- Modding framework -->
|
<haxelib name="polymod" /> <!-- Modding framework -->
|
||||||
<haxelib name="flxanimate" /> <!-- Texture atlas rendering -->
|
<haxelib name="flxanimate" /> <!-- Texture atlas rendering -->
|
||||||
<haxelib name="hxCodec" /> <!-- Video playback -->
|
<haxelib name="hxCodec" if="desktop release" /> <!-- Video playback -->
|
||||||
|
|
||||||
<haxelib name="json2object" /> <!-- JSON parsing -->
|
<haxelib name="json2object" /> <!-- JSON parsing -->
|
||||||
<haxelib name="thx.semver" /> <!-- Version string handling -->
|
<haxelib name="thx.semver" /> <!-- Version string handling -->
|
||||||
|
|
|
||||||
6
hmm.json
6
hmm.json
|
|
@ -163,8 +163,10 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "thx.semver",
|
"name": "thx.semver",
|
||||||
"type": "haxelib",
|
"type": "git",
|
||||||
"version": "0.2.2"
|
"dir": null,
|
||||||
|
"ref": "cf8d213589a2c7ce4a59b0fdba9e8ff36bc029fa",
|
||||||
|
"url": "https://github.com/FunkinCrew/thx.semver"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ class SoundGroup extends FlxTypedGroup<FunkinSound>
|
||||||
|
|
||||||
function get_playing():Bool
|
function get_playing():Bool
|
||||||
{
|
{
|
||||||
if (getFirstAlive != null) return getFirstAlive().playing;
|
if (getFirstAlive() != null) return getFirstAlive().playing;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -192,8 +192,8 @@ class FunkinCamera extends FlxCamera
|
||||||
// get the isolated bitmap
|
// get the isolated bitmap
|
||||||
final isolated = grabScreen(false, true);
|
final isolated = grabScreen(false, true);
|
||||||
// apply fullscreen blend
|
// apply fullscreen blend
|
||||||
customBlendShader.blend = blend;
|
customBlendShader.blendSwag = blend;
|
||||||
customBlendShader.source = isolated;
|
customBlendShader.sourceSwag = isolated;
|
||||||
customBlendShader.updateViewInfo(FlxG.width, FlxG.height, this);
|
customBlendShader.updateViewInfo(FlxG.width, FlxG.height, this);
|
||||||
applyFilter(customBlendFilter);
|
applyFilter(customBlendFilter);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,20 +4,22 @@ import flixel.addons.display.FlxRuntimeShader;
|
||||||
import funkin.Paths;
|
import funkin.Paths;
|
||||||
import openfl.utils.Assets;
|
import openfl.utils.Assets;
|
||||||
import openfl.display.BitmapData;
|
import openfl.display.BitmapData;
|
||||||
|
import openfl.display.ShaderInput;
|
||||||
|
|
||||||
class BlendModesShader extends FlxRuntimeShader
|
class BlendModesShader extends FlxRuntimeShader
|
||||||
{
|
{
|
||||||
public var camera:BitmapData;
|
public var camera:ShaderInput<BitmapData>;
|
||||||
|
public var cameraData:BitmapData;
|
||||||
|
|
||||||
public function new()
|
public function new()
|
||||||
{
|
{
|
||||||
super(Assets.getText(Paths.frag('blendModes')));
|
super(Assets.getText(Paths.frag('blendModes')));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCamera(camera:BitmapData):Void
|
public function setCamera(cameraData:BitmapData):Void
|
||||||
{
|
{
|
||||||
this.camera = camera;
|
this.cameraData = cameraData;
|
||||||
|
|
||||||
this.setBitmapData('camera', camera);
|
this.setBitmapData('camera', this.cameraData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,20 +6,22 @@ import openfl.utils.Assets;
|
||||||
|
|
||||||
class RuntimeCustomBlendShader extends RuntimePostEffectShader
|
class RuntimeCustomBlendShader extends RuntimePostEffectShader
|
||||||
{
|
{
|
||||||
public var source(default, set):BitmapData;
|
// only different name purely for hashlink fix
|
||||||
|
public var sourceSwag(default, set):BitmapData;
|
||||||
|
|
||||||
function set_source(value:BitmapData):BitmapData
|
function set_sourceSwag(value:BitmapData):BitmapData
|
||||||
{
|
{
|
||||||
this.setBitmapData("source", value);
|
this.setBitmapData("sourceSwag", value);
|
||||||
return source = value;
|
return sourceSwag = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public var blend(default, set):BlendMode;
|
// name change make sure it's not the same variable name as whatever is in the shader file
|
||||||
|
public var blendSwag(default, set):BlendMode;
|
||||||
|
|
||||||
function set_blend(value:BlendMode):BlendMode
|
function set_blendSwag(value:BlendMode):BlendMode
|
||||||
{
|
{
|
||||||
this.setInt("blendMode", cast value);
|
this.setInt("blendMode", cast value);
|
||||||
return blend = value;
|
return blendSwag = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function new()
|
public function new()
|
||||||
|
|
|
||||||
|
|
@ -94,12 +94,12 @@ class RuntimeRainShader extends RuntimePostEffectShader
|
||||||
return lightMap = value;
|
return lightMap = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public var numLights(default, set):Int = 0;
|
public var numLightsSwag(default, set):Int = 0; // swag heads, we have never been more back (needs different name purely for hashlink casting fix)
|
||||||
|
|
||||||
function set_numLights(value:Int):Int
|
function set_numLightsSwag(value:Int):Int
|
||||||
{
|
{
|
||||||
this.setInt('numLights', value);
|
this.setInt('numLights', value);
|
||||||
return numLights = value;
|
return numLightsSwag = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function new()
|
public function new()
|
||||||
|
|
|
||||||
|
|
@ -333,8 +333,12 @@ class Controls extends FlxActionSet
|
||||||
throw 'Invalid name: $name';
|
throw 'Invalid name: $name';
|
||||||
#end
|
#end
|
||||||
|
|
||||||
return byName[name].inputs.map(function(input) return (input.device == KEYBOARD) ? input.inputID : null)
|
// TODO: Revert to `.map().filter()` once HashLink doesn't complain anymore.
|
||||||
.filter(function(key) return key != null);
|
var result:Array<FlxKey> = [];
|
||||||
|
for (input in byName[name].inputs) {
|
||||||
|
if (input.device == KEYBOARD) result.push(input.inputID);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getButtonsForAction(name:Action):Array<FlxGamepadInputID> {
|
public function getButtonsForAction(name:Action):Array<FlxGamepadInputID> {
|
||||||
|
|
@ -343,8 +347,11 @@ class Controls extends FlxActionSet
|
||||||
throw 'Invalid name: $name';
|
throw 'Invalid name: $name';
|
||||||
#end
|
#end
|
||||||
|
|
||||||
return byName[name].inputs.map(function(input) return (input.device == GAMEPAD) ? input.inputID : null)
|
var result:Array<FlxGamepadInputID> = [];
|
||||||
.filter(function(key) return key != null);
|
for (input in byName[name].inputs) {
|
||||||
|
if (input.device == GAMEPAD) result.push(input.inputID);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDialogueName(action:FlxActionDigital):String
|
public function getDialogueName(action:FlxActionDigital):String
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ import flixel.util.FlxColor;
|
||||||
import flixel.util.FlxTimer;
|
import flixel.util.FlxTimer;
|
||||||
#if html5
|
#if html5
|
||||||
import funkin.graphics.video.FlxVideo;
|
import funkin.graphics.video.FlxVideo;
|
||||||
#else
|
#end
|
||||||
|
#if hxCodec
|
||||||
import hxcodec.flixel.FlxVideoSprite;
|
import hxcodec.flixel.FlxVideoSprite;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|
@ -48,14 +49,20 @@ class VideoCutscene
|
||||||
|
|
||||||
#if html5
|
#if html5
|
||||||
playVideoHTML5(filePath);
|
playVideoHTML5(filePath);
|
||||||
#else
|
#end
|
||||||
|
|
||||||
|
#if hxCodec
|
||||||
playVideoNative(filePath);
|
playVideoNative(filePath);
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isPlaying():Bool
|
public static function isPlaying():Bool
|
||||||
{
|
{
|
||||||
|
#if (html5 || hxCodec)
|
||||||
return vid != null;
|
return vid != null;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
#if html5
|
#if html5
|
||||||
|
|
@ -82,7 +89,9 @@ class VideoCutscene
|
||||||
trace('ALERT: Video is null! Could not play cutscene!');
|
trace('ALERT: Video is null! Could not play cutscene!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#end
|
||||||
|
|
||||||
|
#if hxCodec
|
||||||
static var vid:FlxVideoSprite;
|
static var vid:FlxVideoSprite;
|
||||||
|
|
||||||
static function playVideoNative(filePath:String):Void
|
static function playVideoNative(filePath:String):Void
|
||||||
|
|
@ -118,15 +127,20 @@ class VideoCutscene
|
||||||
{
|
{
|
||||||
PlayState.instance.remove(vid);
|
PlayState.instance.remove(vid);
|
||||||
}
|
}
|
||||||
#else
|
#end
|
||||||
|
|
||||||
|
#if hxCodec
|
||||||
if (vid != null)
|
if (vid != null)
|
||||||
{
|
{
|
||||||
vid.stop();
|
vid.stop();
|
||||||
PlayState.instance.remove(vid);
|
PlayState.instance.remove(vid);
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
#if (html5 || hxCodec)
|
||||||
vid.destroy();
|
vid.destroy();
|
||||||
vid = null;
|
vid = null;
|
||||||
|
#end
|
||||||
|
|
||||||
PlayState.instance.camCutscene.visible = true;
|
PlayState.instance.camCutscene.visible = true;
|
||||||
PlayState.instance.camHUD.visible = true;
|
PlayState.instance.camHUD.visible = true;
|
||||||
|
|
@ -148,9 +162,3 @@ class VideoCutscene
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
trace('Video playback failed (${e})');
|
|
||||||
vid = null;
|
|
||||||
finishCutscene(0.5);
|
|
||||||
*/
|
|
||||||
|
|
|
||||||
|
|
@ -6050,7 +6050,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
// Stop the music.
|
// Stop the music.
|
||||||
if (welcomeMusic != null) welcomeMusic.destroy();
|
if (welcomeMusic != null) welcomeMusic.destroy();
|
||||||
if (audioInstTrack != null) audioInstTrack.destroy();
|
if (audioInstTrack != null) audioInstTrack.destroy();
|
||||||
audioVocalTrackGroup.destroy();
|
if (audioVocalTrackGroup != null) audioVocalTrackGroup.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyCanQuickSave():Void
|
function applyCanQuickSave():Void
|
||||||
|
|
|
||||||
|
|
@ -309,8 +309,8 @@ class ChartEditorAudioHandler
|
||||||
snd.loadEmbedded(asset);
|
snd.loadEmbedded(asset);
|
||||||
snd.autoDestroy = true;
|
snd.autoDestroy = true;
|
||||||
FlxG.sound.list.add(snd);
|
FlxG.sound.list.add(snd);
|
||||||
|
snd.play(true);
|
||||||
snd.volume = volume;
|
snd.volume = volume;
|
||||||
snd.play();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function wipeInstrumentalData(state:ChartEditorState):Void
|
public static function wipeInstrumentalData(state:ChartEditorState):Void
|
||||||
|
|
|
||||||
|
|
@ -509,10 +509,10 @@ class StoryMenuState extends MusicBeatState
|
||||||
// super.dispatchEvent(event) dispatches event to module scripts.
|
// super.dispatchEvent(event) dispatches event to module scripts.
|
||||||
super.dispatchEvent(event);
|
super.dispatchEvent(event);
|
||||||
|
|
||||||
if (levelProps != null && levelProps.length > 0)
|
if (levelProps?.members != null && levelProps.members.length > 0)
|
||||||
{
|
{
|
||||||
// Dispatch event to props.
|
// Dispatch event to props.
|
||||||
for (prop in levelProps)
|
for (prop in levelProps.members)
|
||||||
{
|
{
|
||||||
ScriptEventDispatcher.callEvent(prop, event);
|
ScriptEventDispatcher.callEvent(prop, event);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@ package funkin.ui.title;
|
||||||
|
|
||||||
#if html5
|
#if html5
|
||||||
import funkin.graphics.video.FlxVideo;
|
import funkin.graphics.video.FlxVideo;
|
||||||
#else
|
#end
|
||||||
|
#if hxCodec
|
||||||
import hxcodec.flixel.FlxVideoSprite;
|
import hxcodec.flixel.FlxVideoSprite;
|
||||||
#end
|
#end
|
||||||
import funkin.ui.MusicBeatState;
|
import funkin.ui.MusicBeatState;
|
||||||
|
|
@ -25,7 +26,9 @@ class AttractState extends MusicBeatState
|
||||||
|
|
||||||
#if html5
|
#if html5
|
||||||
playVideoHTML5(ATTRACT_VIDEO_PATH);
|
playVideoHTML5(ATTRACT_VIDEO_PATH);
|
||||||
#else
|
#end
|
||||||
|
|
||||||
|
#if hxCodec
|
||||||
playVideoNative(ATTRACT_VIDEO_PATH);
|
playVideoNative(ATTRACT_VIDEO_PATH);
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
@ -50,7 +53,9 @@ class AttractState extends MusicBeatState
|
||||||
trace('ALERT: Video is null! Could not play cutscene!');
|
trace('ALERT: Video is null! Could not play cutscene!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#end
|
||||||
|
|
||||||
|
#if hxCodec
|
||||||
var vid:FlxVideoSprite;
|
var vid:FlxVideoSprite;
|
||||||
|
|
||||||
function playVideoNative(filePath:String):Void
|
function playVideoNative(filePath:String):Void
|
||||||
|
|
@ -95,15 +100,20 @@ class AttractState extends MusicBeatState
|
||||||
{
|
{
|
||||||
remove(vid);
|
remove(vid);
|
||||||
}
|
}
|
||||||
#else
|
#end
|
||||||
|
|
||||||
|
#if hxCodec
|
||||||
if (vid != null)
|
if (vid != null)
|
||||||
{
|
{
|
||||||
vid.stop();
|
vid.stop();
|
||||||
remove(vid);
|
remove(vid);
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
#if (html5 || hxCodec)
|
||||||
vid.destroy();
|
vid.destroy();
|
||||||
vid = null;
|
vid = null;
|
||||||
|
#end
|
||||||
|
|
||||||
FlxG.switchState(() -> new TitleState());
|
FlxG.switchState(() -> new TitleState());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue