[client] update LevelPopup

This commit is contained in:
2019-04-08 21:45:52 +03:00
parent 13d01293f6
commit 4a4ca463c3
12 changed files with 37 additions and 49 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "tankz", "name": "tankz",
"version": "0.9.2", "version": "0.10.0",
"private": true, "private": true,
"devDependencies": { "devDependencies": {
"dateformat": "^3.0.3", "dateformat": "^3.0.3",

View File

@@ -21,6 +21,7 @@ class Style {
public static var lightColor = 0x95937D; public static var lightColor = 0x95937D;
public static var darkColor = 0x777564; public static var darkColor = 0x777564;
public static var textColor = 0xE7E0BB; public static var textColor = 0xE7E0BB;
public static var activeColor = 0xFFFF00;
public static var baseFontSize = 18; public static var baseFontSize = 18;
public static var bigFontSize = 22; public static var bigFontSize = 22;
@@ -88,6 +89,11 @@ class Style {
Skin.text(textColor, baseFontSize, fontFamily, fontEmbed), Skin.text(textColor, baseFontSize, fontFamily, fontEmbed),
Skin.geometry(new Geometry().setPadding([25, 8])), Skin.geometry(new Geometry().setPadding([25, 8])),
]); ]);
resources.skin.put("button.simple.active", [
Skin.buttonColor(lightColor, activeColor),
Skin.text(activeColor, baseFontSize, fontFamily, fontEmbed),
Skin.geometry(new Geometry().setPadding([25, 8])),
]);
resources.skin.put("button.tab", [ resources.skin.put("button.tab", [
Skin.tabColor(lightColor), Skin.tabColor(lightColor),
Skin.text(textColor, baseFontSize, fontFamily, fontEmbed), Skin.text(textColor, baseFontSize, fontFamily, fontEmbed),
@@ -117,6 +123,10 @@ class Style {
Skin.border(ColorUtil.multiply(lightColor, 1.5), 1, 2), Skin.border(ColorUtil.multiply(lightColor, 1.5), 1, 2),
Skin.geometry(new Geometry().setPadding(2)), Skin.geometry(new Geometry().setPadding(2)),
]); ]);
resources.skin.put("window.close", [
Skin.size(36, 36),
new ButtonSVGSkin(Assets.getText("resources/image/icon/window-close-solid.svg"), lightColor),
]);
resources.skin.put("button.settings", [ resources.skin.put("button.settings", [
Skin.size(64, 64), Skin.size(64, 64),
@@ -134,38 +144,5 @@ class Style {
Skin.size(64, 64), Skin.size(64, 64),
new ButtonSVGSkin(Assets.getText("resources/image/icon/play-circle-solid.svg"), lightColor), new ButtonSVGSkin(Assets.getText("resources/image/icon/play-circle-solid.svg"), lightColor),
]); ]);
resources.skin.put("preset.easy", [
Skin.size(64, 64),
new ButtonSVGSkin(Assets.getText("resources/image/icon/smile-solid.svg"), lightColor),
]);
resources.skin.put("preset.normal", [
Skin.size(64, 64),
new ButtonSVGSkin(Assets.getText("resources/image/icon/frown-open-solid.svg"), lightColor),
]);
resources.skin.put("preset.hard", [
Skin.size(64, 64),
new ButtonSVGSkin(Assets.getText("resources/image/icon/sad-cry-solid.svg"), lightColor),
]);
resources.skin.put("preset.default", [
Skin.size(64, 64),
new ButtonSVGSkin(Assets.getText("resources/image/icon/play-circle-solid.svg"), lightColor),
]);
resources.skin.put("preset.easy.complete", [
Skin.size(64, 64),
new ButtonSVGSkin(Assets.getText("resources/image/icon/smile-solid.svg"), 0x337733),
]);
resources.skin.put("preset.normal.complete", [
Skin.size(64, 64),
new ButtonSVGSkin(Assets.getText("resources/image/icon/frown-open-solid.svg"), 0x337733),
]);
resources.skin.put("preset.hard.complete", [
Skin.size(64, 64),
new ButtonSVGSkin(Assets.getText("resources/image/icon/sad-cry-solid.svg"), 0x337733),
]);
resources.skin.put("preset.default.complete", [
Skin.size(64, 64),
new ButtonSVGSkin(Assets.getText("resources/image/icon/play-circle-solid.svg"), 0x337733),
]);
} }
} }

View File

@@ -24,7 +24,8 @@ import ru.m.tankz.game.GameProgress;
private function presetViewFactory(index:Int, value:GamePreset):ButtonView { private function presetViewFactory(index:Int, value:GamePreset):ButtonView {
var result = new ButtonView(); var result = new ButtonView();
result.skinId = 'preset.${value.name}${progress.isPresetCompleted(level.id, value.id) ? '.complete' : ''}'; result.skinId = 'button.simple${!progress.isPresetCompleted(level.id, value.id) ? ".active" : ""}';
result.text = value.name;
result.disabled = !progress.isPresetAvailable(level.id, value.id); result.disabled = !progress.isPresetAvailable(level.id, value.id);
return result; return result;
} }

View File

@@ -8,10 +8,20 @@ view:
geometry.size.height: 400 geometry.size.height: 400
skinId: window skinId: window
views: views:
- id: name - $type: haxework.view.HGroupView
$type: haxework.view.LabelView geometry.size.width: 100%
skinId: text geometry.padding: 10
geometry.padding: [20, 15] layout.vAlign: middle
views:
- id: name
$type: haxework.view.LabelView
geometry.size.width: 100%
geometry.margin.left: 10
layout.hAlign: left
skinId: text
- $type: haxework.view.ButtonView
skinId: window.close
+onPress: $code:reject('close')
- $type: haxework.view.SpriteView - $type: haxework.view.SpriteView
geometry.size.height: 100% geometry.size.height: 100%
- id: presets - id: presets

View File

@@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="frown-open" class="svg-inline--fa fa-frown-open fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM136 208c0-17.7 14.3-32 32-32s32 14.3 32 32-14.3 32-32 32-32-14.3-32-32zm187.3 183.3c-31.2-9.6-59.4-15.3-75.3-15.3s-44.1 5.7-75.3 15.3c-11.5 3.5-22.5-6.3-20.5-18.1 7-40 60.1-61.2 95.8-61.2s88.8 21.3 95.8 61.2c2 11.9-9.1 21.6-20.5 18.1zM328 240c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"></path></svg>

Before

Width:  |  Height:  |  Size: 617 B

View File

@@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="sad-cry" class="svg-inline--fa fa-sad-cry fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M248 8C111 8 0 119 0 256c0 90.1 48.2 168.7 120 212.1V288c0-8.8 7.2-16 16-16s16 7.2 16 16v196.7c29.5 12.4 62 19.3 96 19.3s66.5-6.9 96-19.3V288c0-8.8 7.2-16 16-16s16 7.2 16 16v180.1C447.8 424.7 496 346 496 256 496 119 385 8 248 8zm-65.5 216.5c-14.8-13.2-46.2-13.2-61 0L112 233c-3.8 3.3-9.3 4-13.7 1.6-4.4-2.4-6.9-7.4-6.1-12.4 4-25.2 34.2-42.1 59.9-42.1S208 197 212 222.2c.8 5-1.7 10-6.1 12.4-5.8 3.1-11.2.7-13.7-1.6l-9.7-8.5zM248 416c-26.5 0-48-28.7-48-64s21.5-64 48-64 48 28.7 48 64-21.5 64-48 64zm149.8-181.5c-5.8 3.1-11.2.7-13.7-1.6l-9.5-8.5c-14.8-13.2-46.2-13.2-61 0L304 233c-3.8 3.3-9.3 4-13.7 1.6-4.4-2.4-6.9-7.4-6.1-12.4 4-25.2 34.2-42.1 59.9-42.1S400 197 404 222.2c.6 4.9-1.8 9.9-6.2 12.3z"></path></svg>

Before

Width:  |  Height:  |  Size: 929 B

View File

@@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="smile" class="svg-inline--fa fa-smile fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z"></path></svg>

Before

Width:  |  Height:  |  Size: 616 B

View File

@@ -0,0 +1 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="window-close" class="svg-inline--fa fa-window-close fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-83.6 290.5c4.8 4.8 4.8 12.6 0 17.4l-40.5 40.5c-4.8 4.8-12.6 4.8-17.4 0L256 313.3l-66.5 67.1c-4.8 4.8-12.6 4.8-17.4 0l-40.5-40.5c-4.8-4.8-4.8-12.6 0-17.4l67.1-66.5-67.1-66.5c-4.8-4.8-4.8-12.6 0-17.4l40.5-40.5c4.8-4.8 12.6-4.8 17.4 0l66.5 67.1 66.5-67.1c4.8-4.8 12.6-4.8 17.4 0l40.5 40.5c4.8 4.8 4.8 12.6 0 17.4L313.3 256l67.1 66.5z"></path></svg>

After

Width:  |  Height:  |  Size: 681 B

View File

@@ -27,6 +27,7 @@ class StupidBotControl extends BotControl {
turnRandomTimer = new Timer(2000); turnRandomTimer = new Timer(2000);
turnRandomTimer.run = calcTurn; turnRandomTimer.run = calcTurn;
} }
shot(1000 + Math.round(Math.random() * 4000));
} }
override public function stop():Void { override public function stop():Void {
@@ -37,12 +38,12 @@ class StupidBotControl extends BotControl {
} }
} }
override private function _shot():Void {
super._shot();
shot(1000 + Math.round(Math.random() * 4000));
}
private function calcTurn():Void { private function calcTurn():Void {
if (turnTimer != null) {
turnTimer.stop();
turnTimer = null;
}
// ToDo:
if (handler == null || tank == null) return; if (handler == null || tank == null) return;
var eagle:Eagle = BotHelper.findEagle(playerId.team, handler); var eagle:Eagle = BotHelper.findEagle(playerId.team, handler);
if (eagle != null && Math.random() > 0.5) { if (eagle != null && Math.random() > 0.5) {

View File

@@ -37,7 +37,7 @@ player:
points: points:
- {team: human, type: eagle, index: -1, direction: right, x: 12, y: 24} - {team: human, type: eagle, index: -1, direction: right, x: 12, y: 24}
- {team: human, type: tank, index: 0, direction: top, x: 8, y: 24} - {team: human, type: tank, index: 0, direction: top, x: 8, y: 24}
- {team: human, type: tank, index: 1, direction: top, x: 16, y: 24} #- {team: human, type: tank, index: 1, direction: top, x: 16, y: 24}
- {team: bot, type: tank, index: -1, direction: bottom, x: 0, y: 0} - {team: bot, type: tank, index: -1, direction: bottom, x: 0, y: 0}
- {team: bot, type: tank, index: -2, direction: bottom, x: 12, y: 0} - {team: bot, type: tank, index: -2, direction: bottom, x: 12, y: 0}
- {team: bot, type: tank, index: -3, direction: bottom, x: 24, y: 0} - {team: bot, type: tank, index: -3, direction: bottom, x: 24, y: 0}

View File

@@ -6,6 +6,7 @@ layout.margin: 10
views: views:
- id: tanks - id: tanks
$type: haxework.view.GroupView $type: haxework.view.GroupView
geometry.size.width: 100%
layout: layout:
$type: haxework.view.layout.TailLayout $type: haxework.view.layout.TailLayout
rowSize: 4 rowSize: 4

View File

@@ -56,7 +56,7 @@ class SpawnPointItem extends BitmapItem<SpawnPointEntity> {
return switch(value.type) { return switch(value.type) {
case 'eagle': 'resources/image/eagle/eagle.png'; case 'eagle': 'resources/image/eagle/eagle.png';
case 'tank': 'resources/image/tank/${tankConfig.skin}-0.png'; case 'tank': 'resources/image/tank/${tankConfig.skin}-0.png';
case x: 'resources/image/eagle/eagle-death.png'; case _: 'resources/image/eagle/eagle-death.png';
} }
} }