我在安装完成,运行游戏的时候,发生了这样的问题:
接下来的是【例外通知】中的内容:
// KAGLayer.tjs - KAG 偺儗僀儎偺婎杮僋儔僗
// Copyright (C)2001-2003, W.Dee 夵曄丒攝晍偼帺桼偱偡
/*
儗僀儎娭楢偺僋儔僗奒憌
Layer ( 媑棦媑棦僱僀僥傿償僋儔僗 )
|
+-- KAGLayer ( 偙偺僼傽僀儖 )
|
+-- AnimationLayer ( AnimationLayer.tjs )
| |
| +-- ClickGlyphLayer ( AnimationLayer.tjs )
| |
| +-- GraphicLayer ( GraphicLayer.tjs )
| |
| +-- BaseLayer ( GraphicLayer.tjs )
| |
| +-- CharacterLayer ( GraphicLayer.tjs )
|
+-- MessageLayer ( MessageLayer.tjs )
|
+-- ButtonLayer ( ButtonLayer.tjs )
| |
| +-- LinkButtonLayer ( MessageLayer.tjs )
| |
| +-- LButtonLayer ( HistoryLayer.tjs )
|
+-- EditLayer ( EditLayer.tjs )
| |
| +-- LinkEditLayer ( MessageLayer.tjs )
|
+-- CheckBoxLayer ( CheckBoxLayer.tjs )
|
+-- LinkCheckBoxLayer ( MessageLayer.tjs )
*/
/*
丂偪傚偭偲傢偐傝偯傜偄丄僩儔儞僕僔儑儞廔椆帪偺摦嶌偵偮偄偰妎偊彂偒
丂媑棦媑棦偼僩儔儞僕僔儑儞廔椆帪偵丄僩儔儞僕僔儑儞尦(src=憡庤)偑偁傞応崌偼丄
巕儗僀儎傪娷傓(children=true)応崌偼憡庤偲僣儕乕偛偲帺暘帺恎偺儗僀儎傪岎姺偟丄
巕儗僀儎傪娷傑側偄(children=false)応崌偼丄巕偺愨懳揑側僣儕乕忋偺埵抲偼偦偺
傑傑偵偟偰憡庤偲擖傟懼傢傞丅
丂巕儗僀儎傪娷傑側偄僩儔儞僕僔儑儞傪峴偊傞偺偼攚宨儗僀儎偺傒丅
僩儔儞僕僔儑儞傪峴偆偲丄忋婰偵偍偗傞乽擖傟懼偊乿傪峴偆偑丄媑棦媑棦杮懱偺
擖傟懼偊丄偼 name 側偳偺廳梫側忣曬傕擖傟懼偊偰偟傑偆偺偱丄
GraphicLayer.exchangeInfo 偱撪梕傪岎姺偡傞丅
傑偨丄trans 懏惈偱 exchange=true 偑巜掕偝傟偨応崌偼丄椉幰偺儗僀儎偼擖傟懼傢
傞偑丄exchange=false (僨僼僅儖僩) 偑巜掕偝傟偨応崌偼丄僩儔儞僕僔儑儞尦(src)
偐傜僩儔儞僕僔儑儞愭傊偺忣曬偺僐僺乕傪峴傢側偄偲側傜側偄丅
src側偟 偺帪偼儗僀儎扨撈偱偺僩儔儞僕僔儑儞偑峴傢傟傞偺偱偙傟傜偺峫椂偼
昁梫側偄偑丄廔椆帪偵偼巕儗僀儎偑偡傋偰旕昞帵偵側傞丅
丒儊僢僙乕僕儗僀儎丄慜宨儗僀儎偑丄src側偟偱僩儔儞僕僔儑儞 (children=true)
丂壗傕偟側偔偰傛偄偑丄廔椆屻偦傟傜偺巕儗僀儎偼帺摦揑偵旕昞帵偵側傞丅
丒儊僢僙乕僕儗僀儎丄慜宨儗僀儎偑丄src偁傝偱僩儔儞僕僔儑儞 (children=true)
丂廳梫側忣曬傪僩儔儞僕僔儑儞尦偲岎姺丄exchange=false 偺応崌偼偝傜偵
丂僩儔儞僕僔儑儞尦偺忣曬傪僩儔儞僕僔儑儞愭偵僐僺乕丅偨偩偟丄偙偺僐僺乕偺嵺偵
丂僂傿儞僪僂偺壜帇丒晄壜帇偺忣曬偼僐僺乕偟側偄丅
丒攚宨儗僀儎偑src側偟偱僩儔儞僕僔儑儞(children=true)
丂壗傕偟側偔偰傛偄偑丄廔椆帪偵巕儗僀儎偼旕昞帵偵側傞丅
丒攚宨儗僀儎偑src側偟偱僩儔儞僕僔儑儞(children=false)
丂杮摉偵壗傕偟側偄丅
丒攚宨儗僀儎偑src偁傝偱僩儔儞僕僔儑儞(children=true)
丂廳梫側忣曬傪僩儔儞僕僔儑儞尦偲岎姺丄偟偐傕巕儗僀儎偵懳偟偰傕偙偺
丂乽廳梫側忣曬傪憡庤偲岎姺乿偺巜帵傪弌偡丅exchange=false 偺応崌偼偝傜偵
丂僩儔儞僕僔儑儞尦偺忣曬傪僩儔儞僕僔儑儞愭偵僐僺乕丅偙傟傕丄巕儗僀儎偡傋偰
丂偵懳偟偰傕巜帵偡傞丅
丒攚宨儗僀儎偑src偁傝偱僩儔儞僕僔儑儞(children=false)
丂廳梫側忣曬傪僩儔儞僕僔儑儞尦偲岎姺丅巕儗僀儎偵懳偟偰偼
丂乽廳梫側忣曬傪憡庤偲岎姺乿偺巜帵傪偩偝側偄丅exchange=false 偺応崌偼
丂偝傜偵僩儔儞僕僔儑儞尦偺忣曬傪僩儔儞僕僔儑儞愭偵僐僺乕丅
丂偙傟傕巕儗僀儎偵懳偟偰偼巜帵偟側偄丅
*/
class KAGLayerORIGINAL extends Layer
{
// KAG 偱梡偄傞攚宨/慜宨儗僀儎丄儊僢僙乕僕儗僀儎丄儃僞儞儗僀儎側偳偺婎杮僋儔僗
var inTransition = false; // 僩儔儞僕僔儑儞拞偐
var transExchange = false; // 僩儔儞僕僔儑儞廔椆帪偵擖傟懼偊傪峴偆偐
var transWithChildren = false; // 僩儔儞僕僔儑儞偼巕儗僀儎傕娷傔偰峴偆偐
var moveObject; // 尰嵼恑峴拞偺帺摦堏摦梡僆僽僕僃僋僩(恑峴偟偰偄側偄偲偒偼void)
function KAGLayerORIGINAL(win, par)
{
super.Layer(win, par);
}
function finalize()
{
invalidate moveObject if moveObject !== void;
super.finalize(...);
}
function setOptions(elm)
{
// elm 偵廬偭偰儗僀儎偺僆僾僔儑儞傪愝掕
visible = +elm.visible if elm.visible !== void;
left = +elm.left if elm.left !== void;
top = +elm.top if elm.top !== void;
opacity = +elm.opacity if elm.opacity !== void;
if(elm.modal !== void)
{
// this would not work well
var modal = elm.modal;
if(modal) setMode(), focus(); else removeMode();
}
absolute = +elm.index if elm.index !== void;
}
function loadImages(storage, key)
{
// loadImages 僆乕僶乕儔僀僪
key = adjustColorKey(key);
super.loadImages(storage, key);
}
function adjustColorKey(key)
{
// 暥帤楍偱梌偊傜傟偨僇儔乕僉乕偺曄姺
if(key === void)
key = clNone;
else if(typeof key == "String")
{
if(key == "adapt")
key = clAdapt; // adaptive color key
else
{
if(key.length >= 7)
key = +key;
else
key = +key + 0x3000000; // 0x3000000 = 僷儗僢僩僀儞僨僢僋僗偵傛傞巜掕
}
}
return key;
}
function assignImages(src, copyvisiblestate = false)
{
// assignImages 僆乕僶乕儔僀僪
// src 偺乽栚偵尒偊傞乿忣曬傪偙偺儗僀儎偵僐僺乕偡傞
// 僐僺乕偝傟傞撪梕偼丄
// 丒摟柧搙
// 丒埵抲
// 丒昞帵僒僀僘
// 丒儗僀儎撪夋憸昞帵埵抲(imageLeft, imageTop)
// ( 忋婰俁偮偼 copyvisiblestate = true 偺偽偁偄 )
// 丒夋憸僒僀僘
// 丒儗僀儎夋憸丄椞堟夋憸
super.assignImages(src);
if(copyvisiblestate)
{
var su = super;
su.visible = src.visible;
su.opacity = src.opacity;
su.absolute = src.absolute if !src.isPrimary && src.parent.absoluteOrderMode;
su.type = src.type;
su.setPos(src.left, src.top, src.width, src.height);
su.setImagePos(src.imageLeft, src.imageTop);
}
}
function assignVisibleState(src)
{
// src 偐傜忋婰 assignImages 偺偆偪丄copyvisiblestate = true 偵
// 偟偨偲偒偩偗偵僐僺乕偝傟傞忣曬傪僐僺乕
visible = src.visible;
opacity = src.opacity;
absolute = src.absolute if !src.isPrimary && src.parent.absoluteOrderMode;
type = src.type;
setPos(src.left, src.top, src.width, src.height);
setImagePos(src.imageLeft, src.imageTop);
}
function beginTransition(elm, src)
{
// beginTransition 僆乕僶乕儔僀僪
// elm 偵廬偄丄僩儔儞僕僔儑儞傪奐巒偡傞
// src 偵偼僩儔儞僕僔儑儞偺憡庤傪巜掕
// stopTransition(); // 尰嵼偺僩儔儞僕僔儑儞偼掆巭
if(elm.exchange !== void) transExchange = +elm.exchnge; else transExchange = false;
var method = elm.method;
if(elm.time !== void)
{
elm.time = 1 if +elm.time == 0; // 帪娫偵 0 偼巜掕偱偒側偄偺偱
}
if(method === void)
{
method = 'universal'; // 僨僼僅儖僩偱儐僯僶乕僒儖
}
else if(method == 'scroll')
{
// 僷儔儊乕僞偺曄姺
switch(elm.from)
{
case 'left': elm.from = sttLeft; break;
case 'top': elm.from = sttTop; break;
case 'right': elm.from = sttRight; break;
case 'bottom': elm.from = sttBottom; break;
}
switch(elm.stay)
{
case 'nostay': elm.stay = ststNoStay; break;
case 'stayback': elm.stay = ststStaySrc; break;
case 'stayfore': elm.stay = ststStayDest; break;
default: elm.stay = ststNoStay; break;
}
}
var withchildren = elm.children;
if(withchildren === void)
withchildren = true;
else
withchildren = +withchildren;
transWithChildren = withchildren;
inTransition = true;
window.transCount++; // 恑峴拞偺僩儔儞僕僔儑儞偺悢傪憹傗偡
super.beginTransition(method, withchildren, src, elm);
}
function onTransitionCompleted(dest, src)
{
super.onTransitionCompleted(...);
if(window != null)
{
inTransition = false;
window.transCount--; // 恑峴拞偺僩儔儞僕僔儑儞偺悢傪尭傜偡
atEndOfTransition(src, transWithChildren, transExchange);
window.onLayerTransitionCompleted(this, dest, src);
}
}
function atEndOfTransition(src, withchildren, exchange)
{
// 昁梫偵墳偠偰 僆乕僶乕儔僀僪偡傞偙偲
// 僩儔儞僕僔儑儞偑廔椆偟偨偲偒偵屇偽傟傞丅
// 儗僀儎扨撈偱僩儔儞僕僔儑儞偑峴傢傟偨応崌偼 src 偼 null 偵側傞丅
// 偦偆偱側偄応崌丄exchange 偑 true 偺帪偼丄src 偲 帺暘偺撪梕
// 傪庢傝懼偊丄偦偆偱側偗傟偽 src 偵帺暘偺撪梕
// 傪僐僺乕丅
// 巕儗僀儎傕娷傔偰僩儔儞僕僔儑儞偑峴傢傟偨応崌偼 withchildren 偑
// true 偵側傞丅
// root 偼丄僩儔儞僕僔儑儞偺戝杮偵懳偟偰屇偽傟傞偲偒偵 true 偵側傞丅
}
function beginMove(elm)
{
// elm 偵廬偄帺摦堏摦傪奐巒偡傞
stopMove();
// path 偺暘夝
var array = [].split("(), ", elm.path, , true);
for(var i = array.count-1; i>=0; i--) array[i+3] = +array;
array[0] = left;
array[1] = top;
array[2] = opacity;
// 堏摦梡僆僽僕僃僋僩偺嶌惉
if(elm.spline !== void && +elm.spline)
{
// 僗僾儔僀儞曗娫
moveObject = new SplineMover(this, array, +elm.time,
elm.accel === void ? 0 : +elm.accel, moveFinalFunction);
}
else
{
// 捈慄曗娫
moveObject = new LinearMover(this, array, +elm.time,
elm.accel === void ? 0 : +elm.accel, moveFinalFunction);
}
window.moveCount++;
moveObject.startMove(+elm.delay);
}
function moveFinalFunction()
{
// 帺摦堏摦偑廔椆偡傞偲偒偵屇偽傟傞娭悢
window.moveCount--;
window.onLayerMoveStop();
}
function stopMove()
{
if(moveObject !== void) invalidate moveObject, moveObject = void;
}
function store()
{
// 帿彂攝楍偵尰嵼偺忬懺傪曐懚偡傞
var dic = %[];
dic.left = left;
dic.top = top;
dic.width = width;
dic.height = height;
dic.imageWidth = imageWidth;
dic.imageHeight = imageHeight;
dic.opacity = opacity;
dic.visible = visible;
dic.imageLeft = imageLeft;
dic.imageTop = imageTop;
dic.absolute = absolute;
dic.type = type;
return dic;
}
function restore(dic)
{
// 帿彂攝楍 dic 偐傜忣曬傪撉傒弌偟丄偙偺儗僀儎偵愝掕偡傞
setImageSize(dic.imageWidth, dic.imageHeight);
setPos(dic.left, dic.top, dic.width, dic.height);
setImagePos(dic.imageLeft, dic.imageTop);
opacity = dic.opacity;
visible = dic.visible;
absolute = dic.absolute if !isPrimary && dic.absolute !== void;
type = dic.type if !isPrimary && dic.type !== void;
}
}
※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
/*----------------------------------------------------------------------------/
/ Copyright (C) TYPE-MOON All Rights Reserved.
/ KAG僔僗僥儉偺僆乕僶乕儔僀僪
/----------------------------------------------------------------------------*/
kagVersion = "3 customized";
// 棫偪埵抲曗惓抣偺庢傝崬傒
var correctLeft;
if(Storages.isExistentStorage("correct.ksc"))
correctLeft = Scripts.evalStorage("correct.ksc");
Scripts.execStorage("SystemMessages.tjs");
Scripts.execStorage( "YesNoLayer.tjs" );
Scripts.execStorage("ExButtonLayer.tjs");
Scripts.execStorage("ScrollBarLayer.tjs");
Scripts.execStorage("subroutine.tjs");
// SE偺巜掕
global.clickSE = "僐儞僼傿僌-寛掕.wav";
global.okSE = "僞僀僩儖-寛掕.wav";
global.cancelSE= "僐儞僼傿僌-寛掕.wav";
Plugins.link("util.dll");
/*----------------------------------------------------------------------------/
/ KAGWindow
/----------------------------------------------------------------------------*/
class KAGWindow extends KAGWindowORIGINAL
{
var userChSpeed = 15; // 僨僼僅儖僩愝掕(僥僉僗僩懍搙)
var numBookMarks = 20;
var bookmarkName = "婰壇";
var loadActionName = "傪偨偳";
var loadActionNameLast = "傜傝傞傟傠";
var saveActionName = "偵偺偙";
var saveActionNameLast = "偝偟偡偣偦";
var thumbnailWidth = 133;
var fullcolorThumbnail = false;
var forelayers_count; // 棫偪奊偺悢
// 梙傟(梙傟尭悐張棟偺偨傔)
var quakeStartTick;
var finishQuake;
var lastQuakeX, lastQuakeY; // 捈慜偺梙傟
// 徴寕
var shocking;
var shockVertMax, shockHorzMax;
var finishShock;
var shockRotate, shockStartTick, shockEndTick, lastShockTick;
var pauseQuaking;
var lastShockX, lastShockY; // 捈慜偺徴寕
var returnOriginalPosition; // 尦偺埵抲偵棫偪奊傪栠偡偐丠
// 僥僉僗僩棜楌傪昞帵偟偰傕椙偄偐丠
var historyEnabled;
// 僋儕僢僋儕僺乕僩
var clickRepeatTimer; // 僆乕僩僋儕僢僋僞僀儅乕
var clickRepeatTime1st = 500; // 僆乕僩僋儕僢僋偵擖傞傑偱偺娫妘(弶夞)
var clickRepeatTime = 100; // 僆乕僩僋儕僢僋娫妘
var isClickIfStable; // Stable偺帪偩偗僋儕僢僋偡傞偐丠
var _isClickRepeat; // 僆乕僩僋儕僢僋拞偐丠(mouse on->true/mouse off->false)
var isClickRepeatPause; // 僆乕僩僋儕僢僋偺堦帪掆巭拞偐?
var lastMessageLeft, lastMessageTop;
// 抧暯慄偺崅偝(0側傜夋柺壓抂:0<側傜忋偑傞:0>側傜壓偑傞)
var _horizon = 0;
var savedataHistoryCount = 3;
var inputDevice = "mouse";
var noConcurrentKeys = %[
/* VK_CONTROL=>1, VK_LCONTROL=>1, VK_RCONTROL=>1,
VK_SHIFT=>1, VK_LSHIFT=>1, VK_RSHIFT=>1,
VK_DELETE=>1, VK_BACK=>1, VK_ESCAPE=>1, VK_HOME=>1,
*/
VK_UP=>1, VK_DOWN=>1, VK_LEFT=>1, VK_RIGHT=>1,
]; // 儅僂僗偲暪梡偟側偄僉乕
var noFlipCursor = false; // (僉乕偑墴偝傟偨帪偵)僇乕僜儖傪抏偒旘偽偝側偄
var isChangedAfterSaving = false; // 僙乕僽偟偰偐傜儔儀儖傪捠夁偟偨
var isPossibleChangeScreen = true;
function KAGWindow()
{
super.KAGWindowORIGINAL(...);
freeSaveDataMode = false; // 嵟弶偼true偵偟偰偍偄偰丄昞帵傪曄偊偰偍偔\r
historyEnabled = true; // 僥僉僗僩棜楌偼昞帵偡傞\r
forelayers_count = numCharacterLayers; // 尰帪揰偺慜宨儗僀儎乕悢偑棫偪奊偺悢
}
function finalize()
{
release(clickRepeatTimer);
super.finalize(...);
}
function internalStoreFlags(f)
{
super.internalStoreFlags(...);
// quake, shocking娭楢
/* f.shocking = shocking;
f.shockVertMax = shockVertMax;
f.shockHorzMax = shockHorzMax;
f.finishShock = finishShock;
f.shockRotate = shockRotate;
f.shockStartTick= shockStartTick;
f.shockEndTick = shockEndTick;
f.lastShockTick = lastShockTick;
f.pauseQuaking = pauseQuaking;
f.lastShockX = lastShockY;
*/ f.quakeStartTick= quakeStartTick;
f.finishQuake = finishQuake;
f.lastQuakeX = lastQuakeX;
f.lastQuakeY = lastQuakeY;
f.returnOriginalPosition = returnOriginalPosition;
}
function internalRestoreFlags(f, clear = true, elm = void)
{
// quake, shocking娭楢
/* shocking = f.shocking if f.shocking!==void;
shockVertMax = f.shockVertMax if f.shockVertMax!==void;
shockHorzMax = f.shockHorzMax if f.shockHorzMax!==void;
finishShock = f.finishShock if f.finishShock!==void;
shockRotate = f.shockRotate if f.shockRotate!==void;
shockStartTick = f.shockStartTick if f.shockStartTick!==void;
shockEndTick = f.shockEndTick if f.shockEndTick!==void;
lastShockTick = f.lastShockTick if f.lastShockTick!==void;
pauseQuaking = f.pauseQuaking if f.pauseQuaking!==void;
lastShockY = f.lastShockX if f.lastShockX!==void;
*/ quakeStartTick = f.quakeStartTick if f.quakeStartTick!==void;
finishQuake = f.finishQuake if f.finishQuake!==void;
lastQuakeX = f.lastQuakeX if f.lastQuakeX!==void;
lastQuakeY = f.lastQuakeY if f.lastQuakeY!==void;
returnOriginalPosition = f.returnOriginalPosition if f.returnOriginalPosition!==void;
super.internalRestoreFlags(...);
}
function calcThumbnailSize()
{
// 僒儉僱僀儖偺僒僀僘傪寁嶼偡傞
// 墶暆偼 thumbnailWidth 偵
var ratio = scHeight / scWidth;
var w = thumbnailWidth;
var h = (int)(w * ratio);
// 僒儉僱僀儖梡價僢僩儅僢僾偺僒僀僘傪寁嶼
var size;
if(fullcolorThumbnail)
size = ((((w - 1) >> 2) + 1) << 2) * h * 3 + 54;
else
size =
((((w - 1) >> 2) + 1) << 2) * h +
1024 + 54;
return %[width : w, height : h, size : size];
}
// 僔僗僥儉曄悢偺撉傒崬傒
function internalLoadSystemVariables(filename)
{
var lsfn = filename+".last";
var fnsz = GetFileSize(filename);
var lssz = GetFileSize(lsfn);
var flag;
var failed = "";
// 僼傽僀儖偑懚嵼偟側偄偺偱丄嵟弶偐傜
if(fnsz<0 && lssz<0)
return %[];
// 儅僗僞乕僨乕僞傪奐偔丅幐攕偡傞傛偆側傜僶僢僋傾僢僾傪奐偔
try
{
flag = Scripts.evalStorage(filename);
flag = %[] if flag === void;
DeleteFile(lsfn) if lssz>=0;
MoveFile(filename, lsfn); // 夡傟偰偄側偄僨乕僞偵栠偟偰偍偔
dm(filename+" to "+lsfn);
}
catch(e)
{
try
{
flag = Scripts.evalStorage(lsfn);
flag = %[] if flag === void;
DeleteFile(filename) if fnsz>=0;
MoveFile(lsfn, filename); // 夡傟偰偄側偄僨乕僞偵栠偟偰偍偔
dm(lsfn+" to "+filename);
}
catch(e)
{
failed = e.message;
}
}
if(failed!="")
{
msg = "僔僗僥儉曄悢僨乕僞偲偦偺僶僢僋傾僢僾偺偄偢傟傕偑攋懝偟偰偄傑偡丅\n"
"("+e.message+")\n\""+filename+"\"偲\n\""+lsfn+"\"偺\n"
"擇偮偺僼傽僀儖偼攋婞偟偰偔偩偝偄丅";
System.inform(msg);
System.exit();
}
return flag;
}
function loadSystemVariables()
{
// 奺僔僗僥儉曄悢傪撉傒崬傓
scflags = internalLoadSystemVariables(saveDataLocation + "/" + dataName + "sc.ksd");
sflags = internalLoadSystemVariables(saveDataLocation + "/" + dataName + "su.ksd");
return;
}
function setSystemStateFromSystemVariables()
{
// 戅旔偟偰偄偨忣曬傪暅婣偝偣傞
super.setSystemStateFromSystemVariables(...);
historyEnabled = scflags.historyEnabled if scflags.historyEnabled!==void;
// 僼僅儞僩娭楢
current.defaultBold = scflags.defaultBold if scflags.defaultBold!==void;
current.defaultRubyBold = scflags.defaultRubyBold if scflags.defaultRubyBold!==void;
setMessageLayerFontBold();
// 僂傿儞僪僂埵抲偺暅婣
left = scflags.lastWindowLeft if scflags.lastWindowLeft !== void;
top = scflags.lastWindowTop if scflags.lastWindowTop !== void;
// 愝掕傪斀塮偡傞
setVolume();
}
function saveSystemVariables()
{
// 捈慜偺僼傽僀儖傪曐懚偡傞
var fn = saveDataLocation + "/" + dataName + "sc.ksd";
if(GetFileSize(fn)>GetFileSize(fn+".last"))
{// .last僼傽僀儖偺曽偑僒僀僘偑戝偒偗傟偽丄曐懚偟側偄
DeleteFile(fn+".last") if Storages.isExistentStorage(fn+".last");
MoveFile(fn, fn+".last");
}
var fn = saveDataLocation + "/" + dataName + "su.ksd";
if(GetFileSize(fn)>GetFileSize(fn+".last"))
{
DeleteFile(fn+".last") if Storages.isExistentStorage(fn+".last");
MoveFile(fn, fn+".last");
}
// 尰嵼偺愝掕傪戅旔偡傞
scflags.historyEnabled = historyEnabled;
// 僼僅儞僩娭楢
scflags.defaultBold = current.defaultBold;
scflags.defaultRubyBold = current.defaultRubyBold;
// 僂傿儞僪僂埵抲偺婰榐
scflags.lastWindowLeft = left;
scflags.lastWindowTop = top;
super.saveSystemVariables(...);
}
function setVolume()
{
// BGM,SE偺戝堟壒検傪峏怴偡傞
with(scflags)
{
var bgmVol = int(.bgmVolume * .globalVolume / 100);
var seVol = int(.seVolume * .globalVolume / 100);
bgm.setOptions(%["gvolume" => bgmVol]);
for(var i = 0; i < numSEBuffers; i++)
se.setOptions(%["gvolume" => seVol]);
// dm("BGM壒検: "+bgmVol+" % / SE壒検: "+seVol+" %");
}
}
function setMessageLayerUserFont()
{
super.setMessageLayerUserFont(...);
// 偮偄偱偵儃乕儖僪傕愝掕偡傞(偙傟偼current偐傜帩偭偰偔傞)
setMessageLayerFontBold();
}
function setMessageLayerFontBold()
{
var messages;
var bold = current.defaultBold;
var rubybold = current.defaultRubyBold;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--)
messages.defaultBold = bold,
messages.defaultRubyBold = rubybold;
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--)
messages.defaultBold = bold,
messages.defaultRubyBold = rubybold;
}
function saveBookMarkToFile(fn, savehist = true)
{
// 僼傽僀儖 fn 偵瀤傪曐懚偡傞
if(readOnlyMode) return false;
pcflags.storeTime = (new Date()).getTime(); // 擔晅傪曐懚
// 僙乕僽僨乕僞傪傑偲傔傞
var data = %[];
data.id = saveDataID;
data.core = pcflags;
data.user = pflags;
if(savehist) data.history = historyOfStore;
if(saveThumbnail)
{
// 僒儉僱僀儖傪曐懚
lockSnapshot();
try
{
// 僒儉僱僀儖偺僒僀僘傑偱弅彫
var size = calcThumbnailSize();
var tmp = new Layer(this, primaryLayer);
try
{
tmp.setImageSize(size.width, size.height);
tmp.face = dfBoth;
tmp.stretchCopy(0, 0, size.width, size.height, snapshotLayer,
0, 0, snapshotLayer.imageWidth, snapshotLayer.imageHeight, stLinear);
/*
// 僒儉僱僀儖夋憸傪僙僺傾挷偵偟偰曐懚偡傞応崌偼偙偙傪僐儊儞僩傾僂僩
tmp.doGrayScale();
tmp.adjustGamma(
1.3, 0, 255, // R gamma, floor, ceil
1.0, 0, 255, // G gamma, floor, ceil
0.8, 0, 255); // B gamma, floor, ceil
*/
// 傢偄偣偮偲敾抐偝傟偦偆側夋憸(/[ABC]H.*/)偑昞帵偝傟偰偄偨傜丄儌僓僀僋
var st = kag.fore.base.Anim_loadParams.storage.toUpperCase();
if(st[1]=="H" && (st[0]=="A" || st[0]=="B" ||st[0]=="C"))
{
// 儌僓僀僋壔
var step = 4; // 2偺攞悢
var pixs = 2; // step = 1 << pixs
for(var y=0; y<size.height; y+=step)
{
for(var x=0; x<size.width; x+=step)
{
/* var rc=0, gc=0, bc=0; // 偪傖傫偲偟偨儌僓僀僋(抶偄/拤幚)
var yi=y+step-1, xi=x+step-1;
yi = size.height-1 if yi>=size.height;
xi = size.width-1 if xi>=size.width;
for(; yi>=y; yi--)
{
for(; xi>=x; xi--)
{
var pix = tmp.getMainPixel(xi, yi);
rc += (pix >> 16) & 0xFF;
gc += (pix >> 8) & 0xFF;
bc += (pix ) & 0xFF;
}
}
var col = (((rc >> pixs)&0xFF)<<16) |
(((gc >> pixs)&0xFF)<<8) |
((bc >> pixs)&0xFF);
*/
var col = tmp.getMainPixel(x, y); // 娙堈怓寛掕(憗偄/庒姳棊偪傞)
tmp.fillRect(x, y, step, step, 0xFF000000|col);
}
}
}
try
{
if(fullcolorThumbnail)
tmp.saveLayerImage(fn, "bmp24");
else
tmp.saveLayerImage(fn, "bmp8");
// 僨乕僞傪曐懚
var mode = saveDataMode;
mode += "o" + size.size; // 儌乕僪暥帤楍偵 彂偒崬傒僆僼僙僢僩傪巜掕
(Dictionary.saveStruct incontextof data)(fn, mode);
}
catch(e)
{
System.inform("僼傽僀儖偵曐懚偱偒傑偣傫 (僼傽僀儖傪奐偗側偄偐丄"
"彂偒崬傒嬛巭偱偡)");
return false;
}
}
catch(e)
{
invalidate tmp;
throw e;
}
invalidate tmp;
}
catch(e)
{
unlockSnapshot();
throw e;
}
unlockSnapshot();
}
else
{
// 捠忢偺僼傽僀儖偵曐懚
try
{
(Dictionary.saveStruct incontextof data)(fn, saveDataMode);
}
catch(e)
{
System.inform("僼傽僀儖偵曐懚偱偒傑偣傫 (僼傽僀儖傪奐偗側偄偐丄"
"彂偒崬傒嬛巭偱偡)");
return false;
}
}
isChangedAfterSaving = false; // 僎乕儉偑僙乕僽偝傟偨忬懺
return true;
}
function loadBookMarkFromFile(fn, loaduser = true)
{
// 僼傽僀儖 fn 偐傜瀤傪撉傒崬傓
// loaduser 偑 false 偺帪偼 user 傪撉傒崬傑側偄
try
{
if(!Storages.isExistentStorage(fn)) return false; //僼傽僀儖偑側偄
var data;
var modestr;
if(saveThumbnail)
{
// 巜掕僆僼僙僢僩偐傜僨乕僞傪撉傒崬傓
modestr += "o" + calcThumbnailSize().size;
}
data = Scripts.evalStorage(fn, modestr);
if(data.id != saveDataID)
{
System.inform("懠偺僔僗僥儉偺僨乕僞傪撉傒崬傕偆偲偟傑偟偨", "僄儔乕");
return false;
}
pcflags = data.core;
pcflags = %[] if pcflags === void;
if(loaduser)
{
pflags = data.user;
pflags = %[] if pflags === void;
}
else
{
(Dictionary.assignStruct incontextof pflags)(flags);
}
historyOfStore = data.history;
historyOfStore = [] if historyOfStore === void;
}
catch(e)
{
throw new Exception(bookmarkName+"傪撉傒崬傔側偄偐丄偁傞偄偼"+bookmarkName+"偑"
"夡傟偰偄傑偡(" + e.message + ")");
}
restoreFlags();
return true;
}
function saveBookMarkWithAsk(num, func=void)
{
// 瀤斣崋 num 偵瀤傪愝掕偡傞
num = +num; dm("save: "+num);
// 偦偺偲偒丄愝掕偡傞偐偳偆偐傪偨偢偹傞
if(readOnlyMode) return false;
var prompt;
if(bookMarkDates[num] == "" && !Storages.isExistentStorage(getBookMarkFileNameAtNum(num)))
// bookMarkDates 偑嬻暥帤偺応崌偼瀤偼懚嵼偟側偄
{
// 忋彂偒偟側偄偲偒偼曐懚偡傞偐暦偔昁梫偑柍偄
saveBookMarkAskOk(true, num, func);
playSound(okSE); // 僙乕僽偑幚峴偝傟偨岠壥壒偲偟偰嵞惗(栤偄崌傢偣偡傞帪偼僟僀傾儘僌懁偱嵞惗偝傟傞)
return true;
}
// 僨乕僞偑懚嵼偡傞帪偵忋彂偒嬛巭僼儔僌偑棫偭偰偄偨傜丄彂偒崬傔側偄
if(bookMarkProtectedStates[num]) return false;
prompt += "乽" + bookMarkNames[num] + "乿[婰榐擔帪:"+bookMarkDates[num]+"]偵\n";
prompt += "乽"+ pcflags.currentPageName + "乿"+saveActionName+saveActionNameLast.substring(1,1)+"傑偡偐?";
askYesNo2(prompt, saveBookMarkAskOk, num, func);
return true;
}
function saveBookMarkAskOk(result, num, func=void)
{
if(result)
{
// release(yesnolayer);
if(saveBookMarkToFile(getBookMarkFileNameAtNum(num), true))
{
// 儊僯儏乕 / bookMarkNames / bookMarkDates 傪峏怴
getBookMarkInfoFromData(pcflags, num);
}
}
func(result) if func != void;
}
function loadBookMarkWithAsk(num, func=void)
{
// 瀤斣崋 num 偐傜瀤傪撉傒弌偡
num = +num; dm("load: "+num);
// 偦偺偲偒丄撉傒弌偡偐偳偆偐傪偨偢偹傞
if(num < numBookMarks && bookMarkDates[num] == "" &&
!Storages.isExistentStorage(getBookMarkFileNameAtNum(num)))
// bookMarkDates 偑嬻暥帤偺応崌偼瀤偼懚嵼偟側偄
return false;
var prompt;
prompt += "乽"+ bookMarkNames[num] + "乿\n[婰榐擔帪:"+bookMarkDates[num]+"]\n"+loadActionName+loadActionNameLast.substring(1,1)+"傑偡偐?";
askYesNo2(prompt, loadBookMarkAskOk, num, func);
}
function loadBookMarkAskOk(result, num, func=void)
{
if(result)
{
// release(yesnolayer);
loadBookMark(num);
func() if func != void;
}
}
function eraseBookMarkWithAsk(num, func=void)
{
// 瀤斣崋 num 傪嶍彍偡傞
num = +num; dm("erase: "+num);
// 偦偺偲偒丄嶍彍偟偰傕椙偄偐傪偨偢偹傞
if(num < numBookMarks && //bookMarkDates[num] == "" &&
!Storages.isExistentStorage(getBookMarkFileNameAtNum(num)))
return false;
var prompt;
if(bookMarkProtectedStates[num])
prompt = "忋彂偒嬛巭偺僨乕僞偱偡偑丄";
prompt += "乽"+ bookMarkNames[num] + "乿\n[婰榐擔帪:"+bookMarkDates[num]+"]傪嶍彍偟傑偡偐丠";
askYesNo2(prompt, eraseBookMarkAskOk, num, func);
}
function eraseBookMarkAskOk(result, num, func=void)
{
if(result)
eraseBookMark(num);
func(result) if func != void;
}
function eraseBookMark(num)
{
// 瀤傪徚偡
// num < numBookMarks 偺帪偵偟偐摦嶌偟側偄傛偆偵側偭偨偺偱拲堄
if(num < numBookMarks)
{
// if(!bookMarkProtectedStates[num])
{
bookMarkNames[num] = void;
bookMarkDates[num] = void;
bookMarkProtectedStates[num] = false;
scflags.bookMarkComments[num] = void if scflags.bookMarkComments!=void;
var fname = getBookMarkFileNameAtNum(num);
DeleteFile(fname);
// 嫮惂揑偵僼傽僀儖僷僗僉儍僢僔儏傪僋儕傾
// (isExistentStorage偑嶍彍偟偨僼傽僀儖傪偁傞偲姩堘偄偡傞偺偱)
Storages.addAutoPath("image/");
Storages.removeAutoPath("image/");
fname = Storages.getPlacedPath(fname);
setBookMarkMenuCaptions();
}
}
}
/*
var mouseArea;
function onMouseMove(x, y, shift)
{
if(mouseArea)
{
var ischanged = false;
with(mouseArea)
{
if(x<.left)
{
x = .left;
// dm("x: "+x+" => "+primaryLayer.cursorX+"("+.left+")");
ischanged = true;
}
else if(x>=.right)
{
x = .right - 1;
// dm("x: "+x+" => "+primaryLayer.cursorX+"("+.right+")");
ischanged = true;
}
if(y<.top)
{
y = .top;
// dm("y: "+y+" => "+primaryLayer.cursorY+"("+.top+")");
ischanged = true;
}
else if(y>=.bottom)
{
y = .bottom - 1;
// dm("y: "+y+" => "+primaryLayer.cursorY+"("+.bottom+")");
ischanged = true;
}
}
if(ischanged)
primaryLayer.setCursorPos(x, y);
else
super.onMouseMove(primaryLayer.cursorX, primaryLayer.cursorY, shift);
}
else
super.onMouseMove(primaryLayer.cursorX, primaryLayer.cursorY, shift);
}
*/
function onMouseMove()
{
inputDevice = "mouse";
super.onMouseMove(...);
}
function onMouseDown(x, y, button, shift)
{
isClickRepeat = true;
inputDevice = "mouse";
super.onMouseDown(...);
}
function onMouseUp(x, y, button, shift)
{
isClickRepeat = false;
super.onMouseUp(...);
}
function onMouseWheel(shift, delta, x, y)
{
// 儂僀乕儖偑夞揮偟偨
global.Window.onMouseWheel(...);
dm(shift+","+delta+","+x+","+y+" enabled="+historyEnabled+" / visible = "+historyLayer.visible);
if(historyEnabled) // 僥僉僗僩棜楌傪昞帵偟偰傕偄偄偲偒\r
{
if(!historyLayer.visible)
{
if(delta > 0)
showHistoryByKey(); // 儊僢僙乕僕棜楌傪昞帵\r
else if(System.getTickCount() - lastHistoryHiddenTick > 150)
onPrimaryClick(); // 僋儕僢僋傪僄儈儏儗乕僩
// 仾 tick 傪斾妑偟偰偄傞偺偼丄儊僢僙乕僕棜楌傪塀偡憖嶌偲儂僀乕儖傪
// 庤慜偵夞偡憖嶌偑楢懕偟偨応崌偵彑庤偵撉傒恑傓偺傪偁傞掱搙杊偖巇妡偗
}
else
{
// 儊僢僙乕僕棜楌偵僀儀儞僩傪悅傟棳偡
historyLayer.windowMouseWheel(shift, delta, x, y);
}
}
}
function onKeyDown(key, shift)
{
// 僉乕擖椡偑偁偭偨傜丄儅僂僗僇乕僜儖傪徚偡\r
if(noConcurrentKeys[key])
{
// 暪梡偡傞僉乕埲奜
if(!noFlipCursor)
{
with(primaryLayer)
.setCursorPos(.width+1, .height+1); // 夋柺奜傊堏摦偝偣傞
}
hideMouseCursor(); inputDevice = "keyboard";
}
// 桪愭搙偺崅偄僉乕擖椡
if(key == VK_RETURN && (shift & ssAlt))
{
// Alt + Enter: 僂傿儞僪僂<->僼儖僗僋儕乕儞愗傝懼偊
dm("change screen mode.");
if(fullScreened)
onWindowedMenuItemClick();
else if(this == kag)
onFullScreenMenuItemClick();
}
else if((key == #'X' && (shift & ssCtrl)) || (key == VK_F4 && (shift &ssAlt)))
{
// Ctrl + X / Alt + F4: 僎乕儉廔椆
onCloseQuery();
}
else
{
if(focusedLayer === null)
internalOnKeyDown(key, shift);
}
}
function processKeys(key, shift)
{
if(checkProceedingKey(key, shift)) return;
if(key == #'F')
{
// 師偺慖戰巿/枹撉傑偱恑傓
skipToNextStopByKey();
return;
}
if(key == #'B')
{
// 慜偵栠傞
goBackByKey();
return;
}
if(key == #'A')
{
// 帺摦揑偵撉傒姪傔傞
switchAutoModeByKey();
return;
}
if(freeSaveDataMode)
{
if(key == #'S')
{
// 瀤傪偼偝傓
if(typeof this.storeMenu != "undefined" && storeMenu.enabled)
storeMenu.click();
return;
}
if(key == #'L')
{
// 瀤傪偨偳傞
if(typeof this.restoreMenu != "undefined" && restoreMenu.enabled)
restoreMenu.click();
return;
}
}
if(key == #'R' || key == VK_UP || key==VK_PRIOR)
{
// 儊僢僙乕僕棜楌傪昞帵\r
showHistoryByKey();
historyLayer.keyDisregardOnce = true;
return;
}
if(isKeyOfSub(key))
{// BackSpace傗Delete僉乕偵傕ESC偲摨偠栶妱傪梌偊傞
// 儊僢僙乕僕傪徚偡
if(typeof this.rightClickMenuItem != "undefined" &&
rightClickMenuItem.enabled)
{
rightClickMenuItem.click(); // 僋儕僢僋傪僄儈儏儗乕僩
return;
}
}
}
function checkProceedingKey(key, shift)
{
// key 偑撉傒偡偡傒偺僉乕偺応崌偼僉乕傪張棟偟丄
// true 傪曉偡丅偦偆偱側偗傟偽 false 傪曉偡
if(sf.skipKey<2)
{
if(isKeyOfPrimary(key))
{
// dm(shift+" & "+ssRepeat+" = "+(shift & ssRepeat)+" / clickSkipEnabled = "+clickSkipEnabled+" / "+conductor.status+" == "+conductor.mRun+" = "+(conductor.status == conductor.mRun));
if((shift & ssRepeat) && clickSkipEnabled)/* &&
conductor.status == conductor.mRun)*/
{
dm("key repeat.");
// 僉乕儕僺乕僩
if(skipMode != 4 && skipKeyRepressed)
skipToStop2(); // 傑偩skipMode 4偵擖偭偰偄側偄応崌偼憗憲傝儌乕僪偵擖傞
// skipKeyRepressed 傪僠僃僢僋偡傞偺偼
// 楢懕偟偰僉乕儕僺乕僩偑敪惗偟偰偄傞偲偒偵
// cancelSkip 屻偵僗僉僢僾偵撍擖偡傞偺傪杊偖偨傔
}
else
{
// dm("key press.");
skipKeyRepressed = true;
onPrimaryClickByKey();
}
return true;
}
}
else
{
var greetkey = [ ,, VK_CONTROL, VK_SHIFT ];
if(key == greetkey[sf.skipKey] && clickSkipEnabled)
{
skipToStop2() if skipMode!=4;
return true;
}
else if(isKeyOfPrimary(key) && (!(shift & ssRepeat)))
{
// Ctrl傗Shift偺帪傕丄Return傗Space偺墴壓偼桳岠
onPrimaryClickByKey();
return true;
}
}
return false;
}
function skipKeyPressing()
{
if(sf.skipKey<2)
// VK_RETURN 偁傞偄偼 VK_SPACE 偑墴偝傟偰偄傞偐偳偆偐
return System.getKeyState(VK_RETURN) || System.getKeyState(VK_SPACE) || System.getKeyState(VK_DOWN);
else if(sf.skipKey<3)
return System.getKeyState(VK_CONTROL);
else if(sf.skipKey<4)
return System.getKeyState(VK_SHIFT);
}
function isKeyOfPrimary(key)
{
// 偙偙偵彂偄偰偁傞僉乕偑墴偝傟傞偲丄愭偵恑傓
// Enter, 伀僉乕, Space
return key==VK_RETURN || key==VK_SPACE || key==VK_DOWN;
}
function isKeyOfSub(key)
{
// 僉儍儞僙儖偟偨傝僒僽儊僯儏乕傪奐偔僉乕
// Escape, Home
return key==VK_ESCAPE || key==VK_HOME;
}
function onJoyStick(trig)
{
// JoyStick擖椡偑偁偭偨傜丄儅僂僗僇乕僜儖傪徚偡\r
with(primaryLayer)
.setCursorPos(.width+1, .height+1); // 夋柺奜傊堏摦偝偣傞
hideMouseCursor(); inputDevice = "joystick";
super.onJoyStick(...);
}
function goToStartWithAsk()
{
askYesNo2(isChangedAfterSaving ? SMsg_saveOrReturn : SMsg_returnTop, onReturnTop);
}
function enterAutoMode()
{
popupMessage("帺摦撉傒恑傒傪奐巒偟傑偡丅") if !autoMode;
super.enterAutoMode(...);
}
function cancelAutoMode()
{
popupMessage("帺摦撉傒恑傒傪廔椆偟傑偡丅") if autoMode;
super.cancelAutoMode(...);
}
function skipToStop()
{
popupMessage("師偺慖戰巿/枹撉傑偱恑傒傑偡丅") if skipMode!=3;
super.skipToStop();
}
function cancelSkip()
{
popupMessage("僗僉僢僾傪僉儍儞僙儖偟傑偡丅") if skipMode==3;
super.cancelSkip(...);
}
function onExitMenuItemClick(sender)
{
onCloseQuery(); // 儊僯儏乕偐傜慖偽傟偨帪傕廔椆偟偰傛偄偐暦偔
}
function onReturnTop(result)
{
if(result)
goToStart();
}
function getHandlers()
{
var funcs = super.getHandlers(); // 杮棃偺柦椷孮傪庢傝弌偡
/// 捛壛柦椷 ///
funcs.shock = doShock;
funcs.stopshock = stopShock;
funcs.wshock = waitShock;
funcs.shockT = doShock;
funcs.shockt = doShock;
/// 儖價(嵍婑偣) ///
funcs.rubyl = function(elm)
{
// 師偺暥帤偵懳偡傞儖價愝掕
if(currentWithBack) current.comp.setRuby(elm.text, "left");
current.setRuby(elm.text, "left");
return 0;
} incontextof this;
funcs.ruby = function(elm)
{
if(currentWithBack) current.comp.setRuby(elm.text);
current.setRuby(elm.text);
if(historyWriteEnabled) historyLayer.storeRuby(elm.text);
return 0;
} incontextof this;
/// 懸偪(僗僉僢僾庴偗擖傟) ///
funcs.wait = function(elm)
{
// wait傕僗僉僢僾傪庴偗擖傟傞
if(!sf.effectSkip && skipMode<2)
return doWait(elm); // 僗僉僢僾忬懺偱側偄偲偒偺傒懸偮
else
return 0;
} incontextof this;
return funcs;
}
function onCloseQuery()
{
saveSystemVariables();
if(!askOnClose) { global.Window.onCloseQuery(true); return; }
var msg = isChangedAfterSaving ? SMsg_saveOrExit : SMsg_exitGame;
if(!MYaskYesNo(this, fore.base, msg, MYclose,,, true))
super.onCloseQuery(false); // 栤偄崌傢偣傞偙偲偑弌棃側偐偭偨
}
function MYclose(result)
{
global.Window.onCloseQuery(result);
if(result)
global.kag = void;
}
function askYesNo2(msg, func, arg1, arg2, defaultcancel=false)
{
MYaskYesNo(this, fore.base, msg, func, arg1, arg2, defaultcancel);
}
function onBackStartMenuItemClick(sender)
{
goBackHistory(false); // 栠傞偐妋擣偟側偄
}
// 僥僉僗僩棜楌傪昞帵偟偰偄傞娫偼丄儊僢僙乕僕儗僀儎乕傪旕昞帵偵偟偰偍偔\r
var isMessageLayerVisible;
function showHistory()
{
super.showHistory(...);
isMessageLayerVisible = kag.fore.messages[0].visible;
kag.fore.messages[0].visible = false; // 儊僢僙乕僕傪旕昞帵偵偡傞\r
}
function hideHistory()
{
if(historyShowing)
{
super.hideHistory(...);
// 儊僢僙乕僕儗僀儎乕傪尦偺忬懺偵栠偡
kag.fore.messages[0].visible = isMessageLayerVisible;
}
}
function doQuake(elm)
{
// 僗僉僢僾拞偼梙傟側偄
if(skipMode>=2) return 0;
// 摿庩岠壥偑僇僢僩偝傟偰偄傞側傜梙傟側偄
if(!sf.speffect) return 0;
// 尰帪揰偱偺儊僢僙乕僕僂傿儞僪僂嵗昗傪曐懚
if(!quaking && !shocking)
{
// 偨偩偟丄梙傟偨傝徴寕傪庴偗偰偄側偄帪
lastMessageLeft = current.left;
lastMessageTop = current.top;
}
// 怳暆偺尭悐
quakeStartTick = System.getTickCount(); // 尭悐傪寁嶼偡傞偨傔偵昁梫
finishQuake = elm.finish!==void ? +elm.finish : 0;
// 棫偪奊傪丄廔傢偭偨帪偵尦偺埵抲偵栠偡偐?
returnOriginalPosition = elm.noreturn!==void ? +elm.noreturn : false;
super.doQuake(...);
}
function onQuakeTimerInterval()
{
// quakeTimer 偵傛傝屇偽傟傞
var tick = System.getTickCount();
if(quakeEndTick != -1 && tick > quakeEndTick) {
stopQuake(); return;
}
if(historyShowing || pauseQuaking)
{
// 儊僢僙乕僕棜楌儗僀儎昞帵拞偼偝偡偑偵梙傟偰偄傜傟側偄
setLayerPos(0, 0);
return;
}
var per;
if(quakeEndTick != -1)
{
// 帪娫偵惂尷偺偁傞帪偩偗尭悐偡傞
per = 1.0-((tick - quakeStartTick) / (quakeEndTick - quakeStartTick)) *
(1.0-finishQuake);
}
else
per = 1.0;
var x, y;
if(quakeHorzMax == quakeVertMax)
{
// 偩偄偨偄摨偠
x = int((Math.random() * quakeHorzMax - quakeHorzMax)*per);
y = int((Math.random() * quakeVertMax - quakeVertMax)*per);
}
else if(quakeHorzMax < quakeVertMax)
{
// 廲梙傟
x = int((Math.random() * quakeHorzMax - quakeHorzMax)*per);
y = int(((quakePhase ? Math.random() : -Math.random()) * quakeVertMax)*per);
}
else
{
// 墶梙傟
x = int(((quakePhase ? Math.random() : -Math.random()) * quakeHorzMax)*per);
y = int((Math.random() * quakeVertMax - quakeVertMax)*per);
}
quakePhase = !quakePhase;
lastQuakeX = x, lastQuakeY = y;
// setLayerPos(x+lastShockX, y+lastShockY);
setAllPos(x+lastShockX, y+lastShockY);
}
function stopQuake()
{
// super.stopQuake(...);
if(quaking)
{
setAllPos(0, 0);
quakeTimer.enabled = false;
quaking = false;
conductor.trigger('quake');
lastQuakeX = lastQuakeY = 0; // 梙傟偑廔椆偟偨傜慜夞抣傪僋儕傾
}
}
function setAllPos(x, y, noSetTachie=false)
{
// 攚宨傪梙傜偡
setLayerPos(x, y);
// 儊僢僙乕僕儗僀儎乕偼梙傜偝側偄
current.setPos(lastMessageLeft-x, lastMessageTop-y);
current.comp.setPos(lastMessageLeft-x, lastMessageTop-y);
// 棫偪奊偼攚宨偺敿暘
if(!noSetTachie)
{
x >>=1, y >>= 1;
var fores = fore.layers, backs = back.layers;
for(var i=forelayers_count-1; i>=0; i--)
{
with(fores) .setPos(.calcLeft()-x, .calcTop()-y) if .visible;
with(backs) .setPos(.calcLeft()-x, .calcTop()-y) if .visible;
}
}
}
function resetAllPos()
{
setAllPos(0, 0, returnOriginalPosition);
}
// sin僇乕僽偱梙傟傞張棟
function doShock(elm)
{
// 僗僉僢僾拞偼梙傟側偄
if(skipMode>=2) return 0;
// 摿庩岠壥偑僇僢僩偝傟偰偄傞側傜梙傟側偄
if(!sf.speffect) return 0;
// 梙傟偺曽岦(巜掕偑柍偗傟偽廲偵10)
shockVertMax = elm.vmax!==void ? +elm.vmax : 0;
shockHorzMax = elm.hmax!==void ? +elm.hmax : 0;
// 張棟帪娫
shockStartTick = System.getTickCount();
shockEndTick = elm.time!==void ? +elm.time : 1000;
// 夞揮悢(1偱兾)
shockRotate = (elm.count!==void ? +elm.count : 2) * Math.PI;
// 嵟廔揑側怳暆
finishShock = elm.finish!==void ? +elm.finish : 0;
// 尰帪揰偱偺儊僢僙乕僕僂傿儞僪僂嵗昗傪曐懚
if(!quaking && !shocking)
{
// 偨偩偟丄梙傟偨傝徴寕傪庴偗偰偄側偄帪
lastMessageLeft = current.left;
lastMessageTop = current.top;
}
// 棫偪奊傪丄廔傢偭偨帪偵尦偺埵抲偵栠偡偐?
returnOriginalPosition = elm.noreturn!==void ? +elm.noreturn : false;
// 徴寕張棟拞偩偭偨傜丄僴儞僪儔傪嵞搊榐偟側偄
if(!shocking)
{
System.addContinuousHandler(shock_handler);
shocking = true;
}
lastShockTick = shockStartTick;
return 0;
}
function stopShock()
{
if(shocking)
{
resetAllPos();
System.removeContinuousHandler(shock_handler);
shocking = false;
conductor.trigger('shock');
lastShockX = lastShockY = 0; // 徴寕偑廔椆偟偨傜慜夞抣偼僋儕傾
}
return 0;
}
function shock_handler(tick)
{
// 峏怴娫妘偑抁偡偓傞側傜丄張棟傪峴傢側偄
if(tick-lastShockTick<minInterval)
return;
lastShockTick = tick;
var past = tick - shockStartTick;
if(past>shockEndTick)
{
stopShock();
return;
}
if(historyShowing || pauseQuaking)
{ // 棜楌昞帵拞偼梙傜偝側偄
resetAllPos();
return;
}
var prg = past/shockEndTick;
var per = Math.sin(prg * shockRotate);
var atten = (1.0 - prg * (1.0 - finishShock)) * per;
var x = shockVertMax * atten;
var y = shockHorzMax * atten;
lastShockX = x, lastShockY = y; // 徴寕傪婰壇
setAllPos(x+lastQuakeX, y+lastQuakeY);
}
function waitShock(elm)
{
// 梙傟偑廔椆偡傞傑偱傑偮
if(!shocking) return 0; // 梙傟偰偄側偗傟偽懸偨側偄
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// 僗僉僢僾偱偒傞応崌
if(skipMode)
{
// 僗僉僢僾拞偺応崌
stopShock();
return 0; // 僗僉僢僾拞偺応崌偼梙傟傪掆巭偝偣偰曉傞
}
conductor.wait(%[
click : function
{
stopShock(); // 梙傟偼掆巭偡傞
} incontextof this,
shock : function
{
// 傗傞偙偲側偟
} incontextof this
]);
}
else
{
// 僗僉僢僾偱偒側偄応崌
conductor.wait(%[
shock : function
{
// 傗傞偙偲側偟
} incontextof this
]);
}
return -2;
}
// 僋儕僢僋儕僺乕僩
function onClickRepeat()
{
if(!isClickRepeatPause)
onPrimaryClick() if !isClickIfStable || inStable;
if(isClickRepeat==true)
{
isClickRepeat |= 2;
clickRepeatTimer.interval = clickRepeatTime; // 2夞栚埲崀偺娫妘
}
}
var clickRepeatPauseCount = 0;
function pauseClickRepeat(pause=true, force=false)
{
// dm("pause["+clickRepeatPauseCount+"]: "+pause+" / force = "+force);
if(force && !pause)
{
// 嫮惂揑偵堦帪掆巭忬懺傪夝彍
isClickRepeatPause = false;
clickRepeatPauseCount = 0;
}
else if(pause)
{
isClickRepeatPause = true;
clickRepeatPauseCount++; // 僋儕僢僋儕僺乕僩堦帪掆巭偵偝傟偨夞悢
}
else
{
clickRepeatPauseCount-- if clickRepeatPauseCount>0;
if(clickRepeatPauseCount==0) // 僋儕僢僋儕僺乕僩堦帪掆巭偵偝傟偨夞悢偑0偵側偭偨
isClickRepeatPause = false; // 僋儕僢僋儕僺乕僩堦帪掆巭傪夝彍
}
if(!isClickRepeat)
return;
// dm("click repeat pause: "+pause);
if(clickRepeatTimer.enabled)
{
if(pause)
{
// 堦帪掆巭偝偣傞
clickRepeatTimer.enabled = false;
}
}
else
{
if(!pause)
{
// 嵞奐偝偣傞
clickRepeatTimer.enabled = true;
}
}
}
function onSESoundBufferStop(id)
{
super.onSESoundBufferStop(...);
dm("stop: "+se[id].playingStorage);
se[id].playingStorage = ""; // 嵞惗偑廔椆偟偨偺偱丄嵞惗拞偺僼傽僀儖柤傪徚偡
}
// 僂傿儞僪僂儌乕僪傊曄峏
function onWindowedMenuItemClick()
{
if(isPossibleChangeScreen) // 曄峏壜擻側偲偒偺傒\r
super.onWindowedMenuItemClick(...);
}
// 僼儖僗僋儕乕儞儌乕僪傊曄峏
function onFullScreenMenuItemClick()
{
if(isPossibleChangeScreen) // 曄峏壜擻側偲偒偺傒\r
super.onFullScreenMenuItemClick(...);
}
function doWait(elm)
{
// wait 僞僌偺張棟
var waittime;
if(elm.mode == 'until')
{
// until 儌乕僪
waittime = timeOrigin + +elm.time - System.getTickCount();
if(waittime < 0) { lastWaitTime = 0; return 0; } // 偡偱偵帪娫偑宱夁偟偰偄傞
lastWaitTime = waittime;
if(waittime < 6) return 0; // 偁傑傝偵懸偪帪娫偑抁偄偺偱懸偨側偄
}
else
{
waittime = +elm.time;
}
return waitTime(waittime, (elm.canskip === void || +elm.canskip) && clickSkipEnabled, elm.onskip);
}
// onskip傪庢傝擖傟偨帪娫懸偪
function waitTime(waittime, canskip, onskip)
{
// waittime 暘懸偮
if(waittime == 0) return 0;
if(canskip)
{
// 僗僉僢僾偱偒傞応崌
if(skipMode)
{
// 僗僉僢僾拞偺応崌
if(onskip !== void) onskip!;
return 0; // 偡偖偵曉傞
}
conductor.waitWithTimeOut(%[
click : function(arg)
{
if(arg !== void) arg!;
} incontextof this,
click_arg : onskip,
timeout : function
{
// 傗傞偙偲側偟
} incontextof this
], waittime);
}
else
{
// 僗僉僢僾偱偒側偄応崌
conductor.waitWithTimeOut(%[
timeout : function
{
// 傗傞偙偲側偟
} incontextof this
], waittime);
}
return -2; // break
}
property isClickRepeat
{
setter(i)
{
// dm("click repeat start: "+i);
if(i!=(isClickRepeat & 1))
{
if(i)
{
// 儕僺乕僩奐巒
clickRepeatTimer = new Timer(onClickRepeat, "") if clickRepeatTimer==void;
clickRepeatTimer.interval = clickRepeatTime1st; // 弶夞偺娫妘
clickRepeatTimer.enabled = true;
}
else
{
// 儕僺乕僩廔椆
clickRepeatTimer.enabled = false;
}
_isClickRepeat = i;
}
}
getter { return _isClickRepeat; }
}
property horizon
{
setter(h)
{
if(h != _horizon)
{
/* var dv = h - _horizon;
for(var i=0; i<numCharacterLayers; i++)
{
fore.layers.top -= dv;
back.layers.top -= dv;
}
*/ _horizon = h;
}
}
getter { return _horizon; }
}
}
/*----------------------------------------------------------------------------/
/ AnimationLayer
/----------------------------------------------------------------------------*/
class AnimationLayer extends AnimationLayerORIGINAL
{
function AnimationLayer()
{
super.AnimationLayerORIGINAL(...);
}
function finalize()
{
super.finalize(...);
}
function loadImages(elm)
{
// loadImages 僆乕僶乕儔僀僪
// elm 偼撉傒崬傒忣曬
if(elm === void)
{
freeImage();
return;
}
Anim_loadParams = %[];
(Dictionary.assign incontextof Anim_loadParams)(elm);
// 僷儔儊乕僞傪懸旔
// 傾僯儊乕僔儑儞忣曬傪僋儕傾
clearAnim();
// 夋憸傪撉傒崬傓
global.KAGLayer.loadImages(elm.storage, elm.key);
// 怓曗惓
applyColorCorrection(this, elm);
// 僼儕僢僾
if(elm.flipud !== void && +elm.flipud)
{
// 忋壓斀揮
flipUD();
}
if(elm.fliplr !== void && +elm.fliplr)
{
// 嵍塃斀揮
flipLR();
}
// 僋儕僢僺儞僌
if(elm.clipleft !== void)
{
// 僋儕僢僺儞僌偑巜掕偝傟偰偄傞
width = +elm.clipwidth;
height = +elm.clipheight;
imageLeft = -elm.clipleft;
imageTop = -elm.cliptop;
}
else
{
setSizeToImageSize();
}
// 儗僀儎儌乕僪
if(elm.mode !== void && elm.mode == "rect")
type = ltCoverRect;
else
type = ltTransparent;
// 壜帇晄壜帇丄埵抲丄晄摟柧搙丄僀儞僨僢僋僗
if ( elm !== void && elm.pos !== void ) {
// 億僕僔儑儞偵廬偭偰埵抲傪寛掕
left = calcLeft();
top = calcTop();
}
else
{
if(elm.left !== void) left = +elm.left;
if(elm.top !== void) top = +elm.top;
}
// ADD: 抧暯慄偐傜偺嫍棧偁傢偣
if ( elm !== void && elm.horizon !== void ) {
top -= elm.horizon;
}
if(elm.visible !== void) visible = +elm.visible;
if(elm.opacity !== void) opacity = +elm.opacity;
absolute = +elm.index if elm.index !== void;
// 傾僯儊乕僔儑儞忣曬偑偁傟偽丄撉傒崬傓
Anim_storageName =
Storages.getPlacedPath(
Storages.chopStorageExt(elm.storage) + ".asd");
if(Anim_storageName != '')
{
// 傾僯儊乕僔儑儞忣曬偑偁偭偨!
// 傾僯儊乕僔儑儞忣曬傪僨僼僅儖僩偺僐儞僟僋僞偵撉傒崬傓
loadAnimInfo(0, ''); // 偮偄偱偵傾僯儊乕僔儑儞奐巒(傕偟奐巒偱偒傟偽)
}
}
function calcLeft()
{
// 棫偪埵抲亄夋憸偛偲偺僘儗曗惓
if(Anim_loadParams)
{
with(Anim_loadParams)
{
if(.pos===void)
return +.left;
else
return window.scPositionX[.pos] - width \ 2 + correctLeft[.storage];
}
}
else
return 0;
}
function calcTop()
{
// 抧暯慄偵偁傢偣傞
return window.scHeight - height - window.horizon;
}
}
/*----------------------------------------------------------------------------/
/ MessageLayer
/----------------------------------------------------------------------------*/
class MessageLayer extends MessageLayerORIGINAL
{
var edgeExtent = 2; // 戃暥帤偺傆偲偝
var edgeEmphasis = 1024; // 戃暥帤偺嫮挷搙
var displaysInFixedPitchAlsoByVariable = false; // 忢帪屌掕僺僢僠偱昞帵偡傞偐\r
var defaultRubyBold = false; // 儖價傪儃乕儖僪偵偡傞偐
var currentRubyPosition;
function MessageLayer()
{
super.MessageLayerORIGINAL(...);
}
function finalize()
{
super.finalize(...);
}
function processCh(ch)
{
// \儅乕僋偼昞帵偟側偄\r
if(ch=="\\")
return false;
// 暥帤 ch 傪昤夋偡傞
// 夵峴偑峴傢傟丄偐偮偦傟偑儁乕僕枛抂傪墇偊傞応崌偼 true 傪曉偡
// 偦傟埲奜偼 false
var vert = vertical;
if((vert ? y >= relinexpos : x >= relinexpos ) && autoReturn)
{
if(((lastDrawnCh=="" || wwLeading.indexOf(lastDrawnCh)==-1) &&
wwFollowing.indexOf(ch)==-1) ||
(lastDrawnCh!="" && wwFollowingWeak.indexOf(lastDrawnCh)!=-1 &&
wwFollowingWeak.indexOf(ch)!=-1))
{
// 嵟屻偵昤夋偟偨偺偑峴枛嬛懃暥帤偱側偄応崌
// 偟偐傕偙傟偐傜昤夋偡傞偺偑峴摢嬛懃暥帤偱側偄
// 応崌
// 傑偨偼庛嬛懃暥帤偑楢懕偟偰偄側偄応崌
if(reline()) return autoReturn;
}
else if(vert ? ( y>imageHeight ) : (x>imageWidth))
{
// 偙傟偐傜昤夋偡傞偺偑嫮嬛懃暥帤偱偼側偔偰丄
// 妋幚偵 塃抂傪墇偊傞応崌
// ( 偙偺応崌偼梋敀偼峫偊側偄 )
if(reline()) return autoReturn;
}
}
changeLineSize() if sizeChanged;
var inlink = inLink != -1;
beginLinkLine() if inlink;
var ll = lineLayer;
var llfont = ll.font;
var cw = llfont.getTextWidth(ch);
var dx , dy;
if(vert)
dx = int(lineLayerBase+(fontSize>>1)), dy = int(lineLayerPos);
else
dx = int(lineLayerPos), dy = int(lineLayerBase-fontSize);
var dxp = 0;
if(displaysInFixedPitchAlsoByVariable && typeof ch == "String" && #ch>255)
{
// 壜曄僺僢僠僼僅儞僩偱傕屌掕僺僢僠偱昞帵偡傞偲偒偼\r
// 屌掕僺僢僠憡摉偺僺僢僠偱暥帤傪昞帵偡傞(偨偩偟慡妏偺帪偺傒)
var tw = llfont.height * ch.length;
dxp = (tw - cw) \ (ch.length << 1) if ch.length!=0; // 拞墰傊偢傜偡
cw = tw;
}
if(edge)
ll.drawText(dx+dxp, dy, ch, chColor, 255, antialiased, edgeEmphasis, edgeColor, edgeExtent, 0, 0);
else if(shadow)
ll.drawText(dx+dxp, dy, ch, chColor, 255, antialiased, 255, shadowColor, 0, 2, 2);
else
ll.drawText(dx+dxp, dy, ch, chColor, 255, antialiased);
if(currentRuby != "")
{
// 儖價偑偁傞
// var cw = llfont.getTextWidth(ch);
var orgsize = llfont.height;
llfont.height = rubySize;
llfont.bold = defaultRubyBold if llfont.bold!=defaultRubyBold; // 儖價傪懢帤偵偡傞
var rw = llfont.getTextWidth(currentRuby);
var rx,ry;
if(currentRubyPosition[0]=="c")
{
// 僙儞僞儕儞僌偡傞
if(!vert)
{
rx = int(dx + (cw>>1) - (rw>>1));
ry = int(dy - rubySize - rubyOffset);
}
else
{
rx = int(dx + rubySize + rubyOffset);
ry = int(dy + (cw>>1) - (rw>>1));
}
}
else
{
// 僙儞僞儕儞僌偟側偄
if(!vert)
{
rx = dx;
ry = int(dy - rubySize - rubyOffset);
}
else
{
rx = int(dx + rubySize + rubyOffset);
ry = dy;
}
}
if(edge)
ll.drawText(rx, ry, currentRuby, chColor, 255, antialiased, edgeEmphasis, edgeColor, edgeExtent, 0, 0); // 暥帤
else if(shadow)
ll.drawText(rx, ry, currentRuby, chColor, 255, antialiased, 255, shadowColor, 0, 2, 2); // 暥帤
else
ll.drawText(rx, ry, currentRuby, chColor, 255, antialiased); // 暥帤
llfont.height = orgsize;
currentRuby = '';
llfont.bold = defaultBold if llfont.bold!=defaultBold; // 懢帤傪尦偵栠偡(曄傢偭偰偄偨偲偒偩偗)
}
ll.visible = true;
if(inlink)
{
// 僴僀僷乕儕儞僋偱偪傘乕
ll.face = dfProvince;
if(!vert)
ll.fillRect(lineLayerPos, lineLayerBase - fontSize,
cw, fontSize, numLinks + 1);
else
ll.fillRect(lineLayerBase - (fontSize>>1), lineLayerPos,
fontSize, cw, numLinks + 1);
// 椞堟夋憸傕揾傝偮傇偟偰傗傞
ll.face = dfBoth;
linkFilled = true;
}
cw += pitch;
if(vert) y += cw; else x += cw;
lineLayerPos += cw;
lineLayerLength += cw;
lastDrawnCh = ch;
adjustAlign() if(align >= 0);
return false;
}
/*
function showBreakGlyph(glyphobj, storage, key)
{
// 夋柺偵峴懸偪/儁乕僕懸偪婰崋傪昞帵偡傞\r
glyphobj.parent = this; // 恊傪帺暘偵偡傞
glyphobj.loadImages(storage, key); // 夋憸傪撉傒崬傓
glyphobj.bringToFront(); // 嵟慜柺偵
if(glyphFixedPosition)
{
glyphobj.setPos(glyphFixedLeft, glyphFixedTop);
}
else
{
var px, py;
if(!vertical)
{
px = lineLayerPos + lineLayerOriginX + getLineLayerLeftOffset();
py = y + lineSize + lineSpacing - glyphobj.height;
// 僇乕僜儖偑夋柺奜偵弌偰偟傑偭偨偲偒
// dm("first :px,py = "+px+","+py+" .."+(lineLayer.width-glyphobj.width-marginR));
if(px>=lineLayer.width-glyphobj.width-marginR)
{
// 師峴偺愭摢傊
px -= lineLayerPos;
py += lineSize + lineSpacing;
}
}
else
{
px = x - lineSpacing- (lineSize>>1) - (glyphobj.width>>1);
py = lineLayerPos + lineLayerOriginY + getLineLayerTopOffset();
// 僇乕僜儖偑夋柺奜偵弌偰偟傑偭偨偲偒
dm("first :px,py = "+px+","+py);
if(py>=lineLayer.height-glyphobj.height-marginB)
{
// 師峴偺愭摢傊
px -= lineSpacing + (lineSize>>1);
py -= lineLayerPos;
}
}
// dm("result:px,py = "+px+","+py);
glyphobj.setPos(px, py);
}
glyphobj.visible = true;
}
*/
function setRuby(text, pos="c")
{
super.setRuby(...);
currentRubyPosition = pos;
}
function internalAssign(src)
{
super.internalAssign(...);
currentRubyPosition = src.currentRubyPosition;
}
function internalOnMouseDown(x, y, button)
{
if(button == mbRight)
window.onPrimaryRightClick();
else
super.internalOnMouseDown(...);
}
function restore()
{
super.restore(...);
frameGraphic = sf.frameGraphic;
}
}
/*----------------------------------------------------------------------------/
/ 僥僉僗僩棜楌儗僀儎乕
/----------------------------------------------------------------------------*/
class HistoryLayer extends HistoryLayerORIGINAL
{
var scroll;
var controlWidth = 16;
var controlHeight = 30;
var keyDisregardOnce;
var historyFontSize = []; // 奺儁乕僕偑偳偺僒僀僘偱僼僅儞僩昞帵偝傟偰偄偨偐傪婰榐
var historyLineSpacing = []; // 峴娫
var currentRuby; // 師偺暥帤偵晅梌偝傟傞儖價
var historyRuby = []; // 儖價(儖價暥帤, 寘, align)
var bgimage;
var bgimageLayer;
function HistoryLayer()
{
super.HistoryLayerORIGINAL(...);
}
function finalize()
{
release(bgimageLayer);
super.finalize(...);
}
function clear()
{
historyFontSize = [];
historyLineSpacing = [];
historyRuby = [];
super.clear(...);
}
function save()
{
var dic = super.save(...);
if(dic==void) return void;
if(everypage)
{
dic.historyFontSize = historyFontSize;
dic.historyLineSpacing = historyLineSpacing;
dic.historyRuby = historyRuby;
}
return dic;
}
function load(dic)
{
if(dic!==void && everypage)
{
historyFontSize.assignStruct(dic.historyFontSize) if dic.historyFontSize!==void;
historyLineSpacing.assignStruct(dic.historyLineSpacing) if dic.historyLineSpacing!==void;
historyRuby.assignStruct(dic.historyRuby) if dic.historyRuby!==void;
}
super.load(dic);
}
function store(ch)
{
if(currentLine!==void && currentLine.length<2)
{
historyFontSize[dataPage] = [] if historyFontSize[dataPage]==void;
historyLineSpacing[dataPage]= [] if historyLineSpacing[dataPage]==void;
// 寁應梡偵僼僅儞僩僒僀僘傪曄峏偟丄峏偵婰榐偟偰偍偔
font.height = historyFontSize[dataPage][dataPos] = window.current.fontSize;
historyLineSpacing[dataPage][dataPos] = window.current.lineSpacing; // 峴娫
// dm(currentLine+"["+dataPos+"]: "+historyFontSize[dataPage][dataPos]+"/"+historyLineSpacing[dataPage][dataPos]);
}
var result = super.store(...);
// 儖價傪曐懚
if(currentRuby)
{
historyRuby[dataPage]= [] if historyRuby[dataPage]==void;
currentRuby[1] = dataPos; // 峴
currentRuby[2] = currentLine.length-1; // 寘
historyRuby[dataPage].add(currentRuby);
currentRuby = void;
}
return result;
}
function storeRuby(ruby, pos="c")
{// 儖價 峴 寘 昞帵埵抲(c,l)
currentRuby = [ ruby, 0, 0, pos ];
}
function repage()
{
super.repage(...);
if(everypage)
{
// 怴偟偄擖傟暔傪嶌傞
historyFontSize[dataPage] = [];
historyLineSpacing[dataPage]= [];
historyRuby[dataPage] = void;
}
}
function reline()
{
if(everypage)
{
// 擮偺偨傔丄擖傟暔僠僃僢僋
historyFontSize[dataPage] = [] if historyFontSize[dataPage]==void;
historyLineSpacing[dataPage]= [] if historyLineSpacing[dataPage]==void;
historyFontSize[dataPage][dataPos] = window.current.fontSize;
historyLineSpacing[dataPage][dataPos] = window.current.lineSpacing; // 峴娫
// dm("reline["+dataPos+"]: "+historyFontSize[dataPage][dataPos]+"/"+historyLineSpacing[dataPage][dataPos]);
}
super.reline(...);
}
function dispInit()
{
if(typeof window.pauseClickRepeat != "undefined")
window.pauseClickRepeat(true); // 僋儕僢僋儕僺乕僩傪堦帪掆巭
// 攚宨夋憸傪梡堄
if(bgimage!="")
{
with(bgimageLayer = new global.Layer(window, this))
{
.loadImages(bgimage);
.setSizeToImagaSize();
}
}
super.dispInit(...);
}
function dispUninit()
{
super.dispUninit(...);
release(bgimageLayer); // 攚宨夋憸傪徚嫀
if(typeof window.pauseClickRepeat != "undefined")
window.pauseClickRepeat(false); // 僋儕僢僋儕僺乕僩傪嵞奐
}
function clearBack(n)
{
if(bgimage!==void)
{
}
else
super.clearBack(...);
}
function drawPage()
{
var page = getPage(dispStart);
var i;
var n = dispStart + dataStart;
if(n >= maxPages) n -= maxPages;
var fszs = historyFontSize[n]; // 昞帵奐巒儁乕僕偺僼僅儞僩僒僀僘
var lspcs = historyLineSpacing[n]; // 峴娫
var ruby = historyRuby[n];
var lastls;
var rc = 0;
if(verticalView)
{
var x = width - marginR, y;
for(i = 0; i < repageLine; i++)
{
// 僼僅儞僩僒僀僘傪曄峏
font.height = fszs if fszs!=void && font.height!=fszs;
if(page!="")
{
drawText(x, marginT + getLineStart2(dispStart, i),
page, historyColor, 255, antialiased);
// 儖價
if(ruby)
{
var fh = font.height;
var r;
while((r = ruby[rc]) && r[1]==i) // 摨偠峴偺儖價傪昤夋
{
var ry = y + font.getTextHeight(page.substr(0, r[2]));
var ch = font.getTextHeight(page[r[2]]);
font.height = int(fh * 0.43 + 0.5); // ruby梡僼僅儞僩僒僀僘
ry -= (font.getTextHeight(r[0]) - ch) \ 2 if r[3][0]=="c";
drawTexxt(x-font.height+1, ry, r[0], historyColor, 255, antialiased);
font.height = fh;
rc++; // 師偺儖價
}
}
}
x -= font.height + (lspcs!==void ? (lastls=lspcs) : lastls); // 師峴傊
// dm(i+": x="+x+" / fh="+font.height+" / ls="+lastls);
}
}
else
{
var x, y = marginT;
for(i = 0; i < repageLine; i++)
{
// dm("line pos: "+y);
// 僼僅儞僩僒僀僘傪曄峏
font.height = fszs if fszs!=void && font.height!=fszs;
if(page!="")
{
drawText(x = marginL + getLineStart2(dispStart, i), y, page,
historyColor, 255, antialiased);
// 儖價
if(ruby)
{
var fh = font.height;
var r;
while((r = ruby[rc]) && r[1]==i) // 摨偠峴偺儖價傪昤夋
{
var rx = x + font.getTextWidth(page.substr(0, r[2]));
var cw = font.getTextWidth(page[r[2]]);
font.height = int(fh * 0.43 + 0.5); // ruby梡僼僅儞僩僒僀僘
rx -= (font.getTextWidth(r[0]) - cw) \ 2 if r[3][0]=="c"; // center
drawText(rx, y-font.height+1, r[0], historyColor, 255, antialiased);
font.height = fh; // 尦偵栠偡
rc++; // 師偺儖價
}
}
}
y += font.height + (lspcs!==void ? (lastls=lspcs) : lastls); // 師峴傊
// dm(i+": y="+y+" / fh="+font.height+" / ls="+lastls);
}
}
}
function makeButtons()
{
if(prevPageButton !== void)
{
// 婛偵嶌惉嵪傒
with(scroll)
{
.total = dataPages;
.area = 1;
.current= dataPages;
}
return;
}
var cw = controlWidth;
var ch = controlHeight;
// 暵偠傞儃僞儞
with(closeButton = new global.ExButtonLayer(window, this, "close", width-cw, 0, "closebtn", "儊僢僙乕僕棜楌傪暵偠傞"))
{
.mode = 3;
.readyVisible();
}
if(verticalView)
{
// 廲彂偒偵偼枹懳墳
}
else
{
// 儃僞儞
prevPageButton = new global.ExButtonLayer(window, this, "prev", width-cw, closeButton.height, "prevbtn", "慜偺儁乕僕傪昞帵偟傑偡丅");
with(prevPageButton)
{
.mode = 3;
.readyVisible();
}
nextPageButton = new global.ExButtonLayer(window, this, "next", width-cw, height-ch, "nextbtn", "師偺儁乕僕傪昞帵偟傑偡丅");
with(nextPageButton)
{
.mode = 3;
.readyVisible();
}
// 僗僋儘乕儖僶乕
scroll = new global.ScrollBarLayer(window, this, height-ch*2-closeButton.height, 6, 7);
with(scroll)
{
.left = width - cw;
.top = ch + closeButton.height;
.total = dataPages;
.area = 1;
.current= dataPages;
.moving = 1;
.slider.onMouseWheel = function()
{
// 棜楌儗僀儎乕偐傜偺儊僢僙乕僕偺傒偱摦嶌偡傞傛偆偵
} incontextof scroll.slider;
}
}
}
function prev()
{
scroll.current -= scroll.slider.moving;
}
function next()
{
with(scroll)
{
var cur = .current;
.current += .slider.moving;
if(cur == .current)
hide(); // 堦斣壓偱偝傜偵壓偵峴偙偆偲偟偨偺偱
}
}
function updateButtonState()
{
if(!canScroll)
{
prevPageButton.enabled = canScroll;
nextPageButton.enabled = canScroll;
}
prevPageButton.enabled = !(dispStart==0);
nextPageButton.enabled = !((everypage && dispStart >= dataPages-1) || (!everypage && dispStart >= dataLines-dispLines));
scroll.enabled = canScroll;
}
function windowMouseWheel(shift, delta, x, y)
{
// 僂傿儞僪僂偺儂僀乕儖憖嶌儊僢僙乕僕偑偙偙偵棳偝傟傞
var currenttick = System.getTickCount();
delta = delta \ 120;
if(delta > 0 )
prev();
else if(delta < 0 )
{
// 庤慜
if(currenttick - lastWheelTick > 150 &&
((everypage && dispStart >= dataPages-1) ||
(!everypage && dispStart >= dataLines - dispLines)))
{
/* 偔傞偔傞夞偟偰偄傞偆偪偵偄偒側傝棜楌偑暵偠偨傝偟側偄傛偆側巇妡偗 */
// 婛偵嵟廔晹暘傪昞帵偟偰偄傞\r
hide();
}
else
next();
}
lastWheelTick = currenttick;
}
function onButtonDown(btn)
{
switch(btn.id)
{
case "prev":
prev();
break;
case "next":
next();
break;
case "close":
hide();
break;
}
}
function onKeyDown(key, shift)
{
dm("on key down(in history)");
window.hideMouseCursor();
if(keyDisregardOnce)
{
// 僉乕擖椡傪堦夞偩偗柍帇偡傞(PageUp偱棜楌傪昞帵偡傞偲丄堦偮忋偺儁乕僕偐傜奐巒偟偰偟傑偆偺偱)
keyDisregardOnce = false;
return;
}
if(canScroll)
{
if(verticalView)
{
if(key == VK_DOWN)
next();
else if(key == VK_UP)
prev();
else if(key == VK_LEFT || key == VK_PRIOR)
{
if(everypage)
prev();
else
scrollUp();
}
else if(key == VK_RIGHT || key == VK_NEXT)
{
if(everypage)
next();
else
scrollDown();
}
}
else
{
if(key == VK_DOWN)
{
if(everypage)
next();
else
scrollUp();
}
else if(key == VK_UP)
{
if(everypage)
prev();
else
scrollDown();
}
else if(key == VK_LEFT || key == VK_PRIOR)
prev();
else if(key == VK_RIGHT || key == VK_NEXT)
next();
}
}
if(key == VK_ESCAPE || key == VK_RETURN || key == VK_SPACE || key == VK_HOME)
{
hide();
}
}
function onScroll(cur)
{
if(everypage)
{
dispStart = cur;
clearBack();
drawPage();
}
else
{
// 枹幚憰
}
updateButtonState();
}
}
/*----------------------------------------------------------------------------/
/ KAG儗僀儎乕
/----------------------------------------------------------------------------*/
class KAGLayer extends KAGLayerORIGINAL
{
var _magnify; // 奼戝棪
var mx, my; // 奼戝拞怱嵗昗
var orglayer; // 尦夋憸
var orgStorage; // 丂乂丂偺僼傽僀儖柤
var spread; // 奜宍偑曄壔偡傞偐
var basewidth, baseheight; // 婎弨偲側傞僒僀僘
var noerase; // 尦夋憸傪廔椆帪偵嶍彍偟側偄偐丠
function KAGLayer()
{
super.KAGLayerORIGINAL(...);
_magnify = 1.0;
}
function finalize()
{
release(orglayer);
super.finalize(...);
}
function beginMove(elm)
{
// elm 偵廬偄帺摦堏摦傪奐巒偡傞
stopMove();
var time = +elm.time;
var accel = elm.accel === void ? 0 : +elm.accel;
// 僗僉僢僾拞偼張棟帪娫0偲偡傞
if(sf.effectSkip || kag.skipMode>=2)
time = 0;
if(elm.path===void && elm.affine===void)
{
var rl;
rl = reverseLayer if +elm.both;
if(elm.anglespeed!==void)
{
// 夞揮
var radius = elm.radius===void ? 100 : +elm.radius;
var yradius = elm.yradius===void ? radius : +elm.yradius;
moveObject = new RotationMover(this, time, accel, moveFinalFunction, rl,
elm.cx===void ? 0 : +elm.cx, elm.cy===void ? 0 : +elm.cy,
+elm.anglespeed, radius, yradius);
}
else if(elm.gravity!==void)
{
// 廳椡壛懍搙
moveObject = new GravityMover(this, time, accel, moveFinalFunction, rl,
elm.vx===void ? 0 : +elm.vx, elm.vy===void ? 0 : +elm.vy, +elm.gravity);
}
}
else if(elm.magnify !== void)
{
// 尦夋憸偺曐懚
with(orglayer = new global.Layer(window, this))
{
.name = name+"'s resource";
if(elm.storage!==void)
{
.loadImages(orgStorage = elm.storage); // 奜晹夋憸傪巊梡
.setSizeToImageSize();
}
else
{
.setSize(width, height);
.copyRect(0, 0, this, 0, 0, width, height);
}
}
mx = elm.mx!==void ? +elm.mx : width \ 2; // 弶婜偺奼戝拞怱嵗昗
my = elm.my!==void ? +elm.my : height \ 2;
basewidth = width;
baseheight = height;
spread = elm.spread===void ? true : +elm.spread; // 奜宍偑峀偑傞(曄壔偡傞)偐丠
// path偺暘夝(嵗昗偼拞怱揰傪婎弨偲偡傞)
var array = [].split("(), ", elm.path, , true);
for(var i = array.count-1; i>=0; i--) array[i+4] = +array;
if(spread) array[0] = left+width\2, array[1] = top+height\2;
else array[0] = mx, array[1] = my;
array[2] = opacity;
array[3] = magnify;
// 堏摦梡僆僽僕僃僋僩
if(elm.spline !== void & +elm.spline)
{
moveObject = new SplineMoverWithMagnify(this, array, time, accel,
moveFinalFunction, spread);
}
else
{
moveObject = new LinearMoverWithMagnify(this, array, time, accel,
moveFinalFunction, spread);
}
}
else if(elm.affine!==void)
{
// 傾僼傿儞曄姺偱昤夋偡傞儗僀儎乕
with(orglayer = new global.Layer(window, this))
{
.loadImages(orgStorage = elm.base);
.setSizeToImageSize();
.flipLR() if elm.fliplr!=void;
.flipUD() if elm.flipud!=void;
}
var array = [].split("()", elm.affine,, true);
var p = [];
p[0] = elm.px!==void ? +elm.px : 0; // 弶婜抣
p[1] = elm.py!==void ? +elm.py : 0;
p[2] = elm.deg!==void ? +elm.deg : 0;
p[3] = elm.mag!==void ? +elm.mag : 1;
p[4] = elm.opacity!==void ? +elm.opacity : 255;
p[5] = elm.cx!==void ? +elm.cx : (orglayer.width>>1);
p[6] = elm.cy!==void ? +elm.cy : (orglayer.height>>1);
var pvc = p.count;
var ind = 0;
for(var i=0; i<array.count; i++)
{
var param = [].split(",", array);
for(var j=0; j<pvc; j++)
{
// dm(@"param[${j}] = \""+param[j]+"\"");
// 愝掕偝傟偰偄傟偽偦傟傪丄柍偗傟偽捈慜偺抣傪擖傟傞
p[pvc+ind] = param[j]!="" ? +param[j] : p[ind];
// dm(@"path[${i}][${j}] = "+p[pvc+ind]);
ind++;
}
}
var rl;
rl = reverseLayer if +elm.both;
if(elm.spline !== void && +elm.spline)
moveObject = new SplineMoverWithAffine(this, p, time, accel,
moveFinalFunction, rl, orglayer);
else
moveObject = new LinearMoverWithAffine(this, p, time, accel,
moveFinalFunction, rl, orglayer);
}
else
{
// path 偺暘夝
var array = [].split("(), ", elm.path, , true);
for(var i = array.count-1; i>=0; i--) array[i+3] = +array;
array[0] = left;
array[1] = top;
array[2] = opacity;
// 堏摦梡僆僽僕僃僋僩偺嶌惉
var rl;
rl = reverseLayer if +elm.both;
if(elm.spline !== void && +elm.spline)
{
// 僗僾儔僀儞曗娫
moveObject = new SplineMover(this, array, time, accel, moveFinalFunction, rl);
}
else
{
// 捈慄曗娫
moveObject = new LinearMover(this, array, time, accel, moveFinalFunction, rl);
}
}
window.moveCount++;
moveObject.startMove(time==0 ? 0 : +elm.delay);
}
function moveFinalFunction()
{
// if(!noerase)
{
release(orglayer);
orglayer = void;
}
super.moveFinalFunction(...);
}
function setCenterPos(cl, ct)
{
var l = cl - width\2;
var t = ct - height\2;
// dm(@"(${left}, ${top}) -> (${l}, ${t})");
if(left != l) left = l;
if(top != t) top = t;
}
function setMagnifyCenterPos(x, y)
{
mx = x, my = y;
}
property magnify
{
setter(m)
{
if(m != _magnify)
{
var w = int(basewidth * m);
var h = int(baseheight * m);
if(w == width && h == height) return; // 張棟偺昁梫側偟
if(spread)
{
var cl = left+width\2, ct = top+height\2;
setSize(w, h);
setCenterPos(cl, ct);
stretchCopy(0, 0, width, height,
orglayer, 0, 0, orglayer.width, orglayer.height, stFastLinear, false);
}
else
{
var l = mx - mx * m;
var t = my - my * m;
stretchCopy(l, t, w, h,
orglayer, 0, 0, orglayer.width, orglayer.height, stFastLinear, false);
}
_magnify = m;
}
}
getter { return _magnify; }
}
// 偙偺儗僀儎乕偑棫偪奊偱偁傞偲偒丄懳偺儗僀儎乕傪曉偡
property reverseLayer
{
getter {
var ls = kag.fore.layers;
for(var i=0; i<ls.count; i++)
{
if(ls == this)
return kag.back.layers;
}
ls = kag.back.layers;
for(var i=0; i<ls.count; i++)
{
if(ls == this)
return kag.fore.layers;
}
return void;
}
}
}
/*-----------------------------------------------------------------------------
/ Mover
/----------------------------------------------------------------------------*/
class LinearMover
{
// 捈慄曗娫
var layer; // 儗僀儎
var path; // 揰攝楍
var time; // 揰傪捠夁偡傞偺偵昁梫側帪娫
var accel; // 壛懍搙揑側摦偒傪偡傞偐偳偆偐
var pointCount; // path.count -1
var finalFunction; // 堏摦廔椆帪偵屇傇娭悢
var startTick; // 堏摦奐巒傪偟偨僥傿僢僋
var totalTime; // 慡懱偺帪娫
var delayTimer; // 摦嶌奐巒帪傑偱懸偮偨傔偺僞僀儅
var moving = false; // 堏摦拞偐
var first = true; // 弶夞偺僴儞僪儔屇傃弌偟偐
var nextStop = false; // 師偺僴儞僪儔屇傃弌偟偱掆巭偡傞偐
var another; // 摨偠曄壔傪峴偆儗僀儎乕
function LinearMover(layer, path, time, accel, finalfunction, another=void)
{
this.layer = layer;
this.path = path;
this.time = time;
this.accel = accel;
this.finalFunction = finalfunction;
this.another = another;
totalTime = (pointCount = (path.count \ 3 - 1)) * time;
}
function finalize()
{
stopMove();
if(delayTimer !== void) invalidate delayTimer;
}
function startMove(delay)
{
// 堏摦傪奐巒偡傞
if(delay != 0)
{
delayTimer = new Timer(onDelayTimer, '');
delayTimer.interval = delay;
delayTimer.enabled = true;
moving = true;
}
else
{
moving = true;
if(time<1)
stopMove();
else
System.addContinuousHandler(handler); // ContinuousHandlers 偵捛壛
}
}
function onDelayTimer()
{
// delayTimer 偑敪摦偟偨
delayTimer.enabled = false;
System.addContinuousHandler(handler);
}
function stopMove()
{
// 堏摦傪廔傢傞
if(moving)
{
// 嵟廔埵抲偵堏摦
if(layer isvalid)
{
var idx = int(pointCount*3);
var p = path;
layer.setPos(p[idx], p[idx+1]);
layer.opacity = p[idx+2];
setAnother();
}
System.removeContinuousHandler(handler);
moving = false;
finalFunction();
}
}
function handler(tick)
{
// 堏摦拞偵屇偽傟傞
if(nextStop || !(layer isvalid)) { stopMove(); return; }
if(first) startTick = tick, first = false;
tick -= startTick;
if(tick >= totalTime)
{
nextStop = true;
var idx = int(pointCount*3);
var p = path;
layer.setPos(p[idx], p[idx+1]);
layer.opacity = p[idx+2];
return;
}
if(accel < 0)
{
// 忋尫 ( 嵟弶偑摦偒偑憗偔丄彊乆偵抶偔側傞 )
tick = 1.0 - tick / totalTime;
tick = Math.pow(tick, -accel);
tick = int ( (1.0 - tick) * totalTime );
}
else if(accel > 0)
{
// 壓尫 ( 嵟弶偼摦偒偑抶偔丄彊乆偵憗偔側傞 )
tick = tick / totalTime;
tick = Math.pow(tick, accel);
tick = int ( tick * totalTime );
}
move(tick);
}
function move(tick)
{
var index = tick \ time * 3;
var ratio = tick % time / time;
var p = path;
var sx = p[index];
var sy = p[index+1];
var so = p[index+2];
var ex = p[index+3];
var ey = p[index+4];
var eo = p[index+5];
var l = (ex-sx)*ratio + sx;
var t = (ey-sy)*ratio + sy;
l = int(l + (l<0 ? -0.5 : 0.5));
t = int(t + (t<0 ? -0.5 : 0.5));
var o = eo >= 256 ? so : int((eo-so)*ratio + so);
layer.setPos(l, t);
layer.opacity = o;
setAnother();
}
function setAnother()
{
if(another!==void)
{
another.setPos(layer.left, layer.top);
another.opacity = layer.opacity;
}
}
}
// 僗僾儔僀儞曗娫
class SplineMover extends LinearMover
{
var spline;
function SplineMover(layer, path, time, accel, finalfunction)
{
super.LinearMover(...);
if(path.count < 9)
{
// 3 揰埲壓 ( 巜掕偡傞偺偼偦偺偆偪偺2揰 ) 偼曗姰偱偒側偄
throw new Exception("2 揰埲忋傪巜掕偟偰偔偩偝偄");
}
spline = new Spline(path, 3);
}
function move(tick)
{
var per = tick / totalTime;
var d = ((path.count - 3) \ 3) * per;
var index = int(d);
var pindex = index * 3;
d -= index;
var l = spline.getX(per);
var t = spline.getY(per);
l = int(l + (l<0 ? -0.5 : 0.5));
t = int(t + (t<0 ? -0.5 : 0.5));
var so = path[pindex+2];
var eo = path[pindex+5];
var o = eo >= 256 ? so : int((eo-so)*d + so);
layer.setPos(l, t);
layer.opacity = o;
setAnother();
}
}
class LinearMoverWithMagnify extends LinearMover
{
var pathpoints = 4;
var spread;
function LinearMoverWithMagnify(layer, path, time, accel, finalfunction, spread)
{
super.LinearMover(...);
this.spread = spread;
totalTime = (pointCount = (path.count \ pathpoints - 1)) * time;
}
function goLastPos()
{
var idx = int(pointCount*pathpoints);
var p = path;
if(spread)
layer.setCenterPos(p[idx], p[idx+1]);
else
layer.setMagnifyCenterPos(p[idx], p[idx+1]);
layer.opacity = p[idx+2];
layer.magnify = p[idx+3];
}
function stopMove()
{
// 堏摦傪廔傢傞
if(moving)
{
// 嵟廔埵抲偵堏摦
if(layer isvalid)
goLastPos();
System.removeContinuousHandler(handler);
moving = false;
finalFunction();
}
}
function handler(tick)
{
// 堏摦拞偵屇偽傟傞
if(nextStop || !(layer isvalid)) { stopMove(); return; }
if(first) startTick = tick, first = false;
tick -= startTick;
if(tick >= totalTime)
{
nextStop = true;
goLastPos();
return;
}
if(accel < 0)
{
// 忋尫 ( 嵟弶偑摦偒偑憗偔丄彊乆偵抶偔側傞 )
tick = 1.0 - tick / totalTime;
tick = Math.pow(tick, -accel);
tick = int ( (1.0 - tick) * totalTime );
}
else if(accel > 0)
{
// 壓尫 ( 嵟弶偼摦偒偑抶偔丄彊乆偵憗偔側傞 )
tick = tick / totalTime;
tick = Math.pow(tick, accel);
tick = int ( tick * totalTime );
}
move(tick);
}
function move(tick)
{
var index = tick \ time * pathpoints;
var ratio = tick % time / time;
var p = path;
var sx = p[index];
var sy = p[index+1];
var so = p[index+2];
var sm = p[index+3];
var ex = p[index+4];
var ey = p[index+5];
var eo = p[index+6];
var em = p[index+7];
var l = (ex-sx)*ratio + sx;
var t = (ey-sy)*ratio + sy;
l = int(l + (l<0 ? -0.5 : 0.5));
t = int(t + (t<0 ? -0.5 : 0.5));
var o = eo >= 256 ? so : int((eo-so)*ratio + so);
var m = (em-sm)*ratio + sm;
// dm(@"${l}, ${t}, ${o}, ${m}");
if(spread) layer.setCenterPos(l, t);
else layer.setMagnifyCenterPos(l, t);
layer.opacity = o<0 ? 0 : o>255 ? 255 : o;
layer.magnify = m;
}
}
class SplineMoverWithMagnify extends LinearMoverWithMagnify
{
var spline; // 僗僾儔僀儞曗娫
function SplineMoverWithMagnify()
{
super.LinearMoverWithMagnify(...);
if(path.count < pathpoints*3)
{
// 3 揰埲壓 ( 巜掕偡傞偺偼偦偺偆偪偺2揰 ) 偼曗姰偱偒側偄
throw new Exception("2 揰埲忋傪巜掕偟偰偔偩偝偄");
}
spline = new Spline(path, pathpoints);
}
function move(tick)
{
var per = tick / totalTime;
var d = ((path.count - pathpoints) \ pathpoints) * per;
var index = int(d);
var pindex = index * pathpoints;
d -= index;
var l = spline.getX(per);
var t = spline.getY(per);
l = int(l + (l<0 ? -0.5 : 0.5));
t = int(t + (t<0 ? -0.5 : 0.5));
var so = path[pindex+2];
var sm = path[pindex+3];
var eo = path[pindex+5];
var em = path[pindex+7];
var o = eo >= 256 ? so : int((eo-so)*d + so);
var m = (em-sm)*d + sm;
if(spread) layer.setCenterPos(l, t);
else layer.setMagnifyCenterPos(l, t);
layer.opacity = o<0 ? 0 : o>255 ? 255 : o;
layer.magnify = m;
}
}
class BaseMover
{
var layer;
var baseopacity;
var time, accel;
var finalFunction;
var startTick;
var delayTimer;
var moving;
var another;
function BaseMover(layer, time, accel, finalfunction, another=void)
{
this.layer = layer;
this.baseopacity = layer.opacity;
this.time = time;
this.accel = accel;
this.finalFunction = finalfunction;
this.another = another;
}
function finalize()
{
stopMove();
release(delayTimer);
}
function startMove(delay)
{
// 堏摦傪奐巒偡傞
if(delay != 0)
{
delayTimer = new Timer(onDelayTimer, '') if delayTimer==void;
delayTimer.interval = delay;
delayTimer.enabled = true;
}
else
{
moving = true;
if(time<1)
stopMove();
else
{
startTick = System.getTickCount();
System.addContinuousHandler(handler); // ContinuousHandlers 偵捛壛
}
}
}
function onDelayTimer()
{
// delayTimer 偑敪摦偟偨
delayTimer.enabled = false;
startTick = System.getTickCount();
System.addContinuousHandler(handler);
moving = true;
}
function stopMove()
{
// 堏摦傪廔傢傞
if(moving)
{
// 嵟廔埵抲偵堏摦
if(layer isvalid)
{
layer.opacity = 0;
setAnother();
}
System.removeContinuousHandler(handler);
moving = false;
finalFunction();
}
}
function handler(tick)
{
// 堏摦拞偵屇偽傟傞
tick -= startTick;
if(tick >= time)
{
stopMove();
return;
}
var per = tick / time;
if(accel < 0)
{
// 忋尫 ( 嵟弶偑摦偒偑憗偔丄彊乆偵抶偔側傞 )
tick = Math.pow(1.0 - per, -accel);
tick = int ( (1.0 - tick) * time );
}
else if(accel > 0)
{
// 壓尫 ( 嵟弶偼摦偒偑抶偔丄彊乆偵憗偔側傞 )
tick = Math.pow(per, accel);
tick = int ( tick * time );
}
move(tick, per);
}
function move(tick, per)
{
}
function getBasicOpacityModification(per)
{
var o;
if(per<0.1) o = int(per * (255 - baseopacity)*10) + baseopacity;
else if(per>0.9)o = int((1.0 - per) * 2550);
else o = 255;
return o;
}
function setAnother()
{
if(another!==void)
{
another.setPos(layer.left, layer.top);
another.opacity = layer.opacity;
}
}
}
class RotationMover extends BaseMover
{
var d2r = Math.PI / 180;
var cx, cy;
var anglespeed;
var radius, yradius;
function RotationMover(layer, time, accel, finalfunction, another, cx, cy, anglespd, radius, yradius)
{
super.BaseMover(...);
this.cx = cx;
this.cy = cy;
this.anglespeed = anglespd / 1000 * d2r; // degree/sec -> radian/msec
this.radius = radius;
this.yradius= yradius;
}
function finalize()
{
super.finalize(...);
}
function move(tick, per)
{
var rad = tick * anglespeed;
var l = cx + Math.cos(rad) * radius;
var t = cy + Math.sin(rad) * yradius;
l = int(l + (l<0 ? -0.5 : 0.5));
t = int(t + (t<0 ? -0.5 : 0.5));
layer.setCenterPos(l, t);
layer.opacity = getBasicOpacityModification(per);
setAnother();
}
}
class GravityMover extends BaseMover
{
var ll, lt;
var vx, vy;
var gravity;
function GravityMover(layer, time, accel, finalfunction, another, vx, vy, gravity)
{
super.BaseMover(...);
ll = layer.left;
lt = layer.top;
this.vx = vx;
this.vy = vy;
this.gravity= gravity;
}
function finalize()
{
super.finalize(...);
}
function move(tick, per)
{
var tick2 = tick * tick;
var l = ll + vx * tick;
var t = lt + vy * tick + (gravity * tick2) / 2;
l = int(l + (l<0 ? -0.5 : 0.5));
t = int(t + (t<0 ? -0.5 : 0.5));
layer.setPos(l, t);
layer.opacity = getBasicOpacityModification(per);
setAnother();
}
}
// 傾僼傿儞曄姺偟偨夋憸傪昤夋偡傞儉乕僶乕
class LinearMoverWithAffine extends LinearMover
{
var interpolater;
var affine;
var src;
var lasttick;
function LinearMoverWithAffine(layer, path, time, accel, ff, rl, src)
{
super.LinearMover(...);
this.src = src;
interpolater= createInterpolater(path);
affine = new easyAffineTransform();
}
function finalize()
{
stopMove(); // 掆巭
release(affine);
release(interpolater);
super.finalize(...);
}
function createInterpolater(path)
{
return new LinearInterpolater(path, 7);
}
function startMove(delay)
{
moving = true;
if(time<1)
stopMove();
else
{
lasttick = startTick = System.getTickCount() + delay;
System.addContinuousHandler(handler);
}
}
function stopMove()
{
if(moving)
{
if(layer isvalid)
move(1);
System.removeContinuousHandler(handler);
moving = false;
finalFunction() if finalFunction!=void;
}
}
function handler(tick)
{
if(tick - lasttick < minInterval) return;
lasttick = tick;
var past = tick - startTick;
if(past < 0) return;
if(past < time)
move(calcAccel(past/time, accel));
else
stopMove();
}
function move(per)
{
var l, t, w, h, deg, mag, opa, cx, cy;
// var st = System.getTickCount();
// 慄宍曗娫
with(interpolater)
{
var ir = .getPointAndRatio(per);
// dm(per+": "+ir[0]+", "+ir[1]);
l = .calc(ir, 0);
t = .calc(ir, 1);
deg = .calc(ir, 2);
mag = .calc(ir, 3);
opa = .calc(ir, 4);
cx = .calc(ir, 5);
cy = .calc(ir, 6);
// dm(per+": "+l+", "+t+", "+deg+", "+mag+", "+cx+", "+cy);
}
// 傾僼傿儞曄姺弨旛
var sw = src.width, sh = src.height;
var minX = sw, minY = sh;
with(affine)
{
.initProgrammableTransformation();
.addTransferMatrix(-cx, -cy); // 拞怱揰傊
.addRotateMatrix(deg*Math.PI/180); // 夞揮
.addMagnifyMatrix(mag, mag); // 奼戝
.addTransferMatrix(cx, cy); // 尦偵栠傞
/* dm(@"| ${.matrix[0]} ${.matrix[1]} ${.matrix[2]} |");
dm(@"| ${.matrix[3]} ${.matrix[4]} ${.matrix[5]} |");
dm(@"| ${.matrix[6]} ${.matrix[7]} ${.matrix[8]} |");
*/
// 曄姺屻偵昁梫側僒僀僘傪寁嶼
var pos = [];
pos[0] = .calc(0, 0);
pos[1] = .calc(sw, 0);
pos[2] = .calc(0, sh);
pos[3] = .calc(sw, sh);
var maxX, maxY;
for(var i=0; i<4; i++)
{
// dm("pos["+i+"] = ("+pos[0]+","+pos[1]+")");
minX = pos[0] if pos[0]<=minX;
maxX = pos[0] if pos[0]>=maxX;
minY = pos[1] if pos[1]<=minY;
maxY = pos[1] if pos[1]>=maxY;
}
l += minX - cx; // 偮偄偱偵嵍忋嵗昗傕
t += minY - cy;
w = maxX - minX;
h = maxY - minY;
// dm(@"ltwh: ${l}, ${t}, ${w}, ${h}");
.addTransferMatrix(-minX, -minY);
}
// 儗僀儎乕張棟
with(layer)
{
.setPos(l, t);
.setSize(w, h);
.fillRect(0, 0, w, h, 0x00000000);
affine.transformByProgram(layer, src, 0, 0, sw, sh);
.type = ltTransparent;
.opacity = opa;
.visible = true;
}
setAnother();
// dm((System.getTickCount() - st)+"ms");
}
function setAnother()
{
if(another!==void)
another.assignImages(layer, true);
}
}
// 堏摦偺傒僗僾儔僀儞偵懳墳偟偨傾僼傿儞曄姺儉乕僶乕
class SplineMoverWithAffine extends LinearMoverWithAffine
{
function SplineMoverWithAffine()
{
super.LinearMoverWithAffine(...);
}
function createInterpolater(path)
{
return new Spline(path, 7);
}
}
/*----------------------------------------------------------------------------/
/ 攚宨儗僀儎乕
/----------------------------------------------------------------------------*/
@if(0)
class BaseLayer extends BaseLayerORIGINAL
{
function BaseLayer()
{
super.BaseLayerORIGINAL(...);
}
function finalize()
{
super.finalize(...);
}
/*
function internalOnMouseDown(x, y, button, processprovince = true)
{
// 撪晹娭悢
var provinceprocessed = false;
if(button == mbLeft && processprovince && !window.messageLayerHiding)
provinceprocessed = processProvince(x, y);
if(button == mbLeft && !provinceprocessed)
{
// 帺恎偑僾儔僀儅儕儗僀儎側傜偽丄僂傿儞僪僂偺
// onPrimaryClick 傪屇傇
if(isPrimary)
{
window.onPrimaryClick();
window.isClickRepeat = true;
}
}
else if(button == mbRight)
{
// 帺恎偑僾儔僀儅儕儗僀儎側傜偽丄僂傿儞僪僂偺
// onPrimaryRightClick 傪屇傇
if(isPrimary) window.onPrimaryRightClick();
}
}
function internalOnMouseUp(x, y, button, processprovince = true)
{
var provinceprocessed = false;
if(button == mbLeft && processprovince && !window.messageLayerHiding)
provinceprocessed = processProvince(x, y);
if(button == mbLeft && !provinceprocessed)
{
if(isPrimary) window.isClickRepeat = false;
}
}
function onMouseUp(x, y, button)
{
super.onMouseUp(...);
internalOnMouseUp(x - imageLeft, y - imageTop, button);
}
*//*
function onFocus()
{
super.onFocus(...);
window.pauseClickRepeat(false); // 儕僺乕僩堦帪掆巭偺夝彍
}
function onBlur()
{
super.onBlur(...);
window.pauseClickRepeat(true); // 儕僺乕僩堦帪掆巭
}
function onMouseEnter()
{
super.onMouseEnter(...);
window.pauseClickRepeat(false); // 儕僺乕僩堦帪掆巭偺夝彍
}
function onMouseLeave()
{
super.onMouseLeave(...);
window.pauseClickRepeat(true); // 儕僺乕僩堦帪掆巭
}
*/}
@endif
/*----------------------------------------------------------------------------/
/ SE
/----------------------------------------------------------------------------*/
class SESoundBuffer extends SESoundBufferORIGINAL
{
var playingStorage;
function play(elm)
{
super.play(...);
playingStorage = Storages.chopStorageExt(elm.storage);
}
function fadeIn(elm)
{
super.fadeIn(elm);
playingStorage = Storages.chopStorageExt(elm.storage);
}
function stop()
{
var st = this.status; // 掆巭捈慜偺忬懺傪婰榐
super.stop(...);
if(st == "play") // 掆巭捈慜偵嵞惗拞偩偭偨傜
play(%[storage:"mute"]);// 柍壒僨乕僞傪嵞惗偟丄僶僢僼傽傪鉟楉偵偡傞
}
function stopFade()
{
var st = this.status; // 掆巭捈慜偺忬懺傪婰榐
super.stopFade(...);
if(st == "play") // 掆巭捈慜偵嵞惗拞偩偭偨傜
play(%[storage:"mute"]);// 柍壒僨乕僞傪嵞惗偟丄僶僢僼傽傪鉟楉偵偡傞
}
function restore(dic)
{
// 帿彂攝楍偐傜忬懺傪撉傒弌偟丄暅婣偡傞
currentVolume = dic.volume;
pan = dic.pan;
if(dic.currentStorage != "")
{
play(%[storage : dic.currentStorage, loop : true]);
dm("restore se: "+dic.currentStorage+"(loop:true)");
}
else
fadeOut(%[time:500]); // 傉偭偮傝愗傟偪傖偆偺傕壗側偺偱丄僼僃乕僪偝偣傞
}
}
/*----------------------------------------------------------------------------/
/ BGM
/----------------------------------------------------------------------------*/
class BGM extends BGMORIGINAL
{
var nextElm;
var delayTimer;
function finalize()
{
super.finalize(...);
}
function play(elm)
{
// elm.storage 偱梌偊傜傟偨 BGM 偺墘憈傪奐巒
// elm.loop 偑 true 側傜偽儖乕僾嵞惗傪峴偆
// buf1 偱墘憈傪峴偆
if(elm.storage == currentStorage) return; // 摨偠嬋偼嵞墘憈偟側偄
var loop = elm.loop === void ? true : +elm.loop;
if(elm.delay!=void)
{
dm("delay play: "+elm.delay+" ms");
// 抶墑嵞惗
nextElm = %[];
(Dictionary.assign incontextof nextElm)(elm);
nextElm.delay = void;
delayTimer = new Timer(delayPlay, "");
delayTimer.interval = +elm.delay;
delayTimer.enabled = true;
return;
}
try
{
buf1.stop();
buf2.stop() if buf2 !== void;
}
catch(e)
{
dm("BGM 偺掆巭偵幐攕偟傑偟偨(幚峴偼懕峴偱偒傑偡) : " + e.message);
}
stopFade(); // 僼僃乕僨傿儞僌偼廔椆
buf1.volume = volume;
playBuffer(buf1, elm.storage, loop);
if(loop)
currentStorage = elm.storage; // 儖乕僾墘憈偺応崌
else
currentStorage = ""; // 扨敪墘憈偺応崌
playingStorage = elm.storage;
looping = loop;
}
function delayPlay()
{
invalidate delayTimer;
play(nextElm);
}
function playOverlap(elm)
{
// 僆乕僶乕儔僢僾偑晄梫偐丄
if(!doubleBuffered || currentBuffer.status!="play")
{
play(elm);
return;
}
if(elm.storage == currentStorage) return; // 摨偠嬋偼嵞墘憈偟側偄
var loop = elm.loop === void ? true : +elm.loop;
if(elm.delay!=void)
{
dm("delay play overlap: "+elm.delay+" ms");
// 抶墑嵞惗
nextElm = %[];
(Dictionary.assign incontextof nextElm)(elm);
nextElm.delay = void;
delayTimer = new Timer(delayPlayOverlap, "");
delayTimer.interval = +elm.delay;
delayTimer.enabled = true;
return;
}
// 僟僽儖僶僢僼傽妿偮婛偵嵞惗拞偺応崌丄傕偆堦偮偺僶僢僼傽偱嵞惗奐巒
var nextbuffer; // 師偺墘憈僶僢僼傽
nextbuffer = (currentBuffer == buf1) ? buf2 : buf1;
nextbuffer.volume = volume;
playBuffer(nextbuffer, elm.storage, loop);
if(loop)
currentStorage = elm.storage; // 儖乕僾墘憈偺応崌
else
currentStorage = ""; // 扨敪墘憈偺応崌
playingStorage = elm.storage;
looping = loop;
}
function delayPlayOverlap()
{
invalidate delayTimer;
playOverlap(nextElm);
}
}
/*----------------------------------------------------------------------------/
/
/----------------------------------------------------------------------------*/
var yesnolayer;
function MYaskYesNo(win=kag, par=kag.fore.base, msg, resultfunc, arg1, arg2, defaultcancel=false)
{
if(!alreadyExistYesNo)
{
yesnolayer = new YesNoLayer(win, par, defaultcancel);
if(!yesnolayer.show(msg, resultfunc, arg1, arg2,, par.cursorX, par.cursorY))
{
invalidate yesnolayer;
return false;
}
}
return true;
}
/*----------------------------------------------------------------------------/
/ 椺奜偺嵟廔庴晅
/----------------------------------------------------------------------------*/
System.exceptionHandler = function(e)
{
if(1)
{
// 奐敪拞偼儊僢僙乕僕傪昞帵偡傞偩偗\r
Debug.logAsError(); // 儘僌弌椡
var event_disabled = System.eventDisabled; // 僀儀儞僩僼儔僌曐懚
System.eventDisabled= true; // 僀儀儞僩掆巭
var msg;
msg = "壓婰偺椺奜偑敪惗偟傑偟偨丅杮懱張棟偼懕峴偝傟傑偡丅\n\n";
msg +=e.message;
msg +="\n\n-- trace --\n"+e.trace if e.trace!="";
System.inform(msg);
System.eventDisabled= event_disabled; // 僀儀儞僩僼儔僌暅婣
return kag!=void && kag isvalid && kag.visible;
}
Debug.logAsError(); // 儘僌弌椡
var event_disabled = System.eventDisabled; // 僀儀儞僩僼儔僌曐懚
System.eventDisabled= true; // 僀儀儞僩掆巭
var msg, endmsg;
if(e instanceof "ConductorException")
{
// KAG僗僋儕僾僩忋偱偺椺奜
// 仸僐僐偱偺椺奜偱偼丄嵞婲摦偟捈偟偰傕偆傑偔摦偐側偄壜擻惈偑崅偄丅
msg = "壓婰偺僗僋儕僾僩僄儔乕偑敪惗偟傑偟偨丅\n";
msg +="\n";
msg +="--------------------------------------------------------------------------------\n";
msg +=e.message+"\n";
msg +="--------------------------------------------------------------------------------\n";
msg +="\n";
msg +="Fate偺僀儞僗僩乕儖僨傿儗僋僩儕偵嶌惉偝傟偰偄傞\"fate.exe.console.log\"偲\"hwexcept.log\"丄\n";
msg +="僄儔乕偺敪惗偡傞僙乕僽僨乕僞傪丄敪惗偟偨帪偺忬嫷/憖嶌庤弴側偳偲嫟偵TYPE-MOON\n";
msg +="僒億乕僩宖帵斅傑偱偛楢棈偔偩偝偄丅\n\n";
msg +="仸忣曬偑晄廫暘偱偡偲夞摎偱偒傑偣傫偺偱丄昁偢僼傽僀儖丒忣曬傪偛採嫙偔偩偝偄丅\n\n";
msg +="TYPE-MOON僒億乕僩宖帵斅: http://www.typemoon.com/support/bbs.php\n\n";
endmsg = "P僉乕偱僞僀僩儖傊栠傞偐丄捠忢偺庤弴偱廔椆偟偰偔偩偝偄丅";
}
else
{
// 偦傟埲奜偺椺奜
// 仸嵞婲摦偟捈偣偽偆傑偔摦偔壜擻惈偑偁傞丅
msg = "壓婰偺僄儔乕偑敪惗偟傑偟偨丅\n";
msg +="\n";
msg +="--------------------------------------------------------------------------------\n";
msg +=e.message+"\n";
msg +="--------------------------------------------------------------------------------\n";
msg +="\n";
msg +="傾儞僠僂傿儖僗僜僼僩偦偺懠偺忢挀傾僾儕働乕僔儑儞傪廔椆偟偰僎乕儉傪嵞婲摦偡傞偙偲偱僄儔乕傪\n";
msg +="夞旔偱偒傞壜擻惈偑偁傝傑偡丅孞傝曉偟摨偠傛偆側僄儔乕偑敪惗偡傞応崌偵偼丄\n";
msg +="Fate偺僀儞僗僩乕儖僨傿儗僋僩儕偵嶌惉偝傟偰偄傞\"fate.exe.console.log\"偲\"hwexcept.log\"丄\n";
msg +="僄儔乕偺敪惗偡傞僙乕僽僨乕僞傪丄敪惗偟偨帪偺忬嫷/憖嶌庤弴側偳偲嫟偵TYPE-MOON\n";
msg +="僒億乕僩宖帵斅傑偱偛楢棈偔偩偝偄丅\n\n";
msg +="仸忣曬偑晄廫暘偱偡偲夞摎偱偒傑偣傫偺偱丄昁偢僼傽僀儖丒忣曬傪偛採嫙偔偩偝偄丅\n\n";
msg +="TYPE-MOON僒億乕僩宖帵斅: http://www.typemoon.com/support/bbs.php\n\n";
endmsg = "";
}
// 僎乕儉杮曇拞側傜丄僙乕僽偟偰偍偔
if(kag.pcflags.currentPageName!="僞僀僩儖")
{
// 嬻偄偰偄傞僙乕僽椞堟傪扵偟偰丄僙乕僽偡傞
msg +="--------------------------------------------------------------------------------\n";
var win = kag;
var saved = false;
var quickcount = 10;
var normalcount = 300;
var no;
var key = "(椺奜偐傜偺暅婣梡僨乕僞)";
for(var i=0; i<quickcount; i++)
{
no = win.numBookMarks - 1 - i;
if(win.bookMarkDates[no]=="" || win.bookMarkNames[no].substr(0, key.length)==key)
{
// 僋僀僢僋僙乕僽偵曐懚
win.bookMarkNames[no] = key+win.bookMarkNames[no];
win.saveBookMark(no);
saved = true;
msg +="尰嵼偺忬嫷傪僋僀僢僋僙乕僽偺"+i+"斣栚偵曐懚偟傑偟偨丅\n";
msg +="僙乕僽僨乕僞偺僼傽僀儖柤偼丄\n乽";
msg +=Storages.getLocalName(Storages.getFullPath(win.getBookMarkFileNameAtNum(no)))+
"乿\n偲側傝傑偡丅\n";
break;
}
}
if(!saved)
{
for(var i=0; i<normalcount; i++)
{
no = i;
if(win.bookMarkDates[no]=="")
{
// 捠忢偺僙乕僽椞堟偵曐懚
win.scflags.bookMarkComments[no] = "椺奜偐傜偺暅婣梡僨乕僞";
win.saveBookMark(no);
var pos = sf.convertSaveNoToFileNo[no];
saved = true;
msg +="尰嵼偺忬嫷傪僙乕僽儊僯儏乕偺乽"+(pos\20+1)+"儁乕僕 "+(pos%20\5+1)+"峴 "+
(pos%5+1)+"楍栚乿偵曐懚偟傑偟偨丅";
msg +="僙乕僽僨乕僞偺僼傽僀儖柤偼丄\n乽";
msg +=Storages.getLocalName(Storages.getFullPath(win.getBookMarkFileNameAtNum(no)))+
"乿\n偲側傝傑偡丅\n";
break;
}
}
if(!saved)
{
// 僙乕僽僨乕僞偑堦攖側偺偱丄曐懚愭傪慖傫偱傕傜偆
msg +="僙乕僽僨乕僞偵嬻偒偑偁傝傑偣傫丅\n";
msg +="僙乕僽儊僯儏乕傪奐偒傑偡偺偱丄揔摉側応強偵曐懚偟偰偔偩偝偄丅\n";
global.shortcut_object.show("save"); // 僙乕僽儊僯儏乕傪奐偔
}
}
}
if(endmsg!="")
{
msg +="--------------------------------------------------------------------------------\n";
msg +=endmsg;
}
System.inform(msg);
System.eventDisabled= event_disabled; // 僀儀儞僩僼儔僌暅婣
return kag!=void && kag isvalid && kag.visible;
};
/*----------------------------------------------------------------------------/
/
/----------------------------------------------------------------------------*/
※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
我的电脑配置是:PⅢ 450,192M SDRAM,10G+80G硬盘,G450显卡,双显示器。OS是Win 98第一版。
请问哪位能够帮助我解决一下问题?不胜感激! |