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
|
||||
|
||||
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 { 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);
|
||||
|
||||
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-clean": "^0.4.0",
|
||||
"gulp-cli": "^2.2.0",
|
||||
"gulp-haxetool": "^0.1.9",
|
||||
"gulp-haxetool": "^0.2.1",
|
||||
"yargs": "^13.2.4"
|
||||
},
|
||||
"haxeDependencies": {
|
||||
|
||||
@@ -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,31 +37,35 @@ 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 data:Array<ImageId> = [];
|
||||
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));
|
||||
}
|
||||
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) {
|
||||
var itemId = category != null ? category + "@" + item.name : item.name;
|
||||
data.push(new ImageId().setSource(id).setId(itemId));
|
||||
}
|
||||
return {
|
||||
page: page,
|
||||
data: data,
|
||||
total: response.length,
|
||||
}
|
||||
});
|
||||
}
|
||||
data = data.slice(page.index * page.count, (page.index + 1) * page.count);
|
||||
return {
|
||||
page: page,
|
||||
data: data,
|
||||
total: response.length,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function load(id:String, thumb:Bool = false):Promise<ImageValue> {
|
||||
var url = this.baseUrl + StringTools.replace(id, "@", "/");
|
||||
if (thumb) {
|
||||
var parts = url.split(".");
|
||||
var index = parts.length - 2;
|
||||
parts[index] = parts[index] + "-thumbnail";
|
||||
url = parts.join(".");
|
||||
}
|
||||
// TODO: default size by screen width?
|
||||
var width = thumb ? 360 : 1920;
|
||||
var parts = url.split(".");
|
||||
var index = parts.length - 2;
|
||||
parts[index] = parts[index] + '-w${width}';
|
||||
url = parts.join(".");
|
||||
return Promise.promise(ImageValue.URL(url));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user