From 78db6d6765d0c58e1dc98d8275b6eedcc87e78c2 Mon Sep 17 00:00:00 2001 From: shmyga Date: Thu, 9 Jan 2020 21:20:08 +0300 Subject: [PATCH] [add] PuzzleAppView --- gulp | 3 ++ gulpfile.js | 2 +- package-lock.json | 49 +++++++++++++++++++ package.json | 4 +- src/haxe/ru/m/puzzlez/App.hx | 7 --- src/haxe/ru/m/puzzlez/PuzzlezApp.hx | 15 ++++++ src/haxe/ru/m/puzzlez/PuzzlezTheme.hx | 10 ++++ src/haxe/ru/m/puzzlez/view/PuzzlezAppView.hx | 10 ++++ .../ru/m/puzzlez/view/PuzzlezAppView.yaml | 10 ++++ 9 files changed, 101 insertions(+), 9 deletions(-) create mode 100755 gulp delete mode 100644 src/haxe/ru/m/puzzlez/App.hx create mode 100644 src/haxe/ru/m/puzzlez/PuzzlezApp.hx create mode 100644 src/haxe/ru/m/puzzlez/PuzzlezTheme.hx create mode 100644 src/haxe/ru/m/puzzlez/view/PuzzlezAppView.hx create mode 100644 src/haxe/ru/m/puzzlez/view/PuzzlezAppView.yaml diff --git a/gulp b/gulp new file mode 100755 index 0000000..f4b80cc --- /dev/null +++ b/gulp @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +require('gulp-cli')(); diff --git a/gulpfile.js b/gulpfile.js index 81fe03d..397f555 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -49,7 +49,7 @@ const app = new Project( sources: [ 'src/haxe', ], - main: 'ru.m.puzzlez.App', + main: 'ru.m.puzzlez.PuzzlezApp', meta: { width: 1024, height: 768, diff --git a/package-lock.json b/package-lock.json index 1377788..496dadc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2584,6 +2584,55 @@ "vinyl": "^2.1.0" } }, + "gulp-cli": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz", + "integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==", + "dev": true, + "requires": { + "ansi-colors": "^1.0.1", + "archy": "^1.0.0", + "array-sort": "^1.0.0", + "color-support": "^1.1.3", + "concat-stream": "^1.6.0", + "copy-props": "^2.0.1", + "fancy-log": "^1.3.2", + "gulplog": "^1.0.0", + "interpret": "^1.1.0", + "isobject": "^3.0.1", + "liftoff": "^3.1.0", + "matchdep": "^2.0.0", + "mute-stdout": "^1.0.0", + "pretty-hrtime": "^1.0.0", + "replace-homedir": "^1.0.0", + "semver-greatest-satisfied-range": "^1.1.0", + "v8flags": "^3.0.1", + "yargs": "^7.1.0" + }, + "dependencies": { + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + } + } + } + }, "gulp-debian": { "version": "0.1.9", "resolved": "https://registry.npmjs.org/gulp-debian/-/gulp-debian-0.1.9.tgz", diff --git a/package.json b/package.json index 7f771df..deef85a 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "gulp": "^4.0.0", "gulp-add": "0.0.2", "gulp-clean": "^0.4.0", + "gulp-cli": "^2.2.0", "gulp-haxetool": "0.1.3", "yargs": "^13.2.4" }, @@ -15,5 +16,6 @@ "lime": "7.5.0", "openfl": "8.9.1", "hxcpp": "4.0.52" - } + }, + "dependencies": {} } diff --git a/src/haxe/ru/m/puzzlez/App.hx b/src/haxe/ru/m/puzzlez/App.hx deleted file mode 100644 index 59e1fdf..0000000 --- a/src/haxe/ru/m/puzzlez/App.hx +++ /dev/null @@ -1,7 +0,0 @@ -package ru.m.puzzlez; - -class App { - public static function main() { - trace("ok"); - } -} diff --git a/src/haxe/ru/m/puzzlez/PuzzlezApp.hx b/src/haxe/ru/m/puzzlez/PuzzlezApp.hx new file mode 100644 index 0000000..8fbbb4f --- /dev/null +++ b/src/haxe/ru/m/puzzlez/PuzzlezApp.hx @@ -0,0 +1,15 @@ +package ru.m.puzzlez; + +import haxework.App; +import haxework.log.TraceLogger; +import ru.m.puzzlez.view.PuzzlezAppView; + +class PuzzlezApp extends App { + + public static function main() { + L.push(new TraceLogger()); + var app = new PuzzlezApp(new PuzzlezTheme()); + app.start(new PuzzlezAppView()); + L.d("Puzzlez", "started"); + } +} diff --git a/src/haxe/ru/m/puzzlez/PuzzlezTheme.hx b/src/haxe/ru/m/puzzlez/PuzzlezTheme.hx new file mode 100644 index 0000000..89a282b --- /dev/null +++ b/src/haxe/ru/m/puzzlez/PuzzlezTheme.hx @@ -0,0 +1,10 @@ +package ru.m.puzzlez; + +import haxework.view.theme.Theme; + +class PuzzlezTheme extends Theme { + + public function new() { + super({name: 'Georgia'}, {light: 'gray'}); + } +} diff --git a/src/haxe/ru/m/puzzlez/view/PuzzlezAppView.hx b/src/haxe/ru/m/puzzlez/view/PuzzlezAppView.hx new file mode 100644 index 0000000..1ea4b5e --- /dev/null +++ b/src/haxe/ru/m/puzzlez/view/PuzzlezAppView.hx @@ -0,0 +1,10 @@ +package ru.m.puzzlez.view; + +import haxework.view.group.VGroupView; + +@:template class PuzzlezAppView extends VGroupView { + + public function new() { + super(); + } +} diff --git a/src/haxe/ru/m/puzzlez/view/PuzzlezAppView.yaml b/src/haxe/ru/m/puzzlez/view/PuzzlezAppView.yaml new file mode 100644 index 0000000..38c8b25 --- /dev/null +++ b/src/haxe/ru/m/puzzlez/view/PuzzlezAppView.yaml @@ -0,0 +1,10 @@ +style: background +layout.hAlign: center +layout.vAlign: middle +layout.margin: 20 +views: + - $type: haxework.view.form.LabelView + text: Puzzle'z + font.size: 42 + - $type: haxework.view.form.ButtonView + text: Start \ No newline at end of file