diff --git a/package.json b/package.json index 7aee76c..9b2e16f 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tankz", - "version": "0.16.2", + "version": "0.16.3", "private": true, "devDependencies": { "dateformat": "^3.0.3", diff --git a/src/client/haxe/ru/m/skin/ButtonSVGSkin.hx b/src/client/haxe/ru/m/skin/ButtonSVGSkin.hx index 1d6f656..a66fa58 100644 --- a/src/client/haxe/ru/m/skin/ButtonSVGSkin.hx +++ b/src/client/haxe/ru/m/skin/ButtonSVGSkin.hx @@ -12,20 +12,26 @@ using haxework.color.ColorUtil; @:style(null) private var svg:String; @:style(0) private var color:Null; + @:style(false) private var solid:Null; private var svgs:Map; - public function new(?svg:String, ?color:Color) { + public function new(?svg:String, ?color:Color, ?solid:Bool) { this.svg = svg; this.color = color; - init(); + this.solid = solid; + init(solid); } private inline function buildSVG(color:Color):SVG { return new SVG(svg.replace("currentColor", '#${color}')); } - private function init():Void { + private function init(solid:Bool):Void { + var color = color; + if (solid) { + color = color.multiply(1.5); + } svgs = new Map(); svgs.set(UP, buildSVG(color)); svgs.set(DOWN, buildSVG(color.diff(-24))); @@ -39,7 +45,9 @@ using haxework.color.ColorUtil; graphics.beginFill(0, 0); graphics.drawRect(0, 0, view.width, view.height); graphics.beginFill(color); - graphics.lineStyle(2, color.multiply(1.5)); + if (!solid) { + graphics.lineStyle(2, color.multiply(1.5)); + } // ToDo: padding svg.render(graphics, 0, 0, Std.int(view.width * 0.8), Std.int(view.height * 0.8)); graphics.lineStyle(); diff --git a/src/client/haxe/ru/m/tankz/AppTheme.hx b/src/client/haxe/ru/m/tankz/AppTheme.hx index 19c0aa2..be33df8 100644 --- a/src/client/haxe/ru/m/tankz/AppTheme.hx +++ b/src/client/haxe/ru/m/tankz/AppTheme.hx @@ -1,5 +1,6 @@ package ru.m.tankz; +import haxework.view.utils.DrawUtil.FillType; import flash.text.TextFormatAlign; import haxework.color.Color; import haxework.view.geometry.Box; @@ -104,6 +105,12 @@ class AppTheme extends Theme { "geometry.height" => SizeValue.fromInt(36), ])); + register(new Style("icon.tank", [ + "geometry.width" => SizeValue.fromInt(42), + "geometry.height" => SizeValue.fromInt(42), + "skin.fillType" => FillType.DEFAULT, + ])); + registerButton("settings", "cog-solid.svg"); registerButton("close", "times-circle-solid.svg"); registerButton("next", "arrow-alt-circle-right-solid.svg"); @@ -112,21 +119,25 @@ class AppTheme extends Theme { registerButton("login", "sign-in-solid.svg"); registerButton("logout", "sign-out-solid.svg"); + registerButton("keyboard", "keyboard-light.svg", true); + registerButton("backspace", "backspace-light.svg", true); + registerButton("tablet-android-alt", "tablet-android-alt-light.svg", true); + register(new Style("gamepad", [ "skin.color" => colors.active, ])); } - private function registerButton(name:String, resource:String):Void { + private function registerButton(name:String, resource:String, solid:Bool = false):Void { register(new Style('button.$name', [ "geometry.width" => SizeValue.fromInt(42), "geometry.height" => SizeValue.fromInt(42), - "skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light), + "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), - "skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light), + "skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light, solid), ])); } diff --git a/src/client/haxe/ru/m/tankz/view/common/SlotView.yaml b/src/client/haxe/ru/m/tankz/view/common/SlotView.yaml index c6271f1..2e0ba77 100644 --- a/src/client/haxe/ru/m/tankz/view/common/SlotView.yaml +++ b/src/client/haxe/ru/m/tankz/view/common/SlotView.yaml @@ -5,6 +5,7 @@ layout.vAlign: middle views: - id: tank $type: haxework.view.ImageView + style: icon.tank - id: slot $type: haxework.view.form.LabelView style: text.box diff --git a/src/client/haxe/ru/m/tankz/view/game/PlayerView.yaml b/src/client/haxe/ru/m/tankz/view/game/PlayerView.yaml index 454bbc9..7947773 100644 --- a/src/client/haxe/ru/m/tankz/view/game/PlayerView.yaml +++ b/src/client/haxe/ru/m/tankz/view/game/PlayerView.yaml @@ -9,8 +9,7 @@ views: views: - id: tank $type: haxework.view.ImageView - geometry.width: 42 - geometry.height: 42 + style: icon.tank - id: life $type: haxework.view.form.LabelView style: text.box diff --git a/src/client/resources/image/icon/backspace-light.svg b/src/client/resources/image/icon/backspace-light.svg new file mode 100644 index 0000000..467fb78 --- /dev/null +++ b/src/client/resources/image/icon/backspace-light.svg @@ -0,0 +1,6 @@ + diff --git a/src/client/resources/image/icon/keyboard-light.svg b/src/client/resources/image/icon/keyboard-light.svg new file mode 100644 index 0000000..8dc7ee9 --- /dev/null +++ b/src/client/resources/image/icon/keyboard-light.svg @@ -0,0 +1,6 @@ + diff --git a/src/client/resources/image/icon/tablet-android-alt-light.svg b/src/client/resources/image/icon/tablet-android-alt-light.svg new file mode 100644 index 0000000..35ef4c5 --- /dev/null +++ b/src/client/resources/image/icon/tablet-android-alt-light.svg @@ -0,0 +1,7 @@ +