From bd940b0f8cc80cac953a8a62ac62b82a1c54bc38 Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Thu, 22 Jun 2023 01:52:59 +0530 Subject: [PATCH] start endgame --- data/ui/xbox/endGameWindow.png | Bin 0 -> 10741 bytes src/gui/EndGameGui.hx | 622 ++++++++++++++++++--------------- src/gui/ExitGameDlg.hx | 2 +- src/gui/GuiXboxListButton.hx | 4 + 4 files changed, 347 insertions(+), 281 deletions(-) create mode 100644 data/ui/xbox/endGameWindow.png diff --git a/data/ui/xbox/endGameWindow.png b/data/ui/xbox/endGameWindow.png new file mode 100644 index 0000000000000000000000000000000000000000..b424d574f81a0b07b264e40bdc93dc61a5c2a4cf GIT binary patch literal 10741 zcmX9^c|6nqACK})ijw;d70R^?Ida>mTp=t+Os?e^xzEZmY^LOzGvq#6Ovq80QOuD! z8d1iaOU!-#R=+=XJs$6UKCk!l^?W{GulM`&PBb?Kv$F}Zoj7rV-Pp+B-iZ@T=8W$d ztp73I5%Pn0#s^ctJ+R)1+J50h#*b6(x+c0OPGHez51d&Tzt8v?*#(?9!SVU;i-|}2 zcFc(rGD*e;x>g~Mv>#^4)poe~wXd4iQtzJhef0Tqoy}YPa#7>`@9~_SLRyLuF8v&zf27W8Rj zSpv!m)m>9dC1E+?eja&Jf9mFm3QJp)Zgkjw_=@VxiG<%n!;{@mO2#zweam?m?ABZX z3e&_ZO_=Nxqx_tC|ErW4V{)}(E6=Ttx0gjXN1(&~Vej*rgjW23DL$upF1d&h?>z9m zbHP`SZS-?^@?*2|rKKM(lr?=j~pl?oaJJm@3{Z>0GH1Ip%LS zl^P3&PmBVgB5okxLI79z;IR#DUII z)X$skd=iFrjW#tBTo45#E-=yo_P%BijjL8B_uX%qO@H>0XEFR<;V4{Kz51e*Tb~`Y z`Z>z!!<6K7uRyeY_3yeJ<73GkuA= zORg#T24yq)E}_D08J1>+GMe&z?ogG!<6al}9*{$|Chg!X6MT>Jj;e7xcJl4^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P)L%VYYAM6KKhc&myS2r@$=14C0Cf%~ukA1xH-nsEVjW|J7 zs;hQ=Vm4FLTt(w%kcL!say`sK)7#^;7bHJKx9na)N)==r17E zoR^ZXAUQuGn|-|m_;NG@>5$5sJ%H}nIP%n51Iv?EtlFc`_D9xm-BZc|@|d`m#fB=e ziN#L#clVV^<6ak(dWE1gRW-9`)yaR4)mUr?q_vHNrQ5YZVZswaVx1VUSD!3N5z`xbZfm0`anV4OMUapo{7fMl8^@?y~w$t@}Pm?%w z3T)Ra_=r7UE)MZDUwTFLH%eB7*?g*TeXR2SSMi0x)Z}^Z&*yo+)d~#GBD}Rt2+L|gCV?Hl#@m+#*8=k( zN?Vu9ms3Oo4|7(W?=N#B#0UkE7ql;QHk|y_pj~8pj7>S=zG@AXAgl>!hvkXAiHQ$; z?tL|idx+79!-0oAK5K!V6T&pbgC5%R3b>-i0kR-JtZd5-?dGrH6n)`f`g-Jx9BlI(QCyiPR z*|z#U$@kW8Vd~cJ$Z6{Glg!m0(N?C1>L@3nP=PxryAA@X8bukLycTT1crLeloQvy_ n3mfxbVsw1XJOi5a;}b=L6ZQYmVlx>>HBT5Dni|yVJ$&{*maVFA literal 0 HcmV?d00001 diff --git a/src/gui/EndGameGui.hx b/src/gui/EndGameGui.hx index a97da4ff..60ce1862 100644 --- a/src/gui/EndGameGui.hx +++ b/src/gui/EndGameGui.hx @@ -33,319 +33,381 @@ class EndGameGui extends GuiControl { return [normal, hover, pressed]; } - var pg = new GuiImage(ResourceLoader.getResource("data/ui/endgame/base.png", ResourceLoader.getImage, this.imageResources).toTile()); - pg.horizSizing = Center; - pg.vertSizing = Center; - pg.position = new Vector(28, 20); - pg.extent = new Vector(584, 440); + var scene2d = MarbleGame.canvas.scene2d; - var continueButton = new GuiButton(loadButtonImages("data/ui/endgame/continue")); - continueButton.horizSizing = Right; - continueButton.vertSizing = Bottom; - continueButton.position = new Vector(460, 307); - continueButton.extent = new Vector(104, 54); - continueButton.accelerator = hxd.Key.ENTER; - continueButton.gamepadAccelerator = ["A"]; - continueButton.pressedAction = (e) -> continueFunc(continueButton); + var offsetX = (scene2d.width - 1280) / 2; + var offsetY = (scene2d.height - 720) / 2; - var restartButton = new GuiButton(loadButtonImages("data/ui/endgame/replay")); - restartButton.horizSizing = Right; - restartButton.vertSizing = Bottom; - restartButton.position = new Vector(460, 363); - restartButton.extent = new Vector(104, 54); - restartButton.gamepadAccelerator = ["B"]; - restartButton.pressedAction = (e) -> restartFunc(restartButton); + var subX = 640 - (scene2d.width - offsetX * 2) * 640 / scene2d.width; + var subY = 480 - (scene2d.height - offsetY * 2) * 480 / scene2d.height; - var nextLevel = new GuiControl(); - nextLevel.position = new Vector(326, 307); - nextLevel.extent = new Vector(130, 110); + var innerCtrl = new GuiControl(); + innerCtrl.position = new Vector(offsetX, offsetY); + innerCtrl.extent = new Vector(640 - subX, 480 - subY); + innerCtrl.horizSizing = Width; + innerCtrl.vertSizing = Height; + this.addChild(innerCtrl); - var temprev = new BitmapData(1, 1); - temprev.setPixel(0, 0, 0); - var tmpprevtile = Tile.fromBitmap(temprev); + var endGameWnd = new GuiImage(ResourceLoader.getResource("data/ui/xbox/endGameWindow.png", ResourceLoader.getImage, this.imageResources).toTile()); + endGameWnd.horizSizing = Left; + endGameWnd.vertSizing = Top; + endGameWnd.position = new Vector(80 - offsetX / 2, 170); + endGameWnd.extent = new Vector(336, 150); + innerCtrl.addChild(endGameWnd); - var nextLevelPreview = new GuiImage(tmpprevtile); - nextLevelPreview.position = new Vector(-15, 0); - nextLevelPreview.extent = new Vector(160, 110); - nextLevel.addChild(nextLevelPreview); + var subX = 640 - (scene2d.width - offsetX * 2) * 640 / scene2d.width; + var subY = 480 - (scene2d.height - offsetY * 2) * 480 / scene2d.height; - mission.getNextMission().getPreviewImage(t -> { - nextLevelPreview.bmp.tile = t; - }); - - var nextLevelBtn = new GuiButton(loadButtonImages('data/ui/endgame/level_window')); - nextLevelBtn.horizSizing = Width; - nextLevelBtn.vertSizing = Height; - nextLevelBtn.position = new Vector(0, 0); - nextLevelBtn.extent = new Vector(130, 110); - nextLevelBtn.gamepadAccelerator = ["X"]; - nextLevelBtn.pressedAction = (e) -> nextLevelFunc(nextLevelBtn); - nextLevel.addChild(nextLevelBtn); - - function setButtonStates(enabled:Bool) { - nextLevelBtn.disabled = !enabled; - continueButton.disabled = !enabled; - restartButton.disabled = !enabled; - } - - var arial14fontdata = ResourceLoader.getFileEntry("data/font/arial.fnt"); + var arial14fontdata = ResourceLoader.getFileEntry("data/font/Arial Bold.fnt"); var arial14b = new BitmapFont(arial14fontdata.entry); @:privateAccess arial14b.loader = ResourceLoader.loader; - var arial14 = arial14b.toSdfFont(cast 12 * Settings.uiScale, MultiChannel); + var arial14 = arial14b.toSdfFont(cast 22 * Settings.uiScale, h2d.Font.SDFChannel.MultiChannel); - var domcasual32fontdata = ResourceLoader.getFileEntry("data/font/DomCasualD.fnt"); - var domcasual32b = new BitmapFont(domcasual32fontdata.entry); - @:privateAccess domcasual32b.loader = ResourceLoader.loader; - var domcasual32 = domcasual32b.toSdfFont(cast 28 * Settings.uiScale, MultiChannel); - var domcasual64 = domcasual32b.toSdfFont(cast 58 * Settings.uiScale, MultiChannel); - var domcasual24 = domcasual32b.toSdfFont(cast 20 * Settings.uiScale, MultiChannel); - - var expo50fontdata = ResourceLoader.getFileEntry("data/font/EXPON.fnt"); - var expo50b = new BitmapFont(expo50fontdata.entry); - @:privateAccess expo50b.loader = ResourceLoader.loader; - var expo50 = expo50b.toSdfFont(cast 35 * Settings.uiScale, MultiChannel); - var expo32 = expo50b.toSdfFont(cast 24 * Settings.uiScale, MultiChannel); + var statIcon = new GuiImage(ResourceLoader.getResource("data/ui/xbox/statIcon.png", ResourceLoader.getImage, this.imageResources).toTile()); + statIcon.position = new Vector(38, 27); + statIcon.extent = new Vector(20, 20); + endGameWnd.addChild(statIcon); function mlFontLoader(text:String) { - switch (text) { - case "DomCasual24": - return domcasual24; - case "DomCasual32": - return domcasual32; - case "DomCasual64": - return domcasual64; - case "Arial14": - return arial14; - case "Expo32": - return expo32; - default: - return null; - } + return arial14; } - var egResult = new GuiMLText(domcasual32, mlFontLoader); - egResult.position = new Vector(313, 54); - egResult.extent = new Vector(244, 69); - egResult.text.text = '

${Util.formatTime(timeState.gameplayClock)}

'; - egResult.text.filter = new DropShadow(1.414, 0.785, 0, 1, 0, 0.4, 1, true); - pg.addChild(egResult); - - var egFirstLine = new GuiMLText(domcasual24, mlFontLoader); - egFirstLine.position = new Vector(340, 150); - egFirstLine.extent = new Vector(210, 25); - egFirstLine.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - pg.addChild(egFirstLine); - - var egSecondLine = new GuiMLText(domcasual24, mlFontLoader); - egSecondLine.position = new Vector(341, 178); - egSecondLine.extent = new Vector(209, 25); - egSecondLine.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - pg.addChild(egSecondLine); - - var egThirdLine = new GuiMLText(domcasual24, mlFontLoader); - egThirdLine.position = new Vector(341, 206); - egThirdLine.extent = new Vector(209, 25); - egThirdLine.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - pg.addChild(egThirdLine); - - var egFourthLine = new GuiMLText(domcasual24, mlFontLoader); - egFourthLine.position = new Vector(341, 234); - egFourthLine.extent = new Vector(209, 25); - egFourthLine.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - pg.addChild(egFourthLine); - - var egFifthLine = new GuiMLText(domcasual24, mlFontLoader); - egFifthLine.position = new Vector(341, 262); - egFifthLine.extent = new Vector(209, 25); - egFifthLine.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - pg.addChild(egFifthLine); - - var egFirstLineScore = new GuiMLText(domcasual24, mlFontLoader); - egFirstLineScore.position = new Vector(475, 150); - egFirstLineScore.extent = new Vector(210, 25); - egFirstLineScore.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - pg.addChild(egFirstLineScore); - - var egSecondLineScore = new GuiMLText(domcasual24, mlFontLoader); - egSecondLineScore.position = new Vector(476, 178); - egSecondLineScore.extent = new Vector(209, 25); - egSecondLineScore.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - pg.addChild(egSecondLineScore); - - var egThirdLineScore = new GuiMLText(domcasual24, mlFontLoader); - egThirdLineScore.position = new Vector(476, 206); - egThirdLineScore.extent = new Vector(209, 25); - egThirdLineScore.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - pg.addChild(egThirdLineScore); - - var egFourthLineScore = new GuiMLText(domcasual24, mlFontLoader); - egFourthLineScore.position = new Vector(476, 234); - egFourthLineScore.extent = new Vector(209, 25); - egFourthLineScore.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - pg.addChild(egFourthLineScore); - - var egFifthLineScore = new GuiMLText(domcasual24, mlFontLoader); - egFifthLineScore.position = new Vector(476, 262); - egFifthLineScore.extent = new Vector(209, 25); - egFifthLineScore.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - pg.addChild(egFifthLineScore); - - var egTitleText = new GuiMLText(expo50, mlFontLoader); - egTitleText.text.textColor = 0xffff00; - egTitleText.text.text = 'Your Time:'; - egTitleText.text.filter = new DropShadow(1.414, 0.785, 0, 1, 0, 0.4, 1, true); - egTitleText.position = new Vector(34, 54); - egTitleText.extent = new Vector(247, 69); - pg.addChild(egTitleText); - - var egTopThreeText = new GuiMLText(domcasual32, mlFontLoader); - egTopThreeText.position = new Vector(341, 114); - egTopThreeText.extent = new Vector(209, 34); - egTopThreeText.text.text = 'Top 5 Times:'; // Make toggleable 3-5 - egTopThreeText.text.filter = new DropShadow(1.414, 0.785, 0, 1, 0, 0.4, 1, true); - pg.addChild(egTopThreeText); - - var text = '

'; - // Check for ultimate time TODO - if (mission.ultimateTime > 0 && timeState.gameplayClock < mission.ultimateTime) { - text += 'You beat the Ultimate Time!'; - } else { - if (mission.goldTime > 0 && timeState.gameplayClock < mission.goldTime) { - if (mission.game == "gold" || mission.game.toLowerCase() == "ultra") - text += 'You beat the Gold Time!'; - else - text += 'You beat the Platinum Time!'; - } else { - if (mission.qualifyTime > timeState.gameplayClock) { - text += "You beat the Par Time!"; - } else { - text += 'You didn\'t pass the Par Time!'; - } - } - } - text += '

'; - - var finishMessage = new GuiMLText(expo32, mlFontLoader); - finishMessage.text.textColor = 0x00ff00; - finishMessage.text.text = text; - finishMessage.text.filter = new DropShadow(1, 0.785, 0, 1, 0, 0.4, 1, true); - // finishMessage.justify = Center; - finishMessage.position = new Vector(25, 120); - finishMessage.extent = new Vector(293, 211); - pg.addChild(finishMessage); - - var qualified = mission.qualifyTime > timeState.gameplayClock; + var egResultLeft = new GuiMLText(arial14, mlFontLoader); + egResultLeft.position = new Vector(28, 26); + egResultLeft.extent = new Vector(180, 100); + egResultLeft.text.text = '

Time:
Par Time:
Rating:
My Best Time:

'; + endGameWnd.addChild(egResultLeft); + var c0 = 0xEBEBEB; + var c1 = 0x8DFF8D; + var c2 = 0x88BCEE; + var c3 = 0xFF7575; var scoreData:Array = Settings.getScores(mission.path); - while (scoreData.length < 5) { - scoreData.push({name: "Matan W.", time: 5999.999}); + while (scoreData.length < 1) { + scoreData.push({name: "Nardo Polo", time: 5999.999}); } - egFirstLine.text.text = '

1. ${scoreData[0].name}

'; - egSecondLine.text.text = '

2. ${scoreData[1].name}

'; - egThirdLine.text.text = '

3. ${scoreData[2].name}

'; - egFourthLine.text.text = '

4. ${scoreData[3].name}

'; - egFifthLine.text.text = '

5. ${scoreData[4].name}

'; + var bestScore = scoreData[0]; - var lineelems = [ - egFirstLineScore, - egSecondLineScore, - egThirdLineScore, - egFourthLineScore, - egFifthLineScore - ]; + var egResultRight = new GuiMLText(arial14, mlFontLoader); + egResultRight.position = new Vector(214, 26); + egResultRight.extent = new Vector(180, 100); + egResultRight.text.text = '${Util.formatTime(timeState.gameplayClock)}
${Util.formatTime(mission.qualifyTime)}
0
${Util.formatTime(bestScore.time)}'; + endGameWnd.addChild(egResultRight); - for (i in 0...5) { - if (scoreData[i].time < mission.ultimateTime) { - lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; - } else { - if (scoreData[i].time < mission.goldTime) { - if (mission.game == "gold" || mission.game.toLowerCase() == "ultra") - lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; - else - lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; - } else { - lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; - } - } - } + // var pg = new GuiImage(ResourceLoader.getResource("data/ui/endgame/base.png", ResourceLoader.getImage, this.imageResources).toTile()); + // pg.horizSizing = Center; + // pg.vertSizing = Center; + // pg.position = new Vector(28, 20); + // pg.extent = new Vector(584, 440); - var leftColumn = new GuiMLText(domcasual24, mlFontLoader); - leftColumn.text.lineSpacing = 5; - leftColumn.text.textColor = 0xFFFFFF; - leftColumn.text.text = 'Par Time:
${mission.game == "gold" || mission.game.toLowerCase() == "ultra" ? 'Gold Time:' : 'Platinum Time:'}
${mission.ultimateTime != 0 ? 'Ultimate Time:
' : ''}
Time Passed:
Clock Bonuses:
'; - leftColumn.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); - leftColumn.position = new Vector(25, 165); - leftColumn.extent = new Vector(293, 211); - pg.addChild(leftColumn); + // var continueButton = new GuiButton(loadButtonImages("data/ui/endgame/continue")); + // continueButton.horizSizing = Right; + // continueButton.vertSizing = Bottom; + // continueButton.position = new Vector(460, 307); + // continueButton.extent = new Vector(104, 54); + // continueButton.accelerator = hxd.Key.ENTER; + // continueButton.gamepadAccelerator = ["A"]; + // continueButton.pressedAction = (e) -> continueFunc(continueButton); - var elapsedTime = Math.max(timeState.currentAttemptTime - 3.5, 0); - var bonusTime = Math.max(0, Std.int((elapsedTime - timeState.gameplayClock) * 1000) / 1000); + // var restartButton = new GuiButton(loadButtonImages("data/ui/endgame/replay")); + // restartButton.horizSizing = Right; + // restartButton.vertSizing = Bottom; + // restartButton.position = new Vector(460, 363); + // restartButton.extent = new Vector(104, 54); + // restartButton.gamepadAccelerator = ["B"]; + // restartButton.pressedAction = (e) -> restartFunc(restartButton); - var rightColumn = new GuiMLText(domcasual24, mlFontLoader); - rightColumn.text.lineSpacing = 5; - rightColumn.text.textColor = 0xFFFFFF; - rightColumn.text.text = '${Util.formatTime(mission.qualifyTime == Math.POSITIVE_INFINITY ? 5999.999 : mission.qualifyTime)}
${Util.formatTime(mission.goldTime)}
${mission.ultimateTime != 0 ? '${Util.formatTime(mission.ultimateTime)}
' : ''}
${Util.formatTime(elapsedTime)}
${Util.formatTime(bonusTime)}
'; - rightColumn.text.filter = new DropShadow(1.414, 0.785, 0xffffff, 1, 0, 0.4, 1, true); - rightColumn.position = new Vector(235, 165); - rightColumn.extent = new Vector(293, 211); - pg.addChild(rightColumn); + // var nextLevel = new GuiControl(); + // nextLevel.position = new Vector(326, 307); + // nextLevel.extent = new Vector(130, 110); - pg.addChild(continueButton); - pg.addChild(restartButton); - pg.addChild(nextLevel); - pg.addChild(egFirstLine); - pg.addChild(egSecondLine); - pg.addChild(egThirdLine); - pg.addChild(egFourthLine); - pg.addChild(egFifthLine); + // var temprev = new BitmapData(1, 1); + // temprev.setPixel(0, 0, 0); + // var tmpprevtile = Tile.fromBitmap(temprev); - this.addChild(pg); + // var nextLevelPreview = new GuiImage(tmpprevtile); + // nextLevelPreview.position = new Vector(-15, 0); + // nextLevelPreview.extent = new Vector(160, 110); + // nextLevel.addChild(nextLevelPreview); - var scoreTimes = scoreData.map(x -> x.time).concat([timeState.gameplayClock]); - scoreTimes.sort((a, b) -> a == b ? 0 : (a > b ? 1 : -1)); + // mission.getNextMission().getPreviewImage(t -> { + // nextLevelPreview.bmp.tile = t; + // }); - var idx = scoreTimes.indexOf(timeState.gameplayClock); + // var nextLevelBtn = new GuiButton(loadButtonImages('data/ui/endgame/level_window')); + // nextLevelBtn.horizSizing = Width; + // nextLevelBtn.vertSizing = Height; + // nextLevelBtn.position = new Vector(0, 0); + // nextLevelBtn.extent = new Vector(130, 110); + // nextLevelBtn.gamepadAccelerator = ["X"]; + // nextLevelBtn.pressedAction = (e) -> nextLevelFunc(nextLevelBtn); + // nextLevel.addChild(nextLevelBtn); - // if (Settings.progression[mission.difficultyIndex] == mission.index && qualified) { - // Settings.progression[mission.difficultyIndex]++; + // function setButtonStates(enabled:Bool) { + // nextLevelBtn.disabled = !enabled; + // continueButton.disabled = !enabled; + // restartButton.disabled = !enabled; // } - Settings.save(); - if (idx <= 4) { - setButtonStates(false); - var end = new EnterNameDlg(idx, (name) -> { - setButtonStates(true); - if (scoreSubmitted) - return; + // var arial14fontdata = ResourceLoader.getFileEntry("data/font/arial.fnt"); + // var arial14b = new BitmapFont(arial14fontdata.entry); + // @:privateAccess arial14b.loader = ResourceLoader.loader; + // var arial14 = arial14b.toSdfFont(cast 12 * Settings.uiScale, MultiChannel); - var myScore = {name: name, time: timeState.gameplayClock}; - scoreData.push(myScore); - scoreData.sort((a, b) -> a.time == b.time ? 0 : (a.time > b.time ? 1 : -1)); + // var domcasual32fontdata = ResourceLoader.getFileEntry("data/font/DomCasualD.fnt"); + // var domcasual32b = new BitmapFont(domcasual32fontdata.entry); + // @:privateAccess domcasual32b.loader = ResourceLoader.loader; + // var domcasual32 = domcasual32b.toSdfFont(cast 28 * Settings.uiScale, MultiChannel); + // var domcasual64 = domcasual32b.toSdfFont(cast 58 * Settings.uiScale, MultiChannel); + // var domcasual24 = domcasual32b.toSdfFont(cast 20 * Settings.uiScale, MultiChannel); - egFirstLine.text.text = '

1. ${scoreData[0].name}

'; - egSecondLine.text.text = '

2. ${scoreData[1].name}

'; - egThirdLine.text.text = '

3. ${scoreData[2].name}

'; - egFourthLine.text.text = '

4. ${scoreData[3].name}

'; - egFifthLine.text.text = '

5. ${scoreData[4].name}

'; + // var expo50fontdata = ResourceLoader.getFileEntry("data/font/EXPON.fnt"); + // var expo50b = new BitmapFont(expo50fontdata.entry); + // @:privateAccess expo50b.loader = ResourceLoader.loader; + // var expo50 = expo50b.toSdfFont(cast 35 * Settings.uiScale, MultiChannel); + // var expo32 = expo50b.toSdfFont(cast 24 * Settings.uiScale, MultiChannel); - for (i in 0...5) { - if (scoreData[i].time < mission.ultimateTime) { - lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; - } else { - if (scoreData[i].time < mission.goldTime) { - lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; - } else { - lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; - } - } - } + // function mlFontLoader(text:String) { + // switch (text) { + // case "DomCasual24": + // return domcasual24; + // case "DomCasual32": + // return domcasual32; + // case "DomCasual64": + // return domcasual64; + // case "Arial14": + // return arial14; + // case "Expo32": + // return expo32; + // default: + // return null; + // } + // } - Settings.saveScore(mission.path, myScore); + // var egResult = new GuiMLText(domcasual32, mlFontLoader); + // egResult.position = new Vector(313, 54); + // egResult.extent = new Vector(244, 69); + // egResult.text.text = '

${Util.formatTime(timeState.gameplayClock)}

'; + // egResult.text.filter = new DropShadow(1.414, 0.785, 0, 1, 0, 0.4, 1, true); + // pg.addChild(egResult); - scoreSubmitted = true; - }); - this.addChild(end); - } + // var egFirstLine = new GuiMLText(domcasual24, mlFontLoader); + // egFirstLine.position = new Vector(340, 150); + // egFirstLine.extent = new Vector(210, 25); + // egFirstLine.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // pg.addChild(egFirstLine); + + // var egSecondLine = new GuiMLText(domcasual24, mlFontLoader); + // egSecondLine.position = new Vector(341, 178); + // egSecondLine.extent = new Vector(209, 25); + // egSecondLine.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // pg.addChild(egSecondLine); + + // var egThirdLine = new GuiMLText(domcasual24, mlFontLoader); + // egThirdLine.position = new Vector(341, 206); + // egThirdLine.extent = new Vector(209, 25); + // egThirdLine.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // pg.addChild(egThirdLine); + + // var egFourthLine = new GuiMLText(domcasual24, mlFontLoader); + // egFourthLine.position = new Vector(341, 234); + // egFourthLine.extent = new Vector(209, 25); + // egFourthLine.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // pg.addChild(egFourthLine); + + // var egFifthLine = new GuiMLText(domcasual24, mlFontLoader); + // egFifthLine.position = new Vector(341, 262); + // egFifthLine.extent = new Vector(209, 25); + // egFifthLine.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // pg.addChild(egFifthLine); + + // var egFirstLineScore = new GuiMLText(domcasual24, mlFontLoader); + // egFirstLineScore.position = new Vector(475, 150); + // egFirstLineScore.extent = new Vector(210, 25); + // egFirstLineScore.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // pg.addChild(egFirstLineScore); + + // var egSecondLineScore = new GuiMLText(domcasual24, mlFontLoader); + // egSecondLineScore.position = new Vector(476, 178); + // egSecondLineScore.extent = new Vector(209, 25); + // egSecondLineScore.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // pg.addChild(egSecondLineScore); + + // var egThirdLineScore = new GuiMLText(domcasual24, mlFontLoader); + // egThirdLineScore.position = new Vector(476, 206); + // egThirdLineScore.extent = new Vector(209, 25); + // egThirdLineScore.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // pg.addChild(egThirdLineScore); + + // var egFourthLineScore = new GuiMLText(domcasual24, mlFontLoader); + // egFourthLineScore.position = new Vector(476, 234); + // egFourthLineScore.extent = new Vector(209, 25); + // egFourthLineScore.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // pg.addChild(egFourthLineScore); + + // var egFifthLineScore = new GuiMLText(domcasual24, mlFontLoader); + // egFifthLineScore.position = new Vector(476, 262); + // egFifthLineScore.extent = new Vector(209, 25); + // egFifthLineScore.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // pg.addChild(egFifthLineScore); + + // var egTitleText = new GuiMLText(expo50, mlFontLoader); + // egTitleText.text.textColor = 0xffff00; + // egTitleText.text.text = 'Your Time:'; + // egTitleText.text.filter = new DropShadow(1.414, 0.785, 0, 1, 0, 0.4, 1, true); + // egTitleText.position = new Vector(34, 54); + // egTitleText.extent = new Vector(247, 69); + // pg.addChild(egTitleText); + + // var egTopThreeText = new GuiMLText(domcasual32, mlFontLoader); + // egTopThreeText.position = new Vector(341, 114); + // egTopThreeText.extent = new Vector(209, 34); + // egTopThreeText.text.text = 'Top 5 Times:'; // Make toggleable 3-5 + // egTopThreeText.text.filter = new DropShadow(1.414, 0.785, 0, 1, 0, 0.4, 1, true); + // pg.addChild(egTopThreeText); + + // var text = '

'; + // // Check for ultimate time TODO + // if (mission.ultimateTime > 0 && timeState.gameplayClock < mission.ultimateTime) { + // text += 'You beat the Ultimate Time!'; + // } else { + // if (mission.goldTime > 0 && timeState.gameplayClock < mission.goldTime) { + // if (mission.game == "gold" || mission.game.toLowerCase() == "ultra") + // text += 'You beat the Gold Time!'; + // else + // text += 'You beat the Platinum Time!'; + // } else { + // if (mission.qualifyTime > timeState.gameplayClock) { + // text += "You beat the Par Time!"; + // } else { + // text += 'You didn\'t pass the Par Time!'; + // } + // } + // } + // text += '

'; + + // var finishMessage = new GuiMLText(expo32, mlFontLoader); + // finishMessage.text.textColor = 0x00ff00; + // finishMessage.text.text = text; + // finishMessage.text.filter = new DropShadow(1, 0.785, 0, 1, 0, 0.4, 1, true); + // // finishMessage.justify = Center; + // finishMessage.position = new Vector(25, 120); + // finishMessage.extent = new Vector(293, 211); + // pg.addChild(finishMessage); + + // var qualified = mission.qualifyTime > timeState.gameplayClock; + + // var scoreData:Array = Settings.getScores(mission.path); + // while (scoreData.length < 5) { + // scoreData.push({name: "Matan W.", time: 5999.999}); + // } + + // egFirstLine.text.text = '

1. ${scoreData[0].name}

'; + // egSecondLine.text.text = '

2. ${scoreData[1].name}

'; + // egThirdLine.text.text = '

3. ${scoreData[2].name}

'; + // egFourthLine.text.text = '

4. ${scoreData[3].name}

'; + // egFifthLine.text.text = '

5. ${scoreData[4].name}

'; + + // var lineelems = [ + // egFirstLineScore, + // egSecondLineScore, + // egThirdLineScore, + // egFourthLineScore, + // egFifthLineScore + // ]; + + // for (i in 0...5) { + // if (scoreData[i].time < mission.ultimateTime) { + // lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; + // } else { + // if (scoreData[i].time < mission.goldTime) { + // if (mission.game == "gold" || mission.game.toLowerCase() == "ultra") + // lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; + // else + // lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; + // } else { + // lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; + // } + // } + // } + + // var leftColumn = new GuiMLText(domcasual24, mlFontLoader); + // leftColumn.text.lineSpacing = 5; + // leftColumn.text.textColor = 0xFFFFFF; + // leftColumn.text.text = 'Par Time:
${mission.game == "gold" || mission.game.toLowerCase() == "ultra" ? 'Gold Time:' : 'Platinum Time:'}
${mission.ultimateTime != 0 ? 'Ultimate Time:
' : ''}
Time Passed:
Clock Bonuses:
'; + // leftColumn.text.filter = new DropShadow(1.414, 0.785, 0x7777777F, 1, 0, 0.4, 1, true); + // leftColumn.position = new Vector(25, 165); + // leftColumn.extent = new Vector(293, 211); + // pg.addChild(leftColumn); + + // var elapsedTime = Math.max(timeState.currentAttemptTime - 3.5, 0); + // var bonusTime = Math.max(0, Std.int((elapsedTime - timeState.gameplayClock) * 1000) / 1000); + + // var rightColumn = new GuiMLText(domcasual24, mlFontLoader); + // rightColumn.text.lineSpacing = 5; + // rightColumn.text.textColor = 0xFFFFFF; + // rightColumn.text.text = '${Util.formatTime(mission.qualifyTime == Math.POSITIVE_INFINITY ? 5999.999 : mission.qualifyTime)}
${Util.formatTime(mission.goldTime)}
${mission.ultimateTime != 0 ? '${Util.formatTime(mission.ultimateTime)}
' : ''}
${Util.formatTime(elapsedTime)}
${Util.formatTime(bonusTime)}
'; + // rightColumn.text.filter = new DropShadow(1.414, 0.785, 0xffffff, 1, 0, 0.4, 1, true); + // rightColumn.position = new Vector(235, 165); + // rightColumn.extent = new Vector(293, 211); + // pg.addChild(rightColumn); + + // pg.addChild(continueButton); + // pg.addChild(restartButton); + // pg.addChild(nextLevel); + // pg.addChild(egFirstLine); + // pg.addChild(egSecondLine); + // pg.addChild(egThirdLine); + // pg.addChild(egFourthLine); + // pg.addChild(egFifthLine); + + // this.addChild(pg); + + // var scoreTimes = scoreData.map(x -> x.time).concat([timeState.gameplayClock]); + // scoreTimes.sort((a, b) -> a == b ? 0 : (a > b ? 1 : -1)); + + // var idx = scoreTimes.indexOf(timeState.gameplayClock); + + // // if (Settings.progression[mission.difficultyIndex] == mission.index && qualified) { + // // Settings.progression[mission.difficultyIndex]++; + // // } + // Settings.save(); + + // if (idx <= 4) { + // setButtonStates(false); + // var end = new EnterNameDlg(idx, (name) -> { + // setButtonStates(true); + // if (scoreSubmitted) + // return; + + // var myScore = {name: name, time: timeState.gameplayClock}; + // scoreData.push(myScore); + // scoreData.sort((a, b) -> a.time == b.time ? 0 : (a.time > b.time ? 1 : -1)); + + // egFirstLine.text.text = '

1. ${scoreData[0].name}

'; + // egSecondLine.text.text = '

2. ${scoreData[1].name}

'; + // egThirdLine.text.text = '

3. ${scoreData[2].name}

'; + // egFourthLine.text.text = '

4. ${scoreData[3].name}

'; + // egFifthLine.text.text = '

5. ${scoreData[4].name}

'; + + // for (i in 0...5) { + // if (scoreData[i].time < mission.ultimateTime) { + // lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; + // } else { + // if (scoreData[i].time < mission.goldTime) { + // lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; + // } else { + // lineelems[i].text.text = '${Util.formatTime(scoreData[i].time)}'; + // } + // } + // } + + // Settings.saveScore(mission.path, myScore); + + // scoreSubmitted = true; + // }); + // this.addChild(end); + // } } } diff --git a/src/gui/ExitGameDlg.hx b/src/gui/ExitGameDlg.hx index 6adb94f1..0e703071 100644 --- a/src/gui/ExitGameDlg.hx +++ b/src/gui/ExitGameDlg.hx @@ -65,7 +65,7 @@ class ExitGameDlg extends GuiImage { innerCtrl.addChild(levelTitle); var btnList = new GuiXboxList(); - btnList.position = new Vector(70, 95); + btnList.position = new Vector(70 - offsetX / 2, 95); btnList.horizSizing = Left; btnList.extent = new Vector(502, 500); innerCtrl.addChild(btnList); diff --git a/src/gui/GuiXboxListButton.hx b/src/gui/GuiXboxListButton.hx index 56d260e5..cc0db78a 100644 --- a/src/gui/GuiXboxListButton.hx +++ b/src/gui/GuiXboxListButton.hx @@ -114,6 +114,8 @@ class GuiXboxListButton extends GuiControl { } public override function onMouseRelease(mouseState:MouseState) { + if (mouseState.handled) + return; mouseState.handled = true; super.onMouseRelease(mouseState); if (this.pressedAction != null && !disabled) { @@ -122,6 +124,8 @@ class GuiXboxListButton extends GuiControl { } public override function onMouseEnter(mouseState:MouseState) { + if (mouseState.handled) + return; mouseState.handled = true; super.onMouseEnter(mouseState);