mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-04-18 18:58:06 +08:00
Compare commits
2 Commits
ab705dd46c
...
765a69294b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
765a69294b | ||
|
|
8eb8c3ca72 |
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><meta name="description" content="やり直すんだ。そして、次はうまくやる。"/><meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/><meta name="renderer" content="webkit"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="full-screen" content="true"/><meta name="x5-fullscreen" content="true"/><meta name="360-fullscreen" content="true"/><meta name="theme-color" content="#157878"/><meta name="laya" screenorientation="landscape"/><meta http-equiv="expires" content="0"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>Life Restart</title><script src="libs/laya/min/laya.core.min.js"></script><script src="libs/laya/min/laya.webgl.min.js"></script><script src="libs/laya/min/laya.filter.min.js"></script><script src="libs/laya/min/laya.particle.min.js"></script><script src="libs/laya/min/laya.ui.min.js"></script><script defer="defer" src="chunk/main.c7a9c.js"></script></head><body style="background:black"></body></html>
|
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><meta name="description" content="やり直すんだ。そして、次はうまくやる。"/><meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/><meta name="renderer" content="webkit"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="full-screen" content="true"/><meta name="x5-fullscreen" content="true"/><meta name="360-fullscreen" content="true"/><meta name="theme-color" content="#157878"/><meta name="laya" screenorientation="landscape"/><meta http-equiv="expires" content="0"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>Life Restart</title><script src="libs/laya/min/laya.core.min.js"></script><script src="libs/laya/min/laya.webgl.min.js"></script><script src="libs/laya/min/laya.filter.min.js"></script><script src="libs/laya/min/laya.particle.min.js"></script><script src="libs/laya/min/laya.ui.min.js"></script><script defer="defer" src="chunk/main.a3242.js"></script></head><body style="background:black"></body></html>
|
||||||
20
src/app.js
20
src/app.js
@@ -10,6 +10,25 @@ globalThis.UI =
|
|||||||
UIManager;
|
UIManager;
|
||||||
|
|
||||||
globalThis.$_ = utils;
|
globalThis.$_ = utils;
|
||||||
|
|
||||||
|
globalThis.goto = async tag => {
|
||||||
|
let url;
|
||||||
|
switch(tag) {
|
||||||
|
case 'github': url = 'https://github.com/VickScarlet/lifeRestart'; break;
|
||||||
|
case 'discord': url = 'https://discord.gg/U3qrf49NMQ'; break;
|
||||||
|
case 'sponsor_afd': url = 'https://afdian.net/@LifeRestart'; break;
|
||||||
|
case 'sponsor_ddf': url = 'https://dun.mianbaoduo.com/@vickscarlet'; break;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if(Laya.Browser.onIOS) {
|
||||||
|
window.location.href = url;
|
||||||
|
} else {
|
||||||
|
window.open(url, '_blank');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
class App{
|
class App{
|
||||||
constructor(){
|
constructor(){
|
||||||
this.name = 'lifeRestart';
|
this.name = 'lifeRestart';
|
||||||
@@ -156,6 +175,7 @@ class App{
|
|||||||
dataSet=>Laya.promises.loader.load(`data/${dataSet}.json`, null, Laya.Loader.JSON),
|
dataSet=>Laya.promises.loader.load(`data/${dataSet}.json`, null, Laya.Loader.JSON),
|
||||||
);
|
);
|
||||||
await $ui.switchView(UI.pages.MAIN);
|
await $ui.switchView(UI.pages.MAIN);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
15
src/index.js
15
src/index.js
@@ -1,21 +1,6 @@
|
|||||||
import App from './app.js';
|
import App from './app.js';
|
||||||
import Life from './modules/life.js';
|
import Life from './modules/life.js';
|
||||||
|
|
||||||
globalThis.goto = async tag => {
|
|
||||||
let url;
|
|
||||||
switch(tag) {
|
|
||||||
case 'github': url = 'https://github.com/VickScarlet/lifeRestart'; break;
|
|
||||||
case 'discord': url = 'https://discord.gg/U3qrf49NMQ'; break;
|
|
||||||
case 'sponsor_afd': url = 'https://afdian.net/@LifeRestart'; break;
|
|
||||||
case 'sponsor_ddf': url = 'https://dun.mianbaoduo.com/@vickscarlet'; break;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
window.open(url, '_blank');
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
globalThis.$$eventMap = new Map();
|
globalThis.$$eventMap = new Map();
|
||||||
globalThis.$$event = (tag, data) => {
|
globalThis.$$event = (tag, data) => {
|
||||||
const listener = $$eventMap.get(tag);
|
const listener = $$eventMap.get(tag);
|
||||||
|
|||||||
@@ -44,12 +44,12 @@ class Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do(eventId, property) {
|
do(eventId, property) {
|
||||||
const { effect, branch, event: description, postEvent } = this.get(eventId);
|
const { effect, branch, event: description, postEvent, grade } = this.get(eventId);
|
||||||
if(branch)
|
if(branch)
|
||||||
for(const [cond, next] of branch)
|
for(const [cond, next] of branch)
|
||||||
if(checkCondition(property, cond))
|
if(checkCondition(property, cond))
|
||||||
return { effect, next, description };
|
return { effect, next, description, grade };
|
||||||
return { effect, postEvent, description };
|
return { effect, postEvent, description, grade };
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,13 +142,14 @@ class Life {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doEvent(eventId) {
|
doEvent(eventId) {
|
||||||
const { effect, next, description, postEvent } = this.#event.do(eventId, this.#property);
|
const { effect, next, description, postEvent, grade } = this.#event.do(eventId, this.#property);
|
||||||
this.#property.change(this.PropertyTypes.EVT, eventId);
|
this.#property.change(this.PropertyTypes.EVT, eventId);
|
||||||
this.#property.effect(effect);
|
this.#property.effect(effect);
|
||||||
const content = {
|
const content = {
|
||||||
type: this.PropertyTypes.EVT,
|
type: this.PropertyTypes.EVT,
|
||||||
description,
|
description,
|
||||||
postEvent,
|
postEvent,
|
||||||
|
grade,
|
||||||
}
|
}
|
||||||
if(next) return [content, this.doEvent(next)].flat();
|
if(next) return [content, this.doEvent(next)].flat();
|
||||||
return [content];
|
return [content];
|
||||||
|
|||||||
Reference in New Issue
Block a user