[update] update to haxework renaming

This commit is contained in:
2020-03-24 20:59:47 +03:00
parent 83ed6cc076
commit 821ddbb2a7
47 changed files with 142 additions and 277 deletions

View File

@@ -1,86 +0,0 @@
package hw.app;
import flash.Lib;
import haxework.animate.Animate;
import haxework.animate.FadeAnimate;
import haxework.animate.IAnimate;
import haxework.animate.UnFadeAnimate;
import haxework.resources.IResources;
import haxework.signal.Signal;
import haxework.view.IView;
import haxework.view.popup.PopupManager;
import haxework.view.Root;
import haxework.view.theme.ITheme;
import openfl.display.BitmapData;
import openfl.display.StageDisplayState;
import openfl.events.FullScreenEvent;
class App {
public var view(default, set):IView<Dynamic>;
private function set_view(value:IView<Dynamic>):IView<Dynamic> {
view = value;
Root.bind(view);
return view;
}
public var icon(default, set):BitmapData;
private function set_icon(value:BitmapData):BitmapData {
icon = value;
#if linux
if (icon != null) {
hw.app.LinuxIcon.value = icon;
}
#end
return icon;
}
public var fullScreenSupport(get, never):Bool;
public function get_fullScreenSupport():Bool {
return Lib.current.stage.allowsFullScreen;
}
public var fullScreen(get, set):Bool;
private function get_fullScreen():Bool {
return Lib.current.stage.displayState != StageDisplayState.NORMAL;
}
private function set_fullScreen(value:Bool):Bool {
Lib.current.stage.displayState = value ? StageDisplayState.FULL_SCREEN : StageDisplayState.NORMAL;
return get_fullScreen();
}
public var fullScreenSignal(default, null):Signal<Bool> = new Signal();
@:provide static var app:App;
@:provide static var resources:IResources;
@:provide static var popupManager:PopupManager;
@:provide public var theme:ITheme;
public function new() {
Lib.current.stage.stageFocusRect = false;
Lib.current.stage.addEventListener(FullScreenEvent.FULL_SCREEN, event -> fullScreenSignal.emit(event.fullScreen));
Animate.bind(Lib.current.stage);
popupManager.showAnimateFactory = createShowAnimate;
popupManager.closeAnimateFactory = createCloseAnimate;
resources.text.put("app.version", Const.instance.VERSION);
resources.text.put("app.name", Const.instance.NAME);
app = this;
}
private function createShowAnimate(view:IView<Dynamic>):IAnimate {
return new UnFadeAnimate(view);
}
private function createCloseAnimate(view:IView<Dynamic>):IAnimate {
return new FadeAnimate(view);
}
}

View File

@@ -1,20 +0,0 @@
package hw.app;
import flash.Lib;
import flash.system.Capabilities;
@:singleton class Const {
public var FPS(default, null):Int;
public var BUILD(default, null):String;
public var VERSION(default, null):String;
public var NAME(default, null):String;
public var DEBUG(default, null):Bool;
public function new():Void {
FPS = Std.parseInt(Lib.current.stage.application.meta.get("fps"));
BUILD = CompilationOption.get("build");
VERSION = Lib.current.stage.application.meta.get("version");
NAME = Lib.current.stage.application.meta.get("name");
DEBUG = Capabilities.isDebugger;
}
}

View File

@@ -1,29 +0,0 @@
package hw.app;
import flash.display.BitmapData;
import flash.filters.ColorMatrixFilter;
import flash.geom.Point;
import flash.Lib;
class LinuxIcon {
public static var value(default, set):BitmapData;
private static function set_value(value:BitmapData):BitmapData {
LinuxIcon.value = value;
Lib.current.stage.window.setIcon(prepareIcon(value).image);
return LinuxIcon.value;
}
private static function prepareIcon(bitmap:BitmapData):BitmapData {
var matrix:Array<Float> = [];
matrix = matrix.concat([0, 0, 1, 0, 0]);
matrix = matrix.concat([0, 1, 0, 0, 0]);
matrix = matrix.concat([1, 0, 0, 0, 0]);
matrix = matrix.concat([0, 0, 0, 1, 0]);
var cmf:ColorMatrixFilter = new ColorMatrixFilter(matrix);
var bitmap:BitmapData = bitmap.clone();
bitmap.applyFilter(bitmap, bitmap.rect, new Point(0, 0), cmf);
return bitmap;
}
}

View File

@@ -3,7 +3,7 @@ package ru.m;
import flash.display.StageDisplayState; import flash.display.StageDisplayState;
import flash.events.FullScreenEvent; import flash.events.FullScreenEvent;
import flash.Lib; import flash.Lib;
import haxework.signal.Signal; import hw.signal.Signal;
enum abstract Platform(String) from String to String { enum abstract Platform(String) from String to String {
var ANDROID = "android"; var ANDROID = "android";

View File

@@ -1,6 +1,6 @@
package ru.m.pixabay; package ru.m.pixabay;
import haxework.net.JsonLoader; import hw.net.JsonLoader;
import promhx.Promise; import promhx.Promise;
import ru.m.data.IDataSource; import ru.m.data.IDataSource;

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez; package ru.m.puzzlez;
import haxework.log.TraceLogger; import hw.log.TraceLogger;
import hw.app.App; import hw.app.App;
import hw.app.Const; import hw.app.Const;
import ru.m.puzzlez.storage.GameStorage; import ru.m.puzzlez.storage.GameStorage;

View File

@@ -1,11 +1,11 @@
package ru.m.puzzlez; package ru.m.puzzlez;
import haxework.color.Color; import hw.color.Color;
import haxework.view.geometry.Box; import hw.view.geometry.Box;
import haxework.view.geometry.HAlign; import hw.view.geometry.HAlign;
import haxework.view.geometry.SizeValue; import hw.view.geometry.SizeValue;
import haxework.view.geometry.VAlign; import hw.view.geometry.VAlign;
import haxework.view.theme.Theme; import hw.view.theme.Theme;
import openfl.Assets; import openfl.Assets;
import ru.m.skin.ButtonSVGSkin; import ru.m.skin.ButtonSVGSkin;

View File

@@ -1,7 +1,7 @@
package ru.m.puzzlez.core; package ru.m.puzzlez.core;
import haxework.geom.Point; import hw.geom.Point;
import haxework.signal.Signal; import hw.signal.Signal;
import ru.m.puzzlez.core.GameEvent; import ru.m.puzzlez.core.GameEvent;
import ru.m.puzzlez.core.GameState; import ru.m.puzzlez.core.GameState;
import ru.m.puzzlez.core.PartLocation; import ru.m.puzzlez.core.PartLocation;

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez.core; package ru.m.puzzlez.core;
import haxework.geom.Point; import hw.geom.Point;
enum GameAction { enum GameAction {
PART_TAKE(id:Int); PART_TAKE(id:Int);

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez.core; package ru.m.puzzlez.core;
import haxework.geom.Rectangle; import hw.geom.Rectangle;
import ru.m.puzzlez.core.Id; import ru.m.puzzlez.core.Id;
typedef GamePreset = { typedef GamePreset = {

View File

@@ -1,7 +1,7 @@
package ru.m.puzzlez.core; package ru.m.puzzlez.core;
import haxework.geom.Point; import hw.geom.Point;
import haxework.geom.Rectangle; import hw.geom.Rectangle;
import ru.m.puzzlez.core.BoundType; import ru.m.puzzlez.core.BoundType;
import ru.m.puzzlez.core.GameState; import ru.m.puzzlez.core.GameState;
import ru.m.puzzlez.core.Id; import ru.m.puzzlez.core.Id;

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez.core; package ru.m.puzzlez.core;
import haxework.signal.Signal; import hw.signal.Signal;
interface IGame { interface IGame {
public var state(default, null):GameState; public var state(default, null):GameState;

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez.core; package ru.m.puzzlez.core;
import haxework.geom.Rectangle; import hw.geom.Rectangle;
typedef PartBound = { typedef PartBound = {
var spike:BoundType; var spike:BoundType;

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez.core; package ru.m.puzzlez.core;
import haxework.geom.Point; import hw.geom.Point;
enum PartLocation { enum PartLocation {
//PANEL(index:Int); //PANEL(index:Int);

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez.render; package ru.m.puzzlez.render;
import haxework.color.Color; import hw.color.Color;
import ru.m.puzzlez.core.Id; import ru.m.puzzlez.core.Id;
enum Background { enum Background {

View File

@@ -1,7 +1,7 @@
package ru.m.puzzlez.render; package ru.m.puzzlez.render;
import haxework.signal.Signal; import hw.signal.Signal;
import haxework.view.IView; import hw.view.IView;
import ru.m.puzzlez.core.GameEvent; import ru.m.puzzlez.core.GameEvent;
interface IRender extends IView<Dynamic> { interface IRender extends IView<Dynamic> {

View File

@@ -4,7 +4,7 @@ import flash.display.BitmapData;
import flash.display.Bitmap; import flash.display.Bitmap;
import flash.display.PixelSnapping; import flash.display.PixelSnapping;
import flash.display.Sprite; import flash.display.Sprite;
import haxework.geom.Point; import hw.geom.Point;
import ru.m.puzzlez.core.Part; import ru.m.puzzlez.core.Part;
import ru.m.puzzlez.render.RenderUtil; import ru.m.puzzlez.render.RenderUtil;

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez.render; package ru.m.puzzlez.render;
import haxework.view.form.LabelView; import hw.view.form.LabelView;
class ProgressView extends LabelView { class ProgressView extends LabelView {

View File

@@ -8,10 +8,10 @@ import flash.geom.Point as FlashPoint;
import flash.geom.Rectangle; import flash.geom.Rectangle;
import flash.net.FileReference; import flash.net.FileReference;
import flash.utils.ByteArray; import flash.utils.ByteArray;
import haxework.geom.Point; import hw.geom.Point;
import haxework.signal.Signal; import hw.signal.Signal;
import haxework.view.popup.AlertView; import hw.view.popup.AlertView;
import haxework.view.SpriteView; import hw.view.SpriteView;
import ru.m.puzzlez.core.GameEvent; import ru.m.puzzlez.core.GameEvent;
import ru.m.puzzlez.core.GameState; import ru.m.puzzlez.core.GameState;
import ru.m.puzzlez.core.PartLocation; import ru.m.puzzlez.core.PartLocation;

View File

@@ -3,9 +3,9 @@ package ru.m.puzzlez.render;
import flash.display.BitmapData; import flash.display.BitmapData;
import flash.display.Shape; import flash.display.Shape;
import flash.geom.Matrix; import flash.geom.Matrix;
import haxework.color.Color; import hw.color.Color;
import haxework.geom.Point; import hw.geom.Point;
import haxework.geom.Rectangle; import hw.geom.Rectangle;
import ru.m.draw.DrawPath; import ru.m.draw.DrawPath;
import ru.m.puzzlez.core.Part; import ru.m.puzzlez.core.Part;
import ru.m.puzzlez.render.part.ClassicPartBuilder; import ru.m.puzzlez.render.part.ClassicPartBuilder;

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez.render.part; package ru.m.puzzlez.render.part;
import haxework.geom.Rectangle; import hw.geom.Rectangle;
import ru.m.draw.DrawPath; import ru.m.draw.DrawPath;
import ru.m.puzzlez.core.Part; import ru.m.puzzlez.core.Part;
import ru.m.puzzlez.render.part.IPartBuilder; import ru.m.puzzlez.render.part.IPartBuilder;

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez.render.part; package ru.m.puzzlez.render.part;
import haxework.geom.Rectangle; import hw.geom.Rectangle;
import ru.m.draw.DrawPath; import ru.m.draw.DrawPath;
import ru.m.puzzlez.core.Part; import ru.m.puzzlez.core.Part;

View File

@@ -3,7 +3,7 @@ package ru.m.puzzlez.source;
import flash.display.BitmapData; import flash.display.BitmapData;
import flash.utils.ByteArray; import flash.utils.ByteArray;
import haxe.io.Bytes; import haxe.io.Bytes;
import haxework.net.BytesLoader; import hw.net.BytesLoader;
import promhx.Promise; import promhx.Promise;
import ru.m.data.IDataSource; import ru.m.data.IDataSource;
import ru.m.pixabay.PixabayApi; import ru.m.pixabay.PixabayApi;

View File

@@ -1,6 +1,6 @@
package ru.m.puzzlez.storage; package ru.m.puzzlez.storage;
import haxework.storage.SharedObjectStorage; import hw.storage.SharedObjectStorage;
import ru.m.puzzlez.render.Background; import ru.m.puzzlez.render.Background;
@:provide class SettingsStorage extends SharedObjectStorage { @:provide class SettingsStorage extends SharedObjectStorage {

View File

@@ -1,9 +1,9 @@
package ru.m.puzzlez.view; package ru.m.puzzlez.view;
import haxe.Timer; import haxe.Timer;
import haxework.view.frame.FrameSwitcher; import hw.view.frame.FrameSwitcher;
import haxework.view.frame.FrameView; import hw.view.frame.FrameView;
import haxework.view.popup.ConfirmView; import hw.view.popup.ConfirmView;
import promhx.Promise; import promhx.Promise;
import ru.m.puzzlez.core.Game; import ru.m.puzzlez.core.Game;
import ru.m.puzzlez.core.GameEvent; import ru.m.puzzlez.core.GameEvent;

View File

@@ -1,30 +1,30 @@
--- ---
style: frame style: frame
layout: layout:
$type: haxework.view.layout.HorizontalLayout $type: hw.view.layout.HorizontalLayout
views: views:
- $type: haxework.view.group.VGroupView - $type: hw.view.group.VGroupView
geometry.height: 100% geometry.height: 100%
geometry.padding: 5 geometry.padding: 5
layout.margin: 10 layout.margin: 10
views: views:
- $type: haxework.view.form.ButtonView - $type: hw.view.form.ButtonView
style: icon.image style: icon.image
+onPress: ~showPreview() +onPress: ~showPreview()
- $type: haxework.view.SpriteView - $type: hw.view.SpriteView
geometry.stretch: true geometry.stretch: true
- $type: haxework.view.form.ToggleButtonView - $type: hw.view.form.ToggleButtonView
style: icon.lock style: icon.lock
on: true on: true
+onPress: | +onPress: |
~button -> { ~button -> {
render.manager.locked = !render.manager.locked; render.manager.locked = !render.manager.locked;
cast(button, haxework.view.form.ToggleButtonView).on = !render.manager.locked; cast(button, hw.view.form.ToggleButtonView).on = !render.manager.locked;
} }
- $type: haxework.view.form.ButtonView - $type: hw.view.form.ButtonView
style: icon.restore style: icon.restore
+onPress: ~render.manager.reset() +onPress: ~render.manager.reset()
- $type: haxework.view.form.ButtonView - $type: hw.view.form.ButtonView
style: icon.setting style: icon.setting
geometry.margin.top: 30 geometry.margin.top: 30
+onPress: ~choiseBackground() +onPress: ~choiseBackground()
@@ -32,7 +32,7 @@ views:
$type: ru.m.puzzlez.render.Render $type: ru.m.puzzlez.render.Render
geometry.width: 100% geometry.width: 100%
geometry.height: 100% geometry.height: 100%
- $type: haxework.view.form.ButtonView - $type: hw.view.form.ButtonView
style: icon.close style: icon.close
geometry.position: absolute geometry.position: absolute
geometry.hAlign: right geometry.hAlign: right

View File

@@ -1,9 +1,9 @@
package ru.m.puzzlez.view; package ru.m.puzzlez.view;
import haxework.view.form.ButtonView; import hw.view.form.ButtonView;
import haxework.view.form.LabelView; import hw.view.form.LabelView;
import haxework.view.frame.FrameSwitcher; import hw.view.frame.FrameSwitcher;
import haxework.view.frame.FrameView; import hw.view.frame.FrameView;
import ru.m.puzzlez.core.ImageListSource; import ru.m.puzzlez.core.ImageListSource;
import ru.m.puzzlez.FileUtil; import ru.m.puzzlez.FileUtil;
import ru.m.puzzlez.source.FileSource; import ru.m.puzzlez.source.FileSource;

View File

@@ -2,17 +2,17 @@
style: frame style: frame
views: views:
- id: header - id: header
$type: haxework.view.form.LabelView $type: hw.view.form.LabelView
style: label.header style: label.header
- id: images - id: images
$type: ru.m.puzzlez.view.common.ImageDataList $type: ru.m.puzzlez.view.common.ImageDataList
geometry.stretch: true geometry.stretch: true
- id: select - id: select
$type: haxework.view.form.ButtonView $type: hw.view.form.ButtonView
text: Select... text: Select...
+onPress: ~selectFile() +onPress: ~selectFile()
visible: false visible: false
- $type: haxework.view.form.ButtonView - $type: hw.view.form.ButtonView
text: Back text: Back
geometry.position: absolute geometry.position: absolute
geometry.hAlign: right geometry.hAlign: right

View File

@@ -1,13 +1,13 @@
package ru.m.puzzlez.view; package ru.m.puzzlez.view;
import haxework.view.form.LabelView; import hw.view.form.LabelView;
import flash.text.TextFormatAlign; import flash.text.TextFormatAlign;
import haxework.view.geometry.HAlign; import hw.view.geometry.HAlign;
import haxework.view.geometry.Position; import hw.view.geometry.Position;
import haxework.view.geometry.VAlign; import hw.view.geometry.VAlign;
import haxework.view.group.IGroupView; import hw.view.group.IGroupView;
import haxework.view.IView; import hw.view.IView;
import haxework.view.text.TextView; import hw.view.text.TextView;
import promhx.Promise; import promhx.Promise;
enum State { enum State {

View File

@@ -1,10 +1,10 @@
package ru.m.puzzlez.view; package ru.m.puzzlez.view;
import haxework.geom.IntPoint; import hw.geom.IntPoint;
import haxework.view.data.DataView; import hw.view.data.DataView;
import haxework.view.form.ToggleButtonView; import hw.view.form.ToggleButtonView;
import haxework.view.frame.FrameSwitcher; import hw.view.frame.FrameSwitcher;
import haxework.view.frame.FrameView; import hw.view.frame.FrameView;
import ru.m.puzzlez.core.GameUtil; import ru.m.puzzlez.core.GameUtil;
import ru.m.puzzlez.core.Id; import ru.m.puzzlez.core.Id;
import ru.m.puzzlez.storage.ImageStorage; import ru.m.puzzlez.storage.ImageStorage;

View File

@@ -2,24 +2,24 @@
style: frame style: frame
layout.margin: 10 layout.margin: 10
views: views:
- $type: haxework.view.form.LabelView - $type: hw.view.form.LabelView
text: Puzzle configure text: Puzzle configure
style: label.header style: label.header
- $type: haxework.view.group.HGroupView - $type: hw.view.group.HGroupView
geometry.width: 100% geometry.width: 100%
layout.hAlign: center layout.hAlign: center
layout.vAlign: middle layout.vAlign: middle
views: views:
- id: sizes - id: sizes
$type: haxework.view.data.DataView $type: hw.view.data.DataView
layout: layout:
$type: haxework.view.layout.TailLayout $type: hw.view.layout.TailLayout
hAlign: center hAlign: center
stretch: true stretch: true
margin: 5 margin: 5
factory: ~factory factory: ~factory
+onDataSelect: ~selectSize +onDataSelect: ~selectSize
- $type: haxework.view.form.ButtonView - $type: hw.view.form.ButtonView
style: button.active style: button.active
geometry.margin.left: 15 geometry.margin.left: 15
text: Start text: Start
@@ -28,7 +28,7 @@ views:
$type: ru.m.puzzlez.view.common.PresetView $type: ru.m.puzzlez.view.common.PresetView
geometry.stretch: true geometry.stretch: true
geometry.margin: 15 geometry.margin: 15
- $type: haxework.view.form.ButtonView - $type: hw.view.form.ButtonView
text: Back text: Back
geometry.position: absolute geometry.position: absolute
geometry.hAlign: right geometry.hAlign: right

View File

@@ -2,9 +2,9 @@ package ru.m.puzzlez.view;
import flash.events.KeyboardEvent; import flash.events.KeyboardEvent;
import flash.ui.Keyboard; import flash.ui.Keyboard;
import haxework.view.form.ButtonView; import hw.view.form.ButtonView;
import haxework.view.frame.FrameSwitcher; import hw.view.frame.FrameSwitcher;
import haxework.view.group.VGroupView; import hw.view.group.VGroupView;
import hw.app.App; import hw.app.App;
@:template class PuzzlezAppView extends VGroupView { @:template class PuzzlezAppView extends VGroupView {

View File

@@ -1,6 +1,6 @@
--- ---
views: views:
- $type: haxework.view.frame.FrameSwitcher - $type: hw.view.frame.FrameSwitcher
id: switcher id: switcher
geometry.stretch: true geometry.stretch: true
style: dark style: dark
@@ -10,7 +10,7 @@ views:
_preset_: {$class: ru.m.puzzlez.view.PresetFrame} _preset_: {$class: ru.m.puzzlez.view.PresetFrame}
_game_: {$class: ru.m.puzzlez.view.GameFrame} _game_: {$class: ru.m.puzzlez.view.GameFrame}
- id: fullscreen - id: fullscreen
$type: haxework.view.form.ButtonView $type: hw.view.form.ButtonView
geometry.position: absolute geometry.position: absolute
geometry.hAlign: right geometry.hAlign: right
geometry.vAlign: bottom geometry.vAlign: bottom

View File

@@ -1,9 +1,9 @@
package ru.m.puzzlez.view; package ru.m.puzzlez.view;
import haxework.view.data.DataView; import hw.view.data.DataView;
import haxework.view.form.ButtonView; import hw.view.form.ButtonView;
import haxework.view.frame.FrameSwitcher; import hw.view.frame.FrameSwitcher;
import haxework.view.frame.FrameView; import hw.view.frame.FrameView;
import ru.m.data.IDataSource; import ru.m.data.IDataSource;
import ru.m.pixabay.PixabayApi; import ru.m.pixabay.PixabayApi;
import ru.m.puzzlez.core.GameState.GameStatus; import ru.m.puzzlez.core.GameState.GameStatus;

View File

@@ -1,24 +1,24 @@
--- ---
style: frame style: frame
views: views:
- $type: haxework.view.group.HGroupView - $type: hw.view.group.HGroupView
geometry.hAlign: center geometry.hAlign: center
geometry.margin.top: 15 geometry.margin.top: 15
layout.vAlign: middle layout.vAlign: middle
views: views:
- $type: haxework.view.ImageView - $type: hw.view.ImageView
image: $a:image:resources/icon.png image: $a:image:resources/icon.png
stretch: false stretch: false
fillType: CONTAIN fillType: CONTAIN
geometry.width: 96 geometry.width: 96
geometry.height: 96 geometry.height: 96
- $type: haxework.view.form.LabelView - $type: hw.view.form.LabelView
text: $r:text:app.name text: $r:text:app.name
font.size: 50 font.size: 50
- id: sources - id: sources
$type: haxework.view.data.DataView $type: hw.view.data.DataView
layout: layout:
$type: haxework.view.layout.TailLayout $type: hw.view.layout.TailLayout
rowSize: 5 rowSize: 5
margin: 10 margin: 10
vAlign: middle vAlign: middle
@@ -27,28 +27,28 @@ views:
+onDataSelect: ~load +onDataSelect: ~load
geometry.margin: 5 geometry.margin: 5
overflow.y: scroll overflow.y: scroll
- $type: haxework.view.group.HGroupView - $type: hw.view.group.HGroupView
geometry.width: 100% geometry.width: 100%
layout.vAlign: middle layout.vAlign: middle
layout.margin: 10 layout.margin: 10
views: views:
- id: load - id: load
$type: haxework.view.form.ButtonView $type: hw.view.form.ButtonView
text: Load text: Load
+onPress: ~games('started') +onPress: ~games('started')
- id: complete - id: complete
$type: haxework.view.form.ButtonView $type: hw.view.form.ButtonView
text: Complete text: Complete
+onPress: ~games('complete') +onPress: ~games('complete')
- $type: haxework.view.SpriteView - $type: hw.view.SpriteView
geometry.width: 100% geometry.width: 100%
- $type: haxework.view.form.LabelView - $type: hw.view.form.LabelView
text: $r:text:app.version text: $r:text:app.version
geometry.position: absolute geometry.position: absolute
geometry.hAlign: right geometry.hAlign: right
geometry.vAlign: top geometry.vAlign: top
- id: update - id: update
$type: haxework.view.form.ButtonView $type: hw.view.form.ButtonView
style: button.active style: button.active
geometry.position: absolute geometry.position: absolute
geometry.hAlign: left geometry.hAlign: left

View File

@@ -1,10 +1,10 @@
package ru.m.puzzlez.view.common; package ru.m.puzzlez.view.common;
import haxework.view.data.DataView; import hw.view.data.DataView;
import haxework.view.form.ToggleButtonView; import hw.view.form.ToggleButtonView;
import haxework.view.frame.FrameSwitcher; import hw.view.frame.FrameSwitcher;
import haxework.view.group.VGroupView; import hw.view.group.VGroupView;
import haxework.view.popup.ConfirmView; import hw.view.popup.ConfirmView;
import ru.m.data.IDataSource; import ru.m.data.IDataSource;
import ru.m.puzzlez.core.Id; import ru.m.puzzlez.core.Id;
import ru.m.puzzlez.source.FileSource; import ru.m.puzzlez.source.FileSource;

View File

@@ -1,9 +1,9 @@
--- ---
views: views:
- id: images - id: images
$type: haxework.view.data.ActionDataView $type: hw.view.data.ActionDataView
layout: layout:
$type: haxework.view.layout.TailLayout $type: hw.view.layout.TailLayout
rowSize: 3 rowSize: 3
margin: 5 margin: 5
vAlign: middle vAlign: middle

View File

@@ -1,9 +1,9 @@
package ru.m.puzzlez.view.common; package ru.m.puzzlez.view.common;
import haxework.signal.Signal; import hw.signal.Signal;
import haxework.view.data.DataView; import hw.view.data.DataView;
import haxework.view.form.ToggleButtonView; import hw.view.form.ToggleButtonView;
import haxework.view.layout.TailLayout; import hw.view.layout.TailLayout;
import ru.m.data.IDataSource.DataPage; import ru.m.data.IDataSource.DataPage;
enum PaginatorAction { enum PaginatorAction {

View File

@@ -3,7 +3,7 @@ package ru.m.puzzlez.view.common;
import flash.display.BitmapData; import flash.display.BitmapData;
import flash.display.Graphics; import flash.display.Graphics;
import flash.display.Shape; import flash.display.Shape;
import haxework.view.group.GroupView; import hw.view.group.GroupView;
import ru.m.puzzlez.core.GameState; import ru.m.puzzlez.core.GameState;
import ru.m.puzzlez.render.RenderUtil; import ru.m.puzzlez.render.RenderUtil;
import ru.m.puzzlez.storage.ImageStorage; import ru.m.puzzlez.storage.ImageStorage;

View File

@@ -1,10 +1,10 @@
package ru.m.puzzlez.view.common; package ru.m.puzzlez.view.common;
import haxework.view.data.DataView; import hw.view.data.DataView;
import haxework.view.form.ButtonView; import hw.view.form.ButtonView;
import haxework.view.form.LabelView; import hw.view.form.LabelView;
import haxework.view.group.GroupView; import hw.view.group.GroupView;
import haxework.view.ImageView; import hw.view.ImageView;
import ru.m.puzzlez.core.GameUtil; import ru.m.puzzlez.core.GameUtil;
import ru.m.puzzlez.core.Id; import ru.m.puzzlez.core.Id;
import ru.m.puzzlez.source.FileSource; import ru.m.puzzlez.source.FileSource;

View File

@@ -2,19 +2,19 @@
style: view style: view
views: views:
- id: image - id: image
$type: haxework.view.ImageView $type: hw.view.ImageView
geometry.stretch: true geometry.stretch: true
stretch: false stretch: false
fillType: COVER fillType: COVER
- id: label - id: label
$type: haxework.view.form.LabelView $type: hw.view.form.LabelView
- id: remove - id: remove
$type: haxework.view.form.ButtonView $type: hw.view.form.ButtonView
propagation: false propagation: false
style: icon.control.small.close.red style: icon.control.small.close.red
+onPress: ~emit(Action.REMOVE) +onPress: ~emit(Action.REMOVE)
- id: clean - id: clean
$type: haxework.view.form.ButtonView $type: hw.view.form.ButtonView
propagation: false propagation: false
style: icon.control.small.close.orange style: icon.control.small.close.orange
+onPress: ~emit(Action.CLEAN) +onPress: ~emit(Action.CLEAN)

View File

@@ -1,12 +1,12 @@
package ru.m.puzzlez.view.popup; package ru.m.puzzlez.view.popup;
import haxework.color.Color; import hw.color.Color;
import haxework.view.data.DataView; import hw.view.data.DataView;
import haxework.view.form.ButtonView; import hw.view.form.ButtonView;
import haxework.view.popup.PopupView; import hw.view.popup.PopupView;
import haxework.view.skin.Skin; import hw.view.skin.Skin;
import haxework.view.SpriteView; import hw.view.SpriteView;
import haxework.view.utils.DrawUtil; import hw.view.utils.DrawUtil;
import openfl.Assets; import openfl.Assets;
import openfl.utils.AssetType; import openfl.utils.AssetType;
import promhx.Promise; import promhx.Promise;

View File

@@ -1,6 +1,6 @@
--- ---
view: view:
$type: haxework.view.group.VGroupView $type: hw.view.group.VGroupView
geometry.width: 660 geometry.width: 660
geometry.height: 200 geometry.height: 200
geometry.padding: 10 geometry.padding: 10
@@ -9,41 +9,41 @@ view:
layout.margin: 10 layout.margin: 10
style: frame style: frame
views: views:
- $type: haxework.view.group.HGroupView - $type: hw.view.group.HGroupView
geometry.width: 100% geometry.width: 100%
layout.margin: 10 layout.margin: 10
views: views:
- id: header - id: header
text: Choise background text: Choise background
$type: haxework.view.form.LabelView $type: hw.view.form.LabelView
- id: selected - id: selected
$type: haxework.view.SpriteView $type: hw.view.SpriteView
geometry.width: 100% geometry.width: 100%
geometry.height: 200 geometry.height: 200
- id: colors - id: colors
$type: haxework.view.data.DataView $type: hw.view.data.DataView
factory: ~colorButtonFactory factory: ~colorButtonFactory
geometry.width: 100% geometry.width: 100%
layout: layout:
$type: haxework.view.layout.TailLayout $type: hw.view.layout.TailLayout
margin: 5 margin: 5
+onDataSelect: ~(color) -> selected = COLOR(color) +onDataSelect: ~(color) -> selected = COLOR(color)
- id: textures - id: textures
$type: haxework.view.data.DataView $type: hw.view.data.DataView
factory: ~textureButtonFactory factory: ~textureButtonFactory
geometry.width: 100% geometry.width: 100%
layout: layout:
$type: haxework.view.layout.TailLayout $type: hw.view.layout.TailLayout
margin: 5 margin: 5
+onDataSelect: ~(imageId) -> selected = IMAGE(imageId) +onDataSelect: ~(imageId) -> selected = IMAGE(imageId)
- $type: haxework.view.group.HGroupView - $type: hw.view.group.HGroupView
geometry.width: 100% geometry.width: 100%
layout.hAlign: center layout.hAlign: center
layout.margin: 10 layout.margin: 10
views: views:
- $type: haxework.view.form.ButtonView - $type: hw.view.form.ButtonView
text: Default text: Default
+onPress: ~close(NONE) +onPress: ~close(NONE)
- $type: haxework.view.form.ButtonView - $type: hw.view.form.ButtonView
text: OK text: OK
+onPress: ~close(selected) +onPress: ~close(selected)

View File

@@ -1,7 +1,7 @@
package ru.m.puzzlez.view.popup; package ru.m.puzzlez.view.popup;
import flash.events.MouseEvent; import flash.events.MouseEvent;
import haxework.view.popup.PopupView; import hw.view.popup.PopupView;
import promhx.Promise; import promhx.Promise;
import ru.m.puzzlez.core.GameState; import ru.m.puzzlez.core.GameState;
import ru.m.puzzlez.view.common.PresetView; import ru.m.puzzlez.view.common.PresetView;

View File

@@ -1,6 +1,6 @@
--- ---
view: view:
$type: haxework.view.group.VGroupView $type: hw.view.group.VGroupView
geometry.width: 100% geometry.width: 100%
geometry.height: 100% geometry.height: 100%
geometry.padding: 10 geometry.padding: 10
@@ -9,21 +9,21 @@ view:
layout.margin: 10 layout.margin: 10
style: frame style: frame
views: views:
- $type: haxework.view.group.HGroupView - $type: hw.view.group.HGroupView
geometry.width: 100% geometry.width: 100%
layout.margin: 10 layout.margin: 10
views: views:
- id: header - id: header
text: Image preview text: Image preview
$type: haxework.view.form.LabelView $type: hw.view.form.LabelView
- id: preview - id: preview
$type: ru.m.puzzlez.view.common.PresetView $type: ru.m.puzzlez.view.common.PresetView
geometry.stretch: true geometry.stretch: true
- $type: haxework.view.group.HGroupView - $type: hw.view.group.HGroupView
geometry.width: 100% geometry.width: 100%
layout.hAlign: center layout.hAlign: center
layout.margin: 10 layout.margin: 10
views: views:
- $type: haxework.view.form.ButtonView - $type: hw.view.form.ButtonView
text: OK text: OK
+onPress: ~close(null) +onPress: ~close(null)

View File

@@ -1,13 +1,13 @@
package ru.m.skin; package ru.m.skin;
import format.SVG; import format.SVG;
import haxework.color.Color; import hw.color.Color;
import haxework.view.form.ButtonView; import hw.view.form.ButtonView;
import haxework.view.form.ToggleButtonView; import hw.view.form.ToggleButtonView;
import haxework.view.skin.ISkin; import hw.view.skin.ISkin;
using StringTools; using StringTools;
using haxework.color.ColorUtil; using hw.color.ColorUtil;
@:style class ButtonSVGSkin implements ISkin<ButtonView> { @:style class ButtonSVGSkin implements ISkin<ButtonView> {

View File

@@ -1,6 +1,6 @@
package ru.m.update; package ru.m.update;
import haxework.net.JsonLoader; import hw.net.JsonLoader;
import openfl.Lib; import openfl.Lib;
import openfl.net.URLRequest; import openfl.net.URLRequest;
import promhx.Promise; import promhx.Promise;