mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-30 03:25:47 -05:00
Merge branch 'rewrite/master' into a-bot-bars
This commit is contained in:
commit
41b9ba9bce
3 changed files with 40 additions and 27 deletions
|
@ -193,6 +193,11 @@ class BaseCharacter extends Bopper
|
||||||
return _data.death?.cameraOffsets ?? [0.0, 0.0];
|
return _data.death?.cameraOffsets ?? [0.0, 0.0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getBaseScale():Float
|
||||||
|
{
|
||||||
|
return _data.scale;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDeathCameraZoom():Float
|
public function getDeathCameraZoom():Float
|
||||||
{
|
{
|
||||||
return _data.death?.cameraZoom ?? 1.0;
|
return _data.death?.cameraZoom ?? 1.0;
|
||||||
|
@ -260,8 +265,8 @@ class BaseCharacter extends Bopper
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the sprite scale to the appropriate value.
|
* Set the character's sprite scale to the appropriate value.
|
||||||
* @param scale
|
* @param scale The desired scale.
|
||||||
*/
|
*/
|
||||||
public function setScale(scale:Null<Float>):Void
|
public function setScale(scale:Null<Float>):Void
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,10 +109,11 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements
|
||||||
{
|
{
|
||||||
getBoyfriend().resetCharacter(true);
|
getBoyfriend().resetCharacter(true);
|
||||||
// Reapply the camera offsets.
|
// Reapply the camera offsets.
|
||||||
var charData = _data.characters.bf;
|
var stageCharData:StageDataCharacter = _data.characters.bf;
|
||||||
getBoyfriend().scale.set(charData.scale, charData.scale);
|
var finalScale:Float = getBoyfriend().getBaseScale() * stageCharData.scale;
|
||||||
getBoyfriend().cameraFocusPoint.x += charData.cameraOffsets[0];
|
getBoyfriend().setScale(finalScale);
|
||||||
getBoyfriend().cameraFocusPoint.y += charData.cameraOffsets[1];
|
getBoyfriend().cameraFocusPoint.x += stageCharData.cameraOffsets[0];
|
||||||
|
getBoyfriend().cameraFocusPoint.y += stageCharData.cameraOffsets[1];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -122,19 +123,21 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements
|
||||||
{
|
{
|
||||||
getGirlfriend().resetCharacter(true);
|
getGirlfriend().resetCharacter(true);
|
||||||
// Reapply the camera offsets.
|
// Reapply the camera offsets.
|
||||||
var charData = _data.characters.gf;
|
var stageCharData:StageDataCharacter = _data.characters.gf;
|
||||||
getGirlfriend().scale.set(charData.scale, charData.scale);
|
var finalScale:Float = getBoyfriend().getBaseScale() * stageCharData.scale;
|
||||||
getGirlfriend().cameraFocusPoint.x += charData.cameraOffsets[0];
|
getGirlfriend().setScale(finalScale);
|
||||||
getGirlfriend().cameraFocusPoint.y += charData.cameraOffsets[1];
|
getGirlfriend().cameraFocusPoint.x += stageCharData.cameraOffsets[0];
|
||||||
|
getGirlfriend().cameraFocusPoint.y += stageCharData.cameraOffsets[1];
|
||||||
}
|
}
|
||||||
if (getDad() != null)
|
if (getDad() != null)
|
||||||
{
|
{
|
||||||
getDad().resetCharacter(true);
|
getDad().resetCharacter(true);
|
||||||
// Reapply the camera offsets.
|
// Reapply the camera offsets.
|
||||||
var charData = _data.characters.dad;
|
var stageCharData:StageDataCharacter = _data.characters.dad;
|
||||||
getDad().scale.set(charData.scale, charData.scale);
|
var finalScale:Float = getBoyfriend().getBaseScale() * stageCharData.scale;
|
||||||
getDad().cameraFocusPoint.x += charData.cameraOffsets[0];
|
getDad().setScale(finalScale);
|
||||||
getDad().cameraFocusPoint.y += charData.cameraOffsets[1];
|
getDad().cameraFocusPoint.x += stageCharData.cameraOffsets[0];
|
||||||
|
getDad().cameraFocusPoint.y += stageCharData.cameraOffsets[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset positions of named props.
|
// Reset positions of named props.
|
||||||
|
@ -393,23 +396,23 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements
|
||||||
#end
|
#end
|
||||||
|
|
||||||
// Apply position and z-index.
|
// Apply position and z-index.
|
||||||
var charData:StageDataCharacter = null;
|
var stageCharData:StageDataCharacter = null;
|
||||||
switch (charType)
|
switch (charType)
|
||||||
{
|
{
|
||||||
case BF:
|
case BF:
|
||||||
this.characters.set('bf', character);
|
this.characters.set('bf', character);
|
||||||
charData = _data.characters.bf;
|
stageCharData = _data.characters.bf;
|
||||||
character.flipX = !character.getDataFlipX();
|
character.flipX = !character.getDataFlipX();
|
||||||
character.name = 'bf';
|
character.name = 'bf';
|
||||||
character.initHealthIcon(false);
|
character.initHealthIcon(false);
|
||||||
case GF:
|
case GF:
|
||||||
this.characters.set('gf', character);
|
this.characters.set('gf', character);
|
||||||
charData = _data.characters.gf;
|
stageCharData = _data.characters.gf;
|
||||||
character.flipX = character.getDataFlipX();
|
character.flipX = character.getDataFlipX();
|
||||||
character.name = 'gf';
|
character.name = 'gf';
|
||||||
case DAD:
|
case DAD:
|
||||||
this.characters.set('dad', character);
|
this.characters.set('dad', character);
|
||||||
charData = _data.characters.dad;
|
stageCharData = _data.characters.dad;
|
||||||
character.flipX = character.getDataFlipX();
|
character.flipX = character.getDataFlipX();
|
||||||
character.name = 'dad';
|
character.name = 'dad';
|
||||||
character.initHealthIcon(true);
|
character.initHealthIcon(true);
|
||||||
|
@ -421,15 +424,15 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements
|
||||||
// This ensures positioning is based on the idle animation.
|
// This ensures positioning is based on the idle animation.
|
||||||
character.resetCharacter(true);
|
character.resetCharacter(true);
|
||||||
|
|
||||||
if (charData != null)
|
if (stageCharData != null)
|
||||||
{
|
{
|
||||||
character.zIndex = charData.zIndex;
|
character.zIndex = stageCharData.zIndex;
|
||||||
|
|
||||||
// Start with the per-stage character position.
|
// Start with the per-stage character position.
|
||||||
// Subtracting the origin ensures characters are positioned relative to their feet.
|
// Subtracting the origin ensures characters are positioned relative to their feet.
|
||||||
// Subtracting the global offset allows positioning on a per-character basis.
|
// Subtracting the global offset allows positioning on a per-character basis.
|
||||||
character.x = charData.position[0] - character.characterOrigin.x + character.globalOffsets[0];
|
character.x = stageCharData.position[0] - character.characterOrigin.x + character.globalOffsets[0];
|
||||||
character.y = charData.position[1] - character.characterOrigin.y + character.globalOffsets[1];
|
character.y = stageCharData.position[1] - character.characterOrigin.y + character.globalOffsets[1];
|
||||||
|
|
||||||
@:privateAccess(funkin.play.stage.Bopper)
|
@:privateAccess(funkin.play.stage.Bopper)
|
||||||
{
|
{
|
||||||
|
@ -438,16 +441,17 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements
|
||||||
character.originalPosition.y = character.y + character.animOffsets[1];
|
character.originalPosition.y = character.y + character.animOffsets[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
character.scale.set(charData.scale, charData.scale);
|
var finalScale = character.getBaseScale() * stageCharData.scale;
|
||||||
character.cameraFocusPoint.x += charData.cameraOffsets[0];
|
character.setScale(finalScale); // Don't use scale.set for characters!
|
||||||
character.cameraFocusPoint.y += charData.cameraOffsets[1];
|
character.cameraFocusPoint.x += stageCharData.cameraOffsets[0];
|
||||||
|
character.cameraFocusPoint.y += stageCharData.cameraOffsets[1];
|
||||||
|
|
||||||
#if debug
|
#if debug
|
||||||
// Draw the debug icon at the character's feet.
|
// Draw the debug icon at the character's feet.
|
||||||
if (charType == BF || charType == DAD)
|
if (charType == BF || charType == DAD)
|
||||||
{
|
{
|
||||||
debugIcon.x = charData.position[0];
|
debugIcon.x = stageCharData.position[0];
|
||||||
debugIcon.y = charData.position[1];
|
debugIcon.y = stageCharData.position[1];
|
||||||
debugIcon2.x = character.x;
|
debugIcon2.x = character.x;
|
||||||
debugIcon2.y = character.y;
|
debugIcon2.y = character.y;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,11 @@ class ReloadAssetsDebugPlugin extends FlxBasic
|
||||||
{
|
{
|
||||||
super.update(elapsed);
|
super.update(elapsed);
|
||||||
|
|
||||||
|
#if html5
|
||||||
|
if (FlxG.keys.justPressed.FIVE && FlxG.keys.pressed.SHIFT)
|
||||||
|
#else
|
||||||
if (FlxG.keys.justPressed.F5)
|
if (FlxG.keys.justPressed.F5)
|
||||||
|
#end
|
||||||
{
|
{
|
||||||
funkin.modding.PolymodHandler.forceReloadAssets();
|
funkin.modding.PolymodHandler.forceReloadAssets();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue