mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 13:11:42 +00:00
fix android issues
This commit is contained in:
parent
2ef8bc8a58
commit
28221b5f8a
16 changed files with 95 additions and 92 deletions
|
|
@ -164,7 +164,7 @@ class CameraController extends Object {
|
||||||
deltaposY = 0;
|
deltaposY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
var factor = isTouch ? Util.lerp(1 / 25, 1 / 15,
|
var factor = isTouch ? Util.lerp(1 / 200, 1 / 50,
|
||||||
Settings.controlsSettings.cameraSensitivity) : Util.lerp(1 / 1000, 1 / 200, Settings.controlsSettings.cameraSensitivity);
|
Settings.controlsSettings.cameraSensitivity) : Util.lerp(1 / 1000, 1 / 200, Settings.controlsSettings.cameraSensitivity);
|
||||||
|
|
||||||
// CameraPitch += deltaposY * factor;
|
// CameraPitch += deltaposY * factor;
|
||||||
|
|
|
||||||
10
src/Main.hx
10
src/Main.hx
|
|
@ -64,8 +64,16 @@ class Main extends hxd.App {
|
||||||
s3d.camera.setFovX(Settings.optionsSettings.fovX, Settings.optionsSettings.screenWidth / Settings.optionsSettings.screenHeight);
|
s3d.camera.setFovX(Settings.optionsSettings.fovX, Settings.optionsSettings.screenWidth / Settings.optionsSettings.screenHeight);
|
||||||
#end
|
#end
|
||||||
#if android
|
#if android
|
||||||
var zoomRatio = Window.getInstance().height / 700;
|
var zoomRatio = Math.min(Window.getInstance().height, Window.getInstance().width) / 700;
|
||||||
s2d.scaleMode = Zoom(zoomRatio);
|
s2d.scaleMode = Zoom(zoomRatio);
|
||||||
|
|
||||||
|
trace("Initial Window resized to "
|
||||||
|
+ Window.getInstance().width
|
||||||
|
+ "x"
|
||||||
|
+ Window.getInstance().height
|
||||||
|
+ " (Zoom "
|
||||||
|
+ zoomRatio
|
||||||
|
+ ")");
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#if android
|
#if android
|
||||||
|
|
|
||||||
|
|
@ -61,11 +61,14 @@ class ResourceLoader {
|
||||||
#if (js || android)
|
#if (js || android)
|
||||||
var mfileSystem = ManifestBuilder.create("data");
|
var mfileSystem = ManifestBuilder.create("data");
|
||||||
var mloader:ManifestLoader = new ManifestLoader(mfileSystem);
|
var mloader:ManifestLoader = new ManifestLoader(mfileSystem);
|
||||||
var preloader = new ManifestProgress(mloader, () -> {
|
var entries = mfileSystem.manifest.iterator();
|
||||||
loader = mloader;
|
while (entries.hasNext()) {
|
||||||
fileSystem = mfileSystem;
|
var e = entries.next();
|
||||||
onLoadedFunc();
|
e.load();
|
||||||
}, scene2d);
|
}
|
||||||
|
loader = mloader;
|
||||||
|
fileSystem = mfileSystem;
|
||||||
|
onLoadedFunc();
|
||||||
#if js
|
#if js
|
||||||
loader = mloader;
|
loader = mloader;
|
||||||
fileSystem = mfileSystem;
|
fileSystem = mfileSystem;
|
||||||
|
|
@ -109,9 +112,6 @@ class ResourceLoader {
|
||||||
});
|
});
|
||||||
worker.run();
|
worker.run();
|
||||||
#end
|
#end
|
||||||
#if android
|
|
||||||
preloader.start();
|
|
||||||
#end
|
|
||||||
#end
|
#end
|
||||||
#if (hl && !android)
|
#if (hl && !android)
|
||||||
onLoadedFunc();
|
onLoadedFunc();
|
||||||
|
|
|
||||||
|
|
@ -250,11 +250,11 @@ class Settings {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@:hlNative public static function open_url(url:String):Void {}
|
@:hlNative public static function open_web_url(url:String):Void {}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
public static function applySettings() {
|
public static function applySettings() {
|
||||||
#if hl
|
#if (hl && !android)
|
||||||
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
||||||
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
||||||
#end
|
#end
|
||||||
|
|
@ -489,9 +489,26 @@ class Settings {
|
||||||
public static function init() {
|
public static function init() {
|
||||||
load();
|
load();
|
||||||
#if hl
|
#if hl
|
||||||
Window.getInstance().resize(Window.getInstance().width, Window.getInstance().height);
|
var wnd = Window.getInstance();
|
||||||
|
// var zoomRatio = Window.getInstance().windowToPixelRatio;
|
||||||
|
// Window.getInstance().resize(Window.getInstance().width, Window.getInstance().height);
|
||||||
// Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
// Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight);
|
||||||
Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
// Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed;
|
||||||
|
var zoomRatio = Math.min(Window.getInstance().height, Window.getInstance().width) / 700;
|
||||||
|
Settings.zoomRatio = zoomRatio;
|
||||||
|
#if hl
|
||||||
|
Settings.optionsSettings.screenWidth = cast wnd.width;
|
||||||
|
Settings.optionsSettings.screenHeight = cast wnd.height;
|
||||||
|
#end
|
||||||
|
trace("Window resized to "
|
||||||
|
+ Settings.optionsSettings.screenWidth
|
||||||
|
+ "x"
|
||||||
|
+ Settings.optionsSettings.screenHeight
|
||||||
|
+ " (Zoom "
|
||||||
|
+ zoomRatio
|
||||||
|
+ ")");
|
||||||
|
|
||||||
|
// MarbleGame.canvas.scene2d.scaleMode = Zoom(zoomRatio);
|
||||||
#end
|
#end
|
||||||
#if js
|
#if js
|
||||||
Window.getInstance().propagateKeyEvents = true;
|
Window.getInstance().propagateKeyEvents = true;
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,10 @@ class ManifestEntry extends FileEntry {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (onReady != null)
|
if (onReady != null) {
|
||||||
onReady();
|
onReady();
|
||||||
// haxe.Timer.delay(onReady, 1);
|
// haxe.Timer.delay(onReady, 1);
|
||||||
|
}
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ class ManifestProgress extends h2d.Object {
|
||||||
|
|
||||||
function finish():Void {
|
function finish():Void {
|
||||||
// setProgress(1, 1);
|
// setProgress(1, 1);
|
||||||
repaint();
|
// repaint();
|
||||||
text.text = "All done!";
|
text.text = "All done!";
|
||||||
if (removeSelf)
|
if (removeSelf)
|
||||||
remove();
|
remove();
|
||||||
|
|
@ -110,18 +110,18 @@ class ManifestProgress extends h2d.Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showFileName(task:LoaderTask) {
|
function showFileName(task:LoaderTask) {
|
||||||
repaint();
|
// repaint();
|
||||||
// text.text = "Loading: " + task.entry.path;
|
// text.text = "Loading: " + task.entry.path;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fileLoaded(task:LoaderTask) {
|
function fileLoaded(task:LoaderTask) {
|
||||||
repaint();
|
// repaint();
|
||||||
// setProgress(1, 1);
|
// setProgress(1, 1);
|
||||||
// text.text = "Loaded : " + task.entry.path;
|
// text.text = "Loaded : " + task.entry.path;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fileProgress(task:LoaderTask) {
|
function fileProgress(task:LoaderTask) {
|
||||||
repaint();
|
// repaint();
|
||||||
// setProgress(task.loaded, task.total);
|
// setProgress(task.loaded, task.total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ class TorqueFileEntry extends LocalEntry {
|
||||||
onReady();
|
onReady();
|
||||||
#else
|
#else
|
||||||
// if (Settings.optionsSettings.fastLoad)
|
// if (Settings.optionsSettings.fastLoad)
|
||||||
onReady();
|
if (onReady != null)
|
||||||
|
haxe.Timer.delay(onReady, 1);
|
||||||
// else {
|
// else {
|
||||||
// if (onReady != null)
|
// if (onReady != null)
|
||||||
// haxe.Timer.delay(onReady, 1);
|
// haxe.Timer.delay(onReady, 1);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
import h2d.filter.Filter;
|
import h2d.filter.Filter;
|
||||||
|
import h2d.HtmlText;
|
||||||
import h2d.Flow;
|
import h2d.Flow;
|
||||||
import h3d.Engine;
|
import h3d.Engine;
|
||||||
import h2d.Tile;
|
import h2d.Tile;
|
||||||
|
|
@ -52,7 +53,6 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
super();
|
super();
|
||||||
this.font = font;
|
this.font = font;
|
||||||
this.texts = texts;
|
this.texts = texts;
|
||||||
this._manualScroll = true;
|
|
||||||
this.textObjs = [];
|
this.textObjs = [];
|
||||||
this.dropShadow = filter;
|
this.dropShadow = filter;
|
||||||
this._imageLoader = imageLoader;
|
this._imageLoader = imageLoader;
|
||||||
|
|
@ -109,8 +109,7 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
for (i in 0...textObjs.length) {
|
for (i in 0...textObjs.length) {
|
||||||
var text = textObjs[i];
|
var text = textObjs[i];
|
||||||
text.setPosition(Math.floor((!scrollable ? renderRect.position.x : 0) + 5),
|
text.setPosition(Math.floor((!scrollable ? renderRect.position.x : 0) + 5),
|
||||||
Math.floor((!scrollable ? renderRect.position.y : 0)
|
Math.floor((!scrollable ? renderRect.position.y : 0) + (i * (text.font.size + 4) + 5 + textYOffset * Settings.uiScale - this.scroll)));
|
||||||
+ (i * (text.font.size + 4 * Settings.uiScale) + (5 + textYOffset) * Settings.uiScale - this.scroll)));
|
|
||||||
|
|
||||||
if (_prevSelected == i) {
|
if (_prevSelected == i) {
|
||||||
text.textColor = selectedColor;
|
text.textColor = selectedColor;
|
||||||
|
|
@ -118,20 +117,14 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override function render(scene2d:Scene, ?parent:h2d.Flow) {
|
public override function render(scene2d:Scene) {
|
||||||
var renderRect = this.getRenderRectangle();
|
var renderRect = this.getRenderRectangle();
|
||||||
var htr = this.getHitTestRect(false);
|
var htr = this.getHitTestRect();
|
||||||
|
|
||||||
if (parent != null) {
|
if (scene2d.contains(g))
|
||||||
if (parent.contains(g))
|
scene2d.removeChild(g);
|
||||||
parent.removeChild(g);
|
scene2d.addChild(g);
|
||||||
parent.addChild(g);
|
g.setPosition(renderRect.position.x, renderRect.position.y - this.scroll);
|
||||||
|
|
||||||
var off = this.getOffsetFromParent();
|
|
||||||
parent.getProperties(g).isAbsolute = true;
|
|
||||||
|
|
||||||
g.setPosition(off.x, off.y - this.scroll);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scrollable) {
|
if (scrollable) {
|
||||||
this.flow = new Flow();
|
this.flow = new Flow();
|
||||||
|
|
@ -141,18 +134,12 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
this.flow.multiline = true;
|
this.flow.multiline = true;
|
||||||
this.flow.layout = Stack;
|
this.flow.layout = Stack;
|
||||||
this.flow.overflow = FlowOverflow.Hidden;
|
this.flow.overflow = FlowOverflow.Hidden;
|
||||||
|
if (scene2d.contains(this.flow))
|
||||||
|
scene2d.removeChild(this.flow);
|
||||||
|
|
||||||
if (parent != null) {
|
scene2d.addChild(this.flow);
|
||||||
if (parent.contains(this.flow)) {
|
|
||||||
parent.removeChild(this.flow);
|
|
||||||
}
|
|
||||||
parent.addChild(this.flow);
|
|
||||||
var off = this.getOffsetFromParent();
|
|
||||||
var props = parent.getProperties(this.flow);
|
|
||||||
props.isAbsolute = true;
|
|
||||||
|
|
||||||
this.flow.setPosition(off.x, off.y);
|
this.flow.setPosition(htr.position.x, htr.position.y);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i in 0...textObjs.length) {
|
for (i in 0...textObjs.length) {
|
||||||
|
|
@ -170,8 +157,7 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
}
|
}
|
||||||
|
|
||||||
text.setPosition(Math.floor((!scrollable ? renderRect.position.x : 0) + 5),
|
text.setPosition(Math.floor((!scrollable ? renderRect.position.x : 0) + 5),
|
||||||
Math.floor((!scrollable ? renderRect.position.y : 0)
|
Math.floor((!scrollable ? renderRect.position.y : 0) + (i * (text.font.size + 4) + 5 + textYOffset * Settings.uiScale - this.scroll)));
|
||||||
+ (i * (text.font.size + 4 * Settings.uiScale) + (5 + textYOffset) * Settings.uiScale - this.scroll)));
|
|
||||||
|
|
||||||
if (_prevSelected == i) {
|
if (_prevSelected == i) {
|
||||||
text.textColor = selectedColor;
|
text.textColor = selectedColor;
|
||||||
|
|
@ -179,11 +165,11 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
}
|
}
|
||||||
|
|
||||||
redrawSelectionRect(htr);
|
redrawSelectionRect(htr);
|
||||||
super.render(scene2d, parent);
|
super.render(scene2d);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function calculateFullHeight() {
|
public function calculateFullHeight() {
|
||||||
return (this.texts.length * (font.size + 4 * Settings.uiScale));
|
return (this.texts.length * (font.size + 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override function dispose() {
|
public override function dispose() {
|
||||||
|
|
@ -203,11 +189,11 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
if (MarbleGame.canvas.scene2d.contains(text)) {
|
if (MarbleGame.canvas.scene2d.contains(text)) {
|
||||||
MarbleGame.canvas.scene2d.removeChild(text); // Refresh "layer"
|
MarbleGame.canvas.scene2d.removeChild(text); // Refresh "layer"
|
||||||
}
|
}
|
||||||
text.remove();
|
|
||||||
}
|
}
|
||||||
if (MarbleGame.canvas.scene2d.contains(g))
|
if (MarbleGame.canvas.scene2d.contains(g))
|
||||||
MarbleGame.canvas.scene2d.removeChild(g);
|
MarbleGame.canvas.scene2d.removeChild(g);
|
||||||
g.remove();
|
if (MarbleGame.canvas.scene2d.contains(this.flow))
|
||||||
|
MarbleGame.canvas.scene2d.removeChild(this.flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override function onMouseMove(mouseState:MouseState) {
|
public override function onMouseMove(mouseState:MouseState) {
|
||||||
|
|
@ -215,7 +201,7 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
var renderRect = this.getRenderRectangle();
|
var renderRect = this.getRenderRectangle();
|
||||||
var yStart = renderRect.position.y;
|
var yStart = renderRect.position.y;
|
||||||
var dy = mousePos.y - yStart;
|
var dy = mousePos.y - yStart;
|
||||||
var hoverIndex = Math.floor(dy / (font.size + 4 * Settings.uiScale));
|
var hoverIndex = Math.floor((dy + this.scroll) / (font.size + 4));
|
||||||
if (hoverIndex >= this.texts.length) {
|
if (hoverIndex >= this.texts.length) {
|
||||||
hoverIndex = -1;
|
hoverIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
@ -247,7 +233,7 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
var renderRect = this.getRenderRectangle();
|
var renderRect = this.getRenderRectangle();
|
||||||
var yStart = renderRect.position.y;
|
var yStart = renderRect.position.y;
|
||||||
var dy = mousePos.y - yStart;
|
var dy = mousePos.y - yStart;
|
||||||
var selectedIndex = Math.floor((dy + this.scroll) / (font.size + 4 * Settings.uiScale));
|
var selectedIndex = Math.floor((dy + this.scroll) / (font.size + 4));
|
||||||
if (selectedIndex >= this.texts.length) {
|
if (selectedIndex >= this.texts.length) {
|
||||||
selectedIndex = -1;
|
selectedIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
@ -267,31 +253,26 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
g.clear();
|
g.clear();
|
||||||
g.beginFill(selectedFillColor);
|
g.beginFill(selectedFillColor);
|
||||||
|
|
||||||
var off = this.getOffsetFromParent();
|
|
||||||
// Check if we are between the top and bottom, render normally in that case
|
// Check if we are between the top and bottom, render normally in that case
|
||||||
var topY = 2 * Settings.uiScale + (_prevSelected * (font.size + 4 * Settings.uiScale)) + g.y;
|
var topY = 2 + (_prevSelected * (font.size + 4)) + g.y;
|
||||||
var bottomY = 2 * Settings.uiScale + (_prevSelected * (font.size + 4 * Settings.uiScale)) + g.y + font.size + 4 * Settings.uiScale;
|
var bottomY = 2 + (_prevSelected * (font.size + 4)) + g.y + font.size + 4;
|
||||||
var topRectY = off.y;
|
var topRectY = renderRect.position.y;
|
||||||
var bottomRectY = off.y + renderRect.extent.y;
|
var bottomRectY = renderRect.position.y + renderRect.extent.y;
|
||||||
|
|
||||||
if (topY >= topRectY && bottomY <= bottomRectY)
|
if (topY >= topRectY && bottomY <= bottomRectY)
|
||||||
g.drawRect(0, 5 * Settings.uiScale
|
g.drawRect(0, 5 + (_prevSelected * (font.size + 4)) - 3, renderRect.extent.x, font.size + 4);
|
||||||
+ (_prevSelected * (font.size + 4 * Settings.uiScale))
|
|
||||||
- 3 * Settings.uiScale, renderRect.extent.x,
|
|
||||||
font.size
|
|
||||||
+ 4 * Settings.uiScale);
|
|
||||||
// We need to do math the draw the partially visible top selected
|
// We need to do math the draw the partially visible top selected
|
||||||
if (topY <= topRectY && bottomY >= topRectY) {
|
if (topY <= topRectY && bottomY >= topRectY) {
|
||||||
g.drawRect(0, this.scroll, renderRect.extent.x, topY + font.size + 4 * Settings.uiScale - off.y);
|
g.drawRect(0, this.scroll, renderRect.extent.x, topY + font.size + 4 - renderRect.position.y);
|
||||||
}
|
}
|
||||||
// Same for the bottom
|
// Same for the bottom
|
||||||
if (topY <= bottomRectY && bottomY >= bottomRectY) {
|
if (topY <= bottomRectY && bottomY >= bottomRectY) {
|
||||||
g.drawRect(0, this.scroll
|
g.drawRect(0, this.scroll
|
||||||
+ renderRect.extent.y
|
+ renderRect.extent.y
|
||||||
- font.size
|
- font.size
|
||||||
- 4 * Settings.uiScale
|
- 4
|
||||||
+ (topY + font.size + 4 * Settings.uiScale - bottomRectY),
|
+ (topY + font.size + 4 - bottomRectY), renderRect.extent.x,
|
||||||
renderRect.extent.x, off.y
|
renderRect.position.y
|
||||||
+ renderRect.extent.y
|
+ renderRect.extent.y
|
||||||
- (topY));
|
- (topY));
|
||||||
}
|
}
|
||||||
|
|
@ -306,11 +287,11 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
var renderRect = this.getRenderRectangle();
|
var renderRect = this.getRenderRectangle();
|
||||||
|
|
||||||
this.scroll = scrollY;
|
this.scroll = scrollY;
|
||||||
var hittestrect = this.getHitTestRect(false);
|
var hittestrect = this.getHitTestRect();
|
||||||
for (i in 0...textObjs.length) {
|
for (i in 0...textObjs.length) {
|
||||||
var text = textObjs[i];
|
var text = textObjs[i];
|
||||||
text.y = Math.floor((i * (text.font.size + 4 * Settings.uiScale) + (5 + textYOffset) * Settings.uiScale - scrollY));
|
text.y = Math.floor((i * (text.font.size + 4) + 5 + textYOffset * Settings.uiScale - scrollY));
|
||||||
g.y = -scrollY;
|
g.y = renderRect.position.y - scrollY;
|
||||||
}
|
}
|
||||||
redrawSelectionRect(hittestrect);
|
redrawSelectionRect(hittestrect);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -394,7 +394,7 @@ class MPPlayMissionGui extends GuiImage {
|
||||||
chatScroll = new GuiScrollCtrl(ResourceLoader.getResource("data/ui/common/philscroll.png", ResourceLoader.getImage, this.imageResources).toTile());
|
chatScroll = new GuiScrollCtrl(ResourceLoader.getResource("data/ui/common/philscroll.png", ResourceLoader.getImage, this.imageResources).toTile());
|
||||||
chatScroll.position = new Vector(47, 282);
|
chatScroll.position = new Vector(47, 282);
|
||||||
chatScroll.extent = new Vector(407, 193);
|
chatScroll.extent = new Vector(407, 193);
|
||||||
chatScroll.childrenHandleScroll = true;
|
// chatScroll.childrenHandleScroll = true;
|
||||||
chatScroll.scrollToBottom = true;
|
chatScroll.scrollToBottom = true;
|
||||||
window.addChild(chatScroll);
|
window.addChild(chatScroll);
|
||||||
|
|
||||||
|
|
@ -402,7 +402,8 @@ class MPPlayMissionGui extends GuiImage {
|
||||||
chatBox.text.textColor = 0x000000;
|
chatBox.text.textColor = 0x000000;
|
||||||
chatBox.horizSizing = Width;
|
chatBox.horizSizing = Width;
|
||||||
chatBox.position = new Vector(0, 0);
|
chatBox.position = new Vector(0, 0);
|
||||||
chatBox.extent = new Vector(396, 1184);
|
chatBox.extent = new Vector(396, 193);
|
||||||
|
chatBox.scrollable = true;
|
||||||
chatScroll.addChild(chatBox);
|
chatScroll.addChild(chatBox);
|
||||||
|
|
||||||
var chatInputContainer = new GuiControl();
|
var chatInputContainer = new GuiControl();
|
||||||
|
|
@ -430,7 +431,7 @@ class MPPlayMissionGui extends GuiImage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chatInput.text.text = "";
|
chatInput.text.text = "";
|
||||||
haxe.Timer.delay(() -> chatInput.text.focus(), 10);
|
// haxe.Timer.delay(() -> chatInput.text.focus(), 10);
|
||||||
}
|
}
|
||||||
@:privateAccess Key.keyPressed[e.keyCode] = 0; // consume keys
|
@:privateAccess Key.keyPressed[e.keyCode] = 0; // consume keys
|
||||||
}
|
}
|
||||||
|
|
@ -646,8 +647,8 @@ class MPPlayMissionGui extends GuiImage {
|
||||||
redrawChat();
|
redrawChat();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override function render(scene2d:Scene, ?parent:h2d.Flow) {
|
public override function render(scene2d:Scene) {
|
||||||
super.render(scene2d, parent);
|
super.render(scene2d);
|
||||||
setSelectedFunc(currentSelectionStatic);
|
setSelectedFunc(currentSelectionStatic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ class MPPreGameDlg extends GuiControl {
|
||||||
.toTile());
|
.toTile());
|
||||||
playerListContainer.position = new Vector(57, 286);
|
playerListContainer.position = new Vector(57, 286);
|
||||||
playerListContainer.extent = new Vector(525, 99);
|
playerListContainer.extent = new Vector(525, 99);
|
||||||
playerListContainer.childrenHandleScroll = true;
|
// playerListContainer.childrenHandleScroll = true;
|
||||||
// playerList.maxScrollY = 394 * Settings.uiScale;
|
// playerList.maxScrollY = 394 * Settings.uiScale;
|
||||||
dialogImg.addChild(playerListContainer);
|
dialogImg.addChild(playerListContainer);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,6 @@ class MPSearchGui extends GuiImage {
|
||||||
scrollCtrl = new GuiScrollCtrl(ResourceLoader.getResource("data/ui/common/philscroll.png", ResourceLoader.getImage, this.imageResources).toTile());
|
scrollCtrl = new GuiScrollCtrl(ResourceLoader.getResource("data/ui/common/philscroll.png", ResourceLoader.getImage, this.imageResources).toTile());
|
||||||
scrollCtrl.position = new Vector(18, 68);
|
scrollCtrl.position = new Vector(18, 68);
|
||||||
scrollCtrl.extent = new Vector(447, 317);
|
scrollCtrl.extent = new Vector(447, 317);
|
||||||
scrollCtrl.childrenHandleScroll = true;
|
|
||||||
this.addChild(scrollCtrl);
|
this.addChild(scrollCtrl);
|
||||||
|
|
||||||
searchMissionList = new GuiTextListCtrl(markerFelt24, displayList, 0xFFFFFF);
|
searchMissionList = new GuiTextListCtrl(markerFelt24, displayList, 0xFFFFFF);
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class MainMenuGui extends GuiImage {
|
||||||
siteButton.extent = new Vector(400, 30);
|
siteButton.extent = new Vector(400, 30);
|
||||||
siteButton.pressedAction = (sender) -> {
|
siteButton.pressedAction = (sender) -> {
|
||||||
#if sys
|
#if sys
|
||||||
Settings.open_url("https://marbleblast.com");
|
Settings.open_web_url("https://marbleblast.com");
|
||||||
#end
|
#end
|
||||||
#if js
|
#if js
|
||||||
js.Browser.window.open("https://marbleblast.com");
|
js.Browser.window.open("https://marbleblast.com");
|
||||||
|
|
@ -198,7 +198,7 @@ class MainMenuGui extends GuiImage {
|
||||||
kofi.extent = new Vector(143, 36);
|
kofi.extent = new Vector(143, 36);
|
||||||
kofi.pressedAction = (sender) -> {
|
kofi.pressedAction = (sender) -> {
|
||||||
#if sys
|
#if sys
|
||||||
Settings.open_url("https://ko-fi.com/H2H5FRTTL");
|
Settings.open_web_url("https://ko-fi.com/H2H5FRTTL");
|
||||||
#end
|
#end
|
||||||
#if js
|
#if js
|
||||||
js.Browser.window.open("https://ko-fi.com/H2H5FRTTL");
|
js.Browser.window.open("https://ko-fi.com/H2H5FRTTL");
|
||||||
|
|
@ -213,7 +213,7 @@ class MainMenuGui extends GuiImage {
|
||||||
github.extent = new Vector(94, 38);
|
github.extent = new Vector(94, 38);
|
||||||
github.pressedAction = (sender) -> {
|
github.pressedAction = (sender) -> {
|
||||||
#if sys
|
#if sys
|
||||||
Settings.open_url("https://github.com/RandomityGuy/MBHaxe");
|
Settings.open_web_url("https://github.com/RandomityGuy/MBHaxe");
|
||||||
#end
|
#end
|
||||||
#if js
|
#if js
|
||||||
js.Browser.window.open("https://github.com/RandomityGuy/MBHaxe");
|
js.Browser.window.open("https://github.com/RandomityGuy/MBHaxe");
|
||||||
|
|
|
||||||
|
|
@ -68,12 +68,9 @@ class OptionsDlg extends GuiImage {
|
||||||
generalBtn.extent = new Vector(134, 65);
|
generalBtn.extent = new Vector(134, 65);
|
||||||
window.addChild(generalBtn);
|
window.addChild(generalBtn);
|
||||||
|
|
||||||
var hotkeysBtn = new GuiButton(loadButtonImages2('data/ui/options/hotkeys'));
|
var hotkeysBtn = new GuiButton(loadButtonImages2('data/ui/options/hotkeys')); // touch settings
|
||||||
hotkeysBtn.position = new Vector(325, 19);
|
hotkeysBtn.position = new Vector(325, 19);
|
||||||
hotkeysBtn.extent = new Vector(134, 65);
|
hotkeysBtn.extent = new Vector(134, 65);
|
||||||
if (touch) {
|
|
||||||
hotkeysBtn.disabled = true;
|
|
||||||
}
|
|
||||||
window.addChild(hotkeysBtn);
|
window.addChild(hotkeysBtn);
|
||||||
|
|
||||||
var onlineBtn = new GuiImage(ResourceLoader.getResource("data/ui/options/online_i.png", ResourceLoader.getImage, this.imageResources).toTile());
|
var onlineBtn = new GuiImage(ResourceLoader.getResource("data/ui/options/online_i.png", ResourceLoader.getImage, this.imageResources).toTile());
|
||||||
|
|
|
||||||
|
|
@ -237,8 +237,6 @@ class PlayGui {
|
||||||
};
|
};
|
||||||
|
|
||||||
Window.getInstance().addResizeEvent(resizeEv);
|
Window.getInstance().addResizeEvent(resizeEv);
|
||||||
|
|
||||||
onFinish();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initTimer() {
|
public function initTimer() {
|
||||||
|
|
@ -862,7 +860,7 @@ class PlayGui {
|
||||||
public function setSpectateMenu(enabled:Bool) {
|
public function setSpectateMenu(enabled:Bool) {
|
||||||
if (enabled && spectatorCtrl == null) {
|
if (enabled && spectatorCtrl == null) {
|
||||||
initSpectatorMenu();
|
initSpectatorMenu();
|
||||||
spectatorCtrl.render(MarbleGame.canvas.scene2d, @:privateAccess playGuiCtrl._flow);
|
spectatorCtrl.render(MarbleGame.canvas.scene2d);
|
||||||
blastFill.bmp.visible = false;
|
blastFill.bmp.visible = false;
|
||||||
blastFrame.bmp.visible = false;
|
blastFrame.bmp.visible = false;
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1164,7 +1162,7 @@ class PlayGui {
|
||||||
color: 0
|
color: 0
|
||||||
}; // new h2d.filter.DropShadow(1.414, 0.785, 0x000000F, 1, 0, 0.4, 1, true);
|
}; // new h2d.filter.DropShadow(1.414, 0.785, 0x000000F, 1, 0, 0.4, 1, true);
|
||||||
this.playGuiCtrl.addChild(middleMsg);
|
this.playGuiCtrl.addChild(middleMsg);
|
||||||
middleMsg.render(scene2d, @:privateAccess this.playGuiCtrl._flow);
|
middleMsg.render(scene2d);
|
||||||
middleMsg.text.y -= (25 / playGuiCtrl.extent.y) * scene2d.height;
|
middleMsg.text.y -= (25 / playGuiCtrl.extent.y) * scene2d.height;
|
||||||
|
|
||||||
this.middleMessages.push({ctrl: middleMsg, age: 0});
|
this.middleMessages.push({ctrl: middleMsg, age: 0});
|
||||||
|
|
|
||||||
|
|
@ -1117,7 +1117,7 @@ class PlayMissionGui extends GuiImage {
|
||||||
kofi.extent = new Vector(143, 36);
|
kofi.extent = new Vector(143, 36);
|
||||||
kofi.pressedAction = (sender) -> {
|
kofi.pressedAction = (sender) -> {
|
||||||
#if sys
|
#if sys
|
||||||
Settings.open_url("https://ko-fi.com/H2H5FRTTL");
|
Settings.open_web_url("https://ko-fi.com/H2H5FRTTL");
|
||||||
#end
|
#end
|
||||||
#if js
|
#if js
|
||||||
js.Browser.window.open("https://ko-fi.com/H2H5FRTTL");
|
js.Browser.window.open("https://ko-fi.com/H2H5FRTTL");
|
||||||
|
|
|
||||||
|
|
@ -233,8 +233,8 @@ class TouchInput {
|
||||||
this.rightButton = new SpectatorChangeTargetButton(true);
|
this.rightButton = new SpectatorChangeTargetButton(true);
|
||||||
this.leftButton.add(par);
|
this.leftButton.add(par);
|
||||||
this.rightButton.add(par);
|
this.rightButton.add(par);
|
||||||
this.leftButton.guiElement.render(MarbleGame.canvas.scene2d, @:privateAccess par._flow);
|
this.leftButton.guiElement.render(MarbleGame.canvas.scene2d);
|
||||||
this.rightButton.guiElement.render(MarbleGame.canvas.scene2d, @:privateAccess par._flow);
|
this.rightButton.guiElement.render(MarbleGame.canvas.scene2d);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
jumpButton.setVisible(true);
|
jumpButton.setVisible(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue