testing webhook >:D
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
<git name="flxanimate" url="https://github.com/CodenameCrew/cne-flxanimate" />
|
||||
<git name="hxdiscord_rpc" url="https://github.com/CodenameCrew/cne-hxdiscord_rpc" skipDeps="true" />
|
||||
<lib name="hxvlc" version="1.9.3" skipDeps="true" />
|
||||
<lib name="funkin-modchart" />
|
||||
|
||||
<!-- Documentation and other features -->
|
||||
<git name="away3d" url="https://github.com/CodenameCrew/away3d" />
|
||||
|
||||
+11
@@ -105,6 +105,9 @@
|
||||
<define name="DISCORD_RPC" if="desktop"/>
|
||||
</section>
|
||||
|
||||
<!-- Comment this out to disable modcharting features -->
|
||||
<define name="MODCHARTING_FEATURES"/>
|
||||
|
||||
<!-- Comment this out to disable GitHub API integration !-->
|
||||
<define name="GITHUB_API" unless="web || hl"/>
|
||||
|
||||
@@ -185,6 +188,14 @@
|
||||
|
||||
<!-- _________________________________ Additional stuff _______________________________ -->
|
||||
|
||||
<section if="MODCHARTING_FEATURES">
|
||||
<haxedef name="FM_ENGINE" value="CODENAME"/>
|
||||
<haxedef name="FM_ENGINE_VERSION" value="1.0"/>
|
||||
|
||||
<haxelib name="funkin-modchart" />
|
||||
<haxeflag name="--macro" value="modchart.core.macros.Macro.includeFiles()"/>
|
||||
</section>
|
||||
|
||||
<section if="COMPILE_ALL_CLASSES">
|
||||
<haxeflag name="-dce" value="no" />
|
||||
<haxeflag name="--macro" value="funkin.backend.system.macros.Macros.addAdditionalClasses()" />
|
||||
|
||||
@@ -914,6 +914,28 @@ final class CoolUtil
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the screen position of an point, while taking the camera zoom into account.
|
||||
*
|
||||
* @param object Any `FlxObject`
|
||||
* @param camera The desired "screen" coordinate space. If `null`, `FlxG.camera` is used.
|
||||
* @param result Optional arg for the returning point
|
||||
* @return The screen position of the object.
|
||||
*/
|
||||
public static function pointToScreenPosition(object:FlxPoint, ?camera:FlxCamera, ?result:FlxPoint) {
|
||||
if (result == null)
|
||||
result = FlxPoint.get();
|
||||
if (camera == null)
|
||||
camera = FlxG.camera;
|
||||
|
||||
result.set(object.x, object.y);
|
||||
result.x = (((result.x - camera.scroll.x) * camera.zoom) - ((camera.width * 0.5) * (camera.zoom - camera.initialZoom)));
|
||||
result.y = (((result.y - camera.scroll.y) * camera.zoom) - ((camera.height * 0.5) * (camera.zoom - camera.initialZoom)));
|
||||
|
||||
object.putWeak();
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts an array alphabetically.
|
||||
* @param array Array to sort
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package funkin.backend.utils;
|
||||
|
||||
import flixel.math.FlxRect;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.math.FlxAngle;
|
||||
import flixel.math.FlxPoint;
|
||||
@@ -18,7 +19,7 @@ final class DrawUtil {
|
||||
dot.draw();
|
||||
}
|
||||
|
||||
public static inline function drawLine(point1:FlxPoint, point2:FlxPoint, sizeModify:Float = 1, ?color:Null<FlxColor>) {
|
||||
public static inline function drawLine(point1:FlxPoint, point2:FlxPoint, thickness:Float = 1, ?color:Null<FlxColor>) {
|
||||
if (line == null) createDrawers();
|
||||
|
||||
var dx:Float = point2.x - point1.x;
|
||||
@@ -27,11 +28,12 @@ final class DrawUtil {
|
||||
var angle:Float = Math.atan2(dy, dx);
|
||||
var distance:Float = Math.sqrt(dx * dx + dy * dy);
|
||||
|
||||
line.setPosition(point1.x, point1.y);
|
||||
// Math.ceil to prevent flickering
|
||||
line.setPosition(Math.ceil(point1.x), Math.ceil(point1.y));
|
||||
line.angle = angle * FlxAngle.TO_DEG;
|
||||
line.origin.set(0, line.frameHeight / 2);
|
||||
line.scale.x = distance / line.frameWidth;
|
||||
line.scale.y = 0.20/line.cameras[0].zoom * sizeModify;
|
||||
line.scale.y = thickness;
|
||||
line.y -= line.height / 2;
|
||||
if (color != null) line.color = color;
|
||||
line.draw();
|
||||
@@ -39,6 +41,15 @@ final class DrawUtil {
|
||||
line.angle = 0;
|
||||
line.scale.x = line.scale.y = 1;
|
||||
line.updateHitbox();
|
||||
|
||||
point1.putWeak(); point2.putWeak();
|
||||
}
|
||||
|
||||
public static inline function drawRect(rect:FlxRect, thickness:Float = 1, ?color:Null<FlxColor>) {
|
||||
DrawUtil.drawLine(FlxPoint.weak(rect.x, rect.y), FlxPoint.weak(rect.x + rect.width, rect.y), thickness, color);
|
||||
DrawUtil.drawLine(FlxPoint.weak(rect.x, rect.y), FlxPoint.weak(rect.x, rect.y + rect.height), thickness, color);
|
||||
DrawUtil.drawLine(FlxPoint.weak(rect.x + rect.width, rect.y), FlxPoint.weak(rect.x + rect.width, rect.y + rect.height), thickness, color);
|
||||
DrawUtil.drawLine(FlxPoint.weak(rect.x, rect.y + rect.height), FlxPoint.weak(rect.x + rect.width, rect.y + rect.height), thickness, color);
|
||||
}
|
||||
|
||||
public static inline function createDrawers() {
|
||||
@@ -50,7 +61,7 @@ final class DrawUtil {
|
||||
dot.camera = FlxG.camera;
|
||||
dot.forceIsOnScreen = true;
|
||||
|
||||
line = new FlxSprite().makeGraphic(30, 30, FlxColor.WHITE);
|
||||
line = new FlxSprite().makeGraphic(1, 1, FlxColor.WHITE);
|
||||
line.camera = FlxG.camera;
|
||||
line.forceIsOnScreen = true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package funkin.editors.character;
|
||||
|
||||
import funkin.editors.extra.AxisGizmo;
|
||||
import flixel.math.FlxRect;
|
||||
import funkin.editors.stage.StageEditor;
|
||||
import funkin.game.Stage;
|
||||
@@ -14,7 +15,6 @@ import funkin.editors.ui.UIContextMenu.UIContextMenuOptionSpr;
|
||||
import funkin.game.Character;
|
||||
import haxe.xml.Access;
|
||||
import haxe.xml.Printer;
|
||||
import funkin.editors.extra.DrawAxis;
|
||||
|
||||
class CharacterEditor extends UIState {
|
||||
static var __character:String;
|
||||
@@ -33,7 +33,8 @@ class CharacterEditor extends UIState {
|
||||
// public var dragOffsetsCheckbox:UICheckbox;
|
||||
// public var lockCameraCheckbox:UICheckbox;
|
||||
|
||||
public var drawAxis:DrawAxis;
|
||||
public var axisGizmo:AxisGizmo;
|
||||
public var characterGizmo:CharacterGizmos;
|
||||
public var uiGroup:FlxTypedGroup<FlxSprite> = new FlxTypedGroup<FlxSprite>();
|
||||
|
||||
public var cameraHoverDummy:CameraHoverDummy;
|
||||
@@ -42,6 +43,7 @@ class CharacterEditor extends UIState {
|
||||
public var characterAnimsWindow:CharacterAnimsWindow;
|
||||
|
||||
public var charCamera:FlxCamera;
|
||||
public var gizmosCamera:FlxCamera;
|
||||
public var uiCamera:FlxCamera;
|
||||
|
||||
public var animationText:UIText;
|
||||
@@ -255,6 +257,20 @@ class CharacterEditor extends UIState {
|
||||
|
||||
charCamera = FlxG.camera;
|
||||
|
||||
gizmosCamera = new FlxCamera();
|
||||
gizmosCamera.bgColor = 0;
|
||||
FlxG.cameras.add(gizmosCamera);
|
||||
|
||||
axisGizmo = new AxisGizmo();
|
||||
axisGizmo.cameras = [gizmosCamera];
|
||||
add(axisGizmo);
|
||||
|
||||
characterGizmo = new CharacterGizmos();
|
||||
characterGizmo.boxGizmo = Options.characterHitbox;
|
||||
characterGizmo.cameraGizmo = Options.characterCamera;
|
||||
characterGizmo.cameras = [gizmosCamera];
|
||||
add(characterGizmo);
|
||||
|
||||
uiCamera = new FlxCamera();
|
||||
uiCamera.bgColor = 0;
|
||||
|
||||
@@ -264,17 +280,12 @@ class CharacterEditor extends UIState {
|
||||
character.debugMode = true;
|
||||
character.cameras = [charCamera];
|
||||
|
||||
character.debugHitbox = Options.characterHitbox;
|
||||
character.debugCamera = Options.characterCamera;
|
||||
characterGizmo.character = character;
|
||||
|
||||
changeCharacterIsPlayer(character.playerOffsets);
|
||||
|
||||
add(character);
|
||||
|
||||
drawAxis = new DrawAxis();
|
||||
drawAxis.cameras = [charCamera];
|
||||
add(drawAxis);
|
||||
|
||||
uiGroup.cameras = [uiCamera];
|
||||
add(cameraHoverDummy = new CameraHoverDummy(uiGroup, FlxPoint.weak(0, 0)));
|
||||
|
||||
@@ -627,17 +638,17 @@ class CharacterEditor extends UIState {
|
||||
|
||||
function _view_character_show_hitbox(t) {
|
||||
t.icon = (Options.characterHitbox = !Options.characterHitbox) ? 1 : 0;
|
||||
character.debugHitbox = Options.characterHitbox;
|
||||
characterGizmo.boxGizmo = Options.characterHitbox;
|
||||
}
|
||||
|
||||
function _view_character_show_camera(t) {
|
||||
t.icon = (Options.characterCamera = !Options.characterCamera) ? 1 : 0;
|
||||
character.debugCamera = Options.characterCamera;
|
||||
characterGizmo.cameraGizmo = Options.characterCamera;
|
||||
}
|
||||
|
||||
function _view_character_show_axis(t) {
|
||||
t.icon = (Options.characterAxis = !Options.characterAxis) ? 1 : 0;
|
||||
drawAxis.visible = Options.characterAxis;
|
||||
axisGizmo.visible = Options.characterAxis;
|
||||
}
|
||||
|
||||
function _view_focus_character(_) {
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package funkin.editors.character;
|
||||
|
||||
import funkin.game.Character;
|
||||
|
||||
class CharacterGizmos extends FlxSprite {
|
||||
public var character:Character;
|
||||
|
||||
public var boxGizmo:Bool = true;
|
||||
public var cameraGizmo:Bool = true;
|
||||
|
||||
public override function draw() {
|
||||
super.draw();
|
||||
|
||||
if (character == null) return;
|
||||
|
||||
if (boxGizmo) drawHitbox();
|
||||
if (cameraGizmo) drawCamera();
|
||||
}
|
||||
|
||||
public function drawHitbox() {
|
||||
// TODO: ATLAS VESION OF THIS CODE
|
||||
if (character._matrix == null || character.frame == null) return;
|
||||
|
||||
for (camera in cameras) {
|
||||
character._rect.set(character._matrix.tx, character._matrix.ty, character.frame.frame.width * character._matrix.a, character.frame.frame.height * character._matrix.d);
|
||||
@:privateAccess character._rect = FlxG.camera.transformRect(character._rect);
|
||||
trace(character._rect);
|
||||
|
||||
if (DrawUtil.line == null) DrawUtil.createDrawers();
|
||||
DrawUtil.line.camera = camera; DrawUtil.line.alpha = 0.75;
|
||||
|
||||
DrawUtil.drawRect(character._rect, 1, 0xFF8F8A00);
|
||||
// yes i made a drawRect function for this purpose, no im not using it >:D
|
||||
DrawUtil.drawLine(
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(character._rect.x, character._rect.y), FlxG.camera, FlxPoint.weak()),
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(character._rect.x + character._rect.width, character._rect.y), FlxG.camera, FlxPoint.weak()),
|
||||
1, 0xFF007B8F
|
||||
);
|
||||
DrawUtil.drawLine(
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(character._rect.x, character._rect.y), FlxG.camera, FlxPoint.weak()),
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(character._rect.x, character._rect.y + character._rect.height), FlxG.camera, FlxPoint.weak()),
|
||||
1, 0xFF007B8F
|
||||
);
|
||||
DrawUtil.drawLine(
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(character._rect.x + character._rect.width, character._rect.y), FlxG.camera, FlxPoint.weak()),
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(character._rect.x + character._rect.width, character._rect.y + character._rect.height), FlxG.camera, FlxPoint.weak()),
|
||||
1, 0xFF007B8F
|
||||
);
|
||||
DrawUtil.drawLine(
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(character._rect.x, character._rect.y + character._rect.height), FlxG.camera, FlxPoint.weak()),
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(character._rect.x + character._rect.width, character._rect.y + character._rect.height), FlxG.camera, FlxPoint.weak()),
|
||||
1, 0xFF007B8F
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function drawCamera() {
|
||||
for (camera in cameras) {
|
||||
var camPos:FlxPoint = character.getCameraPosition();
|
||||
camPos -= camera.scroll;
|
||||
|
||||
if (DrawUtil.line == null) DrawUtil.createDrawers();
|
||||
DrawUtil.line.camera = camera; DrawUtil.line.alpha = 0.75;
|
||||
|
||||
DrawUtil.drawLine(
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(camPos.x - 8, camPos.y), FlxG.camera, FlxPoint.weak()),
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(camPos.x + 8, camPos.y), FlxG.camera, FlxPoint.weak()),
|
||||
1, 0xFF00A0B9);
|
||||
|
||||
DrawUtil.drawLine(
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(camPos.x, camPos.y - 8), FlxG.camera, FlxPoint.weak()),
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(camPos.x, camPos.y + 8), FlxG.camera, FlxPoint.weak()),
|
||||
1, 0xFF00A0B9);
|
||||
|
||||
camPos.put();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package funkin.editors.extra;
|
||||
|
||||
class AxisGizmo extends FlxObject {
|
||||
var _worldPos:FlxPoint = FlxPoint.get();
|
||||
|
||||
public override function draw() {
|
||||
super.draw();
|
||||
|
||||
for (camera in cameras) {
|
||||
if (DrawUtil.line == null) DrawUtil.createDrawers();
|
||||
DrawUtil.line.camera = camera; DrawUtil.line.alpha = 0.75;
|
||||
|
||||
CoolUtil.pointToScreenPosition(FlxPoint.weak(), FlxG.camera, _worldPos);
|
||||
// Stole these colors directly from godot >:D -luanr
|
||||
DrawUtil.drawLine(
|
||||
FlxPoint.weak(_worldPos.x, 0),
|
||||
FlxPoint.weak(_worldPos.x, camera.height),
|
||||
1, 0xFF76BC02);
|
||||
|
||||
DrawUtil.drawLine(
|
||||
FlxPoint.weak(0, _worldPos.y),
|
||||
FlxPoint.weak(camera.width, _worldPos.y),
|
||||
1, 0xFFD72C47);
|
||||
}
|
||||
}
|
||||
|
||||
public override function destroy() {
|
||||
super.destroy();
|
||||
_worldPos.put();
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package funkin.editors.extra;
|
||||
|
||||
import openfl.display.Graphics;
|
||||
import flixel.util.FlxSpriteUtil;
|
||||
|
||||
class DrawAxis extends FlxObject {
|
||||
public override function draw() {
|
||||
super.draw();
|
||||
|
||||
/*
|
||||
for (camera in cameras) {
|
||||
var gfx:Graphics = FlxG.renderBlit ? {
|
||||
FlxSpriteUtil.flashGfx.clear();
|
||||
FlxSpriteUtil.flashGfx;
|
||||
} : camera.debugLayer.graphics;
|
||||
|
||||
// Stole these colors directly from godot
|
||||
gfx.lineStyle(2, 0xFF76BC02, 1);
|
||||
|
||||
gfx.moveTo(-camera.scroll.x, camera.viewMarginTop);
|
||||
gfx.lineTo(-camera.scroll.x, camera.viewMarginBottom);
|
||||
|
||||
gfx.lineStyle(2, 0xFFD72C47, 1);
|
||||
|
||||
gfx.moveTo(camera.viewMarginLeft, -camera.scroll.y);
|
||||
gfx.lineTo(camera.viewMarginRight, -camera.scroll.y);
|
||||
|
||||
if (FlxG.renderBlit)
|
||||
camera.buffer.draw(FlxSpriteUtil.flashGfxSprite);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -427,7 +427,6 @@ class StageEditor extends UIState {
|
||||
override function destroy() {
|
||||
super.destroy();
|
||||
nextScroll = FlxDestroyUtil.destroy(nextScroll);
|
||||
DrawUtil.destroyDrawers();
|
||||
if(Framerate.isLoaded) {
|
||||
Framerate.fpsCounter.alpha = 1;
|
||||
Framerate.memoryCounter.alpha = 1;
|
||||
|
||||
@@ -132,6 +132,7 @@ class UIState extends MusicBeatState {
|
||||
super.destroy();
|
||||
__mousePos.put();
|
||||
|
||||
DrawUtil.destroyDrawers();
|
||||
WindowUtils.resetAffixes();
|
||||
SaveWarning.reset();
|
||||
|
||||
|
||||
@@ -247,66 +247,9 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
super.draw();
|
||||
postDraw();
|
||||
|
||||
if (!ghostDraw) {
|
||||
if (debugHitbox) drawHitbox();
|
||||
if (debugCamera) drawCamera();
|
||||
}
|
||||
|
||||
script.call("postDraw", [e]);
|
||||
}
|
||||
|
||||
public var debugHitbox:Bool = false;
|
||||
public var debugCamera:Bool = false;
|
||||
|
||||
public function drawHitbox() {
|
||||
if (_matrix == null || frame == null) return;
|
||||
|
||||
/*
|
||||
for (camera in cameras) {
|
||||
var gfx:Graphics = FlxG.renderBlit ? {
|
||||
FlxSpriteUtil.flashGfx.clear();
|
||||
FlxSpriteUtil.flashGfx;
|
||||
} : camera.debugLayer.graphics;
|
||||
|
||||
_rect.set(_matrix.tx, _matrix.ty, frame.frame.width * _matrix.a, frame.frame.height * _matrix.d);
|
||||
@:privateAccess _rect = camera.transformRect(_rect);
|
||||
|
||||
gfx.lineStyle(2, 0xFF007B8F, 1);
|
||||
gfx.drawRect(_rect.x, _rect.y, _rect.width, _rect.height);
|
||||
|
||||
if (FlxG.renderBlit)
|
||||
camera.buffer.draw(FlxSpriteUtil.flashGfxSprite);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public function drawCamera() {
|
||||
/*
|
||||
for (camera in cameras) {
|
||||
var gfx:Graphics = FlxG.renderBlit ? {
|
||||
FlxSpriteUtil.flashGfx.clear();
|
||||
FlxSpriteUtil.flashGfx;
|
||||
} : camera.debugLayer.graphics;
|
||||
|
||||
var camPos:FlxPoint = getCameraPosition();
|
||||
camPos -= camera.scroll;
|
||||
|
||||
gfx.lineStyle(2, 0xFF00A0B9, 1);
|
||||
|
||||
gfx.moveTo(camPos.x - 8, camPos.y);
|
||||
gfx.lineTo(camPos.x + 8, camPos.y);
|
||||
|
||||
gfx.moveTo(camPos.x, camPos.y - 8);
|
||||
gfx.lineTo(camPos.x, camPos.y + 8);
|
||||
|
||||
camPos.put();
|
||||
|
||||
if (FlxG.renderBlit)
|
||||
camera.buffer.draw(FlxSpriteUtil.flashGfxSprite);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public var singAnims = ["singLEFT", "singDOWN", "singUP", "singRIGHT"];
|
||||
public inline function getSingAnim(direction:Int, suffix:String = ""):String
|
||||
return singAnims[direction % singAnims.length] + suffix;
|
||||
|
||||
@@ -39,6 +39,9 @@ class Options
|
||||
public static var songOffset:Float = 0;
|
||||
public static var framerate:Int = 120;
|
||||
public static var gpuOnlyBitmaps:Bool = #if (mac || web) false #else true #end; // causes issues on mac and web
|
||||
#if MODCHARTING_FEATURES
|
||||
public static var modchartingHoldSubdivisions:Int = 4;
|
||||
#end
|
||||
|
||||
public static var lastLoadedMod:String = null;
|
||||
|
||||
|
||||
@@ -226,9 +226,7 @@ class NativeApplication
|
||||
var joystick = Joystick.devices.get(joystickEventInfo.id);
|
||||
if (joystick != null) joystick.onHatMove.dispatch(joystickEventInfo.index, joystickEventInfo.eventValue);
|
||||
|
||||
case TRACKBALL_MOVE:
|
||||
var joystick = Joystick.devices.get(joystickEventInfo.id);
|
||||
if (joystick != null) joystick.onTrackballMove.dispatch(joystickEventInfo.index, joystickEventInfo.x, joystickEventInfo.y);
|
||||
case TRACKBALL_MOVE: // I guess this was just removed ??
|
||||
|
||||
case BUTTON_DOWN:
|
||||
var joystick = Joystick.devices.get(joystickEventInfo.id);
|
||||
|
||||
Reference in New Issue
Block a user