Compare commits
3 Commits
227a83d1f0
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e67513897 | |||
| e41d461ba6 | |||
| acf0706bef |
10
README.md
10
README.md
@@ -1,9 +1,13 @@
|
|||||||
# Puzzlez
|
# Puzzle'z
|
||||||
|
|
||||||
|
Puzzle game
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Play
|
## Play
|
||||||
|
|
||||||
https://shmyga.ru/puzzlez/html5/index.html
|
https://shmyga.ru/puzzlez/html5/index.html
|
||||||
|
|
||||||
## Packages
|
## Releases
|
||||||
|
|
||||||
https://git.shmyga.ru/InfernalGames/-/packages/generic/puzzlez
|
https://git.shmyga.ru/InfernalGames/puzzlez/releases
|
||||||
|
|||||||
BIN
docs/Screenshot_2026-05-04_15-42-42.jpg
Normal file
BIN
docs/Screenshot_2026-05-04_15-42-42.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 357 KiB |
10
gulpfile.js
10
gulpfile.js
@@ -4,8 +4,11 @@ const Config = require("./config.json");
|
|||||||
const packageInfo = require("./package.json");
|
const packageInfo = require("./package.json");
|
||||||
const { System, Sdk, Haxe, Project } = require("gulp-haxetool");
|
const { System, Sdk, Haxe, Project } = require("gulp-haxetool");
|
||||||
const dateformat = require("dateformat");
|
const dateformat = require("dateformat");
|
||||||
|
const argv = require("yargs").argv;
|
||||||
const publish = require("./tasks/gulp-publish");
|
const publish = require("./tasks/gulp-publish");
|
||||||
|
|
||||||
|
Project.useRuffle();
|
||||||
|
|
||||||
if (packageInfo.haxe) {
|
if (packageInfo.haxe) {
|
||||||
Haxe.VERSION = packageInfo.haxe;
|
Haxe.VERSION = packageInfo.haxe;
|
||||||
}
|
}
|
||||||
@@ -63,6 +66,9 @@ const config = new Project.Config({
|
|||||||
flags: ["proto_debug"],
|
flags: ["proto_debug"],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const host = argv.host || "localhost";
|
||||||
|
const port = argv.port || 5000;
|
||||||
|
|
||||||
const app = new Project(
|
const app = new Project(
|
||||||
Project.BuildSystem.OPENFL,
|
Project.BuildSystem.OPENFL,
|
||||||
[
|
[
|
||||||
@@ -87,6 +93,10 @@ const app = new Project(
|
|||||||
width: 1280,
|
width: 1280,
|
||||||
height: 768,
|
height: 768,
|
||||||
},
|
},
|
||||||
|
macros: [
|
||||||
|
`CompilationOption.set('host','${host}')`,
|
||||||
|
`CompilationOption.set('port',${port})`,
|
||||||
|
],
|
||||||
flags: ["app"],
|
flags: ["app"],
|
||||||
}),
|
}),
|
||||||
).bind(module, gulp);
|
).bind(module, gulp);
|
||||||
|
|||||||
27325
package-lock.json
generated
27325
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@
|
|||||||
"gulp-add": "0.0.2",
|
"gulp-add": "0.0.2",
|
||||||
"gulp-clean": "^0.4.0",
|
"gulp-clean": "^0.4.0",
|
||||||
"gulp-cli": "^2.2.0",
|
"gulp-cli": "^2.2.0",
|
||||||
"gulp-haxetool": "^0.1.9",
|
"gulp-haxetool": "^0.2.1",
|
||||||
"yargs": "^13.2.4"
|
"yargs": "^13.2.4"
|
||||||
},
|
},
|
||||||
"haxeDependencies": {
|
"haxeDependencies": {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class NginxImageSource implements ImageSource {
|
|||||||
public var id(default, never):String = "nginx";
|
public var id(default, never):String = "nginx";
|
||||||
|
|
||||||
private var baseUrl:String;
|
private var baseUrl:String;
|
||||||
|
private var cache:Map<String, Promise<NginxResponse>> = new Map();
|
||||||
|
|
||||||
public function new(baseUrl:String) {
|
public function new(baseUrl:String) {
|
||||||
this.baseUrl = baseUrl;
|
this.baseUrl = baseUrl;
|
||||||
@@ -36,31 +37,35 @@ class NginxImageSource implements ImageSource {
|
|||||||
|
|
||||||
public function getPage(page:Page):Promise<DataPage<ImageId>> {
|
public function getPage(page:Page):Promise<DataPage<ImageId>> {
|
||||||
var category = page.filter.get("category");
|
var category = page.filter.get("category");
|
||||||
return new JsonLoader<NginxResponse>().GET(category != null ? this.baseUrl + category + "/" : this.baseUrl)
|
var url = category != null ? this.baseUrl + category + "/" : this.baseUrl;
|
||||||
.then((response:NginxResponse) -> {
|
if (!this.cache.exists(url)) {
|
||||||
var data:Array<ImageId> = [];
|
this.cache.set(url, new JsonLoader<NginxResponse>().GET(url));
|
||||||
for (item in response) {
|
}
|
||||||
if (item.type == NginxResponseItemType.FILE) {
|
return this.cache.get(url).then((response:NginxResponse) -> {
|
||||||
var itemId = category != null ? category + "@" + item.name : item.name;
|
var data:Array<ImageId> = [];
|
||||||
data.push(new ImageId().setSource(id).setId(itemId));
|
for (item in response) {
|
||||||
}
|
if (item.type == NginxResponseItemType.FILE) {
|
||||||
|
var itemId = category != null ? category + "@" + item.name : item.name;
|
||||||
|
data.push(new ImageId().setSource(id).setId(itemId));
|
||||||
}
|
}
|
||||||
return {
|
}
|
||||||
page: page,
|
data = data.slice(page.index * page.count, (page.index + 1) * page.count);
|
||||||
data: data,
|
return {
|
||||||
total: response.length,
|
page: page,
|
||||||
}
|
data: data,
|
||||||
});
|
total: response.length,
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function load(id:String, thumb:Bool = false):Promise<ImageValue> {
|
public function load(id:String, thumb:Bool = false):Promise<ImageValue> {
|
||||||
var url = this.baseUrl + StringTools.replace(id, "@", "/");
|
var url = this.baseUrl + StringTools.replace(id, "@", "/");
|
||||||
if (thumb) {
|
// TODO: default size by screen width?
|
||||||
var parts = url.split(".");
|
var width = thumb ? 360 : 1920;
|
||||||
var index = parts.length - 2;
|
var parts = url.split(".");
|
||||||
parts[index] = parts[index] + "-thumbnail";
|
var index = parts.length - 2;
|
||||||
url = parts.join(".");
|
parts[index] = parts[index] + '-w${width}';
|
||||||
}
|
url = parts.join(".");
|
||||||
return Promise.promise(ImageValue.URL(url));
|
return Promise.promise(ImageValue.URL(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user