mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
more fixes and suggestions
This commit is contained in:
parent
f41b169dca
commit
2662ff7074
6 changed files with 51 additions and 11 deletions
|
|
@ -155,10 +155,21 @@ class MarbleGame {
|
|||
js.Browser.window.addEventListener('keydown', (e:js.html.KeyboardEvent) -> {
|
||||
var buttonCode = (e.keyCode);
|
||||
@:privateAccess Key.keyPressed[buttonCode] = Key.getFrame();
|
||||
if (world != null && @:privateAccess world.playGui.isChatFocused()) {
|
||||
@:privateAccess Window.getInstance().onKeyDown(e);
|
||||
}
|
||||
});
|
||||
js.Browser.window.addEventListener('keyup', (e:js.html.KeyboardEvent) -> {
|
||||
var buttonCode = (e.keyCode);
|
||||
@:privateAccess Key.keyPressed[buttonCode] = -Key.getFrame();
|
||||
if (world != null && @:privateAccess world.playGui.isChatFocused()) {
|
||||
@:privateAccess Window.getInstance().onKeyUp(e);
|
||||
}
|
||||
});
|
||||
js.Browser.window.addEventListener('keypress', (e:js.html.KeyboardEvent) -> {
|
||||
if (world != null && @:privateAccess world.playGui.isChatFocused()) {
|
||||
@:privateAccess Window.getInstance().onKeyPress(e);
|
||||
}
|
||||
});
|
||||
|
||||
pointercontainer.addEventListener('touchstart', (e:js.html.TouchEvent) -> {
|
||||
|
|
|
|||
|
|
@ -339,8 +339,8 @@ class JoinServerGui extends GuiImage {
|
|||
|
||||
this.addChild(window);
|
||||
|
||||
if (StringTools.trim(Settings.highscoreName).length == 0 || Settings.highscoreName == "Player") {
|
||||
MarbleGame.canvas.pushDialog(new EnterNameDlg(-1, (n) -> {})); // Pls enter name
|
||||
if (StringTools.trim(Settings.highscoreName).length == 0 || Settings.highscoreName == "" || Settings.highscoreName == null) {
|
||||
haxe.Timer.delay(() -> MarbleGame.canvas.pushDialog(new EnterNameDlg(-1, (n) -> {})), 50); // Pls enter name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class MPExitGameDlg extends GuiControl {
|
|||
dialogImg.addChild(resumeBtn);
|
||||
|
||||
var serverSettingsBtn = new GuiButton(loadButtonImagesExt("data/ui/mp/play/settings"));
|
||||
serverSettingsBtn.position = new Vector(195, 184);
|
||||
serverSettingsBtn.position = new Vector(155, 184);
|
||||
serverSettingsBtn.extent = new Vector(45, 45);
|
||||
serverSettingsBtn.vertSizing = Top;
|
||||
serverSettingsBtn.pressedAction = (e) -> {
|
||||
|
|
@ -82,7 +82,7 @@ class MPExitGameDlg extends GuiControl {
|
|||
}
|
||||
|
||||
var kickBtn = new GuiButton(loadButtonImagesExt("data/ui/mp/play/kick"));
|
||||
kickBtn.position = new Vector(108, 184);
|
||||
kickBtn.position = new Vector(68, 184);
|
||||
kickBtn.extent = new Vector(45, 45);
|
||||
kickBtn.vertSizing = Top;
|
||||
kickBtn.pressedAction = (e) -> {
|
||||
|
|
@ -93,6 +93,15 @@ class MPExitGameDlg extends GuiControl {
|
|||
kickBtn.disabled = true;
|
||||
}
|
||||
|
||||
var optionsBtn = new GuiButton(loadButtonImagesExt("data/ui/mp/play/playersettings"));
|
||||
optionsBtn.position = new Vector(242, 184);
|
||||
optionsBtn.extent = new Vector(45, 45);
|
||||
optionsBtn.vertSizing = Top;
|
||||
optionsBtn.pressedAction = (e) -> {
|
||||
MarbleGame.canvas.pushDialog(new OptionsDlg(true));
|
||||
}
|
||||
dialogImg.addChild(optionsBtn);
|
||||
|
||||
var quickspawnBtn = new GuiButton(loadButtonImages("data/ui/mp/exit/respawn"));
|
||||
quickspawnBtn.position = new Vector(224, 132);
|
||||
quickspawnBtn.extent = new Vector(104, 45);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package gui;
|
||||
|
||||
import hxd.BitmapData;
|
||||
import h2d.filter.DropShadow;
|
||||
import h2d.Text;
|
||||
import gui.GuiControl.MouseState;
|
||||
|
|
@ -18,7 +19,7 @@ import src.Settings;
|
|||
class OptionsDlg extends GuiImage {
|
||||
var musicSliderFunc:(dt:Float, mouseState:MouseState) -> Void;
|
||||
|
||||
public function new() {
|
||||
public function new(pause:Bool = false) {
|
||||
function chooseBg() {
|
||||
var rand = Math.random();
|
||||
if (rand >= 0 && rand <= 0.244)
|
||||
|
|
@ -28,7 +29,13 @@ class OptionsDlg extends GuiImage {
|
|||
return ResourceLoader.getImage('data/ui/backgrounds/ultra/${cast (Math.floor(Util.lerp(1, 9, Math.random())), Int)}.jpg');
|
||||
}
|
||||
var img = chooseBg();
|
||||
super(img.resource.toTile());
|
||||
var temprev = new BitmapData(1, 1);
|
||||
temprev.setPixel(0, 0, 0);
|
||||
var tmpprevtile = Tile.fromBitmap(temprev);
|
||||
if (!pause)
|
||||
super(img.resource.toTile());
|
||||
else
|
||||
super(tmpprevtile);
|
||||
this.horizSizing = Width;
|
||||
this.vertSizing = Height;
|
||||
this.position = new Vector();
|
||||
|
|
@ -80,7 +87,10 @@ class OptionsDlg extends GuiImage {
|
|||
homeBtn.extent = new Vector(94, 46);
|
||||
homeBtn.pressedAction = (sender) -> {
|
||||
applyFunc();
|
||||
MarbleGame.canvas.setContent(new MainMenuGui());
|
||||
if (!pause)
|
||||
MarbleGame.canvas.setContent(new MainMenuGui());
|
||||
else
|
||||
MarbleGame.canvas.popDialog(this);
|
||||
}
|
||||
window.addChild(homeBtn);
|
||||
|
||||
|
|
@ -446,9 +456,10 @@ class OptionsDlg extends GuiImage {
|
|||
remapBtn.position = new Vector(5 + 203, 35);
|
||||
remapBtn.txtCtrl.text.text = "Edit";
|
||||
remapBtn.setExtent(new Vector(152, 49));
|
||||
remapBtn.pressedAction = (sender) -> {
|
||||
MarbleGame.canvas.setContent(new TouchCtrlsEditGui());
|
||||
}
|
||||
if (!pause)
|
||||
remapBtn.pressedAction = (sender) -> {
|
||||
MarbleGame.canvas.setContent(new TouchCtrlsEditGui());
|
||||
}
|
||||
hotkeysPanel.addChild(remapBtn);
|
||||
|
||||
makeOption("Hide Controls:", () -> '${Settings.touchSettings.hideControls ? "Yes" : "No"}', 38, hotkeysPanel, "small", ["No", "Yes"], (idx) -> {
|
||||
|
|
|
|||
|
|
@ -1186,6 +1186,8 @@ class PlayGui {
|
|||
}
|
||||
|
||||
public function addMiddleMessage(text:String, color:Int) {
|
||||
if (this.middleMessages.length > 10)
|
||||
return;
|
||||
var markerFelt32fontdata = ResourceLoader.getFileEntry("data/font/MarkerFelt.fnt");
|
||||
var markerFelt32b = new BitmapFont(markerFelt32fontdata.entry);
|
||||
@:privateAccess markerFelt32b.loader = ResourceLoader.loader;
|
||||
|
|
|
|||
|
|
@ -228,7 +228,14 @@ class HuntMode extends NullMode {
|
|||
}
|
||||
|
||||
override function getPreloadFiles() {
|
||||
return ['data/sound/opponentdiamond.wav', 'data/sound/firewrks.wav'];
|
||||
return [
|
||||
'data/sound/opponentdiamond.wav',
|
||||
'data/sound/firewrks.wav',
|
||||
'data/shapes/items/blue.gem.png',
|
||||
'data/shapes/items/red.gem.png',
|
||||
'data/shapes/items/yellow.gem.png',
|
||||
'data/shapes/items/platinum.gem.png'
|
||||
];
|
||||
}
|
||||
|
||||
function setupGems() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue