#publish 仅为了测试webhook
parent
2374a76d38
commit
ca25285d2a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
[
|
||||
null,
|
||||
{"id":1,"members":[{"enemyId":1,"x":336,"y":436,"hidden":false},{"enemyId":1,"x":480,"y":436,"hidden":false}],"name":"蝙蝠*2","pages":[{"conditions":{"actorHp":50,"actorId":1,"actorValid":false,"enemyHp":50,"enemyIndex":0,"enemyValid":false,"switchId":1,"switchValid":false,"turnA":0,"turnB":0,"turnEnding":false,"turnValid":true},"list":[{"code":311,"indent":0,"parameters":[0,0,1,0,1000,true]},{"code":0,"indent":0,"parameters":[]}],"span":2}]},
|
||||
{"id":1,"members":[{"enemyId":1,"x":336,"y":436,"hidden":false},{"enemyId":1,"x":480,"y":436,"hidden":false}],"name":"蝙蝠*2","pages":[{"conditions":{"actorHp":50,"actorId":1,"actorValid":false,"enemyHp":50,"enemyIndex":0,"enemyValid":false,"switchId":1,"switchValid":false,"turnA":0,"turnB":0,"turnEnding":false,"turnValid":false},"list":[{"code":0,"indent":0,"parameters":[]}],"span":1}]},
|
||||
{"id":2,"members":[{"enemyId":2,"x":337,"y":436,"hidden":false},{"enemyId":2,"x":480,"y":436,"hidden":false}],"name":"史莱姆*2","pages":[{"conditions":{"actorHp":50,"actorId":1,"actorValid":false,"enemyHp":50,"enemyIndex":0,"enemyValid":false,"switchId":1,"switchValid":false,"turnA":0,"turnB":0,"turnEnding":false,"turnValid":false},"list":[{"code":0,"indent":0,"parameters":[]}],"span":0}]},
|
||||
{"id":3,"members":[{"enemyId":3,"x":408,"y":436,"hidden":false}],"name":"兽人","pages":[{"conditions":{"actorHp":50,"actorId":1,"actorValid":false,"enemyHp":50,"enemyIndex":0,"enemyValid":false,"switchId":1,"switchValid":false,"turnA":0,"turnB":0,"turnEnding":false,"turnValid":false},"list":[{"code":0,"indent":0,"parameters":[]}],"span":0}]},
|
||||
{"id":4,"members":[{"enemyId":4,"x":408,"y":436,"hidden":false}],"name":"牛头怪","pages":[{"conditions":{"actorHp":50,"actorId":1,"actorValid":false,"enemyHp":50,"enemyIndex":0,"enemyValid":false,"switchId":1,"switchValid":false,"turnA":0,"turnB":0,"turnEnding":false,"turnValid":false},"list":[{"code":0,"indent":0,"parameters":[]}],"span":0}]}
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
@ -0,0 +1,408 @@
|
||||
//=============================================================================
|
||||
// Salted Fish Plugins - Auto Update
|
||||
// SF_AutoUpdate.js
|
||||
//=============================================================================
|
||||
|
||||
"use strict";
|
||||
var Imported = Imported || {};
|
||||
Imported.SF_AutoUpdate = true;
|
||||
|
||||
var SF_Plugins = SF_Plugins || {};
|
||||
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc v1.0.0 - Automatically update the game.
|
||||
* @author Salted Fish
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* ===========================================================================
|
||||
* Introduction
|
||||
* ===========================================================================
|
||||
*
|
||||
* This plugin automatically updates the game.
|
||||
*
|
||||
* ===========================================================================
|
||||
* Requires
|
||||
* ===========================================================================
|
||||
*
|
||||
* You need use ycrpg2-android-client to run on android.
|
||||
* otherwise, you can use ycrpg2-pc-client to run on pc.
|
||||
* This is not supported on ios and web, but web also use the newest version.
|
||||
*
|
||||
* ===========================================================================
|
||||
* How to use
|
||||
* ===========================================================================
|
||||
*
|
||||
* ycrpg2-android-client provide FileUtils and UpdateUtils.
|
||||
* FileUtils is used to read and write Text files, and UpdateUtils is used to
|
||||
* update the game.
|
||||
*
|
||||
* FileUtils provide the following functions:
|
||||
* public void evaluateJavascript(String script)
|
||||
* public boolean canExecute(String fileName)
|
||||
* public boolean canRead(String fileName)
|
||||
* public boolean canWrite(String fileName)
|
||||
* public boolean createNewFile(String fileName)
|
||||
* public boolean delete(String fileName)
|
||||
* public boolean exists(String fileName)
|
||||
* public String getAbsolutePath(String fileName)
|
||||
* public String getCanonicalPath(String fileName)
|
||||
* public String getName(String fileName)
|
||||
* public String getParent(String fileName)
|
||||
* public String getPath(String fileName)
|
||||
* public boolean isAbsolute(String fileName)
|
||||
* public boolean isDirectory(String fileName)
|
||||
* public boolean isFile(String fileName)
|
||||
* public long lastModified(String fileName)
|
||||
* public long length(String fileName)
|
||||
* public String list(String fileName)
|
||||
* public boolean mkdir(String fileName)
|
||||
* public boolean mkdirs(String fileName)
|
||||
* public boolean renameTo(String srcName, String dstName)
|
||||
* public String toString(String fileName)
|
||||
* public String readTextFile(String fileName)
|
||||
* public boolean writeTextFile(String fileName,String content)
|
||||
* public String getFileHashHex(String fileName, String algorithm)
|
||||
* public String getFileHashHex(String fileName)
|
||||
*
|
||||
* UpdateUtils provide the following functions:
|
||||
* public void evaluateJavascript(String script)
|
||||
* public void downloadFullUrl(String fileName, String urlString, String success, String fail)
|
||||
* public void downloadRelativeUrl(String fileName, String urlString, String success, String fail)
|
||||
* public void updateFileCompleted(boolean bool)
|
||||
* public String getHashInfoJson()
|
||||
* public void updateFile(String fileName, String success, String fail)
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
(function () {
|
||||
var SF_AutoUpdate = {};
|
||||
SF_Plugins.SF_AutoUpdate = SF_AutoUpdate;
|
||||
|
||||
SF_AutoUpdate.version = 1.0;
|
||||
|
||||
SF_AutoUpdate.remoteFileInfoName = "file_info_remote.json";
|
||||
SF_AutoUpdate.localFileInfoName = "file_info_local.json";
|
||||
SF_AutoUpdate.remoteFileInfoUrl = "https://ycrpg.xyzzgame.com/ycrpg2/file_info_remote.json";
|
||||
SF_AutoUpdate.remoteUrlRoot = "https://ycrpg.xyzzgame.com/YCrpg2/";
|
||||
SF_AutoUpdate.emptyFileInfoStr = `{"is_file":false,"is_dir":"true","files":[],"dirs":[],"sha_512":""}`;
|
||||
|
||||
SF_AutoUpdate.enableAutoUpdate = false;
|
||||
|
||||
SF_AutoUpdate.isAndroid = function () {
|
||||
return !!window.FileUtils && !!window.UpdateUtils && !SF_AutoUpdate.isPC();
|
||||
}
|
||||
|
||||
SF_AutoUpdate.isPC = function () {
|
||||
return !!Utils.isNwjs();
|
||||
}
|
||||
|
||||
SF_AutoUpdate.isWeb = function () {
|
||||
return !SF_AutoUpdate.isPC() && !SF_AutoUpdate.isAndroid();
|
||||
}
|
||||
|
||||
SF_AutoUpdate.isSupported = function () {
|
||||
return SF_AutoUpdate.enableAutoUpdate && (SF_AutoUpdate.isAndroid() || SF_AutoUpdate.isPC());
|
||||
}
|
||||
|
||||
if (!SF_AutoUpdate.isSupported()) { return; }
|
||||
|
||||
SF_AutoUpdate.FileUtils = window.FileUtils || {};
|
||||
SF_AutoUpdate.UpdateUtils = window.UpdateUtils || {};
|
||||
|
||||
if (SF_AutoUpdate.isPC()) {
|
||||
window.FileUtils = SF_AutoUpdate.FileUtils;
|
||||
window.UpdateUtils = SF_AutoUpdate.UpdateUtils;
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var os = require('os');
|
||||
var crypto = require('crypto');
|
||||
var http = require('http');
|
||||
|
||||
SF_AutoUpdate.FileUtils.evaluateJavascript = function (script) {
|
||||
(new Function(script)).call(window);
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.canExecute = function (fileName) {
|
||||
try {
|
||||
fs.accessSync(fileName, fs.X_OK);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.canRead = function (fileName) {
|
||||
try {
|
||||
fs.accessSync(fileName, fs.R_OK);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.canWrite = function (fileName) {
|
||||
try {
|
||||
fs.accessSync(fileName, fs.W_OK);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.createNewFile = function (fileName) {
|
||||
try {
|
||||
fs.writeFileSync(fileName, "");
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.delete = function (fileName) {
|
||||
try {
|
||||
fs.unlinkSync(fileName);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.exists = function (fileName) {
|
||||
try {
|
||||
fs.accessSync(fileName, fs.F_OK);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.getAbsolutePath = function (fileName) {
|
||||
return path.resolve(fileName);
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.getCanonicalPath = function (fileName) {
|
||||
return path.resolve(fileName);
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.getName = function (fileName) {
|
||||
return path.basename(fileName);
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.getParent = function (fileName) {
|
||||
return path.dirname(fileName);
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.getPath = function (fileName) {
|
||||
return path.resolve(fileName);
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.isAbsolute = function (fileName) {
|
||||
return path.isAbsolute(fileName);
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.isDirectory = function (fileName) {
|
||||
return fs.statSync(fileName).isDirectory();
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.isFile = function (fileName) {
|
||||
return fs.statSync(fileName).isFile();
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.lastModified = function (fileName) {
|
||||
return fs.statSync(fileName).mtime.getTime();
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.length = function (fileName) {
|
||||
return fs.statSync(fileName).size;
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.mkdir = function (fileName) {
|
||||
try {
|
||||
fs.mkdirSync(fileName);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.mkdirs = function (fileName) {
|
||||
try {
|
||||
fs.mkdirSync(fileName, { recursive: true });
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.reanmeTo = function (srcName, dstName) {
|
||||
try {
|
||||
fs.renameSync(oldFileName, newFileName);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.toString = function (fileName) {
|
||||
return path.resolve(fileName);
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.readTextFile = function (fileName) {
|
||||
return fs.readFileSync(fileName, 'utf-8');
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.writeTextFile = function (fileName, text) {
|
||||
return fs.writeFileSync(fileName, text, 'utf-8');
|
||||
}
|
||||
|
||||
SF_AutoUpdate.FileUtils.getFileHashHex = function (fileName, algorithm) {
|
||||
var hash = crypto.createHash(algorithm || 'SHA512');
|
||||
var data = fs.readFileSync(fileName);
|
||||
hash.update(data);
|
||||
return hash.digest('hex');
|
||||
}
|
||||
|
||||
SF_AutoUpdate.UpdateUtils.evaluateJavascript = function (script) {
|
||||
(new Function(script)).call(window);
|
||||
}
|
||||
|
||||
SF_AutoUpdate.UpdateUtils.downloadFullUrl = function (fileName, url, success, fail) {
|
||||
var file = fs.createWriteStream(fileName);
|
||||
http.get(url, function (response) {
|
||||
response.pipe(file);
|
||||
file.on('finish', function () {
|
||||
file.close(SF_AutoUpdate.UpdateUtils.evaluateJavascript.bind(SF_AutoUpdate.UpdateUtils, success));
|
||||
});
|
||||
}).on('error', function (err) {
|
||||
SF_AutoUpdate.UpdateUtils.evaluateJavascript.bind(SF_AutoUpdate.UpdateUtils, fail)(err.message);
|
||||
});
|
||||
}
|
||||
|
||||
SF_AutoUpdate.UpdateUtils.downloadRelativeUrl = function (fileName, url, success, fail) {
|
||||
SF_AutoUpdate.UpdateUtils.downloadFullUrl(fileName, SF_AutoUpdate.remoteUrlRoot + url, success, fail);
|
||||
}
|
||||
|
||||
SF_AutoUpdate.UpdateUtils.updateFileCompleted = function (result) {
|
||||
// todo
|
||||
}
|
||||
|
||||
SF_AutoUpdate.UpdateUtils.getHashInfoJson = function () {
|
||||
try {
|
||||
return fs.readFileSync(SF_AutoUpdate.localFileInfoName) || SF_AutoUpdate.emptyFileInfoStr;
|
||||
} catch (e) {
|
||||
return SF_AutoUpdate.emptyFileInfoStr;
|
||||
}
|
||||
}
|
||||
|
||||
SF_AutoUpdate.UpdateUtils.updateFile = function (fileName, success, fail) {
|
||||
SF_AutoUpdate.UpdateUtils.downloadRelativeUrl(fileName, fileName, success, fail);
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Scene_AutoUpdate
|
||||
//=============================================================================
|
||||
|
||||
function Scene_AutoUpdate() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
window.Scene_AutoUpdate = Scene_AutoUpdate;
|
||||
SF_AutoUpdate.Scene_AutoUpdate = Scene_AutoUpdate;
|
||||
|
||||
Scene_AutoUpdate.prototype = Object.create(Scene_Base.prototype);
|
||||
Scene_AutoUpdate.prototype.constructor = Scene_AutoUpdate;
|
||||
|
||||
Scene_AutoUpdate.prototype.initialize = function () {
|
||||
Scene_Base.prototype.initialize.call(this);
|
||||
this._localFileInfo = JsonEx.parse(UpdateUtils.readTextFile(SF_AutoUpdate.localFileInfoName));
|
||||
this._remoteFileInfo = {};
|
||||
this._updateFileList = [];
|
||||
this._updateFileIndex = 0;
|
||||
this._updateFileCount = 0;
|
||||
this._updateFileName = "";
|
||||
|
||||
this._status = "completed"; // "working", "completed"
|
||||
this._job = ""; // "fetch remote file info", "compare file info", "update file"
|
||||
this._nextJob = "fetched remote file info";
|
||||
};
|
||||
|
||||
Scene_AutoUpdate.prototype.create = function () {
|
||||
Scene_Base.prototype.create.call(this);
|
||||
}
|
||||
|
||||
Scene_AutoUpdate.prototype.start = function () {
|
||||
Scene_Base.prototype.start.call(this);
|
||||
}
|
||||
|
||||
Scene_AutoUpdate.prototype.update = function () {
|
||||
Scene_Base.prototype.update.call(this);
|
||||
this.updateJob();
|
||||
this.updateLoading();
|
||||
}
|
||||
|
||||
Scene_AutoUpdate.prototype.updateLoading = function () {
|
||||
console.log(this._job, this._status);
|
||||
}
|
||||
|
||||
Scene_AutoUpdate.prototype.updateJob = function () {
|
||||
if (this._status === "working") { return; }
|
||||
if (this._nextJob === "") {
|
||||
SceneManager.pop();
|
||||
}
|
||||
this._job = this._nextJob;
|
||||
this._status = "working";
|
||||
switch (this._job) {
|
||||
case "fetched remote file info":
|
||||
this.fetchRemoteFileInfo();
|
||||
this._nextJob = "compare file info";
|
||||
break;
|
||||
case "compare file info":
|
||||
this.compareFileInfo();
|
||||
this._nextJob = "update file";
|
||||
break;
|
||||
case "update file":
|
||||
this.updateFile();
|
||||
this._nextJob = "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Scene_AutoUpdate.prototype.fetchRemoteFileInfo = function () {
|
||||
var success = (function () {
|
||||
this._remoteFileInfo = JsonEx.parse(UpdateUtils.readTextFile(SF_AutoUpdate.remoteFileInfoName));
|
||||
this._status = "completed";
|
||||
this._nextJob = "compare file info";
|
||||
}).bind(this);
|
||||
|
||||
var fail = (function () {
|
||||
this._status = "completed";
|
||||
this._nextJob = "";
|
||||
}).bind(this);
|
||||
|
||||
UpdateUtils.downloadRelativeUrl(
|
||||
SF_AutoUpdate.remoteFileInfoName,
|
||||
SF_AutoUpdate.remoteFileInfoName,
|
||||
CallBack.registerOneTime(success),
|
||||
CallBack.registerOneTime(fail)
|
||||
);
|
||||
}
|
||||
|
||||
Scene_AutoUpdate.prototype.compareFileInfo = function () {
|
||||
|
||||
}
|
||||
//=============================================================================
|
||||
// SceneManager
|
||||
//=============================================================================
|
||||
|
||||
SF_AutoUpdate.SceneManager_initialize = SceneManager.initialize;
|
||||
SceneManager.initialize = function () {
|
||||
SF_AutoUpdate.SceneManager_initialize.call(this);
|
||||
this.addSceneBefore(Scene_AutoUpdate, Scene_Title);
|
||||
}
|
||||
|
||||
|
||||
|
||||
})();
|
@ -0,0 +1,24 @@
|
||||
onmessage = function (e) {
|
||||
var local_file_info = e.data[0];
|
||||
var remote_file_info = e.data[1];
|
||||
|
||||
local_file_info.is_dir = local_file_info.is_dir || false;
|
||||
remote_file_info.is_dir = remote_file_info.is_dir || false;
|
||||
}
|
||||
|
||||
function compare_file_info(local_file_info, remote_file_info) {
|
||||
}
|
||||
|
||||
function compare_file_file(local_file_info, remote_file_info) {
|
||||
console.assert(local_file_info.is_file === remote_file_info.is_file);
|
||||
|
||||
}
|
||||
|
||||
function generate_delete_file_list(file_info) {
|
||||
var delete_file_list = [];
|
||||
if (file_info.is_dir) {
|
||||
for (var i = 0; i < file_info.children.length; i++) {
|
||||
delete_file_list = delete_file_list.concat(generate_delete_file_list(file_info.children[i]));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
//=============================================================================
|
||||
// Salted Fish Plugins - Scene SKill
|
||||
// SF_SceneSkill.js
|
||||
//=============================================================================
|
||||
|
||||
"use strict";
|
||||
var Imported = Imported || {};
|
||||
Imported.SF_SceneSkill = true;
|
||||
|
||||
var SF_Plugins = SF_Plugins || {};
|
||||
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc v1.0.0 - Scene Skill
|
||||
* @author Salted Fish
|
||||
*
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* ===========================================================================
|
||||
* Introduction
|
||||
* ===========================================================================
|
||||
*
|
||||
* This plugin is used to show the skill list.
|
||||
* Any config just change the file.
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
(function () {
|
||||
var SF_SceneSkill = {};
|
||||
SF_Plugins.SF_SceneSkill = SF_SceneSkill;
|
||||
|
||||
SF_SceneSkill.version = 1.0;
|
||||
|
||||
//=============================================================================
|
||||
// Window_UserSelect
|
||||
//=============================================================================
|
||||
|
||||
function Window_UserSelect() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
SF_SceneSkill.Window_UserSelect = Window_UserSelect;
|
||||
window.Window_UserSelect = Window_UserSelect;
|
||||
|
||||
Window_UserSelect.prototype = Object.create(Window_PagingBase.prototype);
|
||||
Window_UserSelect.prototype.constructor = Window_UserSelect;
|
||||
|
||||
Window_UserSelect.prototype.initialize = function () {
|
||||
Window_PagingBase.prototype.initialize.apply(this, arguments);
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Scene_Skill
|
||||
//=============================================================================
|
||||
|
||||
|
||||
})();
|
@ -0,0 +1,250 @@
|
||||
//=============================================================================
|
||||
// Salted Fish Plugins - Scene Splash
|
||||
// SF_SceneSplash.js
|
||||
//=============================================================================
|
||||
|
||||
"use strict";
|
||||
var Imported = Imported || {};
|
||||
Imported.SF_SceneSplash = true;
|
||||
|
||||
var SF_Plugins = SF_Plugins || {};
|
||||
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc v1.0.0 - Scene Splash
|
||||
* @author Salted Fish
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* ===========================================================================
|
||||
* Introduction
|
||||
* ===========================================================================
|
||||
*
|
||||
* This plugin adds a splash scene after Scene_Boot.
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
(function () {
|
||||
var SF_SceneSplash = {};
|
||||
SF_Plugins.SF_SceneSplash = SF_SceneSplash;
|
||||
|
||||
SF_SceneSplash.version = 1.0;
|
||||
|
||||
SF_SceneSplash.FADE_IN_FRAMES = 60; // Number of frames for the fade in effect.
|
||||
SF_SceneSplash.FADE_OUT_FRAMES = 60;// Number of frames for the fade out effect.
|
||||
SF_SceneSplash.SHOW_TIME = 150;// Number of frames for the splash to be shown.
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_SplashBase
|
||||
//=============================================================================
|
||||
|
||||
function Sprite_SplashBase() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Sprite_SplashBase.prototype = Object.create(Sprite.prototype);
|
||||
Sprite_SplashBase.prototype.constructor = Sprite_SplashBase;
|
||||
|
||||
Sprite_SplashBase.prototype.initialize = function (index) {
|
||||
Sprite.prototype.initialize.call(this);
|
||||
this.state = "fadeIn";// "fadeIn", "show", "fadeOut"
|
||||
this.FADE_IN_FRAMES = SF_SceneSplash.FADE_IN_FRAMES;
|
||||
this.FADE_OUT_FRAMES = SF_SceneSplash.FADE_OUT_FRAMES;
|
||||
this.SHOW_TIME = SF_SceneSplash.SHOW_TIME;
|
||||
this.index = index;
|
||||
this.showTime = 0;
|
||||
this.opacity = 0;
|
||||
}
|
||||
|
||||
Sprite_SplashBase.prototype.update = function () {
|
||||
Sprite.prototype.update.call(this);
|
||||
|
||||
if (TouchInput.isTriggered()) {
|
||||
this.state = "fadeOut";
|
||||
}
|
||||
|
||||
if (this.state === "fadeIn") {
|
||||
this.updateFadeIn();
|
||||
} else if (this.state === "show") {
|
||||
this.updateShow();
|
||||
} else if (this.state === "fadeOut") {
|
||||
this.updateFadeOut();
|
||||
}
|
||||
}
|
||||
|
||||
Sprite_SplashBase.prototype.updateFadeIn = function () {
|
||||
this.opacity += 255 / this.FADE_IN_FRAMES;
|
||||
if (this.opacity >= 255) {
|
||||
this.opacity = 255;
|
||||
this.state = "show";
|
||||
}
|
||||
}
|
||||
|
||||
Sprite_SplashBase.prototype.updateShow = function () {
|
||||
this.opacity = 255;
|
||||
this.updateShowTime();
|
||||
}
|
||||
|
||||
Sprite_SplashBase.prototype.updateShowTime = function () {
|
||||
this.showTime++;
|
||||
if (this.showTime >= this.SHOW_TIME) {
|
||||
this.state = "fadeOut";
|
||||
}
|
||||
}
|
||||
|
||||
Sprite_SplashBase.prototype.updateFadeOut = function () {
|
||||
this.opacity -= 255 / this.FADE_OUT_FRAMES;
|
||||
if (this.opacity <= 0) {
|
||||
this.opacity = 0;
|
||||
this.state = "fadeIn";
|
||||
this.showTime = 0;
|
||||
|
||||
if (this.index + 1 < SF_SceneSplash.SpriteClassList.length) {
|
||||
var spriteClass = SF_SceneSplash.SpriteClassList[this.index + 1];
|
||||
var sprite = new spriteClass(this.index + 1);
|
||||
this.parent.addChild(sprite);
|
||||
} else {
|
||||
SceneManager.pop();
|
||||
}
|
||||
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
Sprite_SplashBase.prototype.centerSelf = function () {
|
||||
this.anchor.x = 0.5;
|
||||
this.anchor.y = 0.5;
|
||||
this.x = Graphics.width / 2;
|
||||
this.y = Graphics.height / 2;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_SplashLogo
|
||||
//=============================================================================
|
||||
|
||||
function Sprite_SplashLogo() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Sprite_SplashLogo.prototype = Object.create(Sprite_SplashBase.prototype);
|
||||
Sprite_SplashLogo.prototype.constructor = Sprite_SplashLogo;
|
||||
|
||||
Sprite_SplashLogo.prototype.initialize = function (index) {
|
||||
Sprite_SplashBase.prototype.initialize.call(this, index);
|
||||
this.bitmap = ImageManager.loadSceneSplash("spalsh_logo");
|
||||
this.centerSelf();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_SplashHealthTip
|
||||
//=============================================================================
|
||||
|
||||
function Sprite_SplashHealthTip() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Sprite_SplashHealthTip.prototype = Object.create(Sprite_SplashBase.prototype);
|
||||
Sprite_SplashHealthTip.prototype.constructor = Sprite_SplashHealthTip;
|
||||
|
||||
Sprite_SplashHealthTip.prototype.initialize = function (index) {
|
||||
Sprite_SplashBase.prototype.initialize.call(this, index);
|
||||
this.bitmap = ImageManager.loadSceneSplash("spalsh_health_tip");
|
||||
this.centerSelf();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_SplashAdapted
|
||||
//=============================================================================
|
||||
|
||||
function Sprite_SplashAdapted() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Sprite_SplashAdapted.prototype = Object.create(Sprite_SplashBase.prototype);
|
||||
Sprite_SplashAdapted.prototype.constructor = Sprite_SplashAdapted;
|
||||
|
||||
Sprite_SplashAdapted.prototype.initialize = function (index) {
|
||||
Sprite_SplashBase.prototype.initialize.call(this, index);
|
||||
this.bitmap = ImageManager.loadSceneSplash("splash_adapted");
|
||||
this.centerSelf();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_SplashEnd
|
||||
//=============================================================================
|
||||
|
||||
function Sprite_SplashEnd() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Sprite_SplashEnd.prototype = Object.create(Sprite_SplashBase.prototype);
|
||||
Sprite_SplashEnd.prototype.constructor = Sprite_SplashEnd;
|
||||
|
||||
Sprite_SplashEnd.prototype.initialize = function (index) {
|
||||
Sprite_SplashBase.prototype.initialize.call(this, index);
|
||||
SceneManager.pop();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Sprite Class for Scene Splash
|
||||
//=============================================================================
|
||||
|
||||
SF_SceneSplash.SpriteClassList = [
|
||||
Sprite_SplashLogo, Sprite_SplashHealthTip, Sprite_SplashAdapted, Sprite_SplashEnd
|
||||
];
|
||||
|
||||
//=============================================================================
|
||||
// Scene_Splash
|
||||
//=============================================================================
|
||||
|
||||
function Scene_Splash() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
window.Scene_Splash = Scene_Splash;
|
||||
SF_SceneSplash.Scene_Splash = Scene_Splash;
|
||||
|
||||
Scene_Splash.prototype = Object.create(Scene_Base.prototype);
|
||||
Scene_Splash.prototype.constructor = Scene_Splash;
|
||||
|
||||
Scene_Splash.prototype.initialize = function () {
|
||||
Scene_Base.prototype.initialize.call(this);
|
||||
}
|
||||
|
||||
Scene_Splash.prototype.create = function () {
|
||||
Scene_Base.prototype.create.call(this);
|
||||
this.createBackground();
|
||||
this.createSplash();
|
||||
}
|
||||
|
||||
Scene_Splash.prototype.createBackground = function () {
|
||||
var bitmap = new Bitmap(Graphics.width, Graphics.height);
|
||||
bitmap.fillAll("white");
|
||||
this._backgroundSprite = new Sprite(bitmap);
|
||||
this.addChild(this._backgroundSprite);
|
||||
}
|
||||
|
||||
Scene_Splash.prototype.createSplash = function () {
|
||||
var spriteClass = SF_SceneSplash.SpriteClassList[0];
|
||||
var sprite = new spriteClass(0);
|
||||
this.addChild(sprite);
|
||||
}
|
||||
|
||||
Scene_Splash.prototype.start = function () {
|
||||
Scene_Base.prototype.start.call(this);
|
||||
}
|
||||
|
||||
Scene_Splash.prototype.update = function () {
|
||||
Scene_Base.prototype.update.call(this);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// SceneManager
|
||||
//=============================================================================
|
||||
|
||||
SF_SceneSplash.SceneManager_initialize = SceneManager.initialize;
|
||||
SceneManager.initialize = function () {
|
||||
SF_SceneSplash.SceneManager_initialize.apply(this, arguments);
|
||||
this.addSceneBefore(Scene_Splash, Scene_Title);
|
||||
}
|
||||
|
||||
})();
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue