From 02fd4afb670c35f6115e3bc9606af4359ad3247e Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Tue, 28 May 2024 21:42:51 +0530 Subject: [PATCH] warning on js --- src/gui/MainMenuGui.hx | 7 +++++++ src/gui/MultiplayerGui.hx | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/gui/MainMenuGui.hx b/src/gui/MainMenuGui.hx index d0dac9a0..020b8257 100644 --- a/src/gui/MainMenuGui.hx +++ b/src/gui/MainMenuGui.hx @@ -122,11 +122,18 @@ class MainMenuGui extends GuiImage { btnList.addButton(2, "Changelog", (sender) -> { MarbleGame.canvas.setContent(new VersionGui()); }); + #if hl btnList.addButton(4, "Return to Arcade", (sender) -> { #if hl Sys.exit(0); #end }); + #end + #if js + btnList.addButton(4, "Download", (sender) -> { + js.Browser.window.open("https://github.com/RandomityGuy/MBHaxe"); + }); + #end function loadButtonImages(path:String) { var normal = ResourceLoader.getResource('${path}_n.png', ResourceLoader.getImage, this.imageResources).toTile(); diff --git a/src/gui/MultiplayerGui.hx b/src/gui/MultiplayerGui.hx index 01badc30..74bab591 100644 --- a/src/gui/MultiplayerGui.hx +++ b/src/gui/MultiplayerGui.hx @@ -53,6 +53,20 @@ class MultiplayerGui extends GuiImage { rootTitle.text.alpha = 0.5; innerCtrl.addChild(rootTitle); + var arial14fontdata = ResourceLoader.getFileEntry("data/font/Arial Bold.fnt"); + var arial14b = new BitmapFont(arial14fontdata.entry); + @:privateAccess arial14b.loader = ResourceLoader.loader; + var arial12 = arial14b.toSdfFont(cast 18 * Settings.uiScale, h2d.Font.SDFChannel.MultiChannel); + + #if js + var warningTxt = new GuiText(arial12); + warningTxt.text.textColor = 0xEBEBEB; + warningTxt.position = new Vector(150, 250); + warningTxt.extent = new Vector(100, 100); + warningTxt.text.text = "Warning: You are playing on a browser.\nFor smooth multiplayer experience, it is\nrecommended to download the game on your device."; + innerCtrl.addChild(warningTxt); + #end + var btnList = new GuiXboxList(); btnList.position = new Vector(70 - offsetX, 165); btnList.horizSizing = Left;