mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 05:01:38 +00:00
minor ui fixes
This commit is contained in:
parent
83ebc8760e
commit
d0b8621b8f
6 changed files with 27 additions and 10 deletions
|
|
@ -384,8 +384,8 @@ class CameraController extends Object {
|
||||||
var rightVec = camera.up.cross(forwardVec).normalized();
|
var rightVec = camera.up.cross(forwardVec).normalized();
|
||||||
var upVec = forwardVec.cross(rightVec);
|
var upVec = forwardVec.cross(rightVec);
|
||||||
|
|
||||||
camera.target = marblePosition.add(upVec.multiply(0.55));
|
camera.target = marblePosition.add(cameraVerticalTranslation);
|
||||||
camera.up = upVec;
|
// camera.up = upVec;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,7 @@ class MarbleWorld extends Scheduler {
|
||||||
public var totalGems:Int = 0;
|
public var totalGems:Int = 0;
|
||||||
public var gemCount:Int = 0;
|
public var gemCount:Int = 0;
|
||||||
public var blastAmount:Float = 0;
|
public var blastAmount:Float = 0;
|
||||||
|
public var skipStartBug:Bool = false;
|
||||||
|
|
||||||
var renderBlastAmount:Float = 0;
|
var renderBlastAmount:Float = 0;
|
||||||
|
|
||||||
|
|
@ -465,6 +466,7 @@ class MarbleWorld extends Scheduler {
|
||||||
this.renderBlastAmount = 0;
|
this.renderBlastAmount = 0;
|
||||||
this.outOfBoundsTime = null;
|
this.outOfBoundsTime = null;
|
||||||
this.finishTime = null;
|
this.finishTime = null;
|
||||||
|
this.skipStartBug = false;
|
||||||
|
|
||||||
this.currentCheckpoint = null;
|
this.currentCheckpoint = null;
|
||||||
this.currentCheckpointTrigger = null;
|
this.currentCheckpointTrigger = null;
|
||||||
|
|
@ -590,7 +592,7 @@ class MarbleWorld extends Scheduler {
|
||||||
if ((this.timeState.currentAttemptTime >= 0.5) && (this.timeState.currentAttemptTime < 3.5)) {
|
if ((this.timeState.currentAttemptTime >= 0.5) && (this.timeState.currentAttemptTime < 3.5)) {
|
||||||
this.marble.setMode(Start);
|
this.marble.setMode(Start);
|
||||||
}
|
}
|
||||||
if (this.timeState.currentAttemptTime >= 3.5 && this.finishTime == null) {
|
if ((this.timeState.currentAttemptTime >= 3.5 && this.finishTime == null) || skipStartBug) {
|
||||||
this.marble.setMode(Play);
|
this.marble.setMode(Play);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1149,7 +1151,7 @@ class MarbleWorld extends Scheduler {
|
||||||
var timeMultiplier = this.gameMode.timeMultiplier();
|
var timeMultiplier = this.gameMode.timeMultiplier();
|
||||||
|
|
||||||
if (!this.isWatching) {
|
if (!this.isWatching) {
|
||||||
if (this.bonusTime != 0 && this.timeState.currentAttemptTime >= 3.5) {
|
if (this.bonusTime != 0 && (this.timeState.currentAttemptTime >= 3.5 || skipStartBug)) {
|
||||||
this.bonusTime -= dt;
|
this.bonusTime -= dt;
|
||||||
if (this.bonusTime < 0) {
|
if (this.bonusTime < 0) {
|
||||||
this.timeState.gameplayClock -= this.bonusTime * timeMultiplier;
|
this.timeState.gameplayClock -= this.bonusTime * timeMultiplier;
|
||||||
|
|
@ -1164,7 +1166,7 @@ class MarbleWorld extends Scheduler {
|
||||||
timeTravelSound.stop();
|
timeTravelSound.stop();
|
||||||
timeTravelSound = null;
|
timeTravelSound = null;
|
||||||
}
|
}
|
||||||
if (this.timeState.currentAttemptTime >= 3.5) {
|
if ((this.timeState.currentAttemptTime >= 3.5 || skipStartBug)) {
|
||||||
this.timeState.gameplayClock += dt * timeMultiplier;
|
this.timeState.gameplayClock += dt * timeMultiplier;
|
||||||
} else if (this.timeState.currentAttemptTime + dt >= 3.5) {
|
} else if (this.timeState.currentAttemptTime + dt >= 3.5) {
|
||||||
this.timeState.gameplayClock += ((this.timeState.currentAttemptTime + dt) - 3.5) * timeMultiplier;
|
this.timeState.gameplayClock += ((this.timeState.currentAttemptTime + dt) - 3.5) * timeMultiplier;
|
||||||
|
|
@ -1177,7 +1179,7 @@ class MarbleWorld extends Scheduler {
|
||||||
this.timeState.currentAttemptTime = this.replay.currentPlaybackFrame.time;
|
this.timeState.currentAttemptTime = this.replay.currentPlaybackFrame.time;
|
||||||
this.timeState.gameplayClock = this.replay.currentPlaybackFrame.clockTime;
|
this.timeState.gameplayClock = this.replay.currentPlaybackFrame.clockTime;
|
||||||
this.bonusTime = this.replay.currentPlaybackFrame.bonusTime;
|
this.bonusTime = this.replay.currentPlaybackFrame.bonusTime;
|
||||||
if (this.bonusTime != 0 && this.timeState.currentAttemptTime >= 3.5) {
|
if (this.bonusTime != 0 && (this.timeState.currentAttemptTime >= 3.5 || skipStartBug)) {
|
||||||
if (timeTravelSound == null) {
|
if (timeTravelSound == null) {
|
||||||
var ttsnd = ResourceLoader.getResource("data/sound/timetravelactive.wav", ResourceLoader.getAudio, this.soundResources);
|
var ttsnd = ResourceLoader.getResource("data/sound/timetravelactive.wav", ResourceLoader.getAudio, this.soundResources);
|
||||||
timeTravelSound = AudioManager.playSound(ttsnd, null, true);
|
timeTravelSound = AudioManager.playSound(ttsnd, null, true);
|
||||||
|
|
@ -1546,9 +1548,11 @@ class MarbleWorld extends Scheduler {
|
||||||
|
|
||||||
/** Get the current interpolated orientation quaternion. */
|
/** Get the current interpolated orientation quaternion. */
|
||||||
public function getOrientationQuat(time:Float) {
|
public function getOrientationQuat(time:Float) {
|
||||||
var completion = Util.clamp((time - this.orientationChangeTime) / 0.3, 0, 1);
|
var completion = Util.clamp((time - this.orientationChangeTime) / 0.8, 0, 1);
|
||||||
|
var newDt = completion / 0.4 * 2.302585124969482;
|
||||||
|
var smooth = 1.0 / (newDt * (newDt * 0.235 * newDt) + newDt + 1.0 + 0.48 * newDt * newDt);
|
||||||
var q = this.oldOrientationQuat.clone();
|
var q = this.oldOrientationQuat.clone();
|
||||||
q.slerp(q, this.newOrientationQuat, completion);
|
q.slerp(q, this.newOrientationQuat, 1 - smooth);
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -241,6 +241,7 @@ class Radar {
|
||||||
}
|
}
|
||||||
g.endFill();
|
g.endFill();
|
||||||
g.lineStyle(1, 0x000000, arrowAlpha);
|
g.lineStyle(1, 0x000000, arrowAlpha);
|
||||||
|
g.setColor(0x000000, arrowAlpha);
|
||||||
|
|
||||||
if (foldArrow) {
|
if (foldArrow) {
|
||||||
g.moveTo(lowerRight.x, lowerRight.y);
|
g.moveTo(lowerRight.x, lowerRight.y);
|
||||||
|
|
@ -308,6 +309,7 @@ class Radar {
|
||||||
|
|
||||||
// Border
|
// Border
|
||||||
g.lineStyle(1, 0x000000, circleAlpha);
|
g.lineStyle(1, 0x000000, circleAlpha);
|
||||||
|
g.setColor(0x000000, circleAlpha);
|
||||||
g.moveTo(midTopLeft.x, topLeft.y);
|
g.moveTo(midTopLeft.x, topLeft.y);
|
||||||
g.lineTo(topLeft.x, midTopLeft.y);
|
g.lineTo(topLeft.x, midTopLeft.y);
|
||||||
|
|
||||||
|
|
@ -336,6 +338,7 @@ class Radar {
|
||||||
g.endFill();
|
g.endFill();
|
||||||
|
|
||||||
g.lineStyle(1, 0x000000, circleAlpha);
|
g.lineStyle(1, 0x000000, circleAlpha);
|
||||||
|
g.setColor(0x000000, circleAlpha);
|
||||||
|
|
||||||
g.moveTo(halfBottomRight.x, drawPoint.y);
|
g.moveTo(halfBottomRight.x, drawPoint.y);
|
||||||
g.lineTo(drawPoint.x, halfTopLeft.y);
|
g.lineTo(drawPoint.x, halfTopLeft.y);
|
||||||
|
|
|
||||||
|
|
@ -317,7 +317,7 @@ class Util {
|
||||||
var hundredthOne = hundredth % 10;
|
var hundredthOne = hundredth % 10;
|
||||||
var hundredthTen = (hundredth - hundredthOne) / 10;
|
var hundredthTen = (hundredth - hundredthOne) / 10;
|
||||||
|
|
||||||
return '${minutesTen}${minutesOne}:${secondsTen}${secondsOne}.${hundredthTen}${hundredthOne}${thousandth}';
|
return '${minutesTen}${minutesOne}:${secondsTen}${secondsOne}.${hundredthTen}${hundredthOne}';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function formatTimeHours(time:Float) {
|
public static function formatTimeHours(time:Float) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
|
import gui.GuiControl.MouseState;
|
||||||
import src.AudioManager;
|
import src.AudioManager;
|
||||||
import src.MarbleGame;
|
import src.MarbleGame;
|
||||||
import hxd.res.BitmapFont;
|
import hxd.res.BitmapFont;
|
||||||
|
|
@ -11,6 +12,8 @@ class ExitGameDlg extends GuiImage {
|
||||||
var innerCtrl:GuiControl;
|
var innerCtrl:GuiControl;
|
||||||
var btnList:GuiXboxList;
|
var btnList:GuiXboxList;
|
||||||
|
|
||||||
|
var timeMenu:Float = 0.0;
|
||||||
|
|
||||||
public function new(yesFunc:GuiControl->Void, noFunc:GuiControl->Void, restartFunc:GuiControl->Void) {
|
public function new(yesFunc:GuiControl->Void, noFunc:GuiControl->Void, restartFunc:GuiControl->Void) {
|
||||||
var res = ResourceLoader.getImage("data/ui/xbox/BG_fadeOutSoftEdge.png").resource.toTile();
|
var res = ResourceLoader.getImage("data/ui/xbox/BG_fadeOutSoftEdge.png").resource.toTile();
|
||||||
super(res);
|
super(res);
|
||||||
|
|
@ -109,4 +112,11 @@ class ExitGameDlg extends GuiImage {
|
||||||
|
|
||||||
super.onResize(width, height);
|
super.onResize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override function update(dt:Float, mouseState:MouseState) {
|
||||||
|
super.update(dt, mouseState);
|
||||||
|
timeMenu += dt;
|
||||||
|
if (timeMenu > 3)
|
||||||
|
MarbleGame.instance.world.skipStartBug = true; // Trigger this lol
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -537,7 +537,7 @@ class PlayGui {
|
||||||
blastFill.xScale = (scene2d.height - safeVerMargin * 2) / 480;
|
blastFill.xScale = (scene2d.height - safeVerMargin * 2) / 480;
|
||||||
blastFill.yScale = (scene2d.height - safeVerMargin * 2) / 480;
|
blastFill.yScale = (scene2d.height - safeVerMargin * 2) / 480;
|
||||||
var colorMat = Matrix.I();
|
var colorMat = Matrix.I();
|
||||||
colorMat.colorSet(0x0080FF);
|
colorMat.colorSet(0xCDD2D7);
|
||||||
blastFill.bmp.filter = new h2d.filter.ColorMatrix(colorMat);
|
blastFill.bmp.filter = new h2d.filter.ColorMatrix(colorMat);
|
||||||
|
|
||||||
blastBar.addChild(blastFill);
|
blastBar.addChild(blastFill);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue