diff --git a/src/client/haxe/ru/m/tankz/AppTheme.hx b/src/client/haxe/ru/m/tankz/AppTheme.hx index 8a15fa4..bb039bb 100644 --- a/src/client/haxe/ru/m/tankz/AppTheme.hx +++ b/src/client/haxe/ru/m/tankz/AppTheme.hx @@ -165,14 +165,16 @@ class AppTheme extends Theme { } private function registerButton(name:String, resource:String, solid:Bool = false):Void { + var size = Device.isMobile() ? 64 : 42; + var smallSize = Device.isMobile() ? 42 : 32; register(new Style('button.$name', [ - "geometry.width" => SizeValue.fromInt(42), - "geometry.height" => SizeValue.fromInt(42), + "geometry.width" => SizeValue.fromInt(size), + "geometry.height" => SizeValue.fromInt(size), "skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light, solid), ])); register(new Style('button.$name.small', [ - "geometry.width" => SizeValue.fromInt(32), - "geometry.height" => SizeValue.fromInt(32), + "geometry.width" => SizeValue.fromInt(smallSize), + "geometry.height" => SizeValue.fromInt(smallSize), "skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light, solid), ])); } diff --git a/src/client/haxe/ru/m/tankz/Client.hx b/src/client/haxe/ru/m/tankz/Client.hx index eab7a25..f7fa4f9 100755 --- a/src/client/haxe/ru/m/tankz/Client.hx +++ b/src/client/haxe/ru/m/tankz/Client.hx @@ -26,6 +26,7 @@ class Client { L.d(TAG, 'Debug: ${Const.DEBUG}'); L.i(TAG, 'Version: ${Const.VERSION}'); L.i(TAG, 'Build: ${Const.BUILD}'); + L.i(TAG, 'Mobile: ${Device.isMobile()}'); #if linux LinuxIcon.apply(); #end diff --git a/src/client/haxe/ru/m/tankz/view/MenuFrame.hx b/src/client/haxe/ru/m/tankz/view/MenuFrame.hx index fe0992b..ea5f9ae 100644 --- a/src/client/haxe/ru/m/tankz/view/MenuFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/MenuFrame.hx @@ -64,13 +64,6 @@ using ru.m.tankz.view.ViewUtil; } } - private function packButtonFactory(index:Int, packId:PackId):ButtonView { - var result = new ButtonView(); - result.style = "button.menu"; - result.text = packId.toPackLabel(); - return result; - } - private function startGame(packId:PackId):Void { gameInit = LOCAL({state: new GameState(packId.type), level: null}); switcher.change(LevelFrame.ID, packId); diff --git a/src/client/haxe/ru/m/tankz/view/common/PackView.yaml b/src/client/haxe/ru/m/tankz/view/common/PackView.yaml index d067c13..91917e7 100644 --- a/src/client/haxe/ru/m/tankz/view/common/PackView.yaml +++ b/src/client/haxe/ru/m/tankz/view/common/PackView.yaml @@ -1,7 +1,7 @@ --- style: button.menu geometry.width: 200 -geometry.height: 150 +geometry.height: 130 geometry.padding: 5 layout.hAlign: center layout.vAlign: middle