3 Commits

Author SHA1 Message Date
9e67513897 build(npm): update gulp-haxetool 2026-05-20 00:05:30 +03:00
e41d461ba6 feat(app): update nginx image source 2026-05-20 00:03:52 +03:00
acf0706bef docs: add screenshot 2026-05-04 16:12:46 +03:00
6 changed files with 13774 additions and 13618 deletions

View File

@@ -1,9 +1,13 @@
# Puzzlez
# Puzzle'z
Puzzle game
![Puzzle'z](docs/Screenshot_2026-05-04_15-42-42.jpg "Puzzle'z")
## Play
https://shmyga.ru/puzzlez/html5/index.html
## Packages
## Releases
https://git.shmyga.ru/InfernalGames/-/packages/generic/puzzlez
https://git.shmyga.ru/InfernalGames/puzzlez/releases

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

View File

@@ -4,8 +4,11 @@ const Config = require("./config.json");
const packageInfo = require("./package.json");
const { System, Sdk, Haxe, Project } = require("gulp-haxetool");
const dateformat = require("dateformat");
const argv = require("yargs").argv;
const publish = require("./tasks/gulp-publish");
Project.useRuffle();
if (packageInfo.haxe) {
Haxe.VERSION = packageInfo.haxe;
}
@@ -63,6 +66,9 @@ const config = new Project.Config({
flags: ["proto_debug"],
});
const host = argv.host || "localhost";
const port = argv.port || 5000;
const app = new Project(
Project.BuildSystem.OPENFL,
[
@@ -87,6 +93,10 @@ const app = new Project(
width: 1280,
height: 768,
},
macros: [
`CompilationOption.set('host','${host}')`,
`CompilationOption.set('port',${port})`,
],
flags: ["app"],
}),
).bind(module, gulp);

475
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@
"gulp-add": "0.0.2",
"gulp-clean": "^0.4.0",
"gulp-cli": "^2.2.0",
"gulp-haxetool": "^0.1.9",
"gulp-haxetool": "^0.2.1",
"yargs": "^13.2.4"
},
"haxeDependencies": {

View File

@@ -25,6 +25,7 @@ class NginxImageSource implements ImageSource {
public var id(default, never):String = "nginx";
private var baseUrl:String;
private var cache:Map<String, Promise<NginxResponse>> = new Map();
public function new(baseUrl:String) {
this.baseUrl = baseUrl;
@@ -36,8 +37,11 @@ class NginxImageSource implements ImageSource {
public function getPage(page:Page):Promise<DataPage<ImageId>> {
var category = page.filter.get("category");
return new JsonLoader<NginxResponse>().GET(category != null ? this.baseUrl + category + "/" : this.baseUrl)
.then((response:NginxResponse) -> {
var url = category != null ? this.baseUrl + category + "/" : this.baseUrl;
if (!this.cache.exists(url)) {
this.cache.set(url, new JsonLoader<NginxResponse>().GET(url));
}
return this.cache.get(url).then((response:NginxResponse) -> {
var data:Array<ImageId> = [];
for (item in response) {
if (item.type == NginxResponseItemType.FILE) {
@@ -45,6 +49,7 @@ class NginxImageSource implements ImageSource {
data.push(new ImageId().setSource(id).setId(itemId));
}
}
data = data.slice(page.index * page.count, (page.index + 1) * page.count);
return {
page: page,
data: data,
@@ -55,12 +60,12 @@ class NginxImageSource implements ImageSource {
public function load(id:String, thumb:Bool = false):Promise<ImageValue> {
var url = this.baseUrl + StringTools.replace(id, "@", "/");
if (thumb) {
// TODO: default size by screen width?
var width = thumb ? 360 : 1920;
var parts = url.split(".");
var index = parts.length - 2;
parts[index] = parts[index] + "-thumbnail";
parts[index] = parts[index] + '-w${width}';
url = parts.join(".");
}
return Promise.promise(ImageValue.URL(url));
}