What the hell.
//;# MainWindow.tjs - KAG ƒƒCƒ“ƒEƒBƒ“ƒhƒE
//;# Copyright (C)2001-2005, W.Dee and contributors ‰ü•ÏE”z•z‚ÍŽ©—R‚Å‚·
//;<<'END_OF_TJS_SCRIPT';
// ‚±‚̃XƒNƒŠƒvƒg‚Í—LŒø‚È perl5 ƒXƒNƒŠƒvƒg‚Å‚à‚ ‚é
class KAGWindow extends Window
{
// KAG ‚̃EƒBƒ“ƒhƒE ƒNƒ‰ƒX
// KAG ‚Ì“®ì‚̃ƒCƒ“‚È•”•ª‚Í‚±‚±‚É‹Lq‚µ‚Ä‚ ‚é
// ˆÈ‰º‚Ì‚¤‚¿A/*C*/ ‚̂‚•Ï”‚ÍA––’[‚Ì perl ƒXƒNƒŠƒvƒg‚É‚æ‚Á‚Ä
// Ž©“®“I‚Éžx‚ɃRƒs[‚³‚ê‚éƒR[ƒh‚ª¶¬‚³‚ê‚é•Ï”
var scWidth = 640; // ‰æ–ʉ¡•
var scHeight = 480; // ‰æ–Êc•
var aboutWidth = 320; // u‚±‚̃\ƒtƒg‚ɂ‚¢‚ÄvƒEƒBƒ“ƒhƒE‚̉¡•
var aboutHeight = 200; // “¯c•
var isFirstProcess = true; // ˆê”Ôʼn‚Ì process ‚̌ĂÑo‚µ‚©‚Ç‚¤‚©
var freeSaveDataMode = false; // žx‚ðƒƒjƒ…[ƒo[‚È‚Ç‚ÅŠÇ—‚¹‚¸‚ÉAŒÂ•Ê‚̃tƒ@ƒCƒ‹‚Æ‚µ‚ÄŠÇ—‚·‚é
var saveThumbnail = false; // ƒTƒ€ƒlƒCƒ‹‚ð•Û‘¶‚·‚é‚©‚Ç‚¤‚©
var thumbnailWidth = 133; // ƒTƒ€ƒlƒCƒ‹‚̉¡•
var thumbnailDepth = 8; // ƒTƒ€ƒlƒCƒ‹‚ÌBMPƒ‚[ƒhB8‚©24
// ƒTƒ€ƒlƒCƒ‹‚Ì ƒtƒ‹ƒJƒ‰[‰»‚¨‚æ‚уTƒCƒYƒtƒŠ[‰»‚̃pƒbƒ`‚Í
// ‚ä‚ñŽ‚©‚ç‚¢‚½‚¾‚«‚Ü‚µ‚½B
// ‚±‚Ìê‚ðŽØ‚è‚Ä‚¨—ç\‚µã‚°‚Ü‚·B
var snapshotLayer = void; // ‰æ‘œ‚̃XƒiƒbƒvƒVƒ‡ƒbƒg‚ðˆêŽž“I‚É•Û‘¶‚·‚郌ƒCƒ„
var snapshotLockCount = 0; // ƒƒbƒNƒJƒEƒ“ƒg
var lastSaveDataNameGlobal = ""; // ÅŒã‚É•Û‘¶‚µ‚½ƒtƒŠ[ƒZ[ƒuƒ‚[ƒh‚ł̃tƒ@ƒCƒ‹–¼
/*C*/var lastSaveDataName = ""; // ÅŒã‚É•Û‘¶‚µ‚½ƒtƒŠ[ƒZ[ƒuƒ‚[ƒh‚ł̃tƒ@ƒCƒ‹–¼
var saveDataLocation = "savedata"; // ƒZ[ƒuƒf[ƒ^•Û‘¶êŠ
var saveDataID = "00000000-0000-0000-0000-000000000000"; // ƒZ[ƒuƒf[ƒ^‚Ì ID
var readOnlyMode = false; // “Ç‚Ýž‚Ýê—pƒ‚[ƒh(ƒf[ƒ^‚ðƒfƒBƒXƒN‚É‘‚©‚È‚¢)
var dataName = "data"; // ƒZ[ƒuƒf[ƒ^–¼
var saveDataMode = ""; // ƒf[ƒ^•Û‘¶ƒ‚[ƒh( "c" ‚ňƉ» )
var recordHistoryOfStore = 0; // ’ʉߗš—ð‚ð‹L˜^‚·‚é‚©‚Ç‚¤‚©
// 0 = Ž©“®“I‚É‚Í‹L˜^‚µ‚È‚¢ 1 = •Û‘¶‰Â”\‚ȃ‰ƒxƒ‹‚²‚Æ
// 2 = ‘I‘ðŽˆ ( @s ƒ^ƒO ) ‚²‚Æ
var maxHistoryOfStore = 5; // ’ʉߋL˜^‚ÌÅ‘å”
var historyOfStore = []; // ’ʉߗš—ðƒf[ƒ^
var nextRecordHistory = false;
// ŽŸ‚Ì•Û‘¶‰Â”\‚ȃ‰ƒxƒ‹’ʉߎž‚ÉŒ»Ý‚Ìî•ñ‚ð•Û‘¶‚·‚é‚©‚Ç‚¤‚©
var stablePosibility = false;
// žx‚ð•Û‘¶‰Â”\‚ȃ‰ƒxƒ‹ŠÔ‚Å stable ‚É‚È‚é‰Â”\«‚ª‚ ‚é‚©‚Ç‚¤‚©
var fullScreened = false; // Œ»Ýƒtƒ‹ƒXƒNƒŠ[ƒ“‚©‚Ç‚¤‚©
var isMain = true; // ‚±‚ꂪƒƒCƒ“ƒEƒBƒ“ƒhƒE‚©‚Ç‚¤‚©
var askOnClose = true; // I—¹Žž‚ÉI—¹‚·‚é‚©‚ðƒ†[ƒU‚É•·‚‚©‚Ç‚¤‚©
var helpFile = ""; // uƒwƒ‹ƒv > –ÚŽŸv‚ÅŠJ‚ƒtƒ@ƒCƒ‹
var quakeTimer; // quake —p‚̃^ƒCƒ}
var defaultQuakeTimeInChUnit = false;
/*C*/var quaking = false; // —h‚ê‚Ä‚¢‚é‚©
/*C*/var quakeEndTick = 0; // —h‚ê‚ðI—¹‚³‚¹‚é tick
/*C*/var quakeHorzMax = 0; // ‰¡U•
/*C*/var quakeVertMax = 0; // cU•
/*C*/var quakePhase = 0;
var chDefaultAntialiased; // •¶Žš‚ɃAƒ“ƒ`ƒGƒCƒŠƒAƒX‚ð‚©‚¯‚é‚©‚Ç‚¤‚©
var chDefaultFace; // •¶Žš‚̃fƒtƒHƒ‹ƒg‚̃tƒHƒ“ƒg
var initialMessageLayerVisible = true;
var historyLayer; // ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„
/*C*/var historyWriteEnabled = true; // ƒƒbƒZ[ƒWƒŒƒCƒ„‚É•¶Žš‚ðo—Í‚·‚é‚©
/*C*/var historyEnabled = true; // ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ð•\Ž¦‰Â”\‚©
var historyShowing = false; // ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ð•\Ž¦’†‚©
var lastHistoryHiddenTick = 0; // ÅŒã‚É—š—ðƒŒƒCƒ„‚ª”ñ•\Ž¦‚É‚È‚Á‚½‚Æ‚«‚Ì tick
/*C*/var numCharacterLayers = 0; // ‘OŒiƒŒƒCƒ„‚Ì”
/*C*/var numMessageLayers = 1; // ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ì”
var fore = %[]; // •\ƒŒƒCƒ„
var back = %[]; // — ƒŒƒCƒ„
var scPositionX = %[]; // —§‚¿ŠG‚Ì’†SÀ•W(X)
var tempLayer = void; // ˆêŽž“I‚ȃŒƒCƒ„
var lineBreak; // s‘Ò‚¿—pƒAƒjƒ[ƒVƒ‡ƒ“ƒŒƒCƒ„
var pageBreak; // ƒy[ƒW‘Ò‚¿—pƒOƒŠƒt‚̃Aƒjƒ[ƒVƒ‡ƒ“ƒŒƒCƒ„
var clickWaiting = false; // ƒNƒŠƒbƒN‘Ò‚¿‚©‚Ç‚¤‚©
var mainConductor; // ƒƒCƒ“‚̃Rƒ“ƒ_ƒNƒ^
var extraConductor; // —\”õ‚̃Rƒ“ƒ_ƒNƒ^
var conductor; // Œ»Ý‚̃Rƒ“ƒ_ƒNƒ^
var usingExtraConductor = false; // —\”õ‚̃Rƒ“ƒ_ƒNƒ^‚ðŽg—p’†‚©‚Ç‚¤‚©
var onExtraConductorReturn; // extraConductor ‚©‚ç’Êí‚̃Rƒ“ƒ_ƒNƒ^‚É–ß‚é‚Æ‚«‚É‚æ‚ÔŠÖ”
var tagHandlers; // ƒ^ƒO‚̃nƒ“ƒhƒ‰ŒQŽ«‘”z—ñ
var saveMacros = true; // ƒ}ƒNƒ‚ðžx‚É•Û‘¶‚·‚é‚©‚Ç‚¤‚©
var current; // Œ»Ý‘€ì’†‚̃ƒbƒZ[ƒWƒŒƒCƒ„
/*C*/var currentNum; // Œ»Ý‘€ì’†‚̃ƒbƒZ[ƒWƒŒƒCƒ„”Ô†
/*C*/var currentPage; // Œ»Ý‘€ì’†‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚̃y[ƒW(•\0/— 1)
/*C*/var currentWithBack = false; // — ‰æ–Ê‚É‚à•¶Žš‚ð•`‰æ‚·‚é‚©‚Ç‚¤‚©
var bgm; // BGM ƒIƒuƒWƒFƒNƒg
var numSEBuffers = 1; // Œø‰Ê‰¹ƒoƒbƒtƒ@‚Ì”
var se = []; // Œø‰Ê‰¹ƒoƒbƒtƒ@ƒIƒuƒWƒFƒNƒg
var numMovies = 1; // ƒ€[ƒr[ƒIƒuƒWƒFƒNƒg”
// var movie; // ƒ€[ƒr[ƒIƒuƒWƒFƒNƒg
var movies = []; // ƒ€[ƒr[ƒIƒuƒWƒFƒNƒg
var transCount; // Œ»Ýis’†‚̃gƒ‰ƒ“ƒWƒVƒ‡ƒ“‚Ì”
var moveCount; // Œ»Ýis’†‚ÌŽ©“®ˆÚ“®‚Ì”
var chSpeeds = %[
fast: 10, // u‚‘¬v•¶Žš•\Ž¦ƒXƒs[ƒh
normal: 30, // u•’Êv•¶Žš•\Ž¦ƒXƒs[ƒh
slow: 50, // u’x‚¢v•¶Žš•\Ž¦ƒXƒs[ƒh
];
var userChSpeed = 30; // ƒ†[ƒU‚Ì‘I‚ñ‚¾•¶Žš•\Ž¦ƒXƒs[ƒh
var userCh2ndSpeed = -1; // ƒ†[ƒU‚Ì‘I‚ñ‚¾ Šù“Ç•”•ª‚Ì•¶Žš•\Ž¦ƒXƒs[ƒh
var chNonStopToPageBreak = false; // ƒy[ƒW––‚܂ňê‹C‚É“Ç‚Ýi‚Þ‚© ( l ƒ^ƒO‚𖳎‹‚·‚é‚© )
var ch2ndNonStopToPageBreak = false; // Šù“Ç‚Ì•”•ª‚Ńy[ƒW––‚܂ňê‹C‚É“Ç‚Ýi‚Þ‚©
/*C*/var chUserMode = true; // •¶Žš•\Ž¦‘¬“x‚ÍŒ»Ýƒ†[ƒU‚Ì‘I‚ñ‚¾‚à‚Ì‚©
/*C*/var chSpeed = 30; // Œ»Ý‚Ì•¶Žš•\Ž¦ƒXƒs[ƒh
/*C*/var actualChSpeed = chSpeed; // ŽÀÛ‚Ì•¶Žš•\Ž¦ƒXƒs[ƒh
/*C*/var beforeNoWaitActualChSpeed; // nowait ‚É“ü‚é‘O‚Ì actualChSpeed
/*C*/var beforeNoWaitChUserMode; // nowait ‚É“ü‚é‘O‚Ì chUserMode
/*C*/var clickSkipEnabled = true; // ƒNƒŠƒbƒNƒXƒLƒbƒv‚ª—LŒø‚©
/*C*/var nextSkipEnabled = true; // ŽŸ‚Ì‘I‘ðŽˆ(/–¢“Ç)‚Ü‚Åi‚Þ‚ª—LŒø‚©
var skipMode = 0; // ƒXƒLƒbƒv‚̃‚[ƒh
// 0=ƒXƒLƒbƒv‚È‚µ, 1=ƒNƒŠƒbƒN‘Ò‚¿‹L†‚Ü‚Å, 2=‰üƒy[ƒW‘Ò‚¿‹L†‚Ü‚Å, 3=ŽŸ‚Ì’âŽ~‚Ü‚Å
// 4=‘‘—‚è
var autoMode = false; // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚©‚Ç‚¤‚©
var autoModePageWait = 350; // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒhŽž‚̉üƒy[ƒWŽž‚̃EƒFƒCƒg
var autoModeLineWait = 50; // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒhŽž‚ÌsƒNƒŠƒbƒN‘Ò‚¿Žž‚̃EƒFƒCƒg
// ã‚Ì“ñ‚‚ÍAƒm[ƒEƒFƒCƒg‚É‚µ‚½‚¢ê‡‚Í 0 ‚Å‚Í‚È‚‚Ä -4 ‚ðŽw’è‚·‚邱‚Æ
var skipKeyRepressed = false; // return ‚ ‚é‚¢‚Í space ƒL[ ( f ƒL[‚È‚Ç‚Å‚Í‚È‚¢ )
// ‚ª‰Ÿ‚³‚ê‚é‚Æ true ‚É‚È‚é ( ƒXƒLƒbƒv‰ðœŽž‚É false
var autoModePageWaits = %[
fast: 400, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̉üƒy[ƒWŽž ƒEƒFƒCƒgu’Z‚¢v
faster: 700, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̉üƒy[ƒWŽž ƒEƒFƒCƒgu‚â‚â’Z‚¢v
medium: 1000, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̉üƒy[ƒWŽž ƒEƒFƒCƒgu•’Êv
slower: 1300, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̉üƒy[ƒWŽž ƒEƒFƒCƒgu‚â‚â’x‚¢v
slow: 2000, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̉üƒy[ƒWŽž ƒEƒFƒCƒgu’x‚¢v
];
var autoModeLineWaits = %[
fast: 180, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚Ìs–– ƒEƒFƒCƒgu’Z‚¢v
faster: 240, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚Ìs–– ƒEƒFƒCƒgu‚â‚â’Z‚¢v
medium: 300, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚Ìs–– ƒEƒFƒCƒgu•’Êv
slower: 360, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚Ìs–– ƒEƒFƒCƒgu‚â‚â’x‚¢v
slow: 500, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚Ìs–– ƒEƒFƒCƒgu’x‚¢v
];
/*C*/var canCancelSkipByClick = true; // ƒNƒŠƒbƒN‚É‚æ‚èƒXƒLƒbƒvó‘Ԃ̃Lƒƒƒ“ƒZƒ‹‚ª‚Å‚«‚é‚©
/*C*/var autoWCEnabled = false; // Ž©“®ƒEƒFƒCƒg‚ª—LŒø‚©‚Ç‚¤‚©
/*C*/var autoWCChars = ""; // Ž©“®ƒEƒFƒCƒg‚ð‚©‚¯‚镶Žš
var autoWCWaits = []; // Ž©“®ƒEƒFƒCƒg‚̃EƒFƒCƒg
var timeOrigin; // resetWait ‚Åݒ肳‚ꂽŽžŠÔŒ´“_
var lastWaitTime; // wait mode=until ‚ÅŽÀÛ‚É‘Ò‚Á‚½ŽžŠÔ
var stableHandlers = []; // ƒVƒXƒeƒ€‚ªˆÀ’è(ƒNƒŠƒbƒN‘Ò‚¿/’âŽ~)‚µ‚½‚Æ‚«‚ɌĂ΂ê‚é
var runHandlers = []; // ƒVƒXƒeƒ€‚ª‘–‚èŽn‚ß‚½‚Æ‚«‚ɌĂ΂ê‚é
var inStable = true; // ˆÀ’肵‚Ä‚¢‚é‚Æ‚«(‘–s’†‚Å‚È‚¢‚Æ‚«) true
var inSleep = false; // s ƒ^ƒO‚Å’âŽ~‚µ‚Ä‚¢‚é‚Æ‚« true
var updateBeforeCh = 0; // •¶Žš‚ð•`‰æ‚·‚é‘O‚É‚¢‚Á‚½‚ñ‰æ–Ê•`‰æ‚É“ü‚é‚©‚Ç‚¤‚©‚̃JƒEƒ“ƒg
var messageLayerHiding = false; // ƒ†[ƒU‚É‚æ‚胃bƒZ[ƒWƒŒƒCƒ„‚ª‰B‚³‚ê‚Ä‚¢‚é‚©
/*C*/var rightClickEnabled = true; // ‰EƒNƒŠƒbƒN‚ª—LŒø‚©
/*C*/var rightClickCall = false; // ‰EƒNƒŠƒbƒN‚Å“Á’è‚̃‹[ƒ`ƒ“‚ðŒÄ‚Ô‚©
/*C*/var rightClickJump = false; // ‰EƒNƒŠƒbƒN‚©‚Å“Á’è‚̃‰ƒxƒ‹‚ɃWƒƒƒ“ƒv‚·‚é‚©
/*C*/var rightClickTarget = ""; // ‰EƒNƒŠƒbƒN‚ł̌ĂÑo‚µæ
/*C*/var rightClickStorage = ""; // ‰EƒNƒŠƒbƒN‚ł̌ĂÑo‚µæ
/*C*/var rightClickName = "default"; // ‰EƒNƒŠƒbƒN‚̃ƒjƒ…[•\Ž¦–¼
/*C*/var rightClickCurrentMenuName = ""; // ‰EƒNƒŠƒbƒN‚̃ƒjƒ…[‚ÉŒ»Ýݒ肳‚ê‚Ä‚¢‚é–¼‘O
var rightClickDefaultName = ""; // ‰EƒNƒŠƒbƒN‚̃fƒtƒHƒ‹ƒg‚̃ƒjƒ…[•\Ž¦–¼
/*C*/var lastClickGlyphVisible; // extraConductor ‚ðŽg—p‚·‚é’¼‘O‚ɃNƒŠƒbƒN‘Ò‚¿‹L†‚ª‰ÂŽ‹‚¾‚Á‚½‚©‚Ç‚¤‚©
var lastClickGlyphMessagePage;
// extraConductor ‚ðŽg—p‚·‚é’¼‘O‚̃NƒŠƒbƒN‘Ò‚¿‹L†‚Ì•\Ž¦‚³‚ê‚Ä‚¢‚郃bƒZ[ƒWƒŒƒCƒ„‚̃y[ƒW
var lastClickGlyphMessageNum; // V ”Ô†
var lastClickGlyphWhich; // V "page" ‚© "line" ‚©
var inSleepBeforeExtraConductor; // extraConductor ‚ðŽg—p‚·‚é’¼‘O‚ª inSleep ‚¾‚Á‚½‚©
// ’Êí‚̃}ƒEƒXƒJ[ƒ\ƒ‹
/*C*/var cursorDefault = crArrow; // ’Êí‚̃}ƒEƒXƒJ[ƒ\ƒ‹
/*C*/var cursorPointed = crHandPoint; // ƒ{ƒ^ƒ“AƒŠƒ“ƒN“™‚ðƒ|ƒCƒ“ƒg‚µ‚½Žž‚̃}ƒEƒXƒJ[ƒ\ƒ‹
/*C*/var cursorWaitingClick = crArrow; // ƒNƒŠƒbƒN‘Ò‚¿‚̃}ƒEƒXƒJ[ƒ\ƒ‹
/*C*/var cursorDraggable = crSizeAll; // ƒhƒ‰ƒbƒO‰Â”\‚Èꊗp‚̃}ƒEƒXƒJ[ƒ\ƒ‹
/*C*/var startAnchorEnabled = false; // uʼn‚É–ß‚év‚ªŽg—p‰Â”\‚©‚Ç‚¤‚©
/*C*/var storeEnabled = true; // ƒ†[ƒU‚ªužx‚ð‚Í‚³‚Þvƒƒjƒ…[‚ɃAƒNƒZƒX‰Â”\‚©‚Ç‚¤‚©
/*C*/var restoreEnabled = true; // ƒ†[ƒU‚ªužx‚ð‚½‚Ç‚évƒƒjƒ…[‚ɃAƒNƒZƒX‰Â”\‚©‚Ç‚¤‚©
var storeLabelPassed = false; // •Û‘¶‰Â”\‚ȃ‰ƒxƒ‹‚ð’ʉ߂µ‚½‚©‚Ç‚¤‚©
/*C*/var currentLabel = ""; // Œ»Ý‚̃‰ƒxƒ‹
/*C*/var currentPageName = ""; // Œ»Ý‚̃y[ƒW–¼
var currentRecordName = ""; // Œ»Ý‚Ì‹L˜^–¼ ( trail_ƒXƒgƒŒ[ƒW_ƒ‰ƒxƒ‹ )
var autoRecordPageShowing = false; // ƒ‰ƒxƒ‹’ʉߋL˜^‚ð‚·‚é‚©
var numBookMarks = 10; // ƒƒjƒ…[‚É—pˆÓ‚·‚éžx‚̃Tƒuƒƒjƒ…[€–Ú‚Ì”
var showBookMarkDate = false; // ƒƒjƒ…[‚Éžx‚ð‚Í‚³‚ñ‚¾“ú•tŽž‚ð•\Ž¦‚·‚é‚©
var bookMarkNames = []; // ƒƒjƒ…[‚Éݒ肳‚ê‚Ä‚¢‚éžx‚Ì–¼‘O
var bookMarkDates = []; // žx‚Ì“ú•t
var bookMarkProtectedStates = []; // žx‚ª•ÛŒì‚³‚ê‚Ä‚¢‚é‚©‚Ìî•ñ
var showFixedPitchOnlyInFontSelector = false; // ƒtƒHƒ“ƒg‘I‘ð‚ŌŒèƒsƒbƒgƒtƒHƒ“ƒg‚Ì‚Ý‚ð•\Ž¦‚·‚é‚©
var flags = %[]; // ƒtƒ‰ƒO(ƒ†[ƒU)
var pflags = %[]; // u•Û‘¶‰Â”\‚ȃ‰ƒxƒ‹v‚ð’ʉ߂µ‚½Žž“_‚ł̃tƒ‰ƒO(ƒ†[ƒU)
var pcflags = %[]; // V (ƒRƒA)
var sflags = %[]; // ƒVƒXƒeƒ€•Ï”—̈æ(ƒ†[ƒU)
var scflags = %[]; // ƒVƒXƒeƒ€•Ï”—̈æ(ƒRƒA)
var tflags = %[]; // ˆêŽžƒtƒ‰ƒO
var tempBookMarks = []; // ˆêŽž“I‚É•Û‘¶‚µ‚½žx
var clickCount = 0; // ¶ƒNƒŠƒbƒNƒJƒEƒ“ƒg
var lastMouseDownX; // ÅŒã‚ɃNƒŠƒbƒN‚³‚ꂽ X À•W
var lastMouseDownY; // ÅŒã‚ɃNƒŠƒbƒN‚³‚ꂽ Y À•W
var mouseKeyEnabledCount = 0; // ƒ}ƒEƒXƒL[‚ª—LŒø‚©‚Ç‚¤‚©
var kagPlugins = []; // KAG ƒvƒ‰ƒOƒCƒ“
var keyDownHook = []; // ƒL[‚ª‰Ÿ‚³‚ꂽ‚Æ‚«‚ɌĂÑo‚³‚ê‚镨
var leftClickHook = []; // ‰EƒNƒŠƒbƒN‚³‚ꂽ‚Æ‚«‚ɌĂÑo‚³‚ê‚镨
var rightClickHook = []; // ¶ƒNƒŠƒbƒN‚³‚ꂽ‚Æ‚«‚ɌĂÑo‚³‚ê‚镨
var padKeyMap; // ƒpƒbƒhƒ{ƒ^ƒ“ -> ƒnƒ“ƒhƒ‰(ƒL[ƒR[ƒh)BƒRƒ“ƒXƒgƒ‰ƒNƒ^“à‚ÅÝ’è
var padKeyMapReverse; // ƒL[ƒR[ƒh -> ƒpƒbƒhƒ{ƒ^ƒ“BƒRƒ“ƒXƒgƒ‰ƒNƒ^“à‚ÅÝ’è
var holdPeriodEventQueue = []; // •Û—¯‚É‚³‚ꂽƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒgƒLƒ…[
var isLeavePeriodEvent = false; // ƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒg‚ð•Û—¯‚É‚·‚é‚©‚Ç‚¤‚©
var isWaitPeriodEvent = false; // ƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒg‘Ò‚¿ó‘Ô‚©‚Ç‚¤‚©
var waitedPeriodEventStorageName = void; // ƒsƒŠƒIƒhƒCƒxƒ“ƒg‘Ò‚¿‚ðƒR[ƒ‹‚µ‚½ƒXƒgƒŒ[ƒW–¼
//------------------------------------------------------ ƒRƒ“ƒXƒgƒ‰ƒNƒ^ --
function KAGWindow(ismain = true, width = 0, height = 0)
{
// ƒRƒ“ƒXƒgƒ‰ƒNƒ^
// ˆø” : ismain : ƒƒCƒ“ƒEƒBƒ“ƒhƒE‚Æ‚µ‚Ä쬂³‚ê‚é‚Ì‚©‚Ç‚¤‚©
super.Window(); // eƒNƒ‰ƒX‚̃Rƒ“ƒXƒgƒ‰ƒNƒ^‚ðŒÄ‚Ô
// ƒRƒ“ƒtƒBƒMƒ…ƒŒ[ƒVƒ‡ƒ“
isMain = ismain;
if(ismain)
{
(KAGWindow_config incontextof this)();
(KAGWindow_config_override incontextof this)()
if typeof global.KAGWindow_config_override != "undefined";
}
userChSpeed = chSpeed = actualChSpeed = chSpeeds.normal;
autoModePageWait = autoModePageWaits.medium;
autoModeLineWait = autoModeLineWaits.medium;
askOnClose = false if !ismain;
// saveDataLocation ‚ªƒtƒ‹ƒpƒX‚Å‚È‚¢‚悤‚È‚ç‚Î System.exePath ‚ð
// •t‚¯‰Á‚¦‚é
if(saveDataLocation.indexOf(":") == -1)
saveDataLocation = System.exePath + saveDataLocation;
// ƒƒjƒ…[ƒAƒCƒeƒ€‚Ìì¬
if(ismain) (KAGWindow_createMenus incontextof this)();
if(typeof this.rightClickMenuItem != "undefined")
rightClickDefaultName = rightClickCurrentMenuName = rightClickMenuItem.caption;
if(typeof this.autoModeMediumMenuItem != "undefined")
autoModeMediumMenuItem.checked = true;
if(typeof this.windowedMenuItem != "undefined")
windowedMenuItem.checked = true;
if(typeof this.chNormalMenuItem != "undefined")
chNormalMenuItem.checked = true;
if(typeof this.ch2ndNoChangeMenuItem != "undefined")
ch2ndNoChangeMenuItem.checked = true;
if(ismain) (Menu_visible_config incontextof this)();
createBookMarkSubMenus();
// ƒEƒBƒ“ƒhƒEŠOŒ©‚Ì’²®
if(ismain)
{
borderStyle = bsSingle;
innerSunken = true;
}
else
{
borderStyle = bsDialog;
innerSunken = false;
}
showScrollBars = false;
if(ismain) caption = System.title;
// ƒVƒXƒeƒ€ƒ^ƒCƒgƒ‹‚ðƒLƒƒƒvƒVƒ‡ƒ“‚Æ“¯‚¶‚É
if(ismain) System.title = caption;
// ƒEƒBƒ“ƒhƒEƒTƒCƒY‚Ì’²®
if(width != 0 && height != 0)
{
// —^‚¦‚ç‚ꂽƒTƒCƒY‚ð“K—p
scWidth = width;
scHeight = height;
}
setInnerSize(scWidth, scHeight);
// quake —pƒ^ƒCƒ}‚Ìì¬
quakeTimer = new Timer(onQuakeTimerInterval, '');
add(quakeTimer);
quakeTimer.interval = 50;
// ”wŒiƒŒƒCƒ„‚Ìì¬
fore.messages = [];
back.messages = [];
fore.layers = [];
back.layers = [];
fore.base = new BaseLayer(this, null, "•\-”wŒi");
add(fore.base);
fore.base.setImageSize(scWidth, scHeight);
fore.base.setSizeToImageSize();
back.base = new BaseLayer(this, fore.base, "— -”wŒi");
add(back.base);
back.base.setImageSize(scWidth, scHeight);
back.base.setSizeToImageSize();
fore.base.setCompLayer(back.base);
back.base.setCompLayer(fore.base);
fore.base.freeImage();
back.base.freeImage();
fore.base.setDefaultCursor(cursorDefault);
back.base.setDefaultCursor(cursorDefault);
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚Ìì¬
historyLayer = new HistoryLayer(this, fore.base);
add(historyLayer);
// ‘OŒiƒŒƒCƒ„‚Ìì¬
allocateCharacterLayers(numCharacterLayers);
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ìì¬
allocateMessageLayers(numMessageLayers, false);
current = fore.messages[0];
currentNum = 0;
currentPage = 0;
currentWithBack = false;
if(initialMessageLayerVisible)
{
fore.messages[0].visible = true;
back.messages[0].visible = true;
}
chDefaultAntialiased = fore.messages[0].defaultAntialiased;
// •¶Žš‚ɃAƒ“ƒ`ƒGƒCƒŠƒAƒX‚ð‚©‚¯‚é‚©‚Ç‚¤‚©
chDefaultFace = fore.messages[0].userFace;
// •¶Žš‚̃fƒtƒHƒ‹ƒg‚̃tƒHƒ“ƒg
if(typeof this.chAntialiasMenuItem != "undefined")
chAntialiasMenuItem.checked = chDefaultAntialiased;
// s‘Ò‚¿/ƒy[ƒW‘Ò‚¿ƒAƒjƒ[ƒVƒ‡ƒ“ƒŒƒCƒ„‚Ìì¬
lineBreak = new ClickGlyphLayer(this, fore.base);
add(lineBreak);
lineBreak.name = "sƒNƒŠƒbƒN‘Ò‚¿‹L†";
pageBreak = new ClickGlyphLayer(this, fore.base);
add(pageBreak);
pageBreak.name = "ƒy[ƒW––ƒNƒŠƒbƒN‘Ò‚¿‹L†";
// ƒ^ƒOƒnƒ“ƒhƒ‰/ƒRƒ“ƒ_ƒNƒ^‚ðì¬
tagHandlers = getHandlers();
mainConductor = new Conductor(this, tagHandlers);
add(mainConductor);
conductor = mainConductor;
extraConductor = new Conductor(this, tagHandlers);
add(extraConductor);
// BGM ƒIƒuƒWƒFƒNƒg‚ðì¬
bgm = new BGM(this);
add(bgm);
// Œø‰Ê‰¹ƒIƒuƒWƒFƒNƒg‚ðì¬
for(var i = 0; i < numSEBuffers; i++)
add(se = new SESoundBuffer(this, i));
// ƒ€[ƒr[ƒIƒuƒWƒFƒNƒg‚ðì¬
if(ismain)
{
for( var i = 0; i < numMovies; i++)
add(movies = new Movie(this,i));
}
// ƒfƒtƒHƒ‹ƒg‚̃nƒ“ƒhƒ‰‚ð’ljÁ
stableHandlers.add(defaultStableHandler);
runHandlers.add(defaultRunHandler);
// ƒVƒXƒeƒ€•Ï”‚Ì“Ç‚Ýž‚Ý
if(ismain) loadSystemVariables();
// ƒVƒXƒeƒ€•Ï”‚𔽉f
if(ismain)
{
setSystemStateFromSystemVariables();
setBookMarkMenuCaptions();
}
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚̃NƒŠƒA
clearMessageLayers(false);
// ƒEƒBƒ“ƒhƒEˆÊ’u‚Ì’²ß
if(this.width + this.left > System.desktopLeft + System.desktopWidth)
left = ((System.desktopWidth - this.width) >>1) + System.desktopLeft;
if(this.height + this.top > System.desktopTop + System.desktopHeight)
top = ((System.desktopHeight - this.height) >>1) + System.desktopTop;
// ƒpƒbƒhƒ{ƒ^ƒ“ƒnƒ“ƒhƒ‰‚Ìì¬
createPadKeyMap();
// ƒEƒBƒ“ƒhƒE‚ð•\Ž¦
if(ismain) visible = true;
// ‰æ–ʃTƒCƒY‚ªƒEƒBƒ“ƒhƒEƒTƒCƒY‚æ‚è‚ଂ³‚¢ê‡‚Í
// ƒtƒ‹ƒXƒNƒŠ[ƒ“‚É‚µ‚Ä‚Ý‚é
if(ismain)
{
if(System.screenWidth <= scWidth && System.screenHeight <= scHeight)
onFullScreenMenuItemClick(this);
}
// ‘O‰ñ‹N“®Žž‚Ƀtƒ‹ƒXƒNƒŠ[ƒ“‚¾‚Á‚½ê‡‚̓tƒ‹ƒXƒNƒŠ[ƒ“‚É‚µ‚Ä‚Ý‚é
if(ismain)
{
if(scflags.fullScreen !== void && +scflags.fullScreen)
onFullScreenMenuItemClick(this);
}
// ‚¢‚Á‚½‚ñƒVƒXƒeƒ€•Ï”‚ð‘‚«o‚·
if(ismain) saveSystemVariables();
}
//------------------------------------------------------------- finalize --
function finalize()
{
// finalize ƒƒ\ƒbƒh
// ƒvƒ‰ƒOƒCƒ“‚Ì–³Œø‰»
for(var i = 0; i < kagPlugins.count; i++) invalidate kagPlugins;
// ‘OŒiAƒƒbƒZ[ƒWƒŒƒCƒ„‚𖳌ø‰»
for(var i = 0; i< fore.layers.count; i++) invalidate fore.layers;
for(var i = 0; i< back.layers.count; i++) invalidate back.layers;
for(var i = 0; i< fore.messages.count; i++) invalidate fore.messages;
for(var i = 0; i< back.messages.count; i++) invalidate back.messages;
// snapshotLayer ‚𖳌ø‰»
invalidate snapshotLayer if snapshotLayer !== void;
// tempLayer ‚𖳌ø‰»
invalidate tempLayer if tempLayer !== void;
// ƒX[ƒp[ƒNƒ‰ƒX‚Ì finalize ‚ðŒÄ‚Ô
super.finalize(...);
}
//-------------------------------------------------- onCloseQuery/close --
function onCloseQuery()
{
saveSystemVariables();
if(!askOnClose) { super.onCloseQuery(true); return; }
super.onCloseQuery(askYesNo("Quit the GameH"));
}
function close()
{
// ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚é
saveSystemVariables();
super.close(...);
}
function shutdown()
{
// ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚邪AI—¹Šm”F‚ðs‚í‚È‚¢
// ‚±‚̃ƒ\ƒbƒh“à‚Å close ‚ð‚·‚é‚ÆA—lX‚È
// ƒIƒuƒWƒFƒNƒg‚ª–³Œø‰»‚³‚ê‚Ä‚µ‚Ü‚¢A‚±‚Ì
// ŠÖ”‚©‚ç–ß‚Á‚½æ‚ŃGƒ‰[‚ª”¶‚·‚éB
// ‚»‚Ì‚½‚ßA‚¢‚Á‚½‚ñ AsyncTrigger ‚ð‰î‚µ‚ÄA
// ‘S‚Ẵƒ\ƒbƒh‚©‚ç‹A‚Á‚½‚ ‚ƂɃVƒƒƒbƒgƒ_ƒEƒ“
// ˆ—‚ðs‚¤B
global.shutdownTrigger =
new AsyncTrigger(handleShutdown, '');
global.shutdownTrigger.cached = true;
global.shutdownTrigger.trigger();
if(conductor.status == conductor.mRun)
conductor.interrupt();
// ƒRƒ“ƒ_ƒNƒ^‚ª‘–s’†‚ÌŽž‚Í
// ƒRƒ“ƒ_ƒNƒ^‚É’†’f‚ð“`‚¦‚é
}
function handleShutdown()
{
// shutdown() ‚©‚ç‚̃Vƒƒƒbƒgƒ_ƒEƒ“—v‹‚ð
// ŽÀۂɈ—‚·‚郃\ƒbƒh
var askOnClose_save = askOnClose;
askOnClose = false;
close();
if(this isvalid) askOnClose = askOnClose_save;
}
function closeByScript(elm)
{
// ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚é
// ‚¿‚å‚Á‚Æ–Ê“|‚‚³‚¢‚Æ‚ð‚â‚Á‚Ä‚¢‚é‚Ì‚Í
// shutdown ‚Æ“¯‚¶——R
// u‚¢‚¢‚¦v‚ª‘I‘ð‚³‚ê‚ăEƒBƒ“ƒhƒE‚ª•Â‚¶‚È‚©‚Á‚½ê‡‚Í
// 'not_closed' ƒgƒŠƒK‚ª”s‚³‚êAŽÀs‚ÍÄŠJ‚·‚éB
var askOnClose_save = askOnClose;
if(elm.ask !== void && !(+elm.ask)) askOnClose = false;
global.shutdownTrigger =
new AsyncTrigger(handleCloseByScript, '');
global.shutdownTrigger.cached = true;
global.shutdownTrigger.trigger();
// closeByScript ‚ÍA‚±‚̃nƒ“ƒhƒ‰‚ªI‚í‚Á‚½’¼Œã‚É
// uI—¹‚µ‚Ü‚·‚©Hv‚̃_ƒCƒAƒƒO‚ð•\Ž¦‚·‚éB
// I—¹‚·‚éꇂ͂»‚Ì‚Ü‚ÜI—¹‚·‚éB
// I—¹‚µ‚È‚¢ê‡‚Í 'not_closed' ƒgƒŠƒK‚ª”s‚³‚êA
// ŽÀs‚ÍŒp‘±‚·‚éB
conductor.wait(%[
not_closed : askOnClose_save
? (function
{
// ŽÀÛ‚É‚±‚ꂪŒÄ‚΂ê‚邱‚Æ‚Í‚È‚¢‚ªAˆê‰ž
askOnClose = true;
} incontextof this)
: (function
{
} incontextof this)
]);
}
function handleCloseByScript()
{
// shutdown() ‚©‚ç‚̃Vƒƒƒbƒgƒ_ƒEƒ“—v‹‚ð
// ŽÀۂɈ—‚·‚郃\ƒbƒh
close();
if(this isvalid) // ‚¢‚¢‚¦ ‚ª‘I‘ð‚³‚ê‚½ê‡
conductor.trigger('not_closed');
}
//------------------------------------------------------ ƒvƒ‰ƒOƒCƒ“ˆ— --
function forEachEventHook(method, func, arg)
{
// ‚·‚ׂẴvƒ‰ƒOƒCƒ“ƒIƒuƒWƒFƒNƒg‚Ì method ‚É‚½‚¢‚µ‚Ä
// func ‚ðŽÀs‚·‚é
// func ‚̈ø”‚É‚ÍŠe—v‘f‚Æ arg ‚ª“n‚³‚ê‚é
if(kagPlugins.count)
{
var array = [];
array.assign(kagPlugins); // ‚¢‚Á‚½‚ñƒRƒs[‚µAƒRƒs[‚µ‚½•¨‚ɑ΂µ‚ÄŽÀs‚·‚é
var arraycount = array.count;
for(var i =0; i<arraycount; i++)
{
var obj = array;
if(typeof obj[method] != "undefined")
func(obj[method], arg);
}
}
}
function addPlugin(plugin)
{
// ƒvƒ‰ƒOƒCƒ“ƒIƒuƒWƒFƒNƒg‚ð’ljÁ
kagPlugins.add(plugin);
}
function removePlugin(plugin)
{
// ƒvƒ‰ƒOƒCƒ“ƒIƒuƒWƒFƒNƒg‚ðíœ
kagPlugins.remove(plugin);
}
//---------------------------------------------------------- ƒtƒbƒNˆ— --
function callHook(array, arg1, arg2, arg3)
{
if(array.count)
{
var processed = false;
var newarray = [];
newarray.assign(array);
var arraycount = newarray.count;
for(var i = 0; i < arraycount; i++)
{
var func = newarray;
var ret = func(arg1, arg2, arg3);
processed = processed || ret;
}
return processed;
}
else
{
return false;
}
}
//------------------------------------------ ƒpƒbƒh‚̃L[ƒ}ƒbƒsƒ“ƒOì¬ --
function createPadKeyMap()
{
// ƒpƒbƒh“ü—Í‚Æ‚»‚ê‚ɑΉž‚·‚é“®ì‚̃}ƒbƒsƒ“ƒOB
// •W€‚Å‚Í\ŽšƒL[‚̓L[ƒ{[ƒh‚̃J[ƒ\ƒ‹ƒL[‚Ƀ}ƒbƒsƒ“ƒOA
// ƒ{ƒ^ƒ“1 ‚Í ReturnAƒ{ƒ^ƒ“2 ‚Í ESCAƒ{ƒ^ƒ“3 ‚Í ƒƒbƒZ[ƒW—š—ð‚Ì•\Ž¦
// ‚Ƀ}ƒbƒsƒ“ƒO‚³‚ê‚éB
// ŠÖ”‚ðŽw’肵‚½ê‡‚̓{ƒ^ƒ“‚ð‰Ÿ‚µ‚½‚Æ‚«‚É‚Í‚»‚ÌŠÖ”‚ªŒÄ‚΂ê‚éB
padKeyMap = %[
VK_PADLEFT => VK_LEFT,
VK_PADRIGHT => VK_RIGHT,
VK_PADUP => VK_UP,
VK_PADDOWN => VK_DOWN,
VK_PAD1 => VK_RETURN,
VK_PAD2 => VK_ESCAPE,
VK_PAD3 =>
function(ev) {
showHistoryByKey(this);
},
];
// padKeyMapReverse ‚ðì¬
padKeyMapReverse = %[];
var ar = [];
ar.assign(padKeyMap);
for(var i = 0; i < ar.count; i += 2)
{
if(typeof(ar[i+1]) != "Object")
{
padKeyMapReverse[ar[i+1]] = ar;
}
}
}
function getKeyState(key)
{
// System.getKeyState ŠÖ”‚Æ“¯“™‚¾‚ªAƒpƒbƒh‚̃L[‚ÉŠÖ‚µ‚Ä‚à
// ”½‰ž‚ð•Ô‚·
var sg = System.getKeyState;
var state = sg(key);
if(state) return true;
var pad_key = padKeyMapReverse[key];
if(pad_key !== void)
{
// ƒL[ƒR[ƒh -> ƒpƒbƒh‚̃L[ƒR[ƒh‚Ì•ÏŠ·‚ªŒ©‚‚©‚Á‚½
return sg(pad_key);
}
return false;
}
//-------------------------------------------------------------- action --
function action(ev)
{
if(ev.type == 'onKeyDown' && ev.target === this)
{
// ƒpƒbƒh“ü—͂ɑΉž‚·‚鈗
var handler = padKeyMap[ev.key];
if(handler !== void)
{
// ƒnƒ“ƒhƒ‰‚ªŒ©‚‚©‚Á‚½
if(typeof(handler) == "Object")
{
// ƒnƒ“ƒhƒ‰‚ÍŠÖ”
(handler incontextof this)(ev);
}
else
{
// ƒnƒ“ƒhƒ‰‚̓L[ƒR[ƒh
postInputEvent('onKeyDown', %[key: handler]);
postInputEvent('onKeyUp', %[key: handler]);
}
}
}
}
//------------------------------------------------------ tempLayer ŠÖ˜A --
property temporaryLayer
{
// ƒ[ƒNƒGƒŠƒA‚Æ‚µ‚Ĉꎞ“I‚ÉŽg—p‚Å‚«‚郌ƒCƒ„‚ð•Ô‚·
getter()
{
if(tempLayer === void)
{
tempLayer = new KAGLayer(this, primaryLayer);
tempLayer.name = "ˆêŽžƒ[ƒNƒŒƒCƒ„";
}
return tempLayer;
}
}
//------------------------------------------------ ƒƒjƒ…[ƒAƒCƒeƒ€ŠÖ˜A --
function onExitMenuItemClick(sender)
{
close();
}
function onRightClickMenuItemClick(sender)
{
onPrimaryRightClick(); // ‰EƒNƒŠƒbƒN‚Ì“®ì
}
function onShowHistoryMenuItemClick(sender)
{
if(historyLayer.visible) hideHistory(); else showHistory();
}
function onSkipToNextStopMenuItemClick(sender)
{
skipToStop();
}
function onAutoModeMenuItemClick(sender)
{
if(autoMode) cancelAutoMode(); else enterAutoMode();
}
function onAutoModeWaitMenuClick(sender)
{
sender.checked = true;
autoModePageWait = sender.wait;
autoModeLineWait = sender.lwait;
}
function onBackStartMenuItemClick(sender)
{
goBackHistory();
}
function onGoToStartMenuItemClick(sender)
{
goToStartWithAsk();
}
function onChSpeedMenuItemClick(sender)
{
sender.checked = true;
userChSpeed = sender.speed;
setUserSpeed();
saveSystemVariables();
}
function onChNonStopToPageBreakItemClick(sender)
{
chNonStopToPageBreak = ! chNonStopToPageBreak;
if(typeof this.chNonStopToPageBreakItem != "undefined")
chNonStopToPageBreakItem.checked = chNonStopToPageBreak;
saveSystemVariables();
}
function onCh2ndNonStopToPageBreakItemClick(sender)
{
ch2ndNonStopToPageBreak = ! ch2ndNonStopToPageBreak;
if(typeof this.ch2ndNonStopToPageBreakItem != "undefined")
ch2ndNonStopToPageBreakItem.checked = ch2ndNonStopToPageBreak;
saveSystemVariables();
}
function onCh2ndSpeedMenuItemClick(sender)
{
sender.checked = true;
userCh2ndSpeed = sender.speed;
setUserSpeed();
saveSystemVariables();
}
function onChAntialiasMenuItemClick(sender)
{
chDefaultAntialiased = !chDefaultAntialiased;
if(typeof this.chAntialiasMenuItem != "undefined")
chAntialiasMenuItem.checked = chDefaultAntialiased;
setMessageLayerUserFont();
saveSystemVariables();
}
function onChChangeFontMenuItem(sender)
{
selectFont();
saveSystemVariables();
}
function onRestoreMenuClick(sender)
{
if(!freeSaveDataMode) return;
loadBookMarkFromFileWithAsk();
}
function onStoreMenuClick(sender)
{
if(!freeSaveDataMode) return;
saveBookMarkToFileWithAsk();
}
function onWindowedMenuItemClick(sender)
{
if(fullScreened)
{
try
{
fullScreen = false;
}
catch(e)
{
Debug.notice("ƒEƒBƒ“ƒhƒEƒ‚[ƒh‚ɈÚs‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½ : " + e.message);
}
fullScreened = fullScreen;
if(fullScreened)
fullScreenMenuItem.checked = true;
else
windowedMenuItem.checked = true;
}
saveSystemVariables();
}
function onFullScreenMenuItemClick(sender)
{
if(!fullScreened)
{
try
{
fullScreen = true;
}
catch(e)
{
Debug.notice("ƒtƒ‹ƒXƒNƒŠ[ƒ“ƒ‚[ƒh‚ɈÚs‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½ : " + e.message);
}
fullScreened = fullScreen;
if(fullScreened)
fullScreenMenuItem.checked = true;
else
windowedMenuItem.checked = true;
}
saveSystemVariables();
}
function onHelpIndexMenuItemClick(sender)
{
// ƒwƒ‹ƒvƒtƒ@ƒCƒ‹‚ðŠJ‚
System.shellExecute(Storages.getLocalName(System.exePath) + helpFile);
}
function onHelpAboutMenuItemClick(sender)
{
// u‚±‚̃\ƒtƒg‚ɂ‚¢‚ÄvƒEƒBƒ“ƒhƒE‚ð•\Ž¦
var win = new global.KAGWindow(false, aboutWidth, aboutHeight);
win.setPos(left + ((width - win.width)>>1), top + ((height - win.height)>>1));
win.process('about.ks' ,,, true); // about.ks ‚ð immediate ‚Å•\Ž¦
win.showModal(); // ƒ‚[ƒh•t‚«‚Å•\Ž¦
invalidate win;
}
function onReloadScenarioMenuItemClick(sender)
{
saveBookMark(1000, false);
loadBookMark(1000);
}
function onShowConsoleMenuItemClick(sender)
{
Debug.console.visible = true;
}
function onShowContollerMenuItemClick(sender)
{
Debug.controller.visible = true;
}
function internalSetMenuAccessibleAll(menu, state)
{
// autoEnable ‚ª true ‚Ì‚·‚ׂẴƒjƒ…[€–Ú‚Ì accessible ‚É’l state ‚ð
// Ý’è‚·‚é
if(typeof menu.autoEnable != "undefined" && menu.autoEnable)
menu.accessible = state;
if(typeof menu.stopRecur == "undefined" || !menu.stopRecur)
{
var children = menu.children;
for(var i = children.count -1; i >= 0; i--)
internalSetMenuAccessibleAll(children, state); // Ä‹A
}
}
function canStore()
{
return storeEnabled && storeLabelPassed;
}
function canRestore()
{
return restoreEnabled;
}
function setMenuAccessibleAll()
{
// ƒƒjƒ…[€–Ú‚ÌŽg—p‰Â/•s‰Â‚ðÝ’è‚·‚é
// autoEnable ‚ª true ‚Ì‚·‚ׂẴƒjƒ…[€–Ú‚Ì accessible ‚Ì
// ’l‚ðÝ’è‚·‚é
var notmodal = !historyLayer.visible && !messageLayerHiding;
var state = inStable && notmodal;
internalSetMenuAccessibleAll(menu, state);
// ‚»‚Ì‘¼‚̃ƒjƒ…[‚ÌŽg—p‰Â/•s‰Â
if(typeof this.skipToNextStopMenuItem != "undefined")
skipToNextStopMenuItem.enabled = state && !inSleep && nextSkipEnabled;
if(typeof this.rightClickMenuItem != "undefined")
rightClickMenuItem.enabled = inStable && !historyLayer.visible;
if(typeof this.showHistoryMenuItem != "undefined")
showHistoryMenuItem.enabled = inStable && !messageLayerHiding &&
historyEnabled;
if(typeof this.autoModeMenuItem != "undefined")
autoModeMenuItem.enabled = notmodal;
if(typeof this.goBackMenuItem != "undefined")
goBackMenuItem.enabled = state && isHistoryOfStoreAlive();
if(typeof this.goToStartMenuItem != "undefined")
goToStartMenuItem.enabled = state && startAnchorEnabled;
if(typeof this.storeMenu != "undefined")
{
var st = state && canStore();
var children = storeMenu.children;
if(freeSaveDataMode) storeMenu.enabled = st;
for(var i = children.count - 1; i >= 0; i--)
{
var obj = children;
obj.enabled = obj.orgEnabled && st;
}
}
if(typeof this.restoreMenu != "undefined")
{
var st = state && canRestore();
var children = restoreMenu.children;
if(freeSaveDataMode) restoreMenu.enabled = st;
for(var i = children.count - 1; i >= 0; i--)
{
var obj = children;
obj.enabled = obj.orgEnabled && st;
}
}
}
//----------------------------------------------- ƒ}ƒEƒXƒL[‚ð—LŒø‚É‚·‚é --
function enableMouseKey()
{
// ƒ}ƒEƒXƒL[‚ð—LŒø‚É‚·‚é
if(mouseKeyEnabledCount == 0)
{
useMouseKey = true;
mouseCursorState = mcsVisible;
}
mouseKeyEnabledCount++; // ŽQƃJƒEƒ“ƒ^•ûŽ®
}
function disableMouseKey()
{
// ƒ}ƒEƒXƒL[‚𖳌ø‚É‚·‚é
mouseKeyEnabledCount --;
if(mouseKeyEnabledCount == 0) useMouseKey = false;
}
//----------------------------------------------------- ƒVƒXƒeƒ€•Ï”ŠÖ˜A --
function loadSystemVariables()
{
// ƒVƒXƒeƒ€•Ï”‚Ì“Ç‚Ýž‚Ý
try
{
var fn = saveDataLocation + "/" + dataName +
"sc.ksd";
if(Storages.isExistentStorage(fn))
{
scflags = Scripts.evalStorage(fn);
scflags = %[] if scflags === void;
}
else
{
scflags = %[];
}
var fn = saveDataLocation + "/" + dataName +
"su.ksd";
if(Storages.isExistentStorage(fn))
{
sflags = Scripts.evalStorage(fn);
sflags = %[] if sflags === void;
}
else
{
sflags = %[];
}
}
catch(e)
{
throw new Exception("ƒVƒXƒeƒ€•Ï”ƒf[ƒ^‚ð“Ç‚Ýž‚ß‚È‚¢‚©A"
"‚ ‚é‚¢‚̓VƒXƒeƒ€•Ï”ƒf[ƒ^‚ª‰ó‚ê‚Ä‚¢‚Ü‚·(" + e.message + ")");
}
}
function setSystemStateFromSystemVariables()
{
// ƒVƒXƒeƒ€•Ï”‚ÉŠî‚¢‚ăVƒXƒeƒ€‚ðÝ’è
// (ƒtƒ‹ƒXƒNƒŠ[ƒ“ŠÖ˜A‚ð‚Ì‚¼‚)
if(scflags.autoModePageWait !== void)
{
if(typeof this.autoModeWaitMenu !== "undefined")
{
var children = autoModeWaitMenu.children;
for(var i = children.count-1; i >= 0; i--)
{
var item = children;
if(typeof item.wait !== "undefined" && item.wait == scflags.autoModePageWait)
{
item.checked = true;
break;
}
}
}
}
if(scflags.userChSpeed !== void)
{
if(typeof this.chSpeedMenu !== "undefined")
{
var children = chSpeedMenu.children;
for(var i = children.count-1; i >= 0; i--)
{
var item = children;
if(typeof item.speed !== "undefined" && item.speed == scflags.userChSpeed)
{
item.checked = true;
break;
}
}
}
}
if(scflags.userCh2ndSpeed !== void)
{
if(typeof this.chSpeedMenu !== "undefined")
{
var children = ch2ndSpeedMenu.children;
for(var i = children.count-1; i >= 0; i--)
{
var item = children;
if(typeof item.speed !== "undefined" && item.speed == scflags.userCh2ndSpeed)
{
item.checked = true;
break;
}
}
}
}
lastSaveDataNameGlobal = scflags.lastSaveDataNameGlobal if scflags.lastSaveDataNameGlobal !== void;
bookMarkNames = scflags.bookMarkNames if scflags.bookMarkNames !== void;
bookMarkDates = scflags.bookMarkDates if scflags.bookMarkDates !== void;
bookMarkProtectedStates = scflags.bookMarkProtectedStates if scflags.bookMarkProtectedStates !== void;
autoModePageWait = scflags.autoModePageWait if scflags.autoModePageWait !== void;
autoModeLineWait = scflags.autoModeLineWait if scflags.autoModeLineWait !== void;
userChSpeed = scflags.userChSpeed if scflags.userChSpeed !== void;
userCh2ndSpeed = scflags.userCh2ndSpeed if scflags.userCh2ndSpeed !== void;
setUserSpeed();
chNonStopToPageBreak = scflags.chNonStopToPageBreak if scflags.chNonStopToPageBreak !== void;
if(typeof this.chNonStopToPageBreakItem != "undefined")
chNonStopToPageBreakItem.checked = chNonStopToPageBreak;
ch2ndNonStopToPageBreak = scflags.ch2ndNonStopToPageBreak if scflags.ch2ndNonStopToPageBreak !== void;
if(typeof this.ch2ndNonStopToPageBreakItem != "undefined")
ch2ndNonStopToPageBreakItem.checked = ch2ndNonStopToPageBreak;
chDefaultAntialiased = scflags.chDefaultAntialiased if scflags.chDefaultAntialiased !== void;
if(typeof this.chAntialiasMenuItem != "undefined")
chAntialiasMenuItem.checked = chDefaultAntialiased;
chDefaultFace = scflags.chDefaultFace if scflags.chDefaultFace !== void;
setMessageLayerUserFont();
bgm.restoreSystemState(scflags);
for(var i = 0; i<numSEBuffers; i++)
{
se.restoreSystemState(scflags);
}
}
function clearSystemVariables()
{
// ƒVƒXƒeƒ€•Ï”‚̃NƒŠƒA
(Dictionary.clear incontextof sflags)();
}
function saveSystemVariables()
{
// ƒVƒXƒeƒ€•Ï”‚Ì•Û‘¶
if(!isMain) return;
// ƒvƒ‰ƒOƒCƒ“‚ðŒÄ‚Ô
forEachEventHook('onSaveSystemVariables',
function(handler, f) { handler(); } incontextof this);
// ƒtƒ‹ƒXƒNƒŠ[ƒ“
scflags.fullScreen = fullScreened;
// •¶Žš•\Ž¦‘¬“x
scflags.autoModePageWait = autoModePageWait;
scflags.autoModeLineWait = autoModeLineWait;
scflags.userChSpeed = userChSpeed;
scflags.userCh2ndSpeed = userCh2ndSpeed;
scflags.chDefaultAntialiased = chDefaultAntialiased;
scflags.chDefaultFace = chDefaultFace;
scflags.chNonStopToPageBreak = chNonStopToPageBreak;
scflags.ch2ndNonStopToPageBreak = ch2ndNonStopToPageBreak;
// ƒuƒbƒNƒ}[ƒN–¼
scflags.bookMarkNames = bookMarkNames; // (ƒRƒs[‚Å‚Í‚È‚‚Ä)ŽQÆ‚Å\•ª
scflags.bookMarkDates = bookMarkDates;
scflags.bookMarkProtectedStates = bookMarkProtectedStates;
scflags.lastSaveDataNameGlobal = lastSaveDataNameGlobal;
// ƒtƒ@ƒCƒ‹‚É‘‚«ž‚Þ
if(!readOnlyMode)
{
var fn = saveDataLocation + "/" + dataName +
"sc.ksd";
(Dictionary.saveStruct incontextof scflags)(fn, saveDataMode);
var fn = saveDataLocation + "/" + dataName +
"su.ksd";
(Dictionary.saveStruct incontextof sflags)(fn, saveDataMode);
}
}
//------------------------------------------------------- ƒQ[ƒ€•Ï”ŠÖ˜A --
function internalStoreFlags(f)
{
// f ‚ÉŒ»Ý‚Ìó‘Ô‚ð‹L˜^‚·‚é
// KAGWindow ‚ÉŠÖ‚·‚é‚à‚Ì
(Dictionary.clear incontextof f)(); // ƒNƒŠƒA
// ‚±‚±‚Ì [start_store_vars] ‚©‚ç [end_store_vars] ‚ň͂܂ꂽ•”•ª‚Í
// ––’[‚Ì perl ƒXƒNƒŠƒvƒg‚É‚æ‚Á‚ÄŽ©“®“I‚Ɉ—‚³‚ê‚é‚Ì‚ÅA‚±‚̃}[ƒN‚ðÁ‚µ‚½‚è
// ‚±‚̃}[ƒN‚ÌŠÔ‚ð•ÒW‚µ‚½‚肵‚È‚¢‚±‚ÆB
// [start_store_vars]
f.lastSaveDataName = lastSaveDataName;
f.quaking = quaking;
f.quakeEndTick = quakeEndTick;
f.quakeHorzMax = quakeHorzMax;
f.quakeVertMax = quakeVertMax;
f.quakePhase = quakePhase;
f.historyWriteEnabled = historyWriteEnabled;
f.historyEnabled = historyEnabled;
f.numCharacterLayers = numCharacterLayers;
f.numMessageLayers = numMessageLayers;
f.currentNum = currentNum;
f.currentPage = currentPage;
f.currentWithBack = currentWithBack;
f.chUserMode = chUserMode;
f.chSpeed = chSpeed;
f.actualChSpeed = actualChSpeed;
f.beforeNoWaitActualChSpeed = beforeNoWaitActualChSpeed;
f.beforeNoWaitChUserMode = beforeNoWaitChUserMode;
f.clickSkipEnabled = clickSkipEnabled;
f.nextSkipEnabled = nextSkipEnabled;
f.canCancelSkipByClick = canCancelSkipByClick;
f.autoWCEnabled = autoWCEnabled;
f.autoWCChars = autoWCChars;
f.rightClickEnabled = rightClickEnabled;
f.rightClickCall = rightClickCall;
f.rightClickJump = rightClickJump;
f.rightClickTarget = rightClickTarget;
f.rightClickStorage = rightClickStorage;
f.rightClickName = rightClickName;
f.rightClickCurrentMenuName = rightClickCurrentMenuName;
f.lastClickGlyphVisible = lastClickGlyphVisible;
f.cursorDefault = cursorDefault;
f.cursorPointed = cursorPointed;
f.cursorWaitingClick = cursorWaitingClick;
f.cursorDraggable = cursorDraggable;
f.startAnchorEnabled = startAnchorEnabled;
f.storeEnabled = storeEnabled;
f.restoreEnabled = restoreEnabled;
f.currentLabel = currentLabel;
f.currentPageName = currentPageName;
// [end_store_vars]
// perl ƒXƒNƒŠƒvƒg‚É‚æ‚Á‚ÄŽ©“®“I‚Ɉ—‚³‚ê‚È‚¢‚à‚ÌA‚¢‚‚‚©B
// Ž©“®ƒEƒFƒCƒg
f.autoWCWaits = [];
f.autoWCWaits.assign(autoWCWaits); // Ž©“®ƒEƒFƒCƒg‚̃EƒFƒCƒg
// bgm
f.bgm = bgm.store();
// Œø‰Ê‰¹
f.se = [];
for(var i = 0; i<numSEBuffers; i++)
{
f.se = se.store();
}
// ƒƒbƒZ[ƒWƒŒƒCƒ„
f.foreMessageLayers = [];
f.backMessageLayers = [];
for(var i = 0; i < numMessageLayers; i++)
{
f.foreMessageLayers = fore.messages.store();
f.backMessageLayers = back.messages.store();
}
// ‘OŒiƒŒƒCƒ„
f.foreCharacterLayers = [];
f.backCharacterLayers = [];
for(var i = 0; i < numCharacterLayers; i++)
{
f.foreCharacterLayers = fore.layers.store();
f.backCharacterLayers = back.layers.store();
}
// ”wŒiƒŒƒCƒ„
f.foreBaseLayer = fore.base.store();
f.backBaseLayer = back.base.store();
// ƒEƒBƒ“ƒhƒEƒLƒƒƒvƒVƒ‡ƒ“
f.caption = caption;
// ƒRƒ“ƒ_ƒNƒ^
f.mainConductor = mainConductor.store();
if(!saveMacros) f.mainConductor.macros = void;
// ƒ}ƒNƒî•ñ‚ð void ‚Åã‘‚«‚·‚é‚Æžx’†‚̃}ƒNƒî•ñ‚Í–³Œø‚É‚È‚é
// ƒƒbƒZ[ƒW—š—ð
if(historyLayer.storeState)
{
f.historyData = historyLayer.save();
}
// ƒ€[ƒr[
if( isMain )
{
f.movies = [];
for( var i = 0; i < numMovies; i++)
f.movies = movies.store();
}
// storeHook
forEachEventHook('onStore',
function(handler, f) { handler(f.flags, f.options); } incontextof this,
%[flags:f, options:void]);
}
function storeFlags()
{
// pcflags, pflags ‚É’l‚ð‘‚«ž‚Þ
// flags -> pflags
(Dictionary.assignStruct incontextof pflags)(flags);
internalStoreFlags(pcflags);
}
function internalRestoreFlags(f, clear = true, elm = void)
{
// f ‚©‚çî•ñ‚ð“Ç‚Ýo‚·
// clear ‚ª true ‚È‚ç‚΃ƒbƒZ[ƒWƒŒƒCƒ„‚ðƒNƒŠƒA‚·‚é
// se, bgm ‚ª‚»‚ꂼ‚ê true ‚È‚ç‚΂»‚Ìî•ñ‚à”½‰f‚³‚¹‚é
// backlay ‚ª true ‚ÌꇂÍA•\‰æ–ʂɃ[ƒh‚·‚ׂ«‚à‚Ì‚ð— ‰æ–ʂɃ[ƒh‚·‚é
// KAGWindow ‚ÉŠÖ‚·‚é‚à‚Ì
// ‚±‚±‚Ì [start_restore_vars] ‚©‚ç [end_restore_vars] ‚ň͂܂ꂽ•”•ª‚Í
// (—ª)
// [start_restore_vars]
lastSaveDataName = f.lastSaveDataName if f.lastSaveDataName !== void;
quaking = f.quaking if f.quaking !== void;
quakeEndTick = f.quakeEndTick if f.quakeEndTick !== void;
quakeHorzMax = f.quakeHorzMax if f.quakeHorzMax !== void;
quakeVertMax = f.quakeVertMax if f.quakeVertMax !== void;
quakePhase = f.quakePhase if f.quakePhase !== void;
historyWriteEnabled = f.historyWriteEnabled if f.historyWriteEnabled !== void;
historyEnabled = f.historyEnabled if f.historyEnabled !== void;
numCharacterLayers = f.numCharacterLayers if f.numCharacterLayers !== void;
numMessageLayers = f.numMessageLayers if f.numMessageLayers !== void;
currentNum = f.currentNum if f.currentNum !== void;
currentPage = f.currentPage if f.currentPage !== void;
currentWithBack = f.currentWithBack if f.currentWithBack !== void;
chUserMode = f.chUserMode if f.chUserMode !== void;
chSpeed = f.chSpeed if f.chSpeed !== void;
actualChSpeed = f.actualChSpeed if f.actualChSpeed !== void;
beforeNoWaitActualChSpeed = f.beforeNoWaitActualChSpeed if f.beforeNoWaitActualChSpeed !== void;
beforeNoWaitChUserMode = f.beforeNoWaitChUserMode if f.beforeNoWaitChUserMode !== void;
clickSkipEnabled = f.clickSkipEnabled if f.clickSkipEnabled !== void;
nextSkipEnabled = f.nextSkipEnabled if f.nextSkipEnabled !== void;
canCancelSkipByClick = f.canCancelSkipByClick if f.canCancelSkipByClick !== void;
autoWCEnabled = f.autoWCEnabled if f.autoWCEnabled !== void;
autoWCChars = f.autoWCChars if f.autoWCChars !== void;
rightClickEnabled = f.rightClickEnabled if f.rightClickEnabled !== void;
rightClickCall = f.rightClickCall if f.rightClickCall !== void;
rightClickJump = f.rightClickJump if f.rightClickJump !== void;
rightClickTarget = f.rightClickTarget if f.rightClickTarget !== void;
rightClickStorage = f.rightClickStorage if f.rightClickStorage !== void;
rightClickName = f.rightClickName if f.rightClickName !== void;
rightClickCurrentMenuName = f.rightClickCurrentMenuName if f.rightClickCurrentMenuName !== void;
lastClickGlyphVisible = f.lastClickGlyphVisible if f.lastClickGlyphVisible !== void;
cursorDefault = f.cursorDefault if f.cursorDefault !== void;
cursorPointed = f.cursorPointed if f.cursorPointed !== void;
cursorWaitingClick = f.cursorWaitingClick if f.cursorWaitingClick !== void;
cursorDraggable = f.cursorDraggable if f.cursorDraggable !== void;
startAnchorEnabled = f.startAnchorEnabled if f.startAnchorEnabled !== void;
storeEnabled = f.storeEnabled if f.storeEnabled !== void;
restoreEnabled = f.restoreEnabled if f.restoreEnabled !== void;
currentLabel = f.currentLabel if f.currentLabel !== void;
currentPageName = f.currentPageName if f.currentPageName !== void;
// [end_restore_vars]
// perl ƒXƒNƒŠƒvƒg‚É‚æ‚Á‚ÄŽ©“®“I‚Ɉ—‚³‚ê‚È‚¢‚à‚ÌA‚¢‚‚‚©B
// Ž©“®ƒEƒFƒCƒg
autoWCWaits.assign(f.autoWCWaits) if f.autoWCWaits !== void;
// ƒ€[ƒr[
if( isMain )
{
for( var i = 0; i < numMovies; i++)
movies.restore(f.movies);
}
// ”wŒiƒŒƒCƒ„
var backlay = elm != void && elm.backlay != void && +elm.backlay;
if(backlay)
{
back.base.restore(f.foreBaseLayer);
}
else
{
fore.base.restore(f.foreBaseLayer);
back.base.restore(f.backBaseLayer);
}
// ƒƒbƒZ[ƒWƒŒƒCƒ„
allocateMessageLayers(numMessageLayers);
if(backlay)
{
for(var i = 0; i < numMessageLayers; i++)
{
back.messages.restore(f.foreMessageLayers);
}
}
else
{
for(var i = 0; i < numMessageLayers; i++)
{
fore.messages.restore(f.foreMessageLayers);
back.messages.restore(f.backMessageLayers);
}
}
if(clear)
{
for(var i = 0; i < numMessageLayers; i++)
{
fore.messages.clear();
back.messages.clear();
}
if(historyLayer.storeState)
{
historyLayer.load(f.historyData);
}
else
{
if(historyWriteEnabled)
{
if(historyLayer.everypage)
historyLayer.repage();
else
historyLayer.reline(), historyLayer.reline();
}
historyLayer.clearAction();
}
}
// ‘OŒiƒŒƒCƒ„
allocateCharacterLayers(numCharacterLayers);
if(backlay)
{
for(var i = 0; i < numCharacterLayers; i++)
{
back.layers.restore(f.foreCharacterLayers);
}
}
else
{
for(var i = 0; i < numCharacterLayers; i++)
{
fore.layers.restore(f.foreCharacterLayers);
back.layers.restore(f.backCharacterLayers);
}
}
// quake ŠÖ˜A
restoreQuake();
// bgm
if(elm === void || elm.bgm === void || +elm.bgm)
{
bgm.restore(f.bgm);
}
// Œø‰Ê‰¹
if(elm === void || elm.se === void || +elm.se)
{
for(var i = 0; i<numSEBuffers; i++)
{
se.restore(f.se);
}
}
// ƒEƒBƒ“ƒhƒEƒLƒƒƒvƒVƒ‡ƒ“
caption = f.caption;
System.title = caption;
// current ‚Ìݒ肵’¼‚µ
current = (currentPage?back:fore).messages[currentNum];
// ‰EƒNƒŠƒbƒNƒƒjƒ…[–¼
if(typeof this.rightClickMenuItem != "undefined")
rightClickMenuItem.caption = rightClickCurrentMenuName;
// restoreHook
forEachEventHook('onRestore',
function(handler, f) { handler(f.flags, f.clear, f.options); } incontextof this,
%[flags:f, clear:clear, options:elm]);
}
function restoreFlags()
{
// pcflags, pflags ‚©‚çî•ñ‚ð“Ç‚Ýo‚·
// ƒ[ƒhŽžAƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒgî•ñ‚ðƒNƒŠƒA‚·‚é
purgeMoviePeriod();
// ƒXƒiƒbƒvƒVƒ‡ƒbƒg‚Ì”jŠü
freeSnapshot();
// ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“AŽ©“®ˆÚ“®‚Ì’âŽ~
stopAllTransitions();
stopAllMoves();
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚ð‰B‚·
hideClickGlyphs();
// ƒƒbƒZ[ƒW—š—ð‚ð‰B‚·
hideHistory();
// ƒXƒLƒbƒv‚̃Lƒƒƒ“ƒZƒ‹
cancelSkip();
// pflags -> flags
(Dictionary.assignStruct incontextof flags)(pflags);
// žxŠÇ—ŠÖ˜A
storeLabelPassed = true;
nextRecordHistory = false;
stablePosibility = false;
// ƒRƒ“ƒ_ƒNƒ^
currentRecordName = "";
mainConductor.restore(pcflags.mainConductor);
extraConductor.clear();
setConductorToMain();
// “Ç‚Ýž‚Ý
internalRestoreFlags(pcflags);
// ƒƒjƒ…[ŠÖ˜A
setMenuAccessibleAll();
// ŽÀsŠJŽn
processGo();
}
function clearVariables()
{
// ƒQ[ƒ€•Ï”‚̃NƒŠƒA
(Dictionary.clear incontextof flags)();
}
//--------------------------------------------------------- ’ʉߋL˜^ŠÇ— --
function pushHistoryOfStore()
{
// ’ʉߋL˜^‚ðs‚¤
// pflags, pcflags ‚Éî•ñ‚ðŠi”[‚µ‚½Œã‚ɌĂԂ±‚Æ
if(nextRecordHistory)
{
if(stablePosibility)
{
// stablePosibility ‚ª false ‚ÌꇂÍA
// ‚»‚±‚̃‰ƒxƒ‹‚ŒʉߋL˜^‚ðs‚Á‚Ä‚à
// ‚»‚±‚æ‚è‚à‘O‚É–ß‚é‚·‚ׂª‚È‚¢‚̂ŒʉߋL˜^‚ð‚µ‚È‚¢
// Ž«‘”z—ñ‚ðì¬
var dic = %[];
// user ‚Æ core ‚ð‹L˜^
dic.user = %[];
(Dictionary.assignStruct incontextof dic.user)(pflags);
dic.core = %[];
(Dictionary.assignStruct incontextof dic.core)(pcflags);
// dic ‚ð historyOfStore ‚Ì擪‚É‘}“ü
historyOfStore.insert(0, dic);
// ‚Í‚Ýo‚½•ª‚ðíœ
if(historyOfStore.count > maxHistoryOfStore)
historyOfStore.count = maxHistoryOfStore;
}
nextRecordHistory = false;
}
}
function setToRecordHistory()
{
// ŽŸ‚Ìu•Û‘¶‰Â”\‚ȃ‰ƒxƒ‹v’ʉߎž‚É
// ’ʉߋL˜^‚ðs‚¤‚悤‚ÉÝ’è‚·‚é
// ( ‚½‚¾‚µA‚»‚Ì‚Æ‚«‚É‹L˜^‚³‚ê‚é‚Ì‚ÍAŒ»Ý‚Ìó‘Ô )
nextRecordHistory = true;
}
function isHistoryOfStoreAlive()
{
// ’ʉߋL˜^‚ª—˜—p‰Â”\‚©‚Ç‚¤‚©‚ð•Ô‚·
return historyOfStore.count;
}
function goBackHistory(ask = true)
{
// ’ʉߋL˜^‚ð‚½‚Ç‚èA–ß‚é
if(!isHistoryOfStoreAlive())
return false;
var result;
if(ask)
{
var prompt = "u"+ historyOfStore[0].core.currentPageName + "v‚Ü‚Å–ß‚è‚Ü‚·‚©?";
result = askYesNo(prompt);
}
else
{
result = true;
}
if(result)
{
// user ‚Æ core ‚ð pflags, pcflags ‚É–ß‚·
(Dictionary.assignStruct incontextof pflags)(historyOfStore[0].user);
(Dictionary.assignStruct incontextof pcflags)(historyOfStore[0].core);
// ‹L˜^‚Ì擪‚ð휂·‚é
historyOfStore.erase(0);
// ƒf[ƒ^‚ðŒ³‚ÉAžx‚ð‚½‚Ç‚é“®ì‚ð‚·‚é
restoreFlags();
return true;
}
return false;
}
//--------------------------------------------------------------- žxŠÇ— --
function createBookMarkSubMenus()
{
// užx‚ð‚½‚Ç‚évužx‚ð‚Í‚³‚ÞvˆÈ‰º‚ɃTƒuƒƒjƒ…[€–Ú‚ð’ljÁ
if(freeSaveDataMode) return; // ƒtƒŠ[ƒZ[ƒuƒ‚[ƒh‚Å‚Í‚È‚É‚à‚µ‚È‚¢
if(typeof this.storeMenu !== "undefined" && storeMenu.visible)
{
for(var i = 0; i<numBookMarks; i++)
{
var item;
storeMenu.add(item = new KAGMenuItem(this, string i, 0, onBookMarkStore,
false));
item.bmNum = i;
item.orgEnabled = false;
}
}
if(typeof this.restoreMenu !== "undefined" && restoreMenu.visible)
{
for(var i = 0; i<numBookMarks; i++)
{
var item;
restoreMenu.add(item = new KAGMenuItem(this, string i, 0, onBookMarkRestore,
false));
item.bmNum = i;
item.orgEnabled = false;
}
}
}
function setBookMarkMenuCaptions()
{
// užx‚ð‚½‚Ç‚évužx‚ð‚Í‚³‚ÞvˆÈ‰º‚̃Tƒuƒƒjƒ…[‚É
// ƒLƒƒƒvƒVƒ‡ƒ“‚ðÝ’è
// žx‚ð‹²‚Þ
if(typeof this.storeMenu !== "undefined")
{
var children = storeMenu.children;
for(var i = children.count - 1; i >= 0; i--)
{
if(bookMarkDates != '') // ‹ó•¶Žš—ñ‚Ìꇂ͞x‚ª‚È‚¢‚Æ‚¢‚¤‚±‚Æ
{
// žx‚ª‘¶Ý‚·‚é
var caption;
if(showBookMarkDate) caption = bookMarkDates + " ";
caption += bookMarkNames;
var item = children;
item.caption = caption;
item.enabled = false;
item.orgEnabled = !bookMarkProtectedStates;
}
else
{
// žx‚ª‘¶Ý‚µ‚È‚¢
var item = children;
item.caption = "(None)";
item.enabled = false;
item.orgEnabled = !bookMarkProtectedStates;
}
}
}
// žx‚ð‚½‚Ç‚é
if(typeof this.restoreMenu !== "undefined")
{
var children = restoreMenu.children;
for(var i = children.count - 1; i >= 0; i--)
{
if(bookMarkDates != '') // ‹ó•¶Žš—ñ‚Ìꇂ͞x‚ª‚È‚¢‚Æ‚¢‚¤‚±‚Æ
{
// žx‚ª‘¶Ý‚·‚é
var caption;
if(showBookMarkDate) caption = bookMarkDates + " ";
caption += bookMarkNames;
var item = restoreMenu.children;
item.caption = caption;
item.enabled = false;
item.orgEnabled = true;
}
else
{
var item = restoreMenu.children;
item.caption = "(None)";
item.enabled = false;
item.orgEnabled = false;
}
}
}
setMenuAccessibleAll();
}
function setBookMarkProtectedState(num, s)
{
// n ”Ô‚Ìžx‚Ì•ÛŒìƒtƒ‰ƒO‚ðÝ’è‚·‚é
// s = true ‚È‚ç‚Ξx‚É‘‚«ž‚Ý•ÛŒì‚ð‚·‚é
bookMarkProtectedStates[num] = s;
setBookMarkMenuCaptions();
}
function onBookMarkStore(sender)
{
// žx‚ð‚Í‚³‚Þƒƒjƒ…[‚ª‘I‘ð‚³‚ê‚½
// if(!sender.parent.accessEnabled) return;
saveBookMarkWithAsk(sender.bmNum);
}
function onBookMarkRestore(sender)
{
// žx‚ð‚½‚Ç‚éƒƒjƒ…[‚ª‘I‘ð‚³‚ê‚½
// if(!sender.parent.accessEnabled) return;
loadBookMarkWithAsk(sender.bmNum);
}
function getBookMarkPageName(num)
{
// žx”Ô† num ‚̃uƒbƒNƒ}[ƒN–¼‚𓾂é
if(bookMarkDates[num] != '') // ‹ó•¶Žš—ñ‚Ìꇂ͞x‚ª‚È‚¢‚Æ‚¢‚¤‚±‚Æ
return bookMarkNames[num];
return "(None)";
}
function getBookMarkDate(num)
{
// žx”Ô† num ‚Ì“ú•t‚𓾂é
return bookMarkDates[num];
}
function getBookMarkFileNameAtNum(num)
{
if(num >= 999) // 999 ”ÔˆÈ~‚Í“ÁŽê‚ȃf[ƒ^‚É—p‚¢‚é‚Ì‚Å
return saveDataLocation + "/" + dataName + num + ".ksd";
else
return saveDataLocation + "/" + dataName + num + (saveThumbnail?".bmp":".kdt");
}
function lockSnapshot()
{
// ƒXƒiƒbƒvƒVƒ‡ƒbƒg‚ðƒƒbƒN‚·‚é
// ‰‚߂ăXƒiƒbƒvƒVƒ‡ƒbƒg‚ªƒƒbƒN‚³‚ꂽŽž“_‚ł̉æ–Ê‚ð•Û‘¶‚·‚é
if(snapshotLockCount == 0)
{
if(snapshotLayer === void)
snapshotLayer = new Layer(this, primaryLayer);
snapshotLayer.setImageSize(scWidth, scHeight);
snapshotLayer.face = dfAlpha;
snapshotLayer.piledCopy(0, 0, kag.fore.base, 0, 0, scWidth, scHeight);
}
snapshotLockCount ++;
}
function unlockSnapshot()
{
// ƒXƒiƒbƒvƒVƒ‡ƒbƒg‚̃ƒbƒN‚ð‰ðœ‚·‚é
if(snapshotLockCount == 0)
throw new Exception("snapshotLockCount ‚ªƒAƒ“ƒ_[ƒtƒ[‚µ‚Ü‚µ‚½");
snapshotLockCount --;
if(snapshotLockCount == 0)
{
if(snapshotLayer !== void)
invalidate snapshotLayer, snapshotLayer = void;
}
}
function calcThumbnailSize()
{
// ƒTƒ€ƒlƒCƒ‹‚̃TƒCƒY‚ðŒvŽZ‚·‚é
// ‰¡•‚Í 133 ‚É
var ratio = scHeight / scWidth;
var w = thumbnailWidth;
var h = (int)(w * ratio);
// ƒTƒ€ƒlƒCƒ‹—pƒrƒbƒgƒ}ƒbƒv‚̃TƒCƒY‚ðŒvŽZ
// ƒTƒ€ƒlƒCƒ‹—p‰æ‘œ‚Í 256 F BMP ‚Ü‚½‚Í 24bit ƒtƒ‹ƒJƒ‰[ BMP
var size;
if (thumbnailDepth == 8)
size = ((((w - 1) >> 2) + 1) << 2) * h + 1024 + 54;
else
size = (((w * 3 + 3) >> 2) << 2) * h + 54;
return %[width : w, height : h, size : size];
}
function freeSnapshot()
{
// ƒXƒiƒbƒvƒVƒ‡ƒbƒg‚ð‹§“I‚É”jŠü‚µAsnapshotLockCount ‚ð 0 ‚ÉÝ’è‚·‚é
snapshotLockCount = 0;
if(snapshotLayer !== void)
invalidate snapshotLayer, snapshotLayer = void;
}
function saveBookMarkToFile(fn, savehist = true)
{
// ƒtƒ@ƒCƒ‹ fn ‚Éžx‚ð•Û‘¶‚·‚é
if(readOnlyMode) return false;
pcflags.storeTime = (new Date()).getTime(); // “ú•t‚ð•Û‘¶
// ƒZ[ƒuƒf[ƒ^‚ð‚Ü‚Æ‚ß‚é
var data = %[];
data.id = saveDataID;
data.core = pcflags;
data.user = pflags;
if(savehist) data.history = historyOfStore;
if(saveThumbnail)
{
// ƒTƒ€ƒlƒCƒ‹‚ð•Û‘¶
lockSnapshot();
try
{
// ƒTƒ€ƒlƒCƒ‹‚̃TƒCƒY‚Ü‚Åk¬
var size = calcThumbnailSize();
var tmp = new Layer(this, primaryLayer);
try
{
tmp.setImageSize(size.width, size.height);
tmp.face = dfAlpha;
tmp.stretchCopy(0, 0, size.width, size.height, snapshotLayer,
0, 0, snapshotLayer.imageWidth, snapshotLayer.imageHeight, stLinear);
/*
// ƒTƒ€ƒlƒCƒ‹‰æ‘œ‚ðƒZƒsƒA’²‚É‚µ‚Ä•Û‘¶‚·‚éꇂ̓Rƒƒ“ƒgƒAƒEƒg‚ð‰ðœ
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
*/
try
{
// ƒTƒ€ƒlƒCƒ‹‚ð•Û‘¶
tmp.saveLayerImage(fn, "bmp" + thumbnailDepth);
// ƒf[ƒ^‚ð•Û‘¶
var mode = saveDataMode;
mode += "o" + size.size; // ƒ‚[ƒh•¶Žš—ñ‚É ‘‚«ž‚݃IƒtƒZƒbƒg‚ðŽw’è
(Dictionary.saveStruct incontextof data)(fn, mode);
}
catch(e)
{
invalidate tmp;
unlockSnapshot();
System.inform("File Does not Exist (Can't Open FileA"
"Overwriting Locked)");
return false;
}
}
catch(e)
{
invalidate tmp;
throw e;
}
invalidate tmp;
}
catch(e)
{
unlockSnapshot();
throw e;
}
unlockSnapshot();
}
else
{
// ’Êí‚̃tƒ@ƒCƒ‹‚É•Û‘¶
try
{
(Dictionary.saveStruct incontextof data)(fn, saveDataMode);
}
catch(e)
{
System.inform("File Does Not Exist (Can't Open FileA"
"Overwriting Locked)");
return false;
}
}
return true;
}
function saveBookMark(num, savehist = true)
{
// žx”Ô† num ‚Éžx‚ð•Û‘¶‚·‚é
if(readOnlyMode) return false;
if(bookMarkProtectedStates[num]) return false;
var ret = saveBookMarkToFile(getBookMarkFileNameAtNum(num), savehist);
if(ret)
{
// ƒƒjƒ…[ / bookMarkNames / bookMarkDates ‚ðXV
getBookMarkInfoFromData(pcflags, num);
}
return ret;
}
function getBookMarkInfoFromData(dic, num)
{
// Ž«‘”z—ñ dic ‚©‚çžx‚̃y[ƒW–¼‚Æ“ú•t‚ð“Ç‚Ýo‚µA
// bookMarkDates[num] ‚â bookMarkNames[num] ‚ÉÝ’è‚·‚é
if(num < numBookMarks)
{
bookMarkNames[num] = dic.currentPageName;
var date = new Date();
date.setTime(dic.storeTime);
date = "%04d/%02d/%02d %02d:%02d".sprintf(
date.getYear(), date.getMonth() + 1, date.getDate(),
date.getHours(), date.getMinutes() );
bookMarkDates[num] = date;
setBookMarkMenuCaptions();
saveSystemVariables();
}
}
function loadBookMarkFromFile(fn, loaduser = true)
{
// ƒtƒ@ƒCƒ‹ fn ‚©‚çžx‚ð“Ç‚Ýž‚Þ
// loaduser ‚ª false ‚ÌŽž‚Í user ‚ð“Ç‚Ýž‚Ü‚È‚¢
try
{
if(!Storages.isExistentStorage(fn)) return false; //ƒtƒ@ƒCƒ‹‚ª‚È‚¢
var data;
var modestr;
if(saveThumbnail)
{
// Žw’èƒIƒtƒZƒbƒg‚©‚çƒf[ƒ^‚ð“Ç‚Ýž‚Þ
modestr += "o" + calcThumbnailSize().size;
}
data = Scripts.evalStorage(fn, modestr);
if(data.id != saveDataID)
{
System.inform("Try to Load Other System Data", "Error");
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)
{
System.inform("Save cannot be read, the save"
"May be corrupted or have another form"
"(" + e.message + ")", "Error");
return false;
}
restoreFlags();
return true;
}
function loadBookMark(num, loaduser = true)
{
// žx”Ô† num ‚©‚çƒf[ƒ^‚ð“Ç‚Ýo‚·
return loadBookMarkFromFile(getBookMarkFileNameAtNum(num), loaduser);
}
function saveBookMarkWithAsk(num)
{
// žx”Ô† num ‚Éžx‚ðÝ’è‚·‚é
// ‚»‚Ì‚Æ‚«AÝ’è‚·‚é‚©‚Ç‚¤‚©‚ð‚½‚¸‚Ë‚é
if(readOnlyMode) return false;
if(bookMarkProtectedStates[num]) return false;
var prompt = "OverWrite Save ";
if(num < numBookMarks) prompt += (num + 1);
if(bookMarkDates[num] != "") // bookMarkDates ‚ª‹ó•¶Žš‚Ìꇂ͞x‚Í‘¶Ý‚µ‚È‚¢
prompt += "u" + bookMarkNames[num] + "v";
prompt += "and replace withu"+ pcflags.currentPageName + "v?";
var result = askYesNo(prompt);
if(result) return saveBookMark(num);
return false;
}
function loadBookMarkWithAsk(num)
{
// žx”Ô† num ‚©‚çžx‚ð“Ç‚Ýo‚·
// ‚»‚Ì‚Æ‚«A“Ç‚Ýo‚·‚©‚Ç‚¤‚©‚ð‚½‚¸‚Ë‚é
if(num < numBookMarks && bookMarkDates[num] == "") // bookMarkDates ‚ª‹ó•¶Žš‚Ìꇂ͞x‚Í‘¶Ý‚µ‚È‚¢
return false;
var prompt = "Load Save ";
if(num < numBookMarks) prompt += (num + 1);
prompt += "u"+ bookMarkNames[num] + "v?";
var result = askYesNo(prompt);
if(result) return loadBookMark(num);
return false;
}
function saveBookMarkToFileWithAsk()
{
// ”CˆÓ‚̃tƒ@ƒCƒ‹‚Éžx‚ð•Û‘¶‚·‚é
// currentPageName ‚ðƒtƒ@ƒCƒ‹–¼‚Æ‚µ‚Ä“K‡‚·‚é‚悤‚É
// •ÏŒ`‚·‚é
var invalid = "\\/:,;*?\"<>!.";
var valid = "^FCG–Hhƒ„ID";
var initialname = saveDataLocation + "/";
var through = false;
var orgname = currentPageName;
if(lastSaveDataNameGlobal != "")
{
try
{
initialname = Storages.extractStoragePath(lastSaveDataNameGlobal);
}
catch(e)
{
initialname = saveDataLocation + "/";
}
}
if(orgname == "")
{
// žx‚ÌŒ©o‚µ‚ª‚È‚¢‚Ì‚Å
if(lastSaveDataName == "")
orgname = System.title; // System.title ‚ð‘ã‚í‚è‚ÉŽg‚¤
else
initialname = lastSaveDataName, through = true;
}
if(!through)
{
var length = orgname.length;
for(var i = 0; i < length; i++)
{
var ch = orgname;
var ind = invalid.indexOf(ch);
if(ind != -1)
initialname += valid[ind];
else if(#ch >= 32)
initialname += ch;
}
}
// •Û‘¶‚·‚éƒtƒ@ƒCƒ‹–¼‚𓾂é
var selectdata = %[
title:"žx‚ð‚Í‚³‚Þ",
filter: [saveThumbnail ?
"ƒTƒ€ƒlƒCƒ‹‰æ‘œ•t‚«žxƒf[ƒ^(*.bmp)|*.bmp" :
"žxƒf[ƒ^(*.kdt)|*.kdt"],
filterIndex : 1,
name : initialname,
initialDir : "",
defaultExt : saveThumbnail?"bmp":"kdt",
save : true,
];
if(Storages.selectFile(selectdata))
{
// •Û‘¶
saveBookMarkToFile(lastSaveDataName = lastSaveDataNameGlobal = selectdata.name);
lastSaveDataName = Storages.chopStorageExt(lastSaveDataName);
}
}
function loadBookMarkFromFileWithAsk()
{
// ”CˆÓ‚̃tƒ@ƒCƒ‹‚©‚çžx‚ð“Ç‚Ýž‚Þ
var initialdir = "";
if(lastSaveDataNameGlobal == "")
initialdir = saveDataLocation + "/";
var selectdata = %[
title:"žx‚ð‚½‚Ç‚é",
filter: [saveThumbnail ?
"ƒTƒ€ƒlƒCƒ‹‰æ‘œ•t‚«žxƒf[ƒ^(*.bmp)|*.bmp" :
"žxƒf[ƒ^(*.kdt)|*.kdt"],
filterIndex : 1,
name : lastSaveDataNameGlobal,
initialDir : initialdir,
defaultExt : saveThumbnail?"bmp":"kdt",
save : false,
];
if(Storages.selectFile(selectdata))
{
loadBookMarkFromFile(lastSaveDataName = lastSaveDataNameGlobal = selectdata.name);
lastSaveDataName = Storages.chopStorageExt(lastSaveDataName);
}
}
function copyBookMark(from, to)
{
// žx”Ô† from ‚©‚çžx”Ô† to ‚Éžx‚ðƒRƒs[‚·‚é
if(readOnlyMode) return false;
if(bookMarkProtectedStates[to]) return;
var fn = getBookMarkFileNameAtNum(from);
if(!Storages.isExistentStorage(fn)) return; //ƒtƒ@ƒCƒ‹‚ª‚È‚¢
var data = Scripts.evalStorage(fn);
fn = getBookMarkFileNameAtNum(to);
(Dictionary.saveStruct incontextof data)(fn, saveDataMode);
getBookMarkInfoFromData(data.core, to);
}
function eraseBookMark(num)
{
// žx‚ðÁ‚·
// num < numBookMarks ‚ÌŽž‚É‚µ‚©“®ì‚µ‚È‚¢‚悤‚É‚È‚Á‚½‚Ì‚Å’ˆÓ
if(num < numBookMarks)
{
if(!bookMarkProtectedStates[num])
{
bookMarkDates[num] = "";
setBookMarkMenuCaptions();
}
}
}
function tempDisableStore(elm)
{
// žx‚ðˆêŽž“I‚É•Û‘¶•s‰Â”\‚É‚·‚é
storeEnabled = true;
if(elm.store === void)
storeLabelPassed = false;
else
storeLabelPassed = !(+elm.store);
if(elm.restore == void)
restoreEnabled = true;
else
restoreEnabled = !(+elm.restore);
setMenuAccessibleAll();
}
function setStoreEnabled(enabled)
{
// žxƒƒjƒ…[‚Ì—LŒø/–³Œø‚ÌÝ’è
storeEnabled = enabled;
restoreEnabled = enabled;
setMenuAccessibleAll();
}
function setStartAnchorEnabled(enabled)
{
// uʼn‚É–ß‚év‚Ì—LŒø/–³Œø‚ÌÝ’è
startAnchorEnabled = enabled;
if(enabled) saveBookMark(999, false); // 999 ”Ô‚É•Û‘¶
setMenuAccessibleAll();
}
function goToStart()
{
// ʼn‚É–ß‚é
if(!startAnchorEnabled) return;
loadBookMark(999, false); // žx‚ð“Ç‚Ýž‚Þ
}
function goToStartWithAsk()
{
// ʼn‚É–ß‚é(Šm”F‚ ‚è)
var result = askYesNo("Return to Title?");
if(result) goToStart();
}
function tempSave(num)
{
// tempBookMarks[num] ‚ÉŒ»Ý‚Ìó‘Ô‚ð•Û‘¶‚·‚é
tempBookMarks[num] = %[];
internalStoreFlags(tempBookMarks[num]);
}
function tempLoad(num, elm)
{
// tempBookMarks[num] ‚©‚çó‘Ô‚ð“Ç‚Ýž‚Þ
internalRestoreFlags(tempBookMarks[num], false, elm);
}
function restoreBookMark(num, ask = true)
{
// KAG 2.x ŒÝŠ·—p
if(ask)
return loadBookMarkWithAsk(num);
else
return loadBookMark(num);
}
function storeBookMark(num, ask = true)
{
// KAG 2.x ŒÝŠ·—p
if(ask)
return saveBookMarkWithAsk(num);
else
return saveBookMark(num);
}
//------------------------------------------------- –¢“Ç/Šù“Ç/ƒ‰ƒxƒ‹‹L˜^ --
function setRecordLabel(storage, label)
{
// Œ»Ý‚̃‰ƒxƒ‹‚ðÝ’è‚·‚é
if(autoRecordPageShowing)
{
if(label != '')
{
if(label[0] == '*') label = label.substring(1);
if(label[1] == '-') return; // ƒ[ƒJƒ‹ƒ‰ƒxƒ‹
}
currentRecordName = 'trail_' + Storages.chopStorageExt(
Storages.extractStorageName(storage)) + '_' + label;
}
}
function incRecordLabel(count)
{
// sflags[currentRecordName]++
if(autoRecordPageShowing)
{
if(currentRecordName != "")
{
if(count)
{
if(sflags[currentRecordName] === void)
sflags[currentRecordName] = 0;
sflags[currentRecordName]++;
}
currentRecordName = "";
}
}
}
//------------------------------------------- ƒVƒXƒeƒ€‘S‘Ì‚ÉŠÖŒW‚·‚é‚à‚Ì --
function setTitle(title)
{
// ƒ^ƒCƒgƒ‹‚ðÝ’è
if(isMain) System.title = title;
caption = title;
}
function setCursor(elm)
{
// ƒ}ƒEƒXƒJ[ƒ\ƒ‹‚ÌÝ’è
var conv = function(variable, value)
{
if(value !== void)
{
if(!(typeof value == "String" &&
(value.indexOf('.cur')!=-1 || value.indexOf('.ani')!=-1) ))
value = +value;
this[variable] = value;
}
} incontextof this;
conv('cursorDefault', elm['default']);
conv('cursorPointed', elm.pointed);
conv('cursorWaitingClick', elm.click);
conv('cursorDraggable', elm.draggable);
fore.base.setDefaultCursor(cursorDefault);
back.base.setDefaultCursor(cursorDefault);
}
//---------------------------------------------------- ƒgƒŠƒKŠÇ—(TJS—p) --
function waitTrigger(elm)
{
// elm.name ‚ÅŽ¦‚³‚ꂽƒgƒŠƒK‚ð‘Ò‚Â
if((elm.canskip !== void && +elm.canskip) && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv“®ì’†
if(elm.onskip !== void) Scripts.eval(elm.onskip);
return 0; // ‚·‚®‚É•Ô‚é
}
conductor.wait(%[
click : function(arg)
{
if(arg !== void) Scripts.eval(arg);
} incontextof this,
click_arg : elm.onskip,
elm.name => function
{
} incontextof this
]);
}
else
{
conductor.wait(%[
elm.name => function
{
} incontextof this
]);
}
return -2;
}
function trigger(name)
{
// name ‚ÅŽ¦‚µ‚½ƒgƒŠƒK‚𔓮‚·‚é
conductor.trigger(name);
}
//------------------------------------------------------- ƒƒbƒZ[ƒW—š—ð --
function showHistory()
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ð•\Ž¦‚·‚é
historyLayer.parent = fore.base; // ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚Ìe‚àÄÝ’è
historyLayer.absolute = 2000000;
historyLayer.dispInit();
historyShowing = true;
if(typeof this.showHistoryMenuItem != "undefined")
showHistoryMenuItem.checked = true;
setMenuAccessibleAll();
}
function hideHistory()
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ð”ñ•\Ž¦‚É‚·‚é
historyLayer.dispUninit();
historyShowing = false;
if(typeof this.showHistoryMenuItem != "undefined")
showHistoryMenuItem.checked = false;
setMenuAccessibleAll();
lastHistoryHiddenTick = System.getTickCount();
conductor.trigger('history'); // 'history' ‚ð‘—‚é
}
function setHistoryOptions(elm)
{
// elm ‚©‚烃bƒZ[ƒW—š—ðƒŒƒCƒ„‚̃IƒvƒVƒ‡ƒ“‚ðÝ’è‚·‚é
historyWriteEnabled = +elm.output if elm.output !== void;
historyEnabled = +elm.enabled if elm.enabled !== void;
if(elm.enabled !== void && !historyEnabled)
historyLayer.clearAction();
historyLayer.setOptions(elm); // ‚»‚Ì‘¼‚̃IƒvƒVƒ‡ƒ“
setMenuAccessibleAll();
}
function showHistoryByScenario(elm)
{
// ƒƒbƒZ[ƒW—š—ð‚ðƒVƒiƒŠƒI’†‚©‚ç•\Ž¦‚³‚¹‚é
showHistory();
conductor.wait(%[ // ƒRƒ“ƒ_ƒNƒ^‚ð‘Ò‚¿‚É
history : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
return -2; // break
}
//-------------------------------------------------------------- process --
function process(file, label, countpage = true, immediate = false)
{
// Žw’èƒtƒ@ƒCƒ‹AŽw’胉ƒxƒ‹‚©‚çŽÀs‚ðŠJŽn‚·‚é
if(!usingExtraConductor) incRecordLabel(countpage);
setUserSpeed();
if(file != '')
{
// ƒtƒ@ƒCƒ‹‚ð“Ç‚Ýž‚Ý
conductor.loadScenario(file);
}
if(label != '')
{
// ƒ‰ƒxƒ‹‚Ɉړ®‚·‚é
conductor.goToLabel(label);
}
if(isFirstProcess)
{
storeFlags(); // ˆê”Ôʼn‚Ìó‘Ô‚ðƒXƒgƒA
isFirstProcess = false;
}
dm("ˆ—‚ðŠJŽn‚µ‚Ü‚·");
inSleep = false;
notifyRun();
if(conductor.status != conductor.mRun) conductor.run(immediate); // ŽÀsŠJŽn
}
function processGo()
{
// ƒRƒ“ƒ_ƒNƒ^‚ðŒ»ÝˆÊ’u‚©‚çŽÀsŠJŽn‚³‚¹‚é
dm("ˆ—‚ðŠJŽn‚µ‚Ü‚·");
inSleep = false;
notifyRun();
conductor.run(false); // ŽÀsŠJŽn
}
function processCall(file, label)
{
// Žw’èƒtƒ@ƒCƒ‹AŽw’胉ƒxƒ‹‚ðŒÄ‚Ô
// incRecordLabel(); ‚͌Ă΂Ȃ¢‚Ì‚Å’ˆÓ
if(file != '')
{
// ƒtƒ@ƒCƒ‹‚ð“Ç‚Ýž‚Ý
conductor.loadScenario(file);
}
inSleep = false;
notifyRun();
conductor.callLabel(label); // ŽÀsŠJŽn
dm("ˆ—‚ðŠJŽn‚µ‚Ü‚·");
if(conductor.status != conductor.mRun) conductor.run();
}
//------------------------------------------------- ƒRƒ“ƒ_ƒNƒ^‚̃Cƒxƒ“ƒg --
function onConductorScenarioLoad(name)
{
// ƒRƒ“ƒ_ƒNƒ^‚ªV‚µ‚¢ƒVƒiƒŠƒIƒtƒ@ƒCƒ‹‚ð“Ç‚Ýž‚Þ‘O‚É‚æ‚΂ê‚éB
// name ‚Í“Ç‚Ýž‚à‚¤‚Æ‚µ‚½ƒVƒiƒŠƒIƒtƒ@ƒCƒ‹B
// –ß‚è’l‚É•¶Žš—ñ‚ð•Ô‚·‚ÆA‚»‚ê‚ðƒVƒiƒŠƒI‚Æ‚µ‚Ä
// ƒtƒ@ƒCƒ‹‚Ì‘ã‚í‚è‚ÉŽg‚¤‚悤‚É‚È‚é‚Ì‚ÅA‚±‚±‚ɃtƒBƒ‹ƒ^‚ð‘‚‚±
// ‚Æ‚ª‚Å‚«‚éB
// true ‚ð•Ô‚·‚Æ’Êí‚̃VƒiƒŠƒIƒtƒ@ƒCƒ‹“Ç‚Ýž‚Ý‚Æ‚È‚éB
return true;
}
function onConductorScenarioLoaded(name)
{
// ƒRƒ“ƒ_ƒNƒ^‚ªV‚µ‚¢ƒVƒiƒŠƒIƒtƒ@ƒCƒ‹‚ð“Ç‚Ýž‚ñ‚¾
// if(!usingExtraConductor) incRecordLabel(true);
return true;
}
function onConductorLabel(label, page)
{
// ƒRƒ“ƒ_ƒNƒ^‚ªƒ‰ƒxƒ‹‚ð’ʉ߂µ‚½
if(!usingExtraConductor)
{
incRecordLabel(true);
setRecordLabel(conductor.curStorage, label);
}
setUserSpeed();
if(!usingExtraConductor)
{
if(!getCurrentRead() && skipMode != 4)
cancelSkip(); // –¢“ǂȂ̂ŃXƒLƒbƒv‚ð’âŽ~
currentLabel = label;
}
if(page !== void && page !== '')
{
if(page[0] == '&') page = Scripts.eval((page.substring(1)));
currentPageName = page;
}
if(page !== void)
{
pushHistoryOfStore();
stablePosibility = false;
dm(conductor.curStorage + " : ƒ‰ƒxƒ‹/ƒy[ƒW : " + label + "/" + currentPageName);
if(usingExtraConductor) throw new Exception("‰EƒNƒŠƒbƒNƒTƒuƒ‹[ƒ`ƒ““à/extraCondutor"
"ƒTƒuƒ‹[ƒ`ƒ““à‚Å‚Í•Û‘¶‰Â”\‚ȃ‰ƒxƒ‹‚ð‹Lq‚Å‚«‚Ü‚¹‚ñ");
storeFlags(), storeLabelPassed = true, setMenuAccessibleAll();
if(recordHistoryOfStore == 1) // 1 : •Û‘¶‰Â”\‚ȃ‰ƒxƒ‹‚²‚Æ
setToRecordHistory();
}
return true;
}
function onConductorJump(elm)
{
// ƒRƒ“ƒ_ƒNƒ^‚Å jump ƒ^ƒO‚ðˆ—‚·‚é‚Æ‚«
if(!usingExtraConductor) incRecordLabel(elm.countpage === void || +elm.countpage);
return true;
}
function onConductorCall(elm)
{
// ƒRƒ“ƒ_ƒNƒ^‚ª call ƒ^ƒO‚ðˆ—‚·‚é‚Æ‚«
if(!usingExtraConductor) incRecordLabel(elm.countpage !== void && +elm.countpage);
return true;
}
function onConductorReturn(elm)
{
// ƒRƒ“ƒ_ƒNƒ^‚ª return ƒ^ƒO‚ðˆ—‚·‚é‚Æ‚«
if(!usingExtraConductor) incRecordLabel(elm.countpage === void || +elm.countpage);
if(conductor === extraConductor)
{
// extraConductor ƒTƒuƒ‹[ƒ`ƒ“—p‚̃Rƒ“ƒ_ƒNƒ^‚©‚çŒÄ‚΂ê‚Ä‚¢‚é
if(conductor.callStackDepth == 1)
{
// ‚‚܂èAÅI‚Ì return ‚ªŽÀs‚³‚ꂽ‚ÆŒ¾‚¤‚±‚Æ
dm("extraConductor ƒTƒuƒ‹[ƒ`ƒ“‚©‚ç–ß‚è‚Ü‚· ...");
var run;
if(elm.storage !== void || elm.target !== void) run = true; else run = false;
returnExtraConductor(run);
if(elm.storage !== void) conductor.loadScenario(elm.storage);
if(elm.target !== void) conductor.goToLabel(elm.target);
setRecordLabel(conductor.curStorage, currentLabel = conductor.curLabel);
if(run)
{
notifyRun();
conductor.run();
}
isLeavePeriodEvent = false;
if(elm.storage !== void || elm.target !== void)
{ // return‚ÅŒ³‚̈ʒuˆÈŠO‚ɖ߂鎞‚̓sƒŠƒIƒhƒCƒxƒ“ƒg‚ðƒNƒŠƒA‚·‚éB
holdPeriodEventQueue.clear();
isWaitPeriodEvent = false;
}
if( isWaitPeriodEvent == true )
{ // [wp]‚ŃsƒŠƒIƒhƒCƒxƒ“ƒg‘Ò‚¿‚ð‚µ‚Ä‚¢‚鎞‚Ì‚ÝAƒgƒŠƒK[‚·‚é
fireMoviePeriodFromQueue();
}
return false; // return ‚ÍŽÀs‚µ‚È‚¢
}
}
return true;
}
function purgeMoviePeriod()
{
isLeavePeriodEvent = false;
holdPeriodEventQueue.clear();
isWaitPeriodEvent = false;
waitedPeriodEventStorageName = void;
}
function fireMoviePeriodFromQueue()
{
var retVal = false;
if( holdPeriodEventQueue.count > 0 )
{
if( waitedPeriodEventStorageName == conductor.curStorage && conductor == mainConductor )
{
for( var i = 0; i < holdPeriodEventQueue.count; i++ )
{
conductor.trigger( holdPeriodEventQueue );
retVal = true;
}
}
holdPeriodEventQueue.clear();
}
return retVal;
}
function onConductorAfterReturn()
{
// ƒRƒ“ƒ_ƒNƒ^‚ª return ƒ^ƒO‚ðŽÀs‚µ‚½Œã
if(!usingExtraConductor)
{
setRecordLabel(conductor.curStorage, currentLabel = conductor.curLabel);
}
setUserSpeed();
if(!usingExtraConductor)
{
if(!getCurrentRead() && skipMode != 4)
cancelSkip(); // –¢“ǂȂ̂ŃXƒLƒbƒv‚ð’âŽ~
}
}
function onConductorScript(script, scriptname, lineofs)
{
// iscript ƒ^ƒO
try
{
Scripts.exec(script, scriptname, lineofs);
}
catch(e)
{
throw new Exception(scriptname + " ‚Ì s " + lineofs + " ‚©‚çŽn‚Ü‚é"
" iscript ƒuƒƒbƒN‚ŃGƒ‰[‚ª”¶‚µ‚Ü‚µ‚½B"
"\n( Úׂ̓Rƒ“ƒ\[ƒ‹‚ðŽQÆ‚µ‚Ä‚‚¾‚³‚¢ )\n" + e.message);
}
return true;
}
function onConductorUnknownTag(tagname, elm)
{
// •s–¾‚ȃ^ƒO‚ª‚ ‚Á‚½ê‡
throw new Exception("ƒ^ƒO/ƒ}ƒNƒ \"" + tagname + "\" ‚Í‘¶Ý‚µ‚Ü‚¹‚ñ");
return 0; // ‚±‚Ì–ß‚è’l‚ÍAŠeƒ^ƒOƒnƒ“ƒhƒ‰‚ª•Ô‚·•¨‚Æ‚¨‚È‚¶
}
//----------------------------------------------------------- stable/run --
function notifyStable()
{
// ƒVƒXƒeƒ€‚ªˆÀ’è(ƒNƒŠƒbƒN‘Ò‚¿/’âŽ~)‚µ‚½‚Æ‚«‚ÉAƒnƒ“ƒhƒ‰‚ðŒÄ‚Ô
if(!inStable)
{
inStable = true;
var handlers = stableHandlers;
for(var i = handlers.count-1; i>=0; i--)
handlers();
// stableHook
forEachEventHook('onStableStateChanged',
function(handler, f) { handler(f.stable); } incontextof this,
%[stable:true]);
}
}
function notifyRun()
{
// ƒVƒXƒeƒ€‚ª‘–‚èŽn‚ß‚½‚Æ‚«‚ÉAƒnƒ“ƒhƒ‰‚ðŒÄ‚Ô
if(inStable)
{
inStable = false;
var handlers = runHandlers;
for(var i = handlers.count-1; i>=0; i--)
handlers();
// runHook
forEachEventHook('onStableStateChanged',
function(handler, f) { handler(f.stable); } incontextof this,
%[stable:false]);
if(autoMode) hideMouseCursor();
}
}
function defaultStableHandler()
{
// ƒfƒtƒHƒ‹ƒg‚Ì stable ƒnƒ“ƒhƒ‰
setMenuAccessibleAll();
}
function defaultRunHandler()
{
// ƒfƒtƒHƒ‹ƒg‚Ì run ƒnƒ“ƒhƒ‰
hideHistory();
hideClickGlyphs();
showMessageLayerByUser();
setMenuAccessibleAll();
}
//----------------------------------------------------------- •¶Žš—ñ“ü—Í --
var inputTemp;
function inputString(elm)
{
// •¶Žš—ñ‚ð“ü—Í‚·‚é
var name = elm.name;
var initial = Scripts.eval(name);
var res = System.inputString(elm.title, elm.prompt, initial);
if(res !== void)
{
// name ‚É res ‚ð‘ã“ü‚·‚é
inputTemp = res;
Scripts.eval(("(" + name + ") = kag.inputTemp"));
}
}
//-------------------------------------------------- extraConductor ˆ— --
function callExtraConductor(storage, label, onreturn)
{
// extraConductor ‚ðŽg‚Á‚ăTƒuƒ‹[ƒ`ƒ“‚ðŒÄ‚Ño‚·
onExtraConductorReturn = onreturn;
inSleepBeforeExtraConductor = inSleep; // inSleep •Û‘¶
storeMessageLayerSelProcessLock(); // ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ì storeSelProcessLock ‚ðŒÄ‚Ô
conductor = extraConductor; // ƒRƒ“ƒ_ƒNƒ^‚ðØ‚è‘Ö‚¦‚é
(Dictionary.assign incontextof extraConductor.macros)(mainConductor.macros);
// ƒ}ƒNƒ‚̓Rƒs[
usingExtraConductor = true;
if(storage == '')
{
// ƒXƒgƒŒ[ƒWŽw’肪‚È‚¢‚Ì‚ÅŒ»Ý‚̃XƒgƒŒ[ƒW‚ð“Ç‚Ýž‚Ü‚¹‚é
storage = mainConductor.curStorage;
}
// ŒÄ‚Ño‚·
conductor.clearCallStack();
processCall(storage, label);
}
function returnExtraConductor(run)
{
// extraConductor ‚̃Tƒuƒ‹[ƒ`ƒ“‚©‚ç–ß‚é
// run ‚ª true ‚Ìê‡‚Í ‘Ò‹@ó‘Ô‚Ì•œ‹A‚Ís‚í‚È‚¢
conductor.sleep(); // ’âŽ~
conductor.interrupt();
// interrupt ‚Í ƒRƒ“ƒ_ƒNƒ^‚̃Cƒxƒ“ƒg“à‚ŃRƒ“ƒ_ƒNƒ^‚ÌŽÀs‚ð
// ’âŽ~‚³‚¹‚邽‚߂̃ƒ\ƒbƒh
conductor = mainConductor; // ƒRƒ“ƒ_ƒNƒ^‚ðØ‚è‘Ö‚¦
(Dictionary.assign incontextof mainConductor.macros)(extraConductor.macros);
// ƒ}ƒNƒ‚̓Rƒs[
usingExtraConductor = false;
if(!run)
{ restoreClickGlyphState(); // ƒNƒŠƒbƒN‘Ò‚¿‹L†‚Ì•œ‹A
inSleep = inSleepBeforeExtraConductor; // inSleep •œ‹A
notifyStable();
}
restoreMessageLayerSelProcessLock(); // ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ì restoreSelProcessLock ‚ðŒÄ‚Ô
setMenuAccessibleAll();
cancelSkip();
if(onExtraConductorReturn !== void) onExtraConductorReturn();
}
//------------------------------------------------------- ‰EƒNƒŠƒbƒNˆ— --
function setRightClickOptions(elm)
{
// ‰EƒNƒŠƒbƒN‚̃IƒvƒVƒ‡ƒ“‚ðÝ’è‚·‚é
rightClickEnabled = +elm.enabled if elm.enabled !== void;
if(elm.call !== void)
{
rightClickCall = +elm.call;
if(rightClickCall) rightClickJump = false;
}
if(elm.jump !== void)
{
rightClickJump = +elm.jump;
if(rightClickJump) rightClickCall = false;
}
rightClickTarget = elm.target if elm.target !== void;
rightClickStorage = elm.storage if elm.storage !== void;
if(elm.name !== void)
{
if(typeof this.rightClickMenuItem != "undefined")
{
rightClickName = elm.name;
if(rightClickName == "default")
rightClickMenuItem.caption = rightClickCurrentMenuName = rightClickDefaultName;
else
rightClickMenuItem.caption = rightClickCurrentMenuName = rightClickName;
}
}
}
function callRightClickSubRoutine()
{
isLeavePeriodEvent = true;
// ‰EƒNƒŠƒbƒNƒTƒuƒ‹[ƒ`ƒ“‚ðŒÄ‚Ô
if(typeof this.rightClickMenuItem != "undefined")
{
rightClickMenuItem.caption = rightClickCurrentMenuName = rightClickDefaultName;
}
callExtraConductor(rightClickStorage, rightClickTarget, restoreFromRightClick);
lockMessageLayerSelProcess(); // ‘I‘ðŽˆƒƒbƒN
}
function restoreFromRightClick()
{
// ‰EƒNƒŠƒbƒNƒTƒuƒ‹[ƒ`ƒ“‚©‚甲‚¯‚é‚Æ‚«‚ɌĂ΂ê‚é
if(typeof this.rightClickMenuItem != "undefined")
{
if(rightClickName == "default")
rightClickMenuItem.caption = rightClickCurrentMenuName = rightClickDefaultName;
else
rightClickMenuItem.caption = rightClickCurrentMenuName = rightClickName;
}
}
function setConductorToMain()
{
// restore ‚ÌŽž‚ɌĂ΂êAƒRƒ“ƒ_ƒNƒ^‚ð main ‚ÉØ‚è‘Ö‚¦‚é
if(usingExtraConductor)
{
extraConductor.sleep();
extraConductor.interrupt();
conductor= mainConductor;
usingExtraConductor = false;
}
}
function jumpToRightClickTarget()
{
process(rightClickStorage, rightClickTarget);
}
function onPrimaryRightClick()
{
// ƒvƒ‰ƒCƒ}ƒŠƒŒƒCƒ„‚ʼnEƒNƒŠƒbƒN‚³‚ꂽ‚Æ‚«‚ɌĂ΂ê‚é
if(!callHook(rightClickHook))
{
if(getKeyState(VK_LBUTTON))
{
enterAutoMode();
return;
}
if(!rightClickEnabled) return;
if(inStable)
{
if(rightClickJump)
jumpToRightClickTarget();
else if(rightClickCall && conductor == mainConductor)
callRightClickSubRoutine();
else
switchMessageLayerHiddenByUser();
}
setMenuAccessibleAll();
}
}
//------------------------------------------------------- ‘OŒiƒŒƒCƒ„ˆ— --
function allocateCharacterLayers(num)
{
// ‘OŒiƒŒƒCƒ„”‚ð num ‚ÉÝ’è‚·‚é
if(fore.layers.count > num)
{
// ƒŒƒCƒ„‚ªŒ¸‚é
for(var i = num; i<fore.layers.count; i++)
{
invalidate fore.layers;
invalidate back.layers;
}
fore.layers.count = num;
back.layers.count = num;
}
else if(fore.layers.count < num)
{
// ƒŒƒCƒ„‚ª‘‚¦‚é
for(var i = fore.layers.count; i<num; i++)
{
fore.layers = new CharacterLayer(this, fore.base, "•\‘OŒiƒŒƒCƒ„" + i, i);
back.layers = new CharacterLayer(this, back.base, "— ‘OŒiƒŒƒCƒ„" + i, i);
fore.layers.setCompLayer(back.layers);
back.layers.setCompLayer(fore.layers);
}
reorderLayers();
}
numCharacterLayers = num;
}
//------------------------------------------------- ƒƒbƒZ[ƒWƒŒƒCƒ„ˆ— --
function allocateMessageLayers(num, setdefaultfont = true)
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„”‚ð num ‚ÉÝ’è‚·‚é
if(fore.messages.count > num)
{
// ƒŒƒCƒ„‚ªŒ¸‚é
for(var i = num; i<fore.messages.count; i++)
{
if(current == fore.messages || current == back.messages)
current = fore.messages[0], currentNum = 0, currentPage = 0;
invalidate fore.messages;
invalidate back.messages;
}
fore.messages.count = num;
back.messages.count = num;
}
else if(fore.messages.count < num)
{
// ƒŒƒCƒ„‚ª‘‚¦‚é
for(var i = fore.messages.count; i<num; i++)
{
fore.messages = new MessageLayer(this, fore.base, "•\ƒƒbƒZ[ƒWƒŒƒCƒ„" + i, i, true);
back.messages = new MessageLayer(this, back.base, "— ƒƒbƒZ[ƒWƒŒƒCƒ„" + i, i, true);
fore.messages.setCompLayer(back.messages);
back.messages.setCompLayer(fore.messages);
fore.messages.clear();
back.messages.clear();
}
reorderLayers();
if(setdefaultfont) setMessageLayerUserFont();
}
numMessageLayers = num;
}
function setCurrentMessageLayer(elm)
{
// Œ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚ðÝ’è
var page = getMessageLayerPageFromElm(elm);
var num = getMessageLayerNumberFromElm(elm);
currentNum = num;
currentPage = page;
if(page) current = back.messages[num]; else current = fore.messages[num];
currentWithBack = +elm.withback if elm.withback !== void;
}
function setMessageLayerPosition(elm)
{
// Œ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚̈ʒuA‘®«‚ðÝ’è
var layer = getMessageLayerObjectFromElm(elm);
elm.setPosition(elm);
}
function clearMessageLayers(resetcurrent)
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚̃NƒŠƒA
// ct ƒ^ƒO‚©‚çŒÄ‚΂ê‚é
// resetcurrent ‚ª true ‚Ìꇂ͌»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚ð
// •\0‚ÉÝ’è‚·‚é
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--) messages.clear();
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--) messages.clear();
if(resetcurrent)
{
currentNum = 0;
currentPage = 0;
current = fore.messages[0];
currentWithBack = false;
}
}
function lockMessageLayerSelProcess()
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚É ‘I‘ð‚Æprocess‚ð‹ÖŽ~‚³‚¹‚é
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--) messages.setSelProcessLock(true);
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--) messages.setSelProcessLock(true);
}
function unlockMessageLayerSelProcess()
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚Ì‘I‘ð‚ð‹–‰Â‚·‚é
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--) messages.setSelProcessLock(false);
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--) messages.setSelProcessLock(false);
}
function setMessageLayerUserFont()
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚Ì defaultAntialiased ‚Æ
// userFace ‚ðÝ’è‚·‚é
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--)
messages.defaultAntialiased = chDefaultAntialiased,
messages.userFace = chDefaultFace;
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--)
messages.defaultAntialiased = chDefaultAntialiased,
messages.userFace = chDefaultFace;
}
function storeMessageLayerSelProcessLock()
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚Ì storeSelProcessLock ‚ðŒÄ‚Ño‚·
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--) messages.storeSelProcessLock();
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--) messages.storeSelProcessLock();
}
function restoreMessageLayerSelProcessLock()
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚Ì restoreSelProcessLock ‚ðŒÄ‚Ño‚·
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--) messages.restoreSelProcessLock();
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--) messages.restoreSelProcessLock();
}
function setMessageLayerHiddenState(b)
{
var layers;
layers = fore.messages;
for(var i = layers.count-1; i >= 0; i--) layers.setHiddenStateByUser(b);
layers = fore.layers;
for(var i = layers.count-1; i >= 0; i--) layers.setHiddenStateByUser(b);
// ƒvƒ‰ƒOƒCƒ“‚ðŒÄ‚Ô
forEachEventHook('onMessageHiddenStateChanged',
function(handler, f) { handler(f.hidden); } incontextof this,
%[hidden:b]);
}
function hideMessageLayerByUser()
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚ðˆêŽž“I‚ɉB‚·
if(messageLayerHiding) return;
setMessageLayerHiddenState(true);
if(typeof this.rightClickMenuItem !== "undefined")
rightClickMenuItem.checked = true;
messageLayerHiding = true;
fore.base.cursor = cursorWaitingClick;
setMenuAccessibleAll();
}
function showMessageLayerByUser()
{
// ˆêŽž“I‚ɉB‚³‚ê‚Ä‚¢‚½ƒƒbƒZ[ƒWƒŒƒCƒ„‚ðŒ³‚É–ß‚·
if(!messageLayerHiding) return;
setMessageLayerHiddenState(false);
if(typeof this.rightClickMenuItem !== "undefined")
rightClickMenuItem.checked = false;
messageLayerHiding = false;
conductor.trigger('message'); // 'message' ‚ð‘—‚é
if(clickWaiting)
fore.base.cursor = cursorWaitingClick;
else
fore.base.cursor = cursorDefault;
setMenuAccessibleAll();
}
function switchMessageLayerHiddenByUser()
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ì”ñ•\Ž¦/•\Ž¦‚ðØ‚è‘Ö‚¦‚é
if(messageLayerHiding) showMessageLayerByUser(); else hideMessageLayerByUser();
}
function hideMessageLayerByScenario(elm)
{
// ƒVƒiƒŠƒI‚©‚烃bƒZ[ƒW‚ðˆêŽž“I‚ɉB‚·
hideMessageLayerByUser();
conductor.wait(%[ // ƒRƒ“ƒ_ƒNƒ^‚ð‘Ò‚¿‚É
message : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
return -2; // break
}
function selectFont()
{
// ƒtƒHƒ“ƒg‚ð‘I‘ð‚·‚é
fore.base.font.face = chDefaultFace;
fore.base.font.height = -20;
var flags = fsfSameCharSet | fsfNoVertical | fsfTrueTypeOnly | fsfUseFontFace;
if(showFixedPitchOnlyInFontSelector) flags |= fsfFixedPitch;
if(fore.base.font.doUserSelect(flags, "ƒtƒHƒ“ƒg‚Ì‘I‘ð",
"ƒtƒHƒ“ƒg‚ð‘I‘ð‚µ‚Ä‚‚¾‚³‚¢", "ABCDEFGHI‚ ‚¢‚¤‚¦‚¨ˆŸˆÝ‰FŠGŒä"))
{
chDefaultFace = fore.base.font.face;
setMessageLayerUserFont();
}
}
function mapPrerenderedFont(storage)
{
// ƒŒƒ“ƒ_ƒŠƒ“ƒOς݃tƒHƒ“ƒg‚ðŒ»Ý‚Ì‘€ì‘Îۂ̃ŒƒCƒ„‚É‘I‘ð
// ‚³‚ê‚Ä‚¢‚éƒtƒHƒ“ƒg‚Ƀ}ƒbƒsƒ“ƒO‚·‚é
current.decideSizeChange();
current.lineLayer.font.mapPrerenderedFont(storage);
}
//------------------------------------------------- ƒŒƒCƒ„‚𳂵‚¢‡˜‚É --
function reorderLayers()
{
// ƒŒƒCƒ„‚𳂵‚¢‡˜‚É•À‚Ñ‘Ö‚¦‚é
var index = 1000;
for(var i = 0; i<fore.layers.count; i++)
{
fore.layers.absolute = index;
back.layers.absolute = index;
index += 1000;
}
index = 1000000;
for(var i = 0; i<fore.messages.count; i++)
{
fore.messages.absolute = index;
back.messages.absolute = index;
index += 1000;
}
historyLayer.absolute = 2000000;
}
//--------------------------------------------- ‘®«->ƒŒƒCƒ„ƒIƒuƒWƒFƒNƒg --
function getLayerFromElm(elm, prefix = '')
{
// elm ‚ÉŽw’肳‚ê‚Ä‚¢‚é page ‚Æ layer ‘®«‚©‚çAŠY“–‚·‚é
// ƒIƒuƒWƒFƒNƒg‚ð•Ô‚·
// prefix ‚É‚ÍA‘®«–¼‚Ì‘O‚ɂ‚¯‚éƒvƒŒƒtƒBƒNƒX‚ðŽw’è‚·‚é
var base;
if(elm[prefix + 'page'] == 'back') base = back; else base = fore;
var layer = elm[prefix + 'layer'];
if(layer == 'base') return base.base; // ”wŒi
if(layer[0] == 'm')
{
// message? ( ? = ”’l )
// ‚±‚±‚Å‚Í‚ ‚܂茵–§‚ɃGƒ‰[ƒ`ƒFƒbƒN‚Í‚µ‚È‚¢
if(layer == 'message') return base.messages[currentNum];
return base.messages[+layer.substr(7)];
}
return base.layers[+layer];
}
function getLayerPageFromElm(elm, backlay)
{
// getLayerFromElm ‚ÆŽ—‚Ä‚¢‚邪Apage ‘®«‚Ü‚Å‚Í‚Ý‚È‚¢B
// backlay ‚ª true ‚Ì‚Æ‚«‚Í— Afalse ‚ÌŽž‚Í•\‚̃ŒƒCƒ„‚ð•Ô‚·B
// elm.layer ‚ª void ‚ÌŽž‚Í”wŒiƒŒƒCƒ„‚ð‹A‚·
var base = backlay?back:fore;
var layer = elm.layer;
if(layer === void || layer == 'base') return base.base; // ”wŒi
if(layer[0] == 'm')
{
if(layer == 'message') return base.messages[currentNum];
return base.messages[+layer.substr(7)];
}
return base.layers[+layer];
}
function getMessageLayerPageFromElm(elm)
{
// elm ‚©‚çŠY“–‚·‚é•\/— ‰æ–ʂ̃ƒbƒZ[ƒWƒŒƒCƒ„”z—ñ‚ð•Ô‚·
if(elm.page == 'back') return 1; else return 0;
}
function getMessageLayerNumberFromElm(elm)
{
// elm ‚Ì layer ‘®«‚ÌŽ¦‚·ƒƒbƒZ[ƒWƒŒƒCƒ„”Ô†‚ð•Ô‚·
var layer = elm.layer;
if(layer === void || layer == 'message') return currentNum;
return +layer.substr(7);
}
function getMessageLayerObjectFromElm(elm)
{
// elm ‚Ì layer ‘®«‚ÌŽ¦‚·ƒƒbƒZ[ƒWƒŒƒCƒ„‚ð•Ô‚·
var page = elm.page;
var layer = elm.layer;
if(page === void && layer === void) return current;
var base;
if(page == 'back') base = back; else base = fore;
if(layer === void || layer == 'message') return base.messages[currentNum];
return base.messages[+layer.substr(7)];
}
function getMessageLayerObjectFromPageAndNumber(page, num)
{
return (page?back:fore).messages[num];
}
//----------------------------------------------------- ƒŒƒCƒ„ƒRƒs[ŠÖ˜A --
function backupLayer(elm, toback)
{
// ƒŒƒCƒ„‚Ì•\©¨— ŠÔ‚̃Rƒs[‚ðs‚¤
// toback = true ‚Ìꇂ͕\¨— Afalse ‚Ìꇂ͗ ¨•\
if(elm.layer !== void)
{
// ƒŒƒCƒ„Žw’肪‚ ‚é
getLayerPageFromElm(elm, toback).assignComp(); // ‘΂̃ŒƒCƒ„‚Ì“à—e‚ðƒRƒs[
}
else
{
// ƒŒƒCƒ„Žw’肪–³‚¢‚Ì‚Å‘S•”‚̃ŒƒCƒ„‚ðƒRƒs[
var base = toback ? back:fore;
base.base.assignComp();
var layers = base.layers, messages = base.messages;
for(var i = layers.count-1; i >= 0; i--) layers.assignComp();
for(var i = messages.count-1; i >= 0; i--) messages.assignComp();
forEachEventHook('onCopyLayer',
function(handler, f) { handler(f.toback); } incontextof this,
%[toback:toback]);
}
}
function copyLayer(elm)
{
// elm ‚É]‚Á‚Ä“¯Ží‚̃ŒƒCƒ„ŠÔ‚̃Rƒs[‚ðs‚¤
var src = getLayerFromElm(elm, 'src');
var dest = getLayerFromElm(elm, 'dest');
dest.assign(src);
}
//--------------------------------------------------- ƒAƒjƒ[ƒVƒ‡ƒ“ŠÖ˜A --
function onAnimationStopped(name, segment)
{
// ƒAƒjƒ[ƒVƒ‡ƒ“‚ª’âŽ~‚µ‚½
conductor.trigger('anim:' + name + ':' + segment);
}
function waitAnimation(elm)
{
// ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì’âŽ~‚ð‚Ü‚Â
var layer = getLayerFromElm(elm);
var seg = +elm.seg;
if(!layer.canWaitAnimStop(seg)) return 0; // ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì’âŽ~‚ð‘Ò‚Â
conductor.wait(%[
'anim:' + layer.name + ':' + seg => function
{
} incontextof this
]);
return -2;
}
//--------------------------------------------------- ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŠÖ˜A --
function onLayerTransitionCompleted(layer, dest, src)
{
// ƒŒƒCƒ„‚Ńgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ªI—¹‚µ‚½‚Æ‚«‚ɌĂ΂ê‚é
conductor.trigger('trans'); // 'trans' ‚ð‘—‚é
}
function waitTransition(elm)
{
// ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð‘Ò‚Â
if(transCount == 0) return 0; // ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð‘Ò‚Ä‚È‚¢
if((elm.canskip === void || +elm.canskip) && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv“®ì’†
stopAllTransitions();
return 0; // ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð’âŽ~‚³‚¹‚Ä‚·‚®‚É•Ô‚é
}
conductor.wait(%[
click : function
{
updateBeforeCh = 1;
stopAllTransitions(); // ‚·‚ׂẴgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚Í’âŽ~
} incontextof this,
trans : function
{
updateBeforeCh = 1;
} incontextof this
]);
}
else
{
conductor.wait(%[
trans : function
{
updateBeforeCh = 1;
} incontextof this
]);
}
return -2;
}
function stopAllTransitions()
{
// ‚·‚ׂẴgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð’âŽ~‚³‚¹‚é
var layers, messages;
fore.base.stopTransition();
layers = fore.layers, messages = fore.messages;
for(var i = layers.count-1; i >= 0; i--) layers.stopTransition();
for(var i = messages.count-1; i >= 0; i--) messages.stopTransition();
back.base.stopTransition();
layers = back.layers, messages = back.messages;
for(var i = layers.count-1; i >= 0; i--) layers.stopTransition();
for(var i = messages.count-1; i >= 0; i--) messages.stopTransition();
transCount = 0; // ˆê‰ž
}
function callExchangeInfo()
{
// ‚·‚ׂĂ̔wŒiƒŒƒCƒ„‚ð‚Ì‚¼‚•\ƒŒƒCƒ„‚ɑ΂µ‚Ä
// exchangeInfo ‚ðŒÄ‚Ô
var layers = fore.layers, messages = fore.messages;
for(var i = layers.count-1; i >= 0; i--) layers.exchangeInfo();
for(var i = messages.count-1; i >= 0; i--) messages.exchangeInfo();
}
function callAssignTransSrc()
{
// ‚·‚ׂĂ̔wŒiƒŒƒCƒ„‚ð‚Ì‚¼‚•\ƒŒƒCƒ„‚ɑ΂µ‚Ä
// assignTransSrc ‚ðŒÄ‚Ô
var layers = fore.layers, messages = fore.messages;
for(var i = layers.count-1; i >= 0; i--) layers.assignTransSrc();
for(var i = messages.count-1; i >= 0; i--) messages.assignTransSrc();
forEachEventHook('onCopyLayer',
function(handler, f) { handler(f.toback); } incontextof this,
%[toback:false]);
}
function exchangeForeBack()
{
// ƒŒƒCƒ„‚Ì— ‚Æ•\‚ðŽæ‚è‘Ö‚¦‚é
var tmp = fore;
fore = back;
back = tmp;
current = (currentPage?back:fore).messages[currentNum]; // current ‚Íݒ肵’¼‚µ
forEachEventHook('onExchangeForeBack',
function(handler, f) { handler(); } incontextof this);
}
function swapBaseLayer()
{
// ”wŒiƒŒƒCƒ„‚Ì‚Ý‚ðŽæ‚è‘Ö‚¦‚é
var tmp = fore.base;
fore.base = back.base;
back.base = tmp;
current = (currentPage?back:fore).messages[currentNum]; // current ‚Íݒ肵’¼‚µ
}
function swapCharacterLayer(id)
{
// ‘OŒiƒŒƒCƒ„‚Ì•\‚Æ— ‚ðŽæ‚è‘Ö‚¦‚é
var fl = fore.layers, bl = back.layers;
var tmp = fl[id];
fl[id] = bl[id];
bl[id] = tmp;
}
function swapMessageLayer(id)
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ì•\‚Æ— ‚ðŽæ‚è‘Ö‚¦‚é
var fl = fore.messages, bl = back.messages;
var tmp = fl[id];
fl[id] = bl[id];
bl[id] = tmp;
current = (currentPage?back:fore).messages[currentNum]; // current ‚Íݒ肵’¼‚µ
}
//--------------------------------------------------------- Ž©“®ˆÚ“®ŠÖ˜A --
function onLayerMoveStop()
{
// ƒŒƒCƒ„‚ÌŽ©“®ˆÚ“®‚ªI—¹‚µ‚½
conductor.trigger('move');
}
function waitMove(elm)
{
// Ž©“®ˆÚ“®‚ð‘Ò‚Â
if(moveCount == 0) return 0; // Ž©“®ˆÚ“®‚ð‘Ò‚Ä‚È‚¢
if((elm.canskip === void || +elm.canskip) && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv“®ì’†
stopAllMoves();
return 0; // Ž©“®ˆÚ“®‚ð’âŽ~‚³‚¹‚Ä‚·‚®‚É•Ô‚é
}
conductor.wait(%[
click : function
{
updateBeforeCh = 1;
stopAllMoves(); // ‚·‚ׂẴgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚Í’âŽ~
} incontextof this,
move : function
{
updateBeforeCh = 1;
} incontextof this
]);
}
else
{
conductor.wait(%[
move : function
{
updateBeforeCh = 1;
} incontextof this
]);
}
return -2;
}
function stopAllMoves()
{
// ‚·‚ׂĂ̎©“®ˆÚ“®‚ð’âŽ~‚³‚¹‚é
var layers, messages;
fore.base.stopMove();
back.base.stopMove();
layers = fore.layers, messages = fore.messages;
for(var i = layers.count-1; i >= 0; i--) layers.stopMove();
for(var i = messages.count-1; i >= 0; i--) messages.stopMove();
layers = back.layers, messages = back.messages;
for(var i = layers.count-1; i >= 0; i--) layers.stopMove();
for(var i = messages.count-1; i >= 0; i--) messages.stopMove();
moveCount = 0; // ˆê‰ž
}
//------------------------------------------------ ƒfƒBƒŒƒC/ƒXƒLƒbƒvŠÖ˜A --
function setDelay(elm)
{
// delay ƒ^ƒO‚̈—
var speed = elm.speed;
if(speed == 'nowait')
{
chSpeed = 0;
chUserMode = false;
}
else if(speed == 'user')
{
chUserMode = true;
setUserSpeed();
}
else
{
chSpeed = +speed;
chUserMode = false;
}
if(!skipMode) actualChSpeed = chSpeed;
}
function getCurrentRead()
{
// Œ»Ý‚̃VƒiƒŠƒI•”•ª‚ªŠù“Ç‚©‚Ç‚¤‚©‚ð”»’è‚·‚é
return autoRecordPageShowing && currentRecordName != "" &&
+sflags[currentRecordName] || !autoRecordPageShowing;
}
function setUserSpeed()
{
// ƒ†[ƒU‚Ì‘I‘ð‚µ‚½•¶Žš•\Ž¦ƒXƒs[ƒh‚ðÝ’è
// ‚±‚ÌŠÖ”‚ð“Ç‚ñ‚¾Žž“_‚Å‚·‚Å‚É userChSpeed ‚É‚Í
// ‚ ‚½‚炵‚¢’l‚ªÝ’肳‚ê‚Ä‚¢‚é‚Æ‚Ý‚È‚·B
// ‚ ‚é‚¢‚ÍAƒ‰ƒxƒ‹‚²‚Æ‚ÉA‚»‚Ì‹æˆæ‚ªŠù“Ç‚©–¢“Ç‚©‚Å
// •\Ž¦ƒXƒs[ƒh‚ð•Ï‚¦‚é–Ú“I‚ŌĂ΂ê‚é
if(chUserMode)
{
if(getCurrentRead())
chSpeed = userCh2ndSpeed==-1?userChSpeed:userCh2ndSpeed; // Šù“Ç
else
chSpeed = userChSpeed; // Т҂
}
if(!skipMode) actualChSpeed = chSpeed;
}
function skipToClick()
{
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚܂ŃXƒLƒbƒv
skipMode = 1;
actualChSpeed = 0;
}
function skipToPage()
{
// ‰üƒy[ƒW‘Ò‚¿‹L†‚܂ŃXƒLƒbƒv
skipMode = 2;
actualChSpeed = 0;
}
function skipToStop()
{
// ŽŸ‚Ì’âŽ~‚܂ŃXƒLƒbƒv
onPrimaryClick(); // ƒNƒŠƒbƒN‚Ì“®ì‚ðƒGƒ~ƒ…ƒŒ[ƒg‚·‚é
skipMode = 3;
actualChSpeed = 0;
}
function skipToStop2()
{
// ŽŸ‚Ì’âŽ~‚܂ŃXƒLƒbƒv(‘‘—‚胂[ƒh)
onPrimaryClick();
skipMode = 4;
actualChSpeed = 0;
}
function cancelSkip()
{
// ƒXƒLƒbƒv“®ì‚ðƒLƒƒƒ“ƒZƒ‹
skipMode = 0;
skipKeyRepressed = false;
actualChSpeed = chSpeed;
}
function enterNoWait()
{
// nowait ƒ^ƒO‚̈—
beforeNoWaitActualChSpeed = actualChSpeed;
beforeNoWaitChUserMode = chUserMode;
actualChSpeed = 0;
}
function leaveNoWait()
{
// endnowait ƒ^ƒO‚̈—
actualChSpeed = beforeNoWaitActualChSpeed;
chUserMode = beforeNoWaitChUserMode;
}
function setAutoWait(elm)
{
// Ž©“®ƒEƒFƒCƒg‚ðÝ’è‚·‚é
autoWCEnabled = +elm.enabled if elm.enabled !== void;
autoWCChars = elm.ch if elm.ch !== void;
autoWCWaits = [].split(",", elm.time) if elm.time !== void;
}
function cancelAutoMode()
{
// Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̃Lƒƒƒ“ƒZƒ‹
if(autoMode)
{
autoMode = false;
if(typeof this.autoModeMenuItem !== "undefined")
autoModeMenuItem.checked = false;
var t = conductor.lastTagName;
if(t == 'p'){
showPageBreak();
}
else if(t == 'l'){
showLineBreak(%[canskip: false]);
}
}
}
function enterAutoMode()
{
// Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚É“ü‚é
if(typeof this.autoModeMenuItem !== "undefined")
autoModeMenuItem.checked = true;
if(inStable)
onPrimaryClick();
autoMode = true;
}
//--------------------------------------------------------- ƒEƒFƒCƒgŠÖ˜A --
function resetWait()
{
// ŽžŠÔŒ´“_‚̃ŠƒZƒbƒg
timeOrigin = System.getTickCount();
}
function waitTime(waittime, canskip)
{
// waittime •ª‘Ò‚Â
if(waittime == 0) return 0;
if(canskip)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
return 0; // ƒXƒLƒbƒv’†‚Ìê‡‚Í‚È‚É‚à‚¹‚¸‚É•Ô‚é
}
conductor.waitWithTimeOut(%[
click : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
timeout : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
], waittime);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.waitWithTimeOut(%[
timeout : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
], waittime);
}
return -2; // break
}
function doWait(elm)
{
// wait ƒ^ƒO‚̈—
var waittime;
if(elm.mode == 'until')
{
// until ƒ‚[ƒh
waittime = timeOrigin + +elm.time - System.getTickCount();
if(waittime < 0) { lastWaitTime = 0; return 0; } // ‚·‚Å‚ÉŽžŠÔ‚ªŒo‰ß‚µ‚Ä‚¢‚é
lastWaitTime = waittime;
if(waittime < 6) return 0; // ‚ ‚Ü‚è‚É‘Ò‚¿ŽžŠÔ‚ª’Z‚¢‚Ì‚Å‘Ò‚½‚È‚¢
}
else
{
waittime = +elm.time;
}
return waitTime(waittime, (elm.canskip === void || +elm.canskip) && clickSkipEnabled);
}
function doWaitCh(elm)
{
// +elm.time ‚̃JƒEƒ“ƒg•ªA‘Ò‚Â
var t = elm.time;
return waitTime(actualChSpeed * (t === void ? 1 : +t),
(elm.canskip === void || +elm.canskip) && clickSkipEnabled);
}
//------------------------------------------------------------ quakeŠÖ˜A --
function doQuake(elm)
{
// elm ‚É]‚Á‚Ä quake ‚ðŠJŽn
if(elm.time !== void)
{
if(defaultQuakeTimeInChUnit)
{
if(elm.timemode == 'ms')
quakeEndTick = System.getTickCount() + +elm.time;
else
quakeEndTick = System.getTickCount() + +elm.time * chSpeed;
}
else
{
if(elm.timemode == 'delay')
quakeEndTick = System.getTickCount() + +elm.time * chSpeed;
else
quakeEndTick = System.getTickCount() + +elm.time;
}
}
else
{
quakeEndTick = -1;
}
if(elm.hmax !== void) quakeHorzMax = +elm.hmax; else quakeHorzMax = 10;
if(elm.vmax !== void) quakeVertMax = +elm.vmax; else quakeVertMax = 10;
quakeTimer.enabled = true;
quaking = true;
}
function restoreQuake()
{
// restore ‚©‚çŒÄ‚΂êAžx‚ð•Û‘¶‚µ‚½‚Æ‚«‚É—h‚ê‚Ä‚¢‚½ê‡‚Í—h‚ç‚·
if(quaking && quakeEndTick == -1)
quakeTimer.enabled =true;
}
function stopQuake()
{
// —h‚ê‚ð’âŽ~
setLayerPos(0, 0);
quakeTimer.enabled = false;
quaking = false;
conductor.trigger('quake');
}
function onQuakeTimerInterval()
{
// quakeTimer ‚É‚æ‚èŒÄ‚΂ê‚é
if(quakeEndTick != -1 && System.getTickCount() > quakeEndTick) { stopQuake(); return; }
if(historyShowing)
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„•\Ž¦’†‚Í‚³‚·‚ª‚É—h‚ê‚Ä‚¢‚ç‚ê‚È‚¢
setLayerPos(0, 0);
return;
}
var x, y;
if(quakeHorzMax == quakeVertMax)
{
// ‚¾‚¢‚½‚¢“¯‚¶
x = int(Math.random() * quakeHorzMax - quakeHorzMax);
y = int(Math.random() * quakeVertMax - quakeVertMax);
}
else if(quakeHorzMax < quakeVertMax)
{
// c—h‚ê
x = int(Math.random() * quakeHorzMax - quakeHorzMax);
y = int((quakePhase ? Math.random() : -Math.random()) * quakeVertMax);
}
else
{
// ‰¡—h‚ê
x = int((quakePhase ? Math.random() : -Math.random()) * quakeHorzMax);
y = int(Math.random() * quakeVertMax - quakeVertMax);
}
quakePhase = !quakePhase;
setLayerPos(x, y);
}
function waitQuake(elm)
{
// —h‚ꂪI—¹‚·‚é‚Ü‚Å‚Ü‚Â
if(!quaking || quakeEndTick == -1) return 0; // —h‚ê‚Ä‚¢‚È‚¯‚ê‚Α҂½‚È‚¢
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
stopQuake();
return 0; // ƒXƒLƒbƒv’†‚Ìꇂ͗h‚ê‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function
{
stopQuake(); // —h‚ê‚Í’âŽ~‚·‚é
} incontextof this,
quake : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
quake : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
return -2;
}
//------------------------------------------------------------- ƒNƒŠƒbƒN --
function onPrimaryClick()
{
// ƒvƒ‰ƒCƒ}ƒŠƒŒƒCƒ„‚ÅuƒNƒŠƒbƒN‚Ì“®ìv‚ª‚È‚É‚àƒtƒBƒ‹ƒ^ƒŠƒ“ƒO‚³‚ê‚È‚©‚Á‚½
// ‚Æ‚«Aƒvƒ‰ƒCƒ}ƒŠƒŒƒCƒ„‚©‚çŒÄ‚΂ê‚éB
clickCount ++;
if(!callHook(leftClickHook))
{
if(messageLayerHiding)
{
showMessageLayerByUser(); // ƒƒbƒZ[ƒWƒŒƒCƒ„‚ð•\Ž¦‚·‚é
}
else
{
var st = conductor.status;
var runst = conductor.mRun;
var stopst = conductor.mStop;
if(st != stopst && autoMode)
{
// Ž©“®“Ç‚Ý‚·‚·‚Ý‚Ìê‡
cancelAutoMode();
}
else if(st != stopst && canCancelSkipByClick && skipMode && skipMode != 4)
{
// ƒNƒŠƒbƒN‚É‚æ‚éƒXƒLƒbƒv‚̉𜂪‰Â”\
cancelSkip();
}
else
{
// ‚±‚ÌŽž“_‚ŃtƒBƒ‹ƒ^ƒŠƒ“ƒO‚³‚ê‚È‚¢ƒƒbƒZ[ƒW‚Í‘Ò‚¿ó‘Ԃ̃NƒŠƒA‚È‚Ì‚Å
// conductor ‚É 'click' ‚ð‘—‚è‰ðœ‚ð“`‚¦‚éB
if(!conductor.trigger('click')) // ‘Ò‚¿ó‘Ô‚Å‚È‚¢ê‡‚Í’P‚É–³Ž‹‚³‚ê‚é
{
// ƒnƒ“ƒhƒ‰‚ªŒ©‚‚©‚ç‚È‚¢‚È‚ÇAˆ—‚³‚ê‚È‚©‚Á‚½ê‡
if(st == runst && clickSkipEnabled && skipMode == 0)
{
// ƒNƒŠƒbƒN‚É‚æ‚éƒXƒLƒbƒv‚ª‰Â”\
skipToClick();
}
}
}
}
}
}
function onPrimaryClickByKey()
{
// ƒL[‚ª‰Ÿ‚³‚ꂽ‚Æ‚«ƒvƒ‰ƒCƒ}ƒŠƒŒƒCƒ„‚ðƒNƒŠƒbƒN‚µ‚½‚Ì‚Æ
// “¯‚¶“®ì‚ð‚·‚é‚ªA‚³‚ç‚Ɉꎞ“I‚Ƀ}ƒEƒXƒJ[ƒ\ƒ‹‚ð‰B‚·
onPrimaryClick();
hideMouseCursor();
}
function waitClick(elm)
{
// ƒNƒŠƒbƒN‚ð‘Ò‚Â
conductor.wait(%[
click : function
{
} incontextof this]);
return -2;
}
function onMouseDown(x, y)
{
lastMouseDownX = x;
lastMouseDownY = y;
super.onMouseDown(...);
}
//------------------------------------------------------- ƒL[ƒ{[ƒh‘€ì --
function processKeys(key, shift)
{
if(checkProceedingKey(key, shift)) return;
if(key == #'F')
{
// ŽŸ‚Ì‘I‘ðŽˆ/–¢“Ç‚Ü‚Åi‚Þ
skipToNextStopByKey();
return;
}
if(key == #'B')
{
// ‘O‚É–ß‚é
goBackByKey();
return;
}
if(key == #'A')
{
// Ž©“®“I‚É“Ç‚Ýi‚ß‚é
switchAutoModeByKey();
return;
}
if(freeSaveDataMode)
{
if(key == #'S')
{
// žx‚ð‚Í‚³‚Þ
if(typeof this.storeMenu != "undefined" && storeMenu.enabled)
storeMenu.click();
return;
}
if(key == #'L')
{
// žx‚ð‚½‚Ç‚é
if(typeof this.restoreMenu != "undefined" && restoreMenu.enabled)
restoreMenu.click();
return;
}
}
if(key == #'R' || (key == VK_UP && (shift & ssShift)))
{
// ƒƒbƒZ[ƒW—š—ð‚ð•\Ž¦
showHistoryByKey();
return;
}
if(key == VK_ESCAPE)
{
// ƒƒbƒZ[ƒW‚ðÁ‚·
if(typeof this.rightClickMenuItem != "undefined" &&
rightClickMenuItem.enabled)
{
rightClickMenuItem.click(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
return;
}
}
}
function preProcessKeys(key, shift)
{
return callHook(keyDownHook, key, shift);
}
function internalOnKeyDown(key, shift)
{
if(!preProcessKeys(key, shift)) processKeys(key, shift);
}
function checkProceedingKey(key, shift)
{
// key ‚ª“Ç‚Ý‚·‚·‚݂̃L[ ( ƒXƒy[ƒXƒL[‚©ReturnƒL[ ) ‚ÌꇂÍ
// ƒL[‚ðˆ—‚µAtrue ‚ð•Ô‚·B‚»‚¤‚Å‚È‚¯‚ê‚Î false ‚ð•Ô‚·
if(key == VK_RETURN || key == VK_SPACE)
{
// ƒL[‚ªƒƒbƒZ[ƒWƒLƒ…[‚É—‚Ü‚Á‚Ä‚éꇂª‚ ‚é‚Ì‚Å
// ŽÀÛ‚É‚»‚̃L[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚é‚Ì‚©‚Ç‚¤‚©‚ð
// getKeyState ‚ð—p‚¢‚Ä’²‚ׂé
var sg = getKeyState;
if(sg(VK_RETURN) || sg(VK_SPACE))
{
// ƒL[‚ª‰Ÿ‚³‚ê‚Ä‚½
if((shift & ssRepeat) && clickSkipEnabled &&
conductor.status == conductor.mRun)
{
// ƒL[ƒŠƒs[ƒg
if(skipMode != 4 && skipKeyRepressed)
skipToStop2(); // ‚Ü‚¾skipMode 4‚É“ü‚Á‚Ä‚¢‚È‚¢ê‡‚Í‘‘—‚胂[ƒh‚É“ü‚é
// skipKeyRepressed ‚ðƒ`ƒFƒbƒN‚·‚é‚Ì‚Í
// ˜A‘±‚µ‚ăL[ƒŠƒs[ƒg‚ª”¶‚µ‚Ä‚¢‚é‚Æ‚«‚É
// cancelSkip Œã‚ɃXƒLƒbƒv‚É“Ë“ü‚·‚é‚Ì‚ð–h‚®‚½‚ß
}
else
{
skipKeyRepressed = true;
onPrimaryClickByKey();
}
return true;
}
}
return false;
}
function skipCancelKeyPressing()
{
// ƒXƒLƒbƒv‚ð‰ðœ‚·‚é—vˆö‚Æ‚È‚éƒL[‚ ‚é‚¢‚̓}ƒEƒXƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ê‚Ä‚¢‚é‚©
var sg = getKeyState;
return sg(VK_RETURN) || sg(VK_SPACE) || sg(VK_LBUTTON);
}
function skipKeyPressing()
{
// VK_RETURN ‚ ‚é‚¢‚Í VK_SPACE ‚ª‰Ÿ‚³‚ê‚Ä‚¢‚é‚©‚Ç‚¤‚©
var sg = getKeyState;
return sg(VK_RETURN) || sg(VK_SPACE);
}
function goBackByKey()
{
if(typeof this.goBackMenuItem != "undefined" &&
goBackMenuItem.enabled)
goBackMenuItem.click(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
}
function skipToNextStopByKey()
{
if(typeof this.skipToNextStopMenuItem != "undefined" &&
skipToNextStopMenuItem.enabled)
skipToNextStopMenuItem.click(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
}
function showHistoryByKey()
{
if(typeof this.showHistoryMenuItem != "undefined" &&
showHistoryMenuItem.enabled)
showHistoryMenuItem.click(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
}
function switchAutoModeByKey()
{
if(typeof this.autoModeMenuItem != "undefined" &&
autoModeMenuItem.enabled)
autoModeMenuItem.click(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
}
function onKeyDown(key, shift)
{
if(focusedLayer === null)
internalOnKeyDown(key, shift);
super.onKeyDown(...);
}
function onMouseWheel(shift, delta, x, y)
{
// ƒzƒC[ƒ‹‚ª‰ñ“]‚µ‚½
super.onMouseWheel(...);
if(!historyLayer.visible)
{
if(delta > 0)
showHistoryByKey(); // ƒƒbƒZ[ƒW—š—ð‚ð•\Ž¦
else if(System.getTickCount() - lastHistoryHiddenTick > 150)
onPrimaryClick(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
// ª tick ‚ð”äŠr‚µ‚Ä‚¢‚é‚Ì‚ÍAƒƒbƒZ[ƒW—š—ð‚ð‰B‚·‘€ì‚ƃzƒC[ƒ‹‚ð
// Žè‘O‚ɉñ‚·‘€ì‚ª˜A‘±‚µ‚½ê‡‚ÉŸŽè‚É“Ç‚Ýi‚Þ‚Ì‚ð‚ ‚é’ö“x–h‚®ŽdŠ|‚¯
}
else
{
// ƒƒbƒZ[ƒW—š—ð‚ɃCƒxƒ“ƒg‚ð‚‚ê—¬‚·
historyLayer.windowMouseWheel(shift, delta, x, y);
}
}
//------------------------------------------------- ƒNƒŠƒbƒN‘Ò‚¿‹L†ˆ— --
function hideClickGlyphs()
{
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚ð”ñ•\Ž¦‚É
lineBreak.visible = false;
pageBreak.visible = false;
if(conductor == mainConductor)
{
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚Ìó‘Ô‚ð‹L˜^
lastClickGlyphVisible = false;
}
}
function storeClickGlyphState(which)
{
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚Ìî•ñ‚ðˆêŽž“I‚É‘Ò”ð
// ‚±‚̃f[ƒ^‚͉EƒNƒŠƒbƒNƒTƒuƒ‹[ƒ`ƒ“‚âextraConductorƒTƒuƒ‹[ƒ`ƒ“‚©‚ç–ß‚é‚Æ‚«‚ÉŽQÆ‚·‚é
if(conductor == mainConductor)
{
lastClickGlyphVisible = true;
lastClickGlyphMessagePage = currentPage;
lastClickGlyphMessageNum = currentNum;
lastClickGlyphWhich = which;
}
}
function restoreClickGlyphState()
{
// lastClickGlyph *** ‚Ɉꎞ“I‚É‘Ò”ð‚µ‚½ƒNƒŠƒbƒN‘Ò‚¿‹L†‚Ìî•ñ
// ‚ÉŠî‚¢‚ăNƒŠƒbƒN‘Ò‚¿‹L†‚ðÝ’è‚·‚é
if(lastClickGlyphVisible)
{
var layer = getMessageLayerObjectFromPageAndNumber
(lastClickGlyphMessagePage, lastClickGlyphMessageNum);
if(layer !== void)
{
switch(lastClickGlyphWhich)
{
case 'line':
layer.showLineBreakGlyph(lineBreak);
break;
case 'page':
layer.showPageBreakGlyph(pageBreak);
break;
}
}
}
}
function canIgnoreL()
{
// L ƒ^ƒO‚𖳎‹‚Å‚«‚é‚©‚Ç‚¤‚©
return chNonStopToPageBreak || (getCurrentRead() && ch2ndNonStopToPageBreak);
}
function showLineBreak(elm)
{
// Œ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚És‘Ò‚¿‹L†‚ð•\Ž¦‚·‚é
stablePosibility = true;
if(canIgnoreL())
{
// l ƒ^ƒO‚Ì–³Ž‹
if(elm.canskip === void || !+elm.canskip)
return (skipMode==3 || skipMode==4) ? 0 : -4;
}
if(autoMode)
{
// Ž©“®“Ç‚Ý‚·‚·‚Ý‚Ìê‡
return autoModeLineWait;
}
if(skipMode == 1) cancelSkip();
if(skipMode == 4 && !skipKeyPressing()) cancelSkip();
if(skipMode == 4) return -4;
if(skipMode) return skipCancelKeyPressing()?-4:0;
// ƒXƒLƒbƒv’†(ƒXƒLƒbƒv‚ðƒLƒƒƒ“ƒZƒ‹‚·‚é‚悤‚ȃL[‚ª‚ ‚ê‚΃XƒLƒbƒv‰ðœ
// ‚Ì‚½‚߂̃Cƒxƒ“ƒgˆ—‚Ì‹@‰ï‚ð—^‚¦‚é)
current.showLineBreakGlyph(lineBreak);
storeClickGlyphState("line");
if(!current.nodeVisible)
{
dm("Œx : ”ñ•\Ž¦‚É‚È‚Á‚Ä‚¢‚é" +
(currentPage ? "— " : "•\") + "ƒƒbƒZ[ƒWƒŒƒCƒ„" + currentNum +
"‚ÅsƒNƒŠƒbƒN‘Ò‚¿‚É‚È‚è‚Ü‚µ‚½");
}
// conductor ‚ð 'click' ‚Ü‚Å‘Ò‚¿ó‘Ô‚É
conductor.wait(%[
click : function
{
clickWaiting = false;
fore.base.cursor = cursorDefault;
notifyRun();
} incontextof this
]);
clickWaiting = true;
fore.base.cursor = cursorWaitingClick;
notifyStable();
return -2;
}
function showPageBreak(elm)
{
// Œ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚Ƀy[ƒW‘Ò‚¿‹L†‚ð•\Ž¦‚·‚é
stablePosibility = true;
if(skipMode == 1 || skipMode == 2) cancelSkip();
if(skipMode == 4 && !skipKeyPressing()) cancelSkip();
if(skipMode) return -4; // ‚¢‚Á‚½‚ñƒCƒxƒ“ƒg‚ðˆ—
if(autoMode)
{
// Ž©“®“Ç‚Ý‚·‚·‚Ý‚Ìê‡
return autoModePageWait;
}
current.showPageBreakGlyph(pageBreak);
storeClickGlyphState("page");
if(!current.nodeVisible)
{
dm("Œx : ”ñ•\Ž¦‚É‚È‚Á‚Ä‚¢‚é" +
(currentPage ? "— " : "•\") + "ƒƒbƒZ[ƒWƒŒƒCƒ„" + currentNum +
"‚Ńy[ƒWƒNƒŠƒbƒN‘Ò‚¿‚É‚È‚è‚Ü‚µ‚½");
}
// conductor ‚ð 'click' ‚Ü‚Å‘Ò‚¿ó‘Ô‚É
conductor.wait(%[
click : function
{
clickWaiting = false;
fore.base.cursor = cursorDefault;
notifyRun();
} incontextof this
]);
clickWaiting = true;
fore.base.cursor = cursorWaitingClick;
notifyStable();
return -2;
}
function showPageBreakAndClear()
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚ªÅIs‚Ü‚Å’B‚µ‚ÄŽ©“®‰üƒy[ƒW‚ª‚³‚ê‚é‚Æ‚«‚É
// ŒÄ‚΂ê‚éBŒ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚Ƀy[ƒW‘Ò‚¿‹L†‚ð•\Ž¦‚µA
// ŽÀsÄŠJŽž‚É‚Í MessageLayer.clear2 ‚ðŒÄ‚Ô
stablePosibility = true;
if(skipMode == 1 || skipMode == 2) cancelSkip();
if(skipMode == 4 && !skipKeyPressing()) cancelSkip();
var lasttagname = conductor.lastTagName;
if(!autoMode && ((!canIgnoreL() && lasttagname == 'l') || lasttagname == 'p'))
{ current.clear2(); return -5; }// ‚¢‚Á‚½‚ñƒCƒxƒ“ƒg‚ðˆ—(ƒ^ƒO‚ÍŒã‰ñ‚µ)
if(skipMode) { current.clear2(); return -5; }// ‚¢‚Á‚½‚ñƒCƒxƒ“ƒg‚ðˆ—(ƒ^ƒO‚ÍŒã‰ñ‚µ)
if(!current.nodeVisible)
{
dm("Œx : ”ñ•\Ž¦‚É‚È‚Á‚Ä‚¢‚é" +
(currentPage ? "— " : "•\") + "ƒƒbƒZ[ƒWƒŒƒCƒ„" + currentNum +
"‚ÅŽ©“®‰üƒy[ƒWƒNƒŠƒbƒN‘Ò‚¿‚É‚È‚è‚Ü‚µ‚½");
}
if(autoMode)
{
conductor.waitWithTimeOut(%[ // ƒ^ƒCƒ€ƒAƒEƒg•t‚«ƒEƒFƒCƒg
click : function
{
current.clear2(); // clear2 ‚ðŒÄ‚Ô
cancelAutoMode();
} incontextof this,
timeout : function
{
current.clear2(); // clear2 ‚ðŒÄ‚Ô
} incontextof this
], autoModePageWait <= 0 ? 1 : autoModePageWait);
return -3;
}
else
{
current.showPageBreakGlyph(pageBreak);
storeClickGlyphState("page");
// conductor ‚ð 'click' ‚Ü‚Å‘Ò‚¿ó‘Ô‚É
conductor.wait(%[
click : function
{
clickWaiting = false;
fore.base.cursor = cursorDefault;
current.clear2(); // clear2 ‚ðŒÄ‚Ô
notifyRun();
} incontextof this
]);
clickWaiting = true;
fore.base.cursor = cursorWaitingClick;
notifyStable();
return -3;
}
}
//------------------------------------------------------------- BGM ˆ— --
function onBGMFadeCompleted()
{
// BGM ‚̃tƒF[ƒh‚ªŠ®—¹‚µ‚½
conductor.trigger('bgmfade');
}
function onBGMStop()
{
// BGM ‚ª’âŽ~‚µ‚½
conductor.trigger('bgmstop');
}
function waitBGMFade(elm)
{
// BGM ‚̃tƒF[ƒhI—¹‚ð‘Ò‚Â
if(!bgm.inFading) return 0; // ƒtƒF[ƒh’†‚Å‚È‚¯‚ê‚Α҂½‚È‚¢
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
bgm.stopFade();
return 0; // ƒXƒLƒbƒv’†‚Ìꇂ̓tƒF[ƒh‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function
{
bgm.stopFade(); // ƒtƒF[ƒfƒBƒ“ƒO‚Í’âŽ~‚·‚é
} incontextof this,
bgmfade : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
bgmfade : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
return -2;
}
function waitBGMStop(elm)
{
// BGM ‚ÌĶI—¹‚ð‘Ò‚Â
if(!bgm.canWaitStop) return 0; // BGM ĶI—¹‚ð‘Ò‚Ä‚È‚¯‚ê‚΂»‚Ì‚Ü‚Ü–ß‚é
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
bgm.stop();
return 0; // ƒXƒLƒbƒv’†‚ÌꇂÍĶ‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function
{
bgm.stop(); // Ķ‚ðI—¹‚·‚é
} incontextof this,
bgmstop : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
bgmstop : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
return -2;
}
//----------------------------------------------------------- Œø‰Ê‰¹ˆ— --
function onSESoundBufferFadeCompleted(id)
{
// Œø‰Ê‰¹‚̃tƒF[ƒh‚ªI—¹‚µ‚½
conductor.trigger('sefade' + id);
}
function onSESoundBufferStop(id)
{
// Œø‰Ê‰¹‚ÌĶ‚ªI—¹‚µ‚½
conductor.trigger('sestop' + id);
}
function waitSEFade(elm)
{
var id = +elm.buf;
var buf = se[id];
if(!buf.inFading) return 0; // ƒtƒF[ƒh’†‚Å‚È‚¯‚ê‚΂»‚Ì‚Ü‚Ü–ß‚é
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
buf.stopFade();
return 0; // ƒXƒLƒbƒv’†‚Ìꇂ̓tƒF[ƒh‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function (id)
{
se[id].stopFade(); // ƒtƒF[ƒh‚ðI—¹‚·‚é
} incontextof this,
click_arg : id, // ƒnƒ“ƒhƒ‰‚ւ̈ø”
'sefade'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'sefade'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
'sefade'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'sefade'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
return -2;
}
function waitSEStop(elm)
{
var id = +elm.buf;
var buf = se[id];
if(!buf.canWaitStop()) return 0; // I—¹‚ð‘Ò‚Ä‚È‚¯‚ê‚΂»‚Ì‚Ü‚Ü•Ô‚é
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
buf.stop();
return 0; // ƒXƒLƒbƒv’†‚ÌꇂÍĶ‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function (id)
{
se[id].stop(); // Ķ‚ðI—¹‚·‚é
} incontextof this,
'click_arg' => id, // ƒnƒ“ƒhƒ‰‚ւ̈ø”
'sestop'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'sestop'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
'sestop'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'sestop'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
return -2;
}
//--------------------------------------------------------- ƒ€[ƒr[ŠÖ˜A --
function onMovieStop(id)
{
// ƒ€[ƒr[‚ÌĶ‚ªI—¹‚µ‚½
conductor.trigger('moviestop'+id);
}
function waitMovieStop(elm)
{
var id = +elm.slot;
// ƒ€[ƒr[‚ÌĶI—¹‚ð‘Ò‚Â
if(!movies[id].canWaitStop) return 0; // ƒ€[ƒr[ĶI—¹‚ð‘Ò‚Ä‚È‚¯‚ê‚΂»‚Ì‚Ü‚Ü–ß‚é
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
movies[id].stop();
return 0; // ƒXƒLƒbƒv’†‚ÌꇂÍĶ‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function (id)
{
movies[id].stop(); // Ķ‚ðI—¹‚·‚é
} incontextof this,
'click_arg' => id, // ƒnƒ“ƒhƒ‰‚ւ̈ø”
'moviestop'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'moviestop'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
'moviestop'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'moviestop'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
return -2;
}
function onMoviePeriod(id,type)
{
// ƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒg‚ª”¶‚µ‚½
if( isLeavePeriodEvent != false )
{
holdPeriodEventQueue.add( 'movieperiod'+id+'_'+type );
}
else
{
conductor.trigger('movieperiod'+id+'_'+type);
}
}
function waitMoviePeriod(elm)
{
isWaitPeriodEvent = true;
waitedPeriodEventStorageName = conductor.curStorage;
var id = +elm.slot;
stablePosibility = true;
if( holdPeriodEventQueue.count > 0 )
{
var triggered = false;
for( var i = 0; i < holdPeriodEventQueue.count; i++ )
{
if( elm.for !== void )
{
if( elm.for == 'loop' )
{
if( ('movieperiod'+id+'_'+perLoop) == holdPeriodEventQueue )
triggered = true;
}
else if( elm.for == 'period' )
{
if( ('movieperiod'+id+'_'+perPeriod) == holdPeriodEventQueue )
triggered = true;
}
else if( elm.for == 'prepare' )
{
if( ('movieperiod'+id+'_'+perPrepare) == holdPeriodEventQueue )
triggered = true;
}
else if( elm.for == 'segLoop' )
{
if( ('movieperiod'+id+'_'+perSegLoop) == holdPeriodEventQueue )
triggered = true;
}
else
{
triggered == true;
}
}
else
{
triggered == true;
}
}
holdPeriodEventQueue.clear();
if( triggered == true )
{
isWaitPeriodEvent = false;
return 0;
}
}
// ƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒg‚ð‘Ò‚Â
if(!movies[id].canWaitStop) return 0; // ƒ€[ƒr[‚ªÄ¶’†‚Å‚È‚¯‚ê‚΂»‚Ì‚Ü‚Ü–ß‚é
if( elm.for !== void )
{
if( elm.for == 'loop' )
{
conductor.wait(%[
'movieperiod'+id+'_'+perLoop => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else if( elm.for == 'period' )
{
conductor.wait(%[
'movieperiod'+id+'_'+perPeriod => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else if( elm.for == 'prepare' )
{
conductor.wait(%[
'movieperiod'+id+'_'+perPrepare => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else if( elm.for == 'segLoop' )
{
conductor.wait(%[
'movieperiod'+id+'_'+perSegLoop => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else
{
return 0; // ˆø”‚ª•Ï
}
}
else
{
conductor.wait(%[
'movieperiod'+id+'_'+perLoop => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_'+perPeriod => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_'+perPrepare => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_'+perSegLoop => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
notifyStable();
return -2;
}
//------------------------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ --
function getHandlers()
{
return %[ // Ž«‘”z—ñƒIƒuƒWƒFƒNƒg
/*
ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ‚ÍA–¼‘O‚Æ‚»‚ê‚ɑΉž‚·‚éŠÖ”‚̃yƒA‚ð—ñ‹“‚·‚é‚à‚Ì‚ÅA
ŠÖ”–¼ : function(elm)
{
// ŠÖ”‚Ì’†g
} incontextof this,
‚Ì‘Ž®‚ð—p‚¢‚éB‚½‚¾‚µAŠÖ”–¼‚ª—\–ñŒê‚ÌꇂÍAuŠÖ”–¼ : v‚Å‚Í‚È‚
u"ŠÖ”–¼" => v‚ð—p‚¢‚éB
incontextof this ‚ÍAŠÖ”‚ª³‚µ‚ ‚±‚̃Nƒ‰ƒX‚Ì
ƒIƒuƒWƒFƒNƒg‚̃Rƒ“ƒeƒLƒXƒgã‚Å“®‚‚悤‚É‚·‚邽‚ß‚É•K—vB
*/
//--------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ(ƒƒbƒZ[ƒW‘€ì) --
ch : function(elm)
{
// •¶Žš•\Ž¦
var acs = actualChSpeed;
if(updateBeforeCh)
{
if(acs) { updateBeforeCh--; return -5; } else { updateBeforeCh--; }
}
var text = elm.text;
if(currentWithBack) current.comp.processCh(text);
if(current.processCh(text))
{
return showPageBreakAndClear();
}
if(historyWriteEnabled) historyLayer.store(text);
if(autoWCEnabled)
{
// Ž©“®ƒEƒFƒCƒg
var ind;
if((ind = autoWCChars.indexOf(text)) != -1)
{
return int(acs * autoWCWaits[ind]);
}
}
return acs;
} incontextof this,
graph : function(elm)
{
// ƒOƒ‰ƒtƒBƒbƒN‚𕶎š‚Æ‚µ‚Ä•\Ž¦
var acs = actualChSpeed;
if(updateBeforeCh)
{
if(acs) { updateBeforeCh--; return -5; } else { updateBeforeCh--; }
}
if(currentWithBack) current.comp.processGraph(elm);
if(current.processGraph(elm))
{
return showPageBreakAndClear();
}
if(historyWriteEnabled && elm.alt !== void) historyLayer.store(elm.alt);
return acs;
} incontextof this,
hch : function(elm)
{
// c’†‰¡
var acs = actualChSpeed;
if(updateBeforeCh)
{
if(acs) { updateBeforeCh--; return -5; } else { updateBeforeCh--; }
}
var text = elm.text;
var expand = elm.expand !== void && +elm.expand;
if(currentWithBack) current.comp.putHorizonCh(text, expand);
if(current.putHorizonCh(text, expand))
{
return showPageBreakAndClear();
}
if(historyWriteEnabled) historyLayer.store(text);
return acs;
} incontextof this,
r : function(elm)
{
// ‰üs
if(historyWriteEnabled) historyLayer.reline();
if(currentWithBack) current.comp.processReturn();
if(current.processReturn())
{
var ret = showPageBreakAndClear();
// ‰üs‚Ípending‚µ‚È‚¢
if(ret == -5)
ret = -4;
else if(ret == -3)
ret = -2;
return ret;
}
return actualChSpeed;
} incontextof this,
ruby : function(elm)
{
// ŽŸ‚Ì•¶Žš‚ɑ΂·‚郋ƒrÝ’è
if(currentWithBack) current.comp.setRuby(elm.text);
current.setRuby(elm.text);
return 0;
} incontextof this,
font : function(elm)
{
// ƒtƒHƒ“ƒgÝ’è
if(currentWithBack) current.comp.setFont(elm);
current.setFont(elm);
return 0;
} incontextof this,
deffont : function(elm)
{
// ƒfƒtƒHƒ‹ƒg‚̃tƒHƒ“ƒgÝ’è
if(currentWithBack) current.comp.setDefaultFont(elm);
current.setDefaultFont(elm);
return 0;
} incontextof this,
resetfont : function(elm)
{
// ƒtƒHƒ“ƒg‚̃ŠƒZƒbƒg
if(currentWithBack) current.comp.resetFont();
current.resetFont();
return 0;
} incontextof this,
style : function(elm)
{
// ƒXƒ^ƒCƒ‹Ý’è
if(currentWithBack) current.comp.setStyle(elm);
current.setStyle(elm);
return 0;
} incontextof this,
defstyle : function(elm)
{
// ƒfƒtƒHƒ‹ƒg‚̃Xƒ^ƒCƒ‹Ý’è
if(currentWithBack) current.comp.setDefaultStyle(elm);
current.setDefaultStyle(elm);
return 0;
} incontextof this,
resetstyle : function(elm)
{
// ƒXƒ^ƒCƒ‹‚̃ŠƒZƒbƒg
if(currentWithBack) current.comp.resetStyle();
current.resetStyle();
return 0;
} incontextof this,
link : function(elm)
{
// ƒnƒCƒp[ƒŠƒ“ƒN‚ÌŠJŽn
if(currentWithBack) current.comp.beginHyperLink(elm);
current.beginHyperLink(elm);
return 0;
} incontextof this,
endlink : function(elm)
{
// ƒnƒCƒp[ƒŠƒ“ƒN‚ÌI—¹
if(currentWithBack) current.comp.endHyperLink(elm);
current.endHyperLink(elm);
return 0;
} incontextof this,
button : function(elm)
{
// ƒOƒ‰ƒtƒBƒJƒ‹ƒ{ƒ^ƒ“
if(currentWithBack) current.comp.addButton(elm);
current.addButton(elm);
return 0;
} incontextof this,
edit : function(elm)
{
// ’Pˆês•ÒW
if(currentWithBack) current.comp.addEdit(elm);
current.addEdit(elm);
return 0;
} incontextof this,
checkbox : function(elm)
{
// ’Pˆês•ÒW
if(currentWithBack) current.comp.addCheckBox(elm);
current.addCheckBox(elm);
return 0;
} incontextof this,
commit : function(elm)
{
// ƒtƒH[ƒ€—v‘f‚̃Rƒ~ƒbƒg
current.commit();
return 0;
} incontextof this,
l : function(elm)
{
// sƒNƒŠƒbƒN‘Ò‚¿
return showLineBreak(elm);
} incontextof this,
p : function(elm)
{
// ƒy[ƒWƒNƒŠƒbƒN‘Ò‚¿
if(historyWriteEnabled) historyLayer.reline();
return showPageBreak(elm);
} incontextof this,
current : function(elm)
{
// ‘€ì‘Îۂ̃ƒbƒZ[ƒWƒŒƒCƒ„‚ÌŽw’è
setCurrentMessageLayer(elm);
return 0;
} incontextof this,
position : function(elm)
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚̈ʒuA‘®«‚ðÝ’è
getMessageLayerObjectFromElm(elm).setPosition(elm);
return 0;
} incontextof this,
ct : function(elm)
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚̃ŠƒZƒbƒg(‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚̃NƒŠƒA‚Æ
// current ‚̃ŠƒZƒbƒg)
if(historyWriteEnabled) historyLayer.repage();
clearMessageLayers(true);
return 0;
} incontextof this,
cm : function(elm)
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚̃ŠƒZƒbƒg‚ðs‚¤‚ªAct ‚̂悤‚É
// current ‚̃ŠƒZƒbƒg‚Ís‚í‚È‚¢‚à‚Ì
if(historyWriteEnabled) historyLayer.repage();
clearMessageLayers(false);
return 0;
} incontextof this,
er : function(elm)
{
// Œ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚̃NƒŠƒA
if(historyWriteEnabled) historyLayer.repage();
if(currentWithBack) current.comp.clear();
current.clear();
return 0;
} incontextof this,
indent : function(elm)
{
// ƒCƒ“ƒfƒ“ƒg‚ÌÝ’è
if(currentWithBack) current.comp.setIndent();
current.setIndent();
if(historyWriteEnabled) historyLayer.beginIndent();
return 0;
} incontextof this,
endindent : function(elm)
{
// ƒCƒ“ƒfƒ“ƒg‚̉ðœ
if(currentWithBack) current.comp.resetIndent();
current.resetIndent();
if(historyWriteEnabled) historyLayer.endIndent();
return 0;
} incontextof this,
delay : function(elm)
{
// •¶Žš•\Ž¦‘¬“x‚ÌŽw’è
setDelay(elm);
return 0;
} incontextof this,
nowait : function(elm)
{
// ˆêŽž“I‚Ƀm[ƒEƒFƒCƒg‚ÅŽÀs
enterNoWait();
return 0;
} incontextof this,
endnowait : function(elm)
{
// nowait ‚̉ðœ
leaveNoWait();
return 0;
} incontextof this,
locate : function(elm)
{
// •¶Žš•\Ž¦ˆÊ’u‚ðŽw’è
if(currentWithBack) current.comp.locate(elm.x, elm.y);
current.locate(elm.x, elm.y);
return 0;
} incontextof this,
glyph : function(elm)
{
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚ðŽw’è
current.setGlyph(elm);
return 0;
} incontextof this,
locklink : function(elm)
{
// ƒŠƒ“ƒN‚̃ƒbƒN
lockMessageLayerSelProcess();
return 0;
} incontextof this,
unlocklink : function(elm)
{
// ƒŠƒ“ƒN‚̃Aƒ“ƒƒbƒN
unlockMessageLayerSelProcess();
return 0;
} incontextof this,
//----------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ(ƒVƒXƒeƒ€‘€ì) --
loadplugin : function(elm)
{
// ƒvƒ‰ƒOƒCƒ“‚Ì“Ç‚Ýž‚Ý
Plugins.link(elm.module);
dm("ƒvƒ‰ƒOƒCƒ“‚ð“Ç‚Ýž‚Ý‚Ü‚µ‚½ : " + elm.module);
return 0;
} incontextof this,
title : function(elm)
{
// ƒ^ƒCƒgƒ‹‚ÌÝ’è
setTitle(elm.name);
return 0;
} incontextof this,
s : function(elm)
{
// ŽÀs’âŽ~
stablePosibility = true;
cancelSkip();
if(!usingExtraConductor) incRecordLabel(true);
inSleep = true;
if(recordHistoryOfStore == 2) // 2 : ‘I‘ðŽˆ ( @s ƒ^ƒO ) ‚²‚Æ
setToRecordHistory();
notifyStable();
return -1;
} incontextof this,
clickskip : function(elm)
{
// ƒNƒŠƒbƒNƒXƒLƒbƒv‚ÌÝ’è
clickSkipEnabled = +elm.enabled;
return 0;
} incontextof this,
nextskip : function(elm)
{
// ŽŸ‚Ì‘I‘ðŽˆ(/–¢“Ç)‚Ü‚Åi‚Þ‚ÌÝ’è
nextSkipEnabled = +elm.enabled;
return 0;
} incontextof this,
cancelskip : function(elm)
{
// ƒXƒLƒbƒv‚̉ðœ
cancelSkip();
return 0;
} incontextof this,
cancelautomode : function(elm)
{
// uŽ©“®“I‚É“Ç‚Ýi‚Þv‚̉ðœ
cancelAutoMode();
return 0;
} incontextof this,
resetwait : function(elm)
{
// ŽžŠÔŒ´“_‚ÌÝ’è
resetWait();
return 0;
} incontextof this,
wait : function(elm)
{
// ƒEƒFƒCƒg
return doWait(elm);
} incontextof this,
wc : function(elm)
{
// Žw’蕶Žš•ª‚̃EƒFƒCƒg
return doWaitCh(elm);
} incontextof this,
waitclick : function(elm)
{
// ƒNƒŠƒbƒN‚ð‘Ò‚Â
return waitClick(elm);
} incontextof this,
rclick : function(elm)
{
// ‰EƒNƒŠƒbƒN‚Ì“®ìÝ’è
setRightClickOptions(elm);
return 0;
} incontextof this,
history : function(elm)
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ÌÝ’è
setHistoryOptions(elm);
return 0;
} incontextof this,
showhistory : function(elm)
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚Ì•\Ž¦
return showHistoryByScenario(elm);
} incontextof this,
hr : function(elm)
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ɉüs‚ðo—Í
if(historyWriteEnabled)
{
if(elm.repage !== void && +elm.repage)
historyLayer.repage();
else
historyLayer.reline();
}
return 0;
} incontextof this,
hact : function(elm)
{
// ƒƒbƒZ[ƒW—š—ð‚ɃAƒNƒVƒ‡ƒ“‚ðÝ’è
if(historyWriteEnabled)
historyLayer.setNewAction(elm.exp);
return 0;
} incontextof this,
endhact : function(elm)
{
// ƒƒbƒZ[ƒW—š—ð‚̃AƒNƒVƒ‡ƒ“‚ðƒNƒŠƒA
if(historyWriteEnabled)
historyLayer.clearAction();
return 0;
} incontextof this,
hidemessage : function(elm)
{
// ƒƒbƒZ[ƒW‚ðˆêŽž“I‚ɉB‚·
return hideMessageLayerByScenario(elm);
} incontextof this,
quake : function(elm)
{
// —h‚ê
doQuake(elm);
return 0;
} incontextof this,
stopquake : function(elm)
{
// —h‚ê‚Ì’âŽ~
stopQuake();
return 0;
} incontextof this,
wq : function(elm)
{
// —h‚ê‚Ì’âŽ~‚ð‘Ò‚Â
return waitQuake(elm);
} incontextof this,
autowc : function(elm)
{
// Ž©“®ƒEƒFƒCƒg
setAutoWait(elm);
return 0;
} incontextof this,
cursor : function(elm)
{
// ƒ}ƒEƒXƒJ[ƒ\ƒ‹‚Ì•ÏX
setCursor(elm);
return 0;
} incontextof this,
close : function(elm)
{
// ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚é
closeByScript(elm);
return -2;
} incontextof this,
copybookmark : function(elm)
{
// žx‚ðƒRƒs[
copyBookMark(+elm.from, +elm.to);
return 0;
} incontextof this,
erasebookmark : function(elm)
{
// žx‚ðíœ
eraseBookMark(+elm.place);
return 0;
} incontextof this,
disablestore : function(elm)
{
// žx‚ðˆêŽž“I‚ÉŽg—p•s‰Â‚É
tempDisableStore(elm);
return 0;
} incontextof this,
store : function(elm)
{
// žx‚ÌŽg—p•s‰ÂEŽg—p‰Â‚ðÝ’è‚·‚é
setStoreEnabled(+elm.enabled);
return 0;
} incontextof this,
load : function(elm)
{
// žx‚Ì“Ç‚Ýž‚Ý
if(elm.ask !== void && +elm.ask)
loadBookMarkWithAsk(+elm.place);
else
loadBookMark(+elm.place);
return -4;
} incontextof this,
save : function(elm)
{
// žx‚Ì“Ç‚Ýž‚Ý
if(elm.ask !== void && +elm.ask)
saveBookMarkWithAsk(+elm.place);
else
saveBookMark(+elm.place);
return -4;
} incontextof this,
startanchor : function(elm)
{
// uʼn‚É–ß‚év‚ÌŽg—p•s‰ÂEŽg—p‰Â‚ðÝ’è‚·‚é
setStartAnchorEnabled(elm.enabled === void || +elm.enabled);
return 0;
} incontextof this,
gotostart : function(elm)
{
// uʼn‚É–ß‚év
if(elm.ask !== void && +elm.ask)
goToStartWithAsk();
else
goToStart();
return -4;
} incontextof this,
goback : function(elm)
{
// ’ʉߋL˜^‚ð–ß‚é
if(elm.ask !== void && +elm.ask)
goBackHistory(true);
else
goBackHistory(false);
return -4;
} incontextof this,
record : function(elm)
{
// ’ʉߋL˜^‚ð‚·‚é
setToRecordHistory();
return 0;
} incontextof this,
tempsave : function(elm)
{
// ó‘Ԃ̃ƒ‚ƒŠ‚Ö‚Ì•Û‘¶
tempSave(+elm.place);
return 0;
} incontextof this,
tempload : function(elm)
{
// ó‘Ԃ̃ƒ‚ƒŠ‚Ö‚Ì•Û‘¶
tempLoad(+elm.place, elm);
//elm.se === void || +elm.se, elm.bgm === void || +elm.bgm,
//elm.backlay !== void && +elm.backlay);
return 0;
} incontextof this,
mappfont : function(elm)
{
// ƒŒƒ“ƒ_ƒŠƒ“ƒOς݃tƒHƒ“ƒg‚ðŒ»Ý‚̃tƒHƒ“ƒg‚Ƀ}ƒbƒsƒ“ƒO
mapPrerenderedFont(elm.storage);
return 0;
} incontextof this,
locksnapshot : function(elm)
{
// ‰æ–ʂ̃XƒiƒbƒvƒVƒ‡ƒbƒg‚ðƒƒbƒN‚·‚é
lockSnapshot();
return 0;
} incontextof this,
unlocksnapshot : function(elm)
{
// ‰æ–ʂ̃XƒiƒbƒvƒVƒ‡ƒbƒg‚̃ƒbƒN‚ð‰ðœ‚·‚é
unlockSnapshot();
return 0;
} incontextof this,
//------------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ(ƒŒƒCƒ„‘€ì) --
image : function(elm)
{
// ‰æ‘œ“Ç‚Ýž‚Ý
updateBeforeCh = 1;
var start = System.getTickCount();
getLayerFromElm(elm).loadImages(elm);
dm(elm.storage + " ‚Ì“Ç‚Ýž‚Ý‚É " + (System.getTickCount() - start) + "ms ‚©‚©‚è‚Ü‚µ‚½");
return 0;
} incontextof this,
img : function(elm)
{
// ‰æ‘œ“Ç‚Ýž‚Ý(image‚Æ‚¨‚È‚¶)
updateBeforeCh = 1;
var start = System.getTickCount();
getLayerFromElm(elm).loadImages(elm);
dm(elm.storage + " ‚Ì“Ç‚Ýž‚Ý‚É " + (System.getTickCount() - start) + "ms ‚©‚©‚è‚Ü‚µ‚½");
return 0;
} incontextof this,
pimage : function(elm)
{
// •”•ª’ljÁ‰æ‘œ“Ç‚Ýž‚Ý
getLayerFromElm(elm).loadPartialImage(elm);
return 0;
} incontextof this,
ptext : function(elm)
{
// ”wŒi/‘OŒiƒŒƒCƒ„‚Ö‚Ì•¶Žš•`‰æ
getLayerFromElm(elm).drawReconstructibleText(elm);
return 0;
} incontextof this,
freeimage : function(elm)
{
// ‰æ‘œ‚̃NƒŠƒA
updateBeforeCh = 1;
getLayerFromElm(elm).freeImage(elm);
return 0;
} incontextof this,
animstart : function(elm)
{
// ƒAƒjƒ[ƒVƒ‡ƒ“‚ÌŠJŽn
updateBeforeCh = 1;
getLayerFromElm(elm).startAnim(elm);
return 0;
} incontextof this,
animstop : function(elm)
{
// ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì’âŽ~
updateBeforeCh = 1;
getLayerFromElm(elm).stopAnim(+elm.seg);
return 0;
} incontextof this,
wa : function(elm)
{
// ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì’âŽ~‘Ò‚¿
return waitAnimation(elm);
} incontextof this,
mapimage : function(elm)
{
// ƒNƒŠƒbƒJƒuƒ‹ƒ}ƒbƒv‚̗̈æ‰æ‘œ‚ð“Ç‚Ýž‚Þ
getLayerFromElm(elm).loadProvinceImage(elm.storage);
return 0;
} incontextof this,
mapaction : function(elm)
{
// ƒNƒŠƒbƒJƒuƒ‹ƒ}ƒbƒv‚̗̈æƒAƒNƒVƒ‡ƒ“’è‹`‚ð“Ç‚Ýž‚Þ
getLayerFromElm(elm).loadProvinceActions(elm.storage);
return 0;
} incontextof this,
mapdisable : function(elm)
{
// ƒNƒŠƒbƒJƒuƒ‹ƒ}ƒbƒv‚𖳌ø‚É‚·‚é
getLayerFromElm(elm).clearProvinceActions();
return 0;
} incontextof this,
backlay : function(elm)
{
// ƒŒƒCƒ„‚ð— ‰æ–ʂɃRƒs[
updateBeforeCh = 1;
backupLayer(elm, true);
return 0;
} incontextof this,
forelay : function(elm)
{
// ƒŒƒCƒ„‚ð•\‰æ–ʂɃRƒs[
updateBeforeCh = 1;
backupLayer(elm, false);
return 0;
} incontextof this,
copylay : function(elm)
{
// “¯Ží‚̃ŒƒCƒ„“¯Žm‚̃Rƒs[
updateBeforeCh = 1;
copyLayer(elm);
return 0;
} incontextof this,
layopt : function(elm)
{
// ƒŒƒCƒ„‚̃IƒvƒVƒ‡ƒ“‚ðÝ’è
updateBeforeCh = 1;
getLayerFromElm(elm).setOptions(elm);
return 0;
} incontextof this,
trans : function(elm)
{
// ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ÌŠJŽn
getLayerPageFromElm(elm, false).beginTransition(elm);
return 0;
} incontextof this,
wt : function(elm)
{
// ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð‘Ò‚Â
return waitTransition(elm);
} incontextof this,
stoptrans : function(elm)
{
// ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð’âŽ~‚·‚é
stopAllTransitions();
return 0;
} incontextof this,
move : function(elm)
{
// Ž©“®ˆÚ“®‚ÌŠJŽn
getLayerFromElm(elm).beginMove(elm);
return 0;
} incontextof this,
wm : function(elm)
{
// Ž©“®ˆÚ“®‚ð‘Ò‚Â
return waitMove(elm);
} incontextof this,
stopmove : function(elm)
{
// Ž©“®ˆÚ“®‚ð’âŽ~‚·‚é
stopAllMoves();
return 0;
} incontextof this,
laycount : function(elm)
{
updateBeforeCh = 1;
allocateCharacterLayers(+elm.layers) if elm.layers !== void;
allocateMessageLayers(+elm.messages) if elm.messages !== void;
return 0;
} incontextof this,
//------------------------------ ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ(Œø‰Ê‰¹EBGMEƒrƒfƒI‘€ì) --
playbgm : function(elm)
{
// BGM ‚̉‰‘t
bgm.play(elm);
return 0;
} incontextof this,
stopbgm : function(elm)
{
// BGM ‚Ì’âŽ~
bgm.stop();
return 0;
} incontextof this,
pausebgm : function(elm)
{
// BGM ‚̈ꎞ’âŽ~
bgm.pause();
return 0;
} incontextof this,
resumebgm : function(elm)
{
// BGM ‚ÌÄŠJ
bgm.resume();
return 0;
} incontextof this,
fadeinbgm : function(elm)
{
// BGM ‚̃tƒF[ƒhƒCƒ“
bgm.fadeIn(elm);
return 0;
} incontextof this,
fadeoutbgm : function(elm)
{
// BGM ‚̃tƒF[ƒhƒAƒEƒg
bgm.fadeOut(elm);
return 0;
} incontextof this,
fadebgm : function(elm)
{
// BGM ‚ÌŽw’艹—ʂ܂ł̃tƒF[ƒh
bgm.fade(elm);
return 0;
} incontextof this,
xchgbgm : function(elm)
{
// BGM ‚Ì“ü‚ê‘Ö‚¦/ƒNƒƒXƒtƒF[ƒh
bgm.exchange(elm);
return 0;
} incontextof this,
bgmopt : function(elm)
{
// BGM ‚̃IƒvƒVƒ‡ƒ“Ý’è
bgm.setOptions(elm);
return 0;
} incontextof this,
wb : function(elm)
{
// BGM ‚̃tƒF[ƒhI—¹‘Ò‚¿
return waitBGMFade(elm);
} incontextof this,
wl : function(elm)
{
// BGM ‚ÌĶI—¹‘Ò‚¿
return waitBGMStop(elm);
} incontextof this,
playse : function(elm)
{
// Œø‰Ê‰¹‚ÌĶ
se[+elm.buf].play(elm);
return 0;
} incontextof this,
stopse : function(elm)
{
// Œø‰Ê‰¹‚Ì’âŽ~
se[+elm.buf].stop();
return 0;
} incontextof this,
fadeinse : function(elm)
{
// Œø‰Ê‰¹‚̃tƒF[ƒhƒCƒ“Ķ
se[+elm.buf].fadeIn(elm);
return 0;
} incontextof this,
fadeoutse : function(elm)
{
// Œø‰Ê‰¹‚̃tƒF[ƒhƒAƒEƒg
se[+elm.buf].fadeOut(elm);
return 0;
} incontextof this,
fadese : function(elm)
{
// Œø‰Ê‰¹‚̃tƒF[ƒh
se[+elm.buf].fade(elm);
return 0;
} incontextof this,
seopt : function(elm)
{
// Œø‰Ê‰¹‚̃tƒF[ƒh
se[+elm.buf].setOptions(elm);
return 0;
} incontextof this,
wf : function(elm)
{
// Œø‰Ê‰¹‚̃tƒF[ƒhI—¹‘Ò‚¿
return waitSEFade(elm);
} incontextof this,
ws : function(elm)
{
// Œø‰Ê‰¹‚ÌĶI—¹‘Ò‚¿
return waitSEStop(elm);
} incontextof this,
video : function(elm)
{
// ƒ€[ƒr[‚̃IƒvƒVƒ‡ƒ“‚ðÝ’è‚·‚é
movies[+elm.slot].setOptions(elm);
return 0;
} incontextof this,
playvideo : function(elm)
{
// ƒ€[ƒr[‚ðĶ‚·‚é
movies[+elm.slot].play(elm.storage);
return 0;
} incontextof this,
stopvideo : function(elm)
{
// ƒ€[ƒr[‚ð’âŽ~‚·‚é
movies[+elm.slot].stop();
return 0;
} incontextof this,
openvideo : function(elm)
{
// ƒ€[ƒr[Ķ‚Ì€”õ‚ð‚·‚é
movies[+elm.slot].open(elm.storage);
return 0;
} incontextof this,
wv : function(elm)
{
// ƒ€[ƒr[‚ÌĶI—¹‚ð‘Ò‚Â
return waitMovieStop(elm);
} incontextof this,
// Start: Add: T.Imoto
wp : function(elm)
{
// ƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒg‚ð‘Ò‚Â
return waitMoviePeriod(elm);
} incontextof this,
pausevideo : function(elm)
{
movies[+elm.slot].pause();
return 0;
} incontextof this,
resumevideo : function(elm)
{
movies[+elm.slot].resume();
return 0;
} incontextof this,
preparevideo : function(elm)
{
movies[+elm.slot].prepare();
return 0;
} incontextof this,
rewindvideo : function(elm)
{
movies[+elm.slot].rewind();
return 0;
} incontextof this,
videolayer : function(elm)
{
movies[+elm.slot].storeLayer( elm.layer, elm.page, elm.channel );
movies[+elm.slot].setVideoLayer(getLayerFromElm(elm),elm);
return 0;
} incontextof this,
clearvideolayer : function(elm)
{
movies[+elm.slot].cancelLayer( elm.channel );
movies[+elm.slot].setVideoLayer(null,elm);
return 0;
} incontextof this,
videosegloop : function(elm)
{
movies[+elm.slot].setSegment(elm);
return 0;
} incontextof this,
cancelvideosegloop : function(elm)
{
movies[+elm.slot].cancelSegmentLoop();
return 0;
} incontextof this,
videoevent : function(elm)
{
movies[+elm.slot].setPeriod(elm);
return 0;
} incontextof this,
cancelvideoevent : function(elm)
{
movies[+elm.slot].cancelPeriodEvent();
return 0;
} incontextof this,
// End: Add: T.Imoto
//--------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ(•Ï”ETJS ‘€ì) --
eval : function(elm)
{
// Ž®‚Ì•]‰¿
Scripts.eval(elm.exp);
return 0;
} incontextof this,
trace : function(elm)
{
// Ž®‚̃gƒŒ[ƒX•\Ž¦
var exp = elm.exp;
var result = Scripts.eval(exp);
dm("¥[trace] expression=\"" + exp + "\" type of result=" + typeof result +
" result=" + result);
return 0;
} incontextof this,
input : function(elm)
{
// •¶Žš—ñ‚Ì“ü—Í
inputString(elm);
return 0;
} incontextof this,
clearsysvar : function(elm)
{
// ƒVƒXƒeƒ€•Ï”‚̃NƒŠƒA
clearSystemVariables();
return 0;
} incontextof this,
clearvar : function(elm)
{
// ƒQ[ƒ€•Ï”‚̃NƒŠƒA
clearVariables();
return 0;
} incontextof this,
waittrig : function(elm)
{
// ƒgƒŠƒK‚ð‘Ò‚Â
return waitTrigger(elm);
} incontextof this,
//----------------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ‚ÌI‚í‚è --
interrupt : function(elm) { return -2; } incontextof this ];
}
}
// TJS ƒXƒNƒŠƒvƒg‚Í‚±‚±‚ÅI‚í‚è
"
END_OF_TJS_SCRIPT
# "; /*
# assign ‚ŃRƒs[‚·‚ׂ«•Ï”‚ÌĶ¬‚ðs‚¤ perl ƒXƒNƒŠƒvƒg
open FH, "MainWindow.tjs" or die;
undef($/);
$content = <FH>;
$list_store = '';
$list_restore = '';
while($content =~ /\/\*C\*\/var\s+(\w+)/gs)
{
$list_store .= "\t\tf.$1 = $1;\n";
$list_restore .= "\t\t$1 = f.$1 if f.$1 !== void;\n";
}
$content =~
s/\t\t\/\/ \[start_store_vars\]\n.*?\t\t\/\/ \[end_store_vars\]/\t\t\/\/ \[start_store_vars\]\n$list_store\t\t\/\/ \[end_store_vars\]/s;
$content =~
s/\t\t\/\/ \[start_restore_vars\]\n.*?\t\t\/\/ \[end_restore_vars\]/\t\t\/\/ \[start_restore_vars\]\n$list_restore\t\t\/\/ \[end_restore_vars\]/s;
open FH, ">MainWindow.tjs" or die;
print FH $content;
# */
//;# Copyright (C)2001-2005, W.Dee and contributors ‰ü•ÏE”z•z‚ÍŽ©—R‚Å‚·
//;<<'END_OF_TJS_SCRIPT';
// ‚±‚̃XƒNƒŠƒvƒg‚Í—LŒø‚È perl5 ƒXƒNƒŠƒvƒg‚Å‚à‚ ‚é
class KAGWindow extends Window
{
// KAG ‚̃EƒBƒ“ƒhƒE ƒNƒ‰ƒX
// KAG ‚Ì“®ì‚̃ƒCƒ“‚È•”•ª‚Í‚±‚±‚É‹Lq‚µ‚Ä‚ ‚é
// ˆÈ‰º‚Ì‚¤‚¿A/*C*/ ‚̂‚•Ï”‚ÍA––’[‚Ì perl ƒXƒNƒŠƒvƒg‚É‚æ‚Á‚Ä
// Ž©“®“I‚Éžx‚ɃRƒs[‚³‚ê‚éƒR[ƒh‚ª¶¬‚³‚ê‚é•Ï”
var scWidth = 640; // ‰æ–ʉ¡•
var scHeight = 480; // ‰æ–Êc•
var aboutWidth = 320; // u‚±‚̃\ƒtƒg‚ɂ‚¢‚ÄvƒEƒBƒ“ƒhƒE‚̉¡•
var aboutHeight = 200; // “¯c•
var isFirstProcess = true; // ˆê”Ôʼn‚Ì process ‚̌ĂÑo‚µ‚©‚Ç‚¤‚©
var freeSaveDataMode = false; // žx‚ðƒƒjƒ…[ƒo[‚È‚Ç‚ÅŠÇ—‚¹‚¸‚ÉAŒÂ•Ê‚̃tƒ@ƒCƒ‹‚Æ‚µ‚ÄŠÇ—‚·‚é
var saveThumbnail = false; // ƒTƒ€ƒlƒCƒ‹‚ð•Û‘¶‚·‚é‚©‚Ç‚¤‚©
var thumbnailWidth = 133; // ƒTƒ€ƒlƒCƒ‹‚̉¡•
var thumbnailDepth = 8; // ƒTƒ€ƒlƒCƒ‹‚ÌBMPƒ‚[ƒhB8‚©24
// ƒTƒ€ƒlƒCƒ‹‚Ì ƒtƒ‹ƒJƒ‰[‰»‚¨‚æ‚уTƒCƒYƒtƒŠ[‰»‚̃pƒbƒ`‚Í
// ‚ä‚ñŽ‚©‚ç‚¢‚½‚¾‚«‚Ü‚µ‚½B
// ‚±‚Ìê‚ðŽØ‚è‚Ä‚¨—ç\‚µã‚°‚Ü‚·B
var snapshotLayer = void; // ‰æ‘œ‚̃XƒiƒbƒvƒVƒ‡ƒbƒg‚ðˆêŽž“I‚É•Û‘¶‚·‚郌ƒCƒ„
var snapshotLockCount = 0; // ƒƒbƒNƒJƒEƒ“ƒg
var lastSaveDataNameGlobal = ""; // ÅŒã‚É•Û‘¶‚µ‚½ƒtƒŠ[ƒZ[ƒuƒ‚[ƒh‚ł̃tƒ@ƒCƒ‹–¼
/*C*/var lastSaveDataName = ""; // ÅŒã‚É•Û‘¶‚µ‚½ƒtƒŠ[ƒZ[ƒuƒ‚[ƒh‚ł̃tƒ@ƒCƒ‹–¼
var saveDataLocation = "savedata"; // ƒZ[ƒuƒf[ƒ^•Û‘¶êŠ
var saveDataID = "00000000-0000-0000-0000-000000000000"; // ƒZ[ƒuƒf[ƒ^‚Ì ID
var readOnlyMode = false; // “Ç‚Ýž‚Ýê—pƒ‚[ƒh(ƒf[ƒ^‚ðƒfƒBƒXƒN‚É‘‚©‚È‚¢)
var dataName = "data"; // ƒZ[ƒuƒf[ƒ^–¼
var saveDataMode = ""; // ƒf[ƒ^•Û‘¶ƒ‚[ƒh( "c" ‚ňƉ» )
var recordHistoryOfStore = 0; // ’ʉߗš—ð‚ð‹L˜^‚·‚é‚©‚Ç‚¤‚©
// 0 = Ž©“®“I‚É‚Í‹L˜^‚µ‚È‚¢ 1 = •Û‘¶‰Â”\‚ȃ‰ƒxƒ‹‚²‚Æ
// 2 = ‘I‘ðŽˆ ( @s ƒ^ƒO ) ‚²‚Æ
var maxHistoryOfStore = 5; // ’ʉߋL˜^‚ÌÅ‘å”
var historyOfStore = []; // ’ʉߗš—ðƒf[ƒ^
var nextRecordHistory = false;
// ŽŸ‚Ì•Û‘¶‰Â”\‚ȃ‰ƒxƒ‹’ʉߎž‚ÉŒ»Ý‚Ìî•ñ‚ð•Û‘¶‚·‚é‚©‚Ç‚¤‚©
var stablePosibility = false;
// žx‚ð•Û‘¶‰Â”\‚ȃ‰ƒxƒ‹ŠÔ‚Å stable ‚É‚È‚é‰Â”\«‚ª‚ ‚é‚©‚Ç‚¤‚©
var fullScreened = false; // Œ»Ýƒtƒ‹ƒXƒNƒŠ[ƒ“‚©‚Ç‚¤‚©
var isMain = true; // ‚±‚ꂪƒƒCƒ“ƒEƒBƒ“ƒhƒE‚©‚Ç‚¤‚©
var askOnClose = true; // I—¹Žž‚ÉI—¹‚·‚é‚©‚ðƒ†[ƒU‚É•·‚‚©‚Ç‚¤‚©
var helpFile = ""; // uƒwƒ‹ƒv > –ÚŽŸv‚ÅŠJ‚ƒtƒ@ƒCƒ‹
var quakeTimer; // quake —p‚̃^ƒCƒ}
var defaultQuakeTimeInChUnit = false;
/*C*/var quaking = false; // —h‚ê‚Ä‚¢‚é‚©
/*C*/var quakeEndTick = 0; // —h‚ê‚ðI—¹‚³‚¹‚é tick
/*C*/var quakeHorzMax = 0; // ‰¡U•
/*C*/var quakeVertMax = 0; // cU•
/*C*/var quakePhase = 0;
var chDefaultAntialiased; // •¶Žš‚ɃAƒ“ƒ`ƒGƒCƒŠƒAƒX‚ð‚©‚¯‚é‚©‚Ç‚¤‚©
var chDefaultFace; // •¶Žš‚̃fƒtƒHƒ‹ƒg‚̃tƒHƒ“ƒg
var initialMessageLayerVisible = true;
var historyLayer; // ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„
/*C*/var historyWriteEnabled = true; // ƒƒbƒZ[ƒWƒŒƒCƒ„‚É•¶Žš‚ðo—Í‚·‚é‚©
/*C*/var historyEnabled = true; // ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ð•\Ž¦‰Â”\‚©
var historyShowing = false; // ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ð•\Ž¦’†‚©
var lastHistoryHiddenTick = 0; // ÅŒã‚É—š—ðƒŒƒCƒ„‚ª”ñ•\Ž¦‚É‚È‚Á‚½‚Æ‚«‚Ì tick
/*C*/var numCharacterLayers = 0; // ‘OŒiƒŒƒCƒ„‚Ì”
/*C*/var numMessageLayers = 1; // ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ì”
var fore = %[]; // •\ƒŒƒCƒ„
var back = %[]; // — ƒŒƒCƒ„
var scPositionX = %[]; // —§‚¿ŠG‚Ì’†SÀ•W(X)
var tempLayer = void; // ˆêŽž“I‚ȃŒƒCƒ„
var lineBreak; // s‘Ò‚¿—pƒAƒjƒ[ƒVƒ‡ƒ“ƒŒƒCƒ„
var pageBreak; // ƒy[ƒW‘Ò‚¿—pƒOƒŠƒt‚̃Aƒjƒ[ƒVƒ‡ƒ“ƒŒƒCƒ„
var clickWaiting = false; // ƒNƒŠƒbƒN‘Ò‚¿‚©‚Ç‚¤‚©
var mainConductor; // ƒƒCƒ“‚̃Rƒ“ƒ_ƒNƒ^
var extraConductor; // —\”õ‚̃Rƒ“ƒ_ƒNƒ^
var conductor; // Œ»Ý‚̃Rƒ“ƒ_ƒNƒ^
var usingExtraConductor = false; // —\”õ‚̃Rƒ“ƒ_ƒNƒ^‚ðŽg—p’†‚©‚Ç‚¤‚©
var onExtraConductorReturn; // extraConductor ‚©‚ç’Êí‚̃Rƒ“ƒ_ƒNƒ^‚É–ß‚é‚Æ‚«‚É‚æ‚ÔŠÖ”
var tagHandlers; // ƒ^ƒO‚̃nƒ“ƒhƒ‰ŒQŽ«‘”z—ñ
var saveMacros = true; // ƒ}ƒNƒ‚ðžx‚É•Û‘¶‚·‚é‚©‚Ç‚¤‚©
var current; // Œ»Ý‘€ì’†‚̃ƒbƒZ[ƒWƒŒƒCƒ„
/*C*/var currentNum; // Œ»Ý‘€ì’†‚̃ƒbƒZ[ƒWƒŒƒCƒ„”Ô†
/*C*/var currentPage; // Œ»Ý‘€ì’†‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚̃y[ƒW(•\0/— 1)
/*C*/var currentWithBack = false; // — ‰æ–Ê‚É‚à•¶Žš‚ð•`‰æ‚·‚é‚©‚Ç‚¤‚©
var bgm; // BGM ƒIƒuƒWƒFƒNƒg
var numSEBuffers = 1; // Œø‰Ê‰¹ƒoƒbƒtƒ@‚Ì”
var se = []; // Œø‰Ê‰¹ƒoƒbƒtƒ@ƒIƒuƒWƒFƒNƒg
var numMovies = 1; // ƒ€[ƒr[ƒIƒuƒWƒFƒNƒg”
// var movie; // ƒ€[ƒr[ƒIƒuƒWƒFƒNƒg
var movies = []; // ƒ€[ƒr[ƒIƒuƒWƒFƒNƒg
var transCount; // Œ»Ýis’†‚̃gƒ‰ƒ“ƒWƒVƒ‡ƒ“‚Ì”
var moveCount; // Œ»Ýis’†‚ÌŽ©“®ˆÚ“®‚Ì”
var chSpeeds = %[
fast: 10, // u‚‘¬v•¶Žš•\Ž¦ƒXƒs[ƒh
normal: 30, // u•’Êv•¶Žš•\Ž¦ƒXƒs[ƒh
slow: 50, // u’x‚¢v•¶Žš•\Ž¦ƒXƒs[ƒh
];
var userChSpeed = 30; // ƒ†[ƒU‚Ì‘I‚ñ‚¾•¶Žš•\Ž¦ƒXƒs[ƒh
var userCh2ndSpeed = -1; // ƒ†[ƒU‚Ì‘I‚ñ‚¾ Šù“Ç•”•ª‚Ì•¶Žš•\Ž¦ƒXƒs[ƒh
var chNonStopToPageBreak = false; // ƒy[ƒW––‚܂ňê‹C‚É“Ç‚Ýi‚Þ‚© ( l ƒ^ƒO‚𖳎‹‚·‚é‚© )
var ch2ndNonStopToPageBreak = false; // Šù“Ç‚Ì•”•ª‚Ńy[ƒW––‚܂ňê‹C‚É“Ç‚Ýi‚Þ‚©
/*C*/var chUserMode = true; // •¶Žš•\Ž¦‘¬“x‚ÍŒ»Ýƒ†[ƒU‚Ì‘I‚ñ‚¾‚à‚Ì‚©
/*C*/var chSpeed = 30; // Œ»Ý‚Ì•¶Žš•\Ž¦ƒXƒs[ƒh
/*C*/var actualChSpeed = chSpeed; // ŽÀÛ‚Ì•¶Žš•\Ž¦ƒXƒs[ƒh
/*C*/var beforeNoWaitActualChSpeed; // nowait ‚É“ü‚é‘O‚Ì actualChSpeed
/*C*/var beforeNoWaitChUserMode; // nowait ‚É“ü‚é‘O‚Ì chUserMode
/*C*/var clickSkipEnabled = true; // ƒNƒŠƒbƒNƒXƒLƒbƒv‚ª—LŒø‚©
/*C*/var nextSkipEnabled = true; // ŽŸ‚Ì‘I‘ðŽˆ(/–¢“Ç)‚Ü‚Åi‚Þ‚ª—LŒø‚©
var skipMode = 0; // ƒXƒLƒbƒv‚̃‚[ƒh
// 0=ƒXƒLƒbƒv‚È‚µ, 1=ƒNƒŠƒbƒN‘Ò‚¿‹L†‚Ü‚Å, 2=‰üƒy[ƒW‘Ò‚¿‹L†‚Ü‚Å, 3=ŽŸ‚Ì’âŽ~‚Ü‚Å
// 4=‘‘—‚è
var autoMode = false; // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚©‚Ç‚¤‚©
var autoModePageWait = 350; // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒhŽž‚̉üƒy[ƒWŽž‚̃EƒFƒCƒg
var autoModeLineWait = 50; // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒhŽž‚ÌsƒNƒŠƒbƒN‘Ò‚¿Žž‚̃EƒFƒCƒg
// ã‚Ì“ñ‚‚ÍAƒm[ƒEƒFƒCƒg‚É‚µ‚½‚¢ê‡‚Í 0 ‚Å‚Í‚È‚‚Ä -4 ‚ðŽw’è‚·‚邱‚Æ
var skipKeyRepressed = false; // return ‚ ‚é‚¢‚Í space ƒL[ ( f ƒL[‚È‚Ç‚Å‚Í‚È‚¢ )
// ‚ª‰Ÿ‚³‚ê‚é‚Æ true ‚É‚È‚é ( ƒXƒLƒbƒv‰ðœŽž‚É false
var autoModePageWaits = %[
fast: 400, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̉üƒy[ƒWŽž ƒEƒFƒCƒgu’Z‚¢v
faster: 700, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̉üƒy[ƒWŽž ƒEƒFƒCƒgu‚â‚â’Z‚¢v
medium: 1000, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̉üƒy[ƒWŽž ƒEƒFƒCƒgu•’Êv
slower: 1300, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̉üƒy[ƒWŽž ƒEƒFƒCƒgu‚â‚â’x‚¢v
slow: 2000, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̉üƒy[ƒWŽž ƒEƒFƒCƒgu’x‚¢v
];
var autoModeLineWaits = %[
fast: 180, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚Ìs–– ƒEƒFƒCƒgu’Z‚¢v
faster: 240, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚Ìs–– ƒEƒFƒCƒgu‚â‚â’Z‚¢v
medium: 300, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚Ìs–– ƒEƒFƒCƒgu•’Êv
slower: 360, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚Ìs–– ƒEƒFƒCƒgu‚â‚â’x‚¢v
slow: 500, // Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚Ìs–– ƒEƒFƒCƒgu’x‚¢v
];
/*C*/var canCancelSkipByClick = true; // ƒNƒŠƒbƒN‚É‚æ‚èƒXƒLƒbƒvó‘Ԃ̃Lƒƒƒ“ƒZƒ‹‚ª‚Å‚«‚é‚©
/*C*/var autoWCEnabled = false; // Ž©“®ƒEƒFƒCƒg‚ª—LŒø‚©‚Ç‚¤‚©
/*C*/var autoWCChars = ""; // Ž©“®ƒEƒFƒCƒg‚ð‚©‚¯‚镶Žš
var autoWCWaits = []; // Ž©“®ƒEƒFƒCƒg‚̃EƒFƒCƒg
var timeOrigin; // resetWait ‚Åݒ肳‚ꂽŽžŠÔŒ´“_
var lastWaitTime; // wait mode=until ‚ÅŽÀÛ‚É‘Ò‚Á‚½ŽžŠÔ
var stableHandlers = []; // ƒVƒXƒeƒ€‚ªˆÀ’è(ƒNƒŠƒbƒN‘Ò‚¿/’âŽ~)‚µ‚½‚Æ‚«‚ɌĂ΂ê‚é
var runHandlers = []; // ƒVƒXƒeƒ€‚ª‘–‚èŽn‚ß‚½‚Æ‚«‚ɌĂ΂ê‚é
var inStable = true; // ˆÀ’肵‚Ä‚¢‚é‚Æ‚«(‘–s’†‚Å‚È‚¢‚Æ‚«) true
var inSleep = false; // s ƒ^ƒO‚Å’âŽ~‚µ‚Ä‚¢‚é‚Æ‚« true
var updateBeforeCh = 0; // •¶Žš‚ð•`‰æ‚·‚é‘O‚É‚¢‚Á‚½‚ñ‰æ–Ê•`‰æ‚É“ü‚é‚©‚Ç‚¤‚©‚̃JƒEƒ“ƒg
var messageLayerHiding = false; // ƒ†[ƒU‚É‚æ‚胃bƒZ[ƒWƒŒƒCƒ„‚ª‰B‚³‚ê‚Ä‚¢‚é‚©
/*C*/var rightClickEnabled = true; // ‰EƒNƒŠƒbƒN‚ª—LŒø‚©
/*C*/var rightClickCall = false; // ‰EƒNƒŠƒbƒN‚Å“Á’è‚̃‹[ƒ`ƒ“‚ðŒÄ‚Ô‚©
/*C*/var rightClickJump = false; // ‰EƒNƒŠƒbƒN‚©‚Å“Á’è‚̃‰ƒxƒ‹‚ɃWƒƒƒ“ƒv‚·‚é‚©
/*C*/var rightClickTarget = ""; // ‰EƒNƒŠƒbƒN‚ł̌ĂÑo‚µæ
/*C*/var rightClickStorage = ""; // ‰EƒNƒŠƒbƒN‚ł̌ĂÑo‚µæ
/*C*/var rightClickName = "default"; // ‰EƒNƒŠƒbƒN‚̃ƒjƒ…[•\Ž¦–¼
/*C*/var rightClickCurrentMenuName = ""; // ‰EƒNƒŠƒbƒN‚̃ƒjƒ…[‚ÉŒ»Ýݒ肳‚ê‚Ä‚¢‚é–¼‘O
var rightClickDefaultName = ""; // ‰EƒNƒŠƒbƒN‚̃fƒtƒHƒ‹ƒg‚̃ƒjƒ…[•\Ž¦–¼
/*C*/var lastClickGlyphVisible; // extraConductor ‚ðŽg—p‚·‚é’¼‘O‚ɃNƒŠƒbƒN‘Ò‚¿‹L†‚ª‰ÂŽ‹‚¾‚Á‚½‚©‚Ç‚¤‚©
var lastClickGlyphMessagePage;
// extraConductor ‚ðŽg—p‚·‚é’¼‘O‚̃NƒŠƒbƒN‘Ò‚¿‹L†‚Ì•\Ž¦‚³‚ê‚Ä‚¢‚郃bƒZ[ƒWƒŒƒCƒ„‚̃y[ƒW
var lastClickGlyphMessageNum; // V ”Ô†
var lastClickGlyphWhich; // V "page" ‚© "line" ‚©
var inSleepBeforeExtraConductor; // extraConductor ‚ðŽg—p‚·‚é’¼‘O‚ª inSleep ‚¾‚Á‚½‚©
// ’Êí‚̃}ƒEƒXƒJ[ƒ\ƒ‹
/*C*/var cursorDefault = crArrow; // ’Êí‚̃}ƒEƒXƒJ[ƒ\ƒ‹
/*C*/var cursorPointed = crHandPoint; // ƒ{ƒ^ƒ“AƒŠƒ“ƒN“™‚ðƒ|ƒCƒ“ƒg‚µ‚½Žž‚̃}ƒEƒXƒJ[ƒ\ƒ‹
/*C*/var cursorWaitingClick = crArrow; // ƒNƒŠƒbƒN‘Ò‚¿‚̃}ƒEƒXƒJ[ƒ\ƒ‹
/*C*/var cursorDraggable = crSizeAll; // ƒhƒ‰ƒbƒO‰Â”\‚Èꊗp‚̃}ƒEƒXƒJ[ƒ\ƒ‹
/*C*/var startAnchorEnabled = false; // uʼn‚É–ß‚év‚ªŽg—p‰Â”\‚©‚Ç‚¤‚©
/*C*/var storeEnabled = true; // ƒ†[ƒU‚ªužx‚ð‚Í‚³‚Þvƒƒjƒ…[‚ɃAƒNƒZƒX‰Â”\‚©‚Ç‚¤‚©
/*C*/var restoreEnabled = true; // ƒ†[ƒU‚ªužx‚ð‚½‚Ç‚évƒƒjƒ…[‚ɃAƒNƒZƒX‰Â”\‚©‚Ç‚¤‚©
var storeLabelPassed = false; // •Û‘¶‰Â”\‚ȃ‰ƒxƒ‹‚ð’ʉ߂µ‚½‚©‚Ç‚¤‚©
/*C*/var currentLabel = ""; // Œ»Ý‚̃‰ƒxƒ‹
/*C*/var currentPageName = ""; // Œ»Ý‚̃y[ƒW–¼
var currentRecordName = ""; // Œ»Ý‚Ì‹L˜^–¼ ( trail_ƒXƒgƒŒ[ƒW_ƒ‰ƒxƒ‹ )
var autoRecordPageShowing = false; // ƒ‰ƒxƒ‹’ʉߋL˜^‚ð‚·‚é‚©
var numBookMarks = 10; // ƒƒjƒ…[‚É—pˆÓ‚·‚éžx‚̃Tƒuƒƒjƒ…[€–Ú‚Ì”
var showBookMarkDate = false; // ƒƒjƒ…[‚Éžx‚ð‚Í‚³‚ñ‚¾“ú•tŽž‚ð•\Ž¦‚·‚é‚©
var bookMarkNames = []; // ƒƒjƒ…[‚Éݒ肳‚ê‚Ä‚¢‚éžx‚Ì–¼‘O
var bookMarkDates = []; // žx‚Ì“ú•t
var bookMarkProtectedStates = []; // žx‚ª•ÛŒì‚³‚ê‚Ä‚¢‚é‚©‚Ìî•ñ
var showFixedPitchOnlyInFontSelector = false; // ƒtƒHƒ“ƒg‘I‘ð‚ŌŒèƒsƒbƒgƒtƒHƒ“ƒg‚Ì‚Ý‚ð•\Ž¦‚·‚é‚©
var flags = %[]; // ƒtƒ‰ƒO(ƒ†[ƒU)
var pflags = %[]; // u•Û‘¶‰Â”\‚ȃ‰ƒxƒ‹v‚ð’ʉ߂µ‚½Žž“_‚ł̃tƒ‰ƒO(ƒ†[ƒU)
var pcflags = %[]; // V (ƒRƒA)
var sflags = %[]; // ƒVƒXƒeƒ€•Ï”—̈æ(ƒ†[ƒU)
var scflags = %[]; // ƒVƒXƒeƒ€•Ï”—̈æ(ƒRƒA)
var tflags = %[]; // ˆêŽžƒtƒ‰ƒO
var tempBookMarks = []; // ˆêŽž“I‚É•Û‘¶‚µ‚½žx
var clickCount = 0; // ¶ƒNƒŠƒbƒNƒJƒEƒ“ƒg
var lastMouseDownX; // ÅŒã‚ɃNƒŠƒbƒN‚³‚ꂽ X À•W
var lastMouseDownY; // ÅŒã‚ɃNƒŠƒbƒN‚³‚ꂽ Y À•W
var mouseKeyEnabledCount = 0; // ƒ}ƒEƒXƒL[‚ª—LŒø‚©‚Ç‚¤‚©
var kagPlugins = []; // KAG ƒvƒ‰ƒOƒCƒ“
var keyDownHook = []; // ƒL[‚ª‰Ÿ‚³‚ꂽ‚Æ‚«‚ɌĂÑo‚³‚ê‚镨
var leftClickHook = []; // ‰EƒNƒŠƒbƒN‚³‚ꂽ‚Æ‚«‚ɌĂÑo‚³‚ê‚镨
var rightClickHook = []; // ¶ƒNƒŠƒbƒN‚³‚ꂽ‚Æ‚«‚ɌĂÑo‚³‚ê‚镨
var padKeyMap; // ƒpƒbƒhƒ{ƒ^ƒ“ -> ƒnƒ“ƒhƒ‰(ƒL[ƒR[ƒh)BƒRƒ“ƒXƒgƒ‰ƒNƒ^“à‚ÅÝ’è
var padKeyMapReverse; // ƒL[ƒR[ƒh -> ƒpƒbƒhƒ{ƒ^ƒ“BƒRƒ“ƒXƒgƒ‰ƒNƒ^“à‚ÅÝ’è
var holdPeriodEventQueue = []; // •Û—¯‚É‚³‚ꂽƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒgƒLƒ…[
var isLeavePeriodEvent = false; // ƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒg‚ð•Û—¯‚É‚·‚é‚©‚Ç‚¤‚©
var isWaitPeriodEvent = false; // ƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒg‘Ò‚¿ó‘Ô‚©‚Ç‚¤‚©
var waitedPeriodEventStorageName = void; // ƒsƒŠƒIƒhƒCƒxƒ“ƒg‘Ò‚¿‚ðƒR[ƒ‹‚µ‚½ƒXƒgƒŒ[ƒW–¼
//------------------------------------------------------ ƒRƒ“ƒXƒgƒ‰ƒNƒ^ --
function KAGWindow(ismain = true, width = 0, height = 0)
{
// ƒRƒ“ƒXƒgƒ‰ƒNƒ^
// ˆø” : ismain : ƒƒCƒ“ƒEƒBƒ“ƒhƒE‚Æ‚µ‚Ä쬂³‚ê‚é‚Ì‚©‚Ç‚¤‚©
super.Window(); // eƒNƒ‰ƒX‚̃Rƒ“ƒXƒgƒ‰ƒNƒ^‚ðŒÄ‚Ô
// ƒRƒ“ƒtƒBƒMƒ…ƒŒ[ƒVƒ‡ƒ“
isMain = ismain;
if(ismain)
{
(KAGWindow_config incontextof this)();
(KAGWindow_config_override incontextof this)()
if typeof global.KAGWindow_config_override != "undefined";
}
userChSpeed = chSpeed = actualChSpeed = chSpeeds.normal;
autoModePageWait = autoModePageWaits.medium;
autoModeLineWait = autoModeLineWaits.medium;
askOnClose = false if !ismain;
// saveDataLocation ‚ªƒtƒ‹ƒpƒX‚Å‚È‚¢‚悤‚È‚ç‚Î System.exePath ‚ð
// •t‚¯‰Á‚¦‚é
if(saveDataLocation.indexOf(":") == -1)
saveDataLocation = System.exePath + saveDataLocation;
// ƒƒjƒ…[ƒAƒCƒeƒ€‚Ìì¬
if(ismain) (KAGWindow_createMenus incontextof this)();
if(typeof this.rightClickMenuItem != "undefined")
rightClickDefaultName = rightClickCurrentMenuName = rightClickMenuItem.caption;
if(typeof this.autoModeMediumMenuItem != "undefined")
autoModeMediumMenuItem.checked = true;
if(typeof this.windowedMenuItem != "undefined")
windowedMenuItem.checked = true;
if(typeof this.chNormalMenuItem != "undefined")
chNormalMenuItem.checked = true;
if(typeof this.ch2ndNoChangeMenuItem != "undefined")
ch2ndNoChangeMenuItem.checked = true;
if(ismain) (Menu_visible_config incontextof this)();
createBookMarkSubMenus();
// ƒEƒBƒ“ƒhƒEŠOŒ©‚Ì’²®
if(ismain)
{
borderStyle = bsSingle;
innerSunken = true;
}
else
{
borderStyle = bsDialog;
innerSunken = false;
}
showScrollBars = false;
if(ismain) caption = System.title;
// ƒVƒXƒeƒ€ƒ^ƒCƒgƒ‹‚ðƒLƒƒƒvƒVƒ‡ƒ“‚Æ“¯‚¶‚É
if(ismain) System.title = caption;
// ƒEƒBƒ“ƒhƒEƒTƒCƒY‚Ì’²®
if(width != 0 && height != 0)
{
// —^‚¦‚ç‚ꂽƒTƒCƒY‚ð“K—p
scWidth = width;
scHeight = height;
}
setInnerSize(scWidth, scHeight);
// quake —pƒ^ƒCƒ}‚Ìì¬
quakeTimer = new Timer(onQuakeTimerInterval, '');
add(quakeTimer);
quakeTimer.interval = 50;
// ”wŒiƒŒƒCƒ„‚Ìì¬
fore.messages = [];
back.messages = [];
fore.layers = [];
back.layers = [];
fore.base = new BaseLayer(this, null, "•\-”wŒi");
add(fore.base);
fore.base.setImageSize(scWidth, scHeight);
fore.base.setSizeToImageSize();
back.base = new BaseLayer(this, fore.base, "— -”wŒi");
add(back.base);
back.base.setImageSize(scWidth, scHeight);
back.base.setSizeToImageSize();
fore.base.setCompLayer(back.base);
back.base.setCompLayer(fore.base);
fore.base.freeImage();
back.base.freeImage();
fore.base.setDefaultCursor(cursorDefault);
back.base.setDefaultCursor(cursorDefault);
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚Ìì¬
historyLayer = new HistoryLayer(this, fore.base);
add(historyLayer);
// ‘OŒiƒŒƒCƒ„‚Ìì¬
allocateCharacterLayers(numCharacterLayers);
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ìì¬
allocateMessageLayers(numMessageLayers, false);
current = fore.messages[0];
currentNum = 0;
currentPage = 0;
currentWithBack = false;
if(initialMessageLayerVisible)
{
fore.messages[0].visible = true;
back.messages[0].visible = true;
}
chDefaultAntialiased = fore.messages[0].defaultAntialiased;
// •¶Žš‚ɃAƒ“ƒ`ƒGƒCƒŠƒAƒX‚ð‚©‚¯‚é‚©‚Ç‚¤‚©
chDefaultFace = fore.messages[0].userFace;
// •¶Žš‚̃fƒtƒHƒ‹ƒg‚̃tƒHƒ“ƒg
if(typeof this.chAntialiasMenuItem != "undefined")
chAntialiasMenuItem.checked = chDefaultAntialiased;
// s‘Ò‚¿/ƒy[ƒW‘Ò‚¿ƒAƒjƒ[ƒVƒ‡ƒ“ƒŒƒCƒ„‚Ìì¬
lineBreak = new ClickGlyphLayer(this, fore.base);
add(lineBreak);
lineBreak.name = "sƒNƒŠƒbƒN‘Ò‚¿‹L†";
pageBreak = new ClickGlyphLayer(this, fore.base);
add(pageBreak);
pageBreak.name = "ƒy[ƒW––ƒNƒŠƒbƒN‘Ò‚¿‹L†";
// ƒ^ƒOƒnƒ“ƒhƒ‰/ƒRƒ“ƒ_ƒNƒ^‚ðì¬
tagHandlers = getHandlers();
mainConductor = new Conductor(this, tagHandlers);
add(mainConductor);
conductor = mainConductor;
extraConductor = new Conductor(this, tagHandlers);
add(extraConductor);
// BGM ƒIƒuƒWƒFƒNƒg‚ðì¬
bgm = new BGM(this);
add(bgm);
// Œø‰Ê‰¹ƒIƒuƒWƒFƒNƒg‚ðì¬
for(var i = 0; i < numSEBuffers; i++)
add(se = new SESoundBuffer(this, i));
// ƒ€[ƒr[ƒIƒuƒWƒFƒNƒg‚ðì¬
if(ismain)
{
for( var i = 0; i < numMovies; i++)
add(movies = new Movie(this,i));
}
// ƒfƒtƒHƒ‹ƒg‚̃nƒ“ƒhƒ‰‚ð’ljÁ
stableHandlers.add(defaultStableHandler);
runHandlers.add(defaultRunHandler);
// ƒVƒXƒeƒ€•Ï”‚Ì“Ç‚Ýž‚Ý
if(ismain) loadSystemVariables();
// ƒVƒXƒeƒ€•Ï”‚𔽉f
if(ismain)
{
setSystemStateFromSystemVariables();
setBookMarkMenuCaptions();
}
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚̃NƒŠƒA
clearMessageLayers(false);
// ƒEƒBƒ“ƒhƒEˆÊ’u‚Ì’²ß
if(this.width + this.left > System.desktopLeft + System.desktopWidth)
left = ((System.desktopWidth - this.width) >>1) + System.desktopLeft;
if(this.height + this.top > System.desktopTop + System.desktopHeight)
top = ((System.desktopHeight - this.height) >>1) + System.desktopTop;
// ƒpƒbƒhƒ{ƒ^ƒ“ƒnƒ“ƒhƒ‰‚Ìì¬
createPadKeyMap();
// ƒEƒBƒ“ƒhƒE‚ð•\Ž¦
if(ismain) visible = true;
// ‰æ–ʃTƒCƒY‚ªƒEƒBƒ“ƒhƒEƒTƒCƒY‚æ‚è‚ଂ³‚¢ê‡‚Í
// ƒtƒ‹ƒXƒNƒŠ[ƒ“‚É‚µ‚Ä‚Ý‚é
if(ismain)
{
if(System.screenWidth <= scWidth && System.screenHeight <= scHeight)
onFullScreenMenuItemClick(this);
}
// ‘O‰ñ‹N“®Žž‚Ƀtƒ‹ƒXƒNƒŠ[ƒ“‚¾‚Á‚½ê‡‚̓tƒ‹ƒXƒNƒŠ[ƒ“‚É‚µ‚Ä‚Ý‚é
if(ismain)
{
if(scflags.fullScreen !== void && +scflags.fullScreen)
onFullScreenMenuItemClick(this);
}
// ‚¢‚Á‚½‚ñƒVƒXƒeƒ€•Ï”‚ð‘‚«o‚·
if(ismain) saveSystemVariables();
}
//------------------------------------------------------------- finalize --
function finalize()
{
// finalize ƒƒ\ƒbƒh
// ƒvƒ‰ƒOƒCƒ“‚Ì–³Œø‰»
for(var i = 0; i < kagPlugins.count; i++) invalidate kagPlugins;
// ‘OŒiAƒƒbƒZ[ƒWƒŒƒCƒ„‚𖳌ø‰»
for(var i = 0; i< fore.layers.count; i++) invalidate fore.layers;
for(var i = 0; i< back.layers.count; i++) invalidate back.layers;
for(var i = 0; i< fore.messages.count; i++) invalidate fore.messages;
for(var i = 0; i< back.messages.count; i++) invalidate back.messages;
// snapshotLayer ‚𖳌ø‰»
invalidate snapshotLayer if snapshotLayer !== void;
// tempLayer ‚𖳌ø‰»
invalidate tempLayer if tempLayer !== void;
// ƒX[ƒp[ƒNƒ‰ƒX‚Ì finalize ‚ðŒÄ‚Ô
super.finalize(...);
}
//-------------------------------------------------- onCloseQuery/close --
function onCloseQuery()
{
saveSystemVariables();
if(!askOnClose) { super.onCloseQuery(true); return; }
super.onCloseQuery(askYesNo("Quit the GameH"));
}
function close()
{
// ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚é
saveSystemVariables();
super.close(...);
}
function shutdown()
{
// ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚邪AI—¹Šm”F‚ðs‚í‚È‚¢
// ‚±‚̃ƒ\ƒbƒh“à‚Å close ‚ð‚·‚é‚ÆA—lX‚È
// ƒIƒuƒWƒFƒNƒg‚ª–³Œø‰»‚³‚ê‚Ä‚µ‚Ü‚¢A‚±‚Ì
// ŠÖ”‚©‚ç–ß‚Á‚½æ‚ŃGƒ‰[‚ª”¶‚·‚éB
// ‚»‚Ì‚½‚ßA‚¢‚Á‚½‚ñ AsyncTrigger ‚ð‰î‚µ‚ÄA
// ‘S‚Ẵƒ\ƒbƒh‚©‚ç‹A‚Á‚½‚ ‚ƂɃVƒƒƒbƒgƒ_ƒEƒ“
// ˆ—‚ðs‚¤B
global.shutdownTrigger =
new AsyncTrigger(handleShutdown, '');
global.shutdownTrigger.cached = true;
global.shutdownTrigger.trigger();
if(conductor.status == conductor.mRun)
conductor.interrupt();
// ƒRƒ“ƒ_ƒNƒ^‚ª‘–s’†‚ÌŽž‚Í
// ƒRƒ“ƒ_ƒNƒ^‚É’†’f‚ð“`‚¦‚é
}
function handleShutdown()
{
// shutdown() ‚©‚ç‚̃Vƒƒƒbƒgƒ_ƒEƒ“—v‹‚ð
// ŽÀۂɈ—‚·‚郃\ƒbƒh
var askOnClose_save = askOnClose;
askOnClose = false;
close();
if(this isvalid) askOnClose = askOnClose_save;
}
function closeByScript(elm)
{
// ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚é
// ‚¿‚å‚Á‚Æ–Ê“|‚‚³‚¢‚Æ‚ð‚â‚Á‚Ä‚¢‚é‚Ì‚Í
// shutdown ‚Æ“¯‚¶——R
// u‚¢‚¢‚¦v‚ª‘I‘ð‚³‚ê‚ăEƒBƒ“ƒhƒE‚ª•Â‚¶‚È‚©‚Á‚½ê‡‚Í
// 'not_closed' ƒgƒŠƒK‚ª”s‚³‚êAŽÀs‚ÍÄŠJ‚·‚éB
var askOnClose_save = askOnClose;
if(elm.ask !== void && !(+elm.ask)) askOnClose = false;
global.shutdownTrigger =
new AsyncTrigger(handleCloseByScript, '');
global.shutdownTrigger.cached = true;
global.shutdownTrigger.trigger();
// closeByScript ‚ÍA‚±‚̃nƒ“ƒhƒ‰‚ªI‚í‚Á‚½’¼Œã‚É
// uI—¹‚µ‚Ü‚·‚©Hv‚̃_ƒCƒAƒƒO‚ð•\Ž¦‚·‚éB
// I—¹‚·‚éꇂ͂»‚Ì‚Ü‚ÜI—¹‚·‚éB
// I—¹‚µ‚È‚¢ê‡‚Í 'not_closed' ƒgƒŠƒK‚ª”s‚³‚êA
// ŽÀs‚ÍŒp‘±‚·‚éB
conductor.wait(%[
not_closed : askOnClose_save
? (function
{
// ŽÀÛ‚É‚±‚ꂪŒÄ‚΂ê‚邱‚Æ‚Í‚È‚¢‚ªAˆê‰ž
askOnClose = true;
} incontextof this)
: (function
{
} incontextof this)
]);
}
function handleCloseByScript()
{
// shutdown() ‚©‚ç‚̃Vƒƒƒbƒgƒ_ƒEƒ“—v‹‚ð
// ŽÀۂɈ—‚·‚郃\ƒbƒh
close();
if(this isvalid) // ‚¢‚¢‚¦ ‚ª‘I‘ð‚³‚ê‚½ê‡
conductor.trigger('not_closed');
}
//------------------------------------------------------ ƒvƒ‰ƒOƒCƒ“ˆ— --
function forEachEventHook(method, func, arg)
{
// ‚·‚ׂẴvƒ‰ƒOƒCƒ“ƒIƒuƒWƒFƒNƒg‚Ì method ‚É‚½‚¢‚µ‚Ä
// func ‚ðŽÀs‚·‚é
// func ‚̈ø”‚É‚ÍŠe—v‘f‚Æ arg ‚ª“n‚³‚ê‚é
if(kagPlugins.count)
{
var array = [];
array.assign(kagPlugins); // ‚¢‚Á‚½‚ñƒRƒs[‚µAƒRƒs[‚µ‚½•¨‚ɑ΂µ‚ÄŽÀs‚·‚é
var arraycount = array.count;
for(var i =0; i<arraycount; i++)
{
var obj = array;
if(typeof obj[method] != "undefined")
func(obj[method], arg);
}
}
}
function addPlugin(plugin)
{
// ƒvƒ‰ƒOƒCƒ“ƒIƒuƒWƒFƒNƒg‚ð’ljÁ
kagPlugins.add(plugin);
}
function removePlugin(plugin)
{
// ƒvƒ‰ƒOƒCƒ“ƒIƒuƒWƒFƒNƒg‚ðíœ
kagPlugins.remove(plugin);
}
//---------------------------------------------------------- ƒtƒbƒNˆ— --
function callHook(array, arg1, arg2, arg3)
{
if(array.count)
{
var processed = false;
var newarray = [];
newarray.assign(array);
var arraycount = newarray.count;
for(var i = 0; i < arraycount; i++)
{
var func = newarray;
var ret = func(arg1, arg2, arg3);
processed = processed || ret;
}
return processed;
}
else
{
return false;
}
}
//------------------------------------------ ƒpƒbƒh‚̃L[ƒ}ƒbƒsƒ“ƒOì¬ --
function createPadKeyMap()
{
// ƒpƒbƒh“ü—Í‚Æ‚»‚ê‚ɑΉž‚·‚é“®ì‚̃}ƒbƒsƒ“ƒOB
// •W€‚Å‚Í\ŽšƒL[‚̓L[ƒ{[ƒh‚̃J[ƒ\ƒ‹ƒL[‚Ƀ}ƒbƒsƒ“ƒOA
// ƒ{ƒ^ƒ“1 ‚Í ReturnAƒ{ƒ^ƒ“2 ‚Í ESCAƒ{ƒ^ƒ“3 ‚Í ƒƒbƒZ[ƒW—š—ð‚Ì•\Ž¦
// ‚Ƀ}ƒbƒsƒ“ƒO‚³‚ê‚éB
// ŠÖ”‚ðŽw’肵‚½ê‡‚̓{ƒ^ƒ“‚ð‰Ÿ‚µ‚½‚Æ‚«‚É‚Í‚»‚ÌŠÖ”‚ªŒÄ‚΂ê‚éB
padKeyMap = %[
VK_PADLEFT => VK_LEFT,
VK_PADRIGHT => VK_RIGHT,
VK_PADUP => VK_UP,
VK_PADDOWN => VK_DOWN,
VK_PAD1 => VK_RETURN,
VK_PAD2 => VK_ESCAPE,
VK_PAD3 =>
function(ev) {
showHistoryByKey(this);
},
];
// padKeyMapReverse ‚ðì¬
padKeyMapReverse = %[];
var ar = [];
ar.assign(padKeyMap);
for(var i = 0; i < ar.count; i += 2)
{
if(typeof(ar[i+1]) != "Object")
{
padKeyMapReverse[ar[i+1]] = ar;
}
}
}
function getKeyState(key)
{
// System.getKeyState ŠÖ”‚Æ“¯“™‚¾‚ªAƒpƒbƒh‚̃L[‚ÉŠÖ‚µ‚Ä‚à
// ”½‰ž‚ð•Ô‚·
var sg = System.getKeyState;
var state = sg(key);
if(state) return true;
var pad_key = padKeyMapReverse[key];
if(pad_key !== void)
{
// ƒL[ƒR[ƒh -> ƒpƒbƒh‚̃L[ƒR[ƒh‚Ì•ÏŠ·‚ªŒ©‚‚©‚Á‚½
return sg(pad_key);
}
return false;
}
//-------------------------------------------------------------- action --
function action(ev)
{
if(ev.type == 'onKeyDown' && ev.target === this)
{
// ƒpƒbƒh“ü—͂ɑΉž‚·‚鈗
var handler = padKeyMap[ev.key];
if(handler !== void)
{
// ƒnƒ“ƒhƒ‰‚ªŒ©‚‚©‚Á‚½
if(typeof(handler) == "Object")
{
// ƒnƒ“ƒhƒ‰‚ÍŠÖ”
(handler incontextof this)(ev);
}
else
{
// ƒnƒ“ƒhƒ‰‚̓L[ƒR[ƒh
postInputEvent('onKeyDown', %[key: handler]);
postInputEvent('onKeyUp', %[key: handler]);
}
}
}
}
//------------------------------------------------------ tempLayer ŠÖ˜A --
property temporaryLayer
{
// ƒ[ƒNƒGƒŠƒA‚Æ‚µ‚Ĉꎞ“I‚ÉŽg—p‚Å‚«‚郌ƒCƒ„‚ð•Ô‚·
getter()
{
if(tempLayer === void)
{
tempLayer = new KAGLayer(this, primaryLayer);
tempLayer.name = "ˆêŽžƒ[ƒNƒŒƒCƒ„";
}
return tempLayer;
}
}
//------------------------------------------------ ƒƒjƒ…[ƒAƒCƒeƒ€ŠÖ˜A --
function onExitMenuItemClick(sender)
{
close();
}
function onRightClickMenuItemClick(sender)
{
onPrimaryRightClick(); // ‰EƒNƒŠƒbƒN‚Ì“®ì
}
function onShowHistoryMenuItemClick(sender)
{
if(historyLayer.visible) hideHistory(); else showHistory();
}
function onSkipToNextStopMenuItemClick(sender)
{
skipToStop();
}
function onAutoModeMenuItemClick(sender)
{
if(autoMode) cancelAutoMode(); else enterAutoMode();
}
function onAutoModeWaitMenuClick(sender)
{
sender.checked = true;
autoModePageWait = sender.wait;
autoModeLineWait = sender.lwait;
}
function onBackStartMenuItemClick(sender)
{
goBackHistory();
}
function onGoToStartMenuItemClick(sender)
{
goToStartWithAsk();
}
function onChSpeedMenuItemClick(sender)
{
sender.checked = true;
userChSpeed = sender.speed;
setUserSpeed();
saveSystemVariables();
}
function onChNonStopToPageBreakItemClick(sender)
{
chNonStopToPageBreak = ! chNonStopToPageBreak;
if(typeof this.chNonStopToPageBreakItem != "undefined")
chNonStopToPageBreakItem.checked = chNonStopToPageBreak;
saveSystemVariables();
}
function onCh2ndNonStopToPageBreakItemClick(sender)
{
ch2ndNonStopToPageBreak = ! ch2ndNonStopToPageBreak;
if(typeof this.ch2ndNonStopToPageBreakItem != "undefined")
ch2ndNonStopToPageBreakItem.checked = ch2ndNonStopToPageBreak;
saveSystemVariables();
}
function onCh2ndSpeedMenuItemClick(sender)
{
sender.checked = true;
userCh2ndSpeed = sender.speed;
setUserSpeed();
saveSystemVariables();
}
function onChAntialiasMenuItemClick(sender)
{
chDefaultAntialiased = !chDefaultAntialiased;
if(typeof this.chAntialiasMenuItem != "undefined")
chAntialiasMenuItem.checked = chDefaultAntialiased;
setMessageLayerUserFont();
saveSystemVariables();
}
function onChChangeFontMenuItem(sender)
{
selectFont();
saveSystemVariables();
}
function onRestoreMenuClick(sender)
{
if(!freeSaveDataMode) return;
loadBookMarkFromFileWithAsk();
}
function onStoreMenuClick(sender)
{
if(!freeSaveDataMode) return;
saveBookMarkToFileWithAsk();
}
function onWindowedMenuItemClick(sender)
{
if(fullScreened)
{
try
{
fullScreen = false;
}
catch(e)
{
Debug.notice("ƒEƒBƒ“ƒhƒEƒ‚[ƒh‚ɈÚs‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½ : " + e.message);
}
fullScreened = fullScreen;
if(fullScreened)
fullScreenMenuItem.checked = true;
else
windowedMenuItem.checked = true;
}
saveSystemVariables();
}
function onFullScreenMenuItemClick(sender)
{
if(!fullScreened)
{
try
{
fullScreen = true;
}
catch(e)
{
Debug.notice("ƒtƒ‹ƒXƒNƒŠ[ƒ“ƒ‚[ƒh‚ɈÚs‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½ : " + e.message);
}
fullScreened = fullScreen;
if(fullScreened)
fullScreenMenuItem.checked = true;
else
windowedMenuItem.checked = true;
}
saveSystemVariables();
}
function onHelpIndexMenuItemClick(sender)
{
// ƒwƒ‹ƒvƒtƒ@ƒCƒ‹‚ðŠJ‚
System.shellExecute(Storages.getLocalName(System.exePath) + helpFile);
}
function onHelpAboutMenuItemClick(sender)
{
// u‚±‚̃\ƒtƒg‚ɂ‚¢‚ÄvƒEƒBƒ“ƒhƒE‚ð•\Ž¦
var win = new global.KAGWindow(false, aboutWidth, aboutHeight);
win.setPos(left + ((width - win.width)>>1), top + ((height - win.height)>>1));
win.process('about.ks' ,,, true); // about.ks ‚ð immediate ‚Å•\Ž¦
win.showModal(); // ƒ‚[ƒh•t‚«‚Å•\Ž¦
invalidate win;
}
function onReloadScenarioMenuItemClick(sender)
{
saveBookMark(1000, false);
loadBookMark(1000);
}
function onShowConsoleMenuItemClick(sender)
{
Debug.console.visible = true;
}
function onShowContollerMenuItemClick(sender)
{
Debug.controller.visible = true;
}
function internalSetMenuAccessibleAll(menu, state)
{
// autoEnable ‚ª true ‚Ì‚·‚ׂẴƒjƒ…[€–Ú‚Ì accessible ‚É’l state ‚ð
// Ý’è‚·‚é
if(typeof menu.autoEnable != "undefined" && menu.autoEnable)
menu.accessible = state;
if(typeof menu.stopRecur == "undefined" || !menu.stopRecur)
{
var children = menu.children;
for(var i = children.count -1; i >= 0; i--)
internalSetMenuAccessibleAll(children, state); // Ä‹A
}
}
function canStore()
{
return storeEnabled && storeLabelPassed;
}
function canRestore()
{
return restoreEnabled;
}
function setMenuAccessibleAll()
{
// ƒƒjƒ…[€–Ú‚ÌŽg—p‰Â/•s‰Â‚ðÝ’è‚·‚é
// autoEnable ‚ª true ‚Ì‚·‚ׂẴƒjƒ…[€–Ú‚Ì accessible ‚Ì
// ’l‚ðÝ’è‚·‚é
var notmodal = !historyLayer.visible && !messageLayerHiding;
var state = inStable && notmodal;
internalSetMenuAccessibleAll(menu, state);
// ‚»‚Ì‘¼‚̃ƒjƒ…[‚ÌŽg—p‰Â/•s‰Â
if(typeof this.skipToNextStopMenuItem != "undefined")
skipToNextStopMenuItem.enabled = state && !inSleep && nextSkipEnabled;
if(typeof this.rightClickMenuItem != "undefined")
rightClickMenuItem.enabled = inStable && !historyLayer.visible;
if(typeof this.showHistoryMenuItem != "undefined")
showHistoryMenuItem.enabled = inStable && !messageLayerHiding &&
historyEnabled;
if(typeof this.autoModeMenuItem != "undefined")
autoModeMenuItem.enabled = notmodal;
if(typeof this.goBackMenuItem != "undefined")
goBackMenuItem.enabled = state && isHistoryOfStoreAlive();
if(typeof this.goToStartMenuItem != "undefined")
goToStartMenuItem.enabled = state && startAnchorEnabled;
if(typeof this.storeMenu != "undefined")
{
var st = state && canStore();
var children = storeMenu.children;
if(freeSaveDataMode) storeMenu.enabled = st;
for(var i = children.count - 1; i >= 0; i--)
{
var obj = children;
obj.enabled = obj.orgEnabled && st;
}
}
if(typeof this.restoreMenu != "undefined")
{
var st = state && canRestore();
var children = restoreMenu.children;
if(freeSaveDataMode) restoreMenu.enabled = st;
for(var i = children.count - 1; i >= 0; i--)
{
var obj = children;
obj.enabled = obj.orgEnabled && st;
}
}
}
//----------------------------------------------- ƒ}ƒEƒXƒL[‚ð—LŒø‚É‚·‚é --
function enableMouseKey()
{
// ƒ}ƒEƒXƒL[‚ð—LŒø‚É‚·‚é
if(mouseKeyEnabledCount == 0)
{
useMouseKey = true;
mouseCursorState = mcsVisible;
}
mouseKeyEnabledCount++; // ŽQƃJƒEƒ“ƒ^•ûŽ®
}
function disableMouseKey()
{
// ƒ}ƒEƒXƒL[‚𖳌ø‚É‚·‚é
mouseKeyEnabledCount --;
if(mouseKeyEnabledCount == 0) useMouseKey = false;
}
//----------------------------------------------------- ƒVƒXƒeƒ€•Ï”ŠÖ˜A --
function loadSystemVariables()
{
// ƒVƒXƒeƒ€•Ï”‚Ì“Ç‚Ýž‚Ý
try
{
var fn = saveDataLocation + "/" + dataName +
"sc.ksd";
if(Storages.isExistentStorage(fn))
{
scflags = Scripts.evalStorage(fn);
scflags = %[] if scflags === void;
}
else
{
scflags = %[];
}
var fn = saveDataLocation + "/" + dataName +
"su.ksd";
if(Storages.isExistentStorage(fn))
{
sflags = Scripts.evalStorage(fn);
sflags = %[] if sflags === void;
}
else
{
sflags = %[];
}
}
catch(e)
{
throw new Exception("ƒVƒXƒeƒ€•Ï”ƒf[ƒ^‚ð“Ç‚Ýž‚ß‚È‚¢‚©A"
"‚ ‚é‚¢‚̓VƒXƒeƒ€•Ï”ƒf[ƒ^‚ª‰ó‚ê‚Ä‚¢‚Ü‚·(" + e.message + ")");
}
}
function setSystemStateFromSystemVariables()
{
// ƒVƒXƒeƒ€•Ï”‚ÉŠî‚¢‚ăVƒXƒeƒ€‚ðÝ’è
// (ƒtƒ‹ƒXƒNƒŠ[ƒ“ŠÖ˜A‚ð‚Ì‚¼‚)
if(scflags.autoModePageWait !== void)
{
if(typeof this.autoModeWaitMenu !== "undefined")
{
var children = autoModeWaitMenu.children;
for(var i = children.count-1; i >= 0; i--)
{
var item = children;
if(typeof item.wait !== "undefined" && item.wait == scflags.autoModePageWait)
{
item.checked = true;
break;
}
}
}
}
if(scflags.userChSpeed !== void)
{
if(typeof this.chSpeedMenu !== "undefined")
{
var children = chSpeedMenu.children;
for(var i = children.count-1; i >= 0; i--)
{
var item = children;
if(typeof item.speed !== "undefined" && item.speed == scflags.userChSpeed)
{
item.checked = true;
break;
}
}
}
}
if(scflags.userCh2ndSpeed !== void)
{
if(typeof this.chSpeedMenu !== "undefined")
{
var children = ch2ndSpeedMenu.children;
for(var i = children.count-1; i >= 0; i--)
{
var item = children;
if(typeof item.speed !== "undefined" && item.speed == scflags.userCh2ndSpeed)
{
item.checked = true;
break;
}
}
}
}
lastSaveDataNameGlobal = scflags.lastSaveDataNameGlobal if scflags.lastSaveDataNameGlobal !== void;
bookMarkNames = scflags.bookMarkNames if scflags.bookMarkNames !== void;
bookMarkDates = scflags.bookMarkDates if scflags.bookMarkDates !== void;
bookMarkProtectedStates = scflags.bookMarkProtectedStates if scflags.bookMarkProtectedStates !== void;
autoModePageWait = scflags.autoModePageWait if scflags.autoModePageWait !== void;
autoModeLineWait = scflags.autoModeLineWait if scflags.autoModeLineWait !== void;
userChSpeed = scflags.userChSpeed if scflags.userChSpeed !== void;
userCh2ndSpeed = scflags.userCh2ndSpeed if scflags.userCh2ndSpeed !== void;
setUserSpeed();
chNonStopToPageBreak = scflags.chNonStopToPageBreak if scflags.chNonStopToPageBreak !== void;
if(typeof this.chNonStopToPageBreakItem != "undefined")
chNonStopToPageBreakItem.checked = chNonStopToPageBreak;
ch2ndNonStopToPageBreak = scflags.ch2ndNonStopToPageBreak if scflags.ch2ndNonStopToPageBreak !== void;
if(typeof this.ch2ndNonStopToPageBreakItem != "undefined")
ch2ndNonStopToPageBreakItem.checked = ch2ndNonStopToPageBreak;
chDefaultAntialiased = scflags.chDefaultAntialiased if scflags.chDefaultAntialiased !== void;
if(typeof this.chAntialiasMenuItem != "undefined")
chAntialiasMenuItem.checked = chDefaultAntialiased;
chDefaultFace = scflags.chDefaultFace if scflags.chDefaultFace !== void;
setMessageLayerUserFont();
bgm.restoreSystemState(scflags);
for(var i = 0; i<numSEBuffers; i++)
{
se.restoreSystemState(scflags);
}
}
function clearSystemVariables()
{
// ƒVƒXƒeƒ€•Ï”‚̃NƒŠƒA
(Dictionary.clear incontextof sflags)();
}
function saveSystemVariables()
{
// ƒVƒXƒeƒ€•Ï”‚Ì•Û‘¶
if(!isMain) return;
// ƒvƒ‰ƒOƒCƒ“‚ðŒÄ‚Ô
forEachEventHook('onSaveSystemVariables',
function(handler, f) { handler(); } incontextof this);
// ƒtƒ‹ƒXƒNƒŠ[ƒ“
scflags.fullScreen = fullScreened;
// •¶Žš•\Ž¦‘¬“x
scflags.autoModePageWait = autoModePageWait;
scflags.autoModeLineWait = autoModeLineWait;
scflags.userChSpeed = userChSpeed;
scflags.userCh2ndSpeed = userCh2ndSpeed;
scflags.chDefaultAntialiased = chDefaultAntialiased;
scflags.chDefaultFace = chDefaultFace;
scflags.chNonStopToPageBreak = chNonStopToPageBreak;
scflags.ch2ndNonStopToPageBreak = ch2ndNonStopToPageBreak;
// ƒuƒbƒNƒ}[ƒN–¼
scflags.bookMarkNames = bookMarkNames; // (ƒRƒs[‚Å‚Í‚È‚‚Ä)ŽQÆ‚Å\•ª
scflags.bookMarkDates = bookMarkDates;
scflags.bookMarkProtectedStates = bookMarkProtectedStates;
scflags.lastSaveDataNameGlobal = lastSaveDataNameGlobal;
// ƒtƒ@ƒCƒ‹‚É‘‚«ž‚Þ
if(!readOnlyMode)
{
var fn = saveDataLocation + "/" + dataName +
"sc.ksd";
(Dictionary.saveStruct incontextof scflags)(fn, saveDataMode);
var fn = saveDataLocation + "/" + dataName +
"su.ksd";
(Dictionary.saveStruct incontextof sflags)(fn, saveDataMode);
}
}
//------------------------------------------------------- ƒQ[ƒ€•Ï”ŠÖ˜A --
function internalStoreFlags(f)
{
// f ‚ÉŒ»Ý‚Ìó‘Ô‚ð‹L˜^‚·‚é
// KAGWindow ‚ÉŠÖ‚·‚é‚à‚Ì
(Dictionary.clear incontextof f)(); // ƒNƒŠƒA
// ‚±‚±‚Ì [start_store_vars] ‚©‚ç [end_store_vars] ‚ň͂܂ꂽ•”•ª‚Í
// ––’[‚Ì perl ƒXƒNƒŠƒvƒg‚É‚æ‚Á‚ÄŽ©“®“I‚Ɉ—‚³‚ê‚é‚Ì‚ÅA‚±‚̃}[ƒN‚ðÁ‚µ‚½‚è
// ‚±‚̃}[ƒN‚ÌŠÔ‚ð•ÒW‚µ‚½‚肵‚È‚¢‚±‚ÆB
// [start_store_vars]
f.lastSaveDataName = lastSaveDataName;
f.quaking = quaking;
f.quakeEndTick = quakeEndTick;
f.quakeHorzMax = quakeHorzMax;
f.quakeVertMax = quakeVertMax;
f.quakePhase = quakePhase;
f.historyWriteEnabled = historyWriteEnabled;
f.historyEnabled = historyEnabled;
f.numCharacterLayers = numCharacterLayers;
f.numMessageLayers = numMessageLayers;
f.currentNum = currentNum;
f.currentPage = currentPage;
f.currentWithBack = currentWithBack;
f.chUserMode = chUserMode;
f.chSpeed = chSpeed;
f.actualChSpeed = actualChSpeed;
f.beforeNoWaitActualChSpeed = beforeNoWaitActualChSpeed;
f.beforeNoWaitChUserMode = beforeNoWaitChUserMode;
f.clickSkipEnabled = clickSkipEnabled;
f.nextSkipEnabled = nextSkipEnabled;
f.canCancelSkipByClick = canCancelSkipByClick;
f.autoWCEnabled = autoWCEnabled;
f.autoWCChars = autoWCChars;
f.rightClickEnabled = rightClickEnabled;
f.rightClickCall = rightClickCall;
f.rightClickJump = rightClickJump;
f.rightClickTarget = rightClickTarget;
f.rightClickStorage = rightClickStorage;
f.rightClickName = rightClickName;
f.rightClickCurrentMenuName = rightClickCurrentMenuName;
f.lastClickGlyphVisible = lastClickGlyphVisible;
f.cursorDefault = cursorDefault;
f.cursorPointed = cursorPointed;
f.cursorWaitingClick = cursorWaitingClick;
f.cursorDraggable = cursorDraggable;
f.startAnchorEnabled = startAnchorEnabled;
f.storeEnabled = storeEnabled;
f.restoreEnabled = restoreEnabled;
f.currentLabel = currentLabel;
f.currentPageName = currentPageName;
// [end_store_vars]
// perl ƒXƒNƒŠƒvƒg‚É‚æ‚Á‚ÄŽ©“®“I‚Ɉ—‚³‚ê‚È‚¢‚à‚ÌA‚¢‚‚‚©B
// Ž©“®ƒEƒFƒCƒg
f.autoWCWaits = [];
f.autoWCWaits.assign(autoWCWaits); // Ž©“®ƒEƒFƒCƒg‚̃EƒFƒCƒg
// bgm
f.bgm = bgm.store();
// Œø‰Ê‰¹
f.se = [];
for(var i = 0; i<numSEBuffers; i++)
{
f.se = se.store();
}
// ƒƒbƒZ[ƒWƒŒƒCƒ„
f.foreMessageLayers = [];
f.backMessageLayers = [];
for(var i = 0; i < numMessageLayers; i++)
{
f.foreMessageLayers = fore.messages.store();
f.backMessageLayers = back.messages.store();
}
// ‘OŒiƒŒƒCƒ„
f.foreCharacterLayers = [];
f.backCharacterLayers = [];
for(var i = 0; i < numCharacterLayers; i++)
{
f.foreCharacterLayers = fore.layers.store();
f.backCharacterLayers = back.layers.store();
}
// ”wŒiƒŒƒCƒ„
f.foreBaseLayer = fore.base.store();
f.backBaseLayer = back.base.store();
// ƒEƒBƒ“ƒhƒEƒLƒƒƒvƒVƒ‡ƒ“
f.caption = caption;
// ƒRƒ“ƒ_ƒNƒ^
f.mainConductor = mainConductor.store();
if(!saveMacros) f.mainConductor.macros = void;
// ƒ}ƒNƒî•ñ‚ð void ‚Åã‘‚«‚·‚é‚Æžx’†‚̃}ƒNƒî•ñ‚Í–³Œø‚É‚È‚é
// ƒƒbƒZ[ƒW—š—ð
if(historyLayer.storeState)
{
f.historyData = historyLayer.save();
}
// ƒ€[ƒr[
if( isMain )
{
f.movies = [];
for( var i = 0; i < numMovies; i++)
f.movies = movies.store();
}
// storeHook
forEachEventHook('onStore',
function(handler, f) { handler(f.flags, f.options); } incontextof this,
%[flags:f, options:void]);
}
function storeFlags()
{
// pcflags, pflags ‚É’l‚ð‘‚«ž‚Þ
// flags -> pflags
(Dictionary.assignStruct incontextof pflags)(flags);
internalStoreFlags(pcflags);
}
function internalRestoreFlags(f, clear = true, elm = void)
{
// f ‚©‚çî•ñ‚ð“Ç‚Ýo‚·
// clear ‚ª true ‚È‚ç‚΃ƒbƒZ[ƒWƒŒƒCƒ„‚ðƒNƒŠƒA‚·‚é
// se, bgm ‚ª‚»‚ꂼ‚ê true ‚È‚ç‚΂»‚Ìî•ñ‚à”½‰f‚³‚¹‚é
// backlay ‚ª true ‚ÌꇂÍA•\‰æ–ʂɃ[ƒh‚·‚ׂ«‚à‚Ì‚ð— ‰æ–ʂɃ[ƒh‚·‚é
// KAGWindow ‚ÉŠÖ‚·‚é‚à‚Ì
// ‚±‚±‚Ì [start_restore_vars] ‚©‚ç [end_restore_vars] ‚ň͂܂ꂽ•”•ª‚Í
// (—ª)
// [start_restore_vars]
lastSaveDataName = f.lastSaveDataName if f.lastSaveDataName !== void;
quaking = f.quaking if f.quaking !== void;
quakeEndTick = f.quakeEndTick if f.quakeEndTick !== void;
quakeHorzMax = f.quakeHorzMax if f.quakeHorzMax !== void;
quakeVertMax = f.quakeVertMax if f.quakeVertMax !== void;
quakePhase = f.quakePhase if f.quakePhase !== void;
historyWriteEnabled = f.historyWriteEnabled if f.historyWriteEnabled !== void;
historyEnabled = f.historyEnabled if f.historyEnabled !== void;
numCharacterLayers = f.numCharacterLayers if f.numCharacterLayers !== void;
numMessageLayers = f.numMessageLayers if f.numMessageLayers !== void;
currentNum = f.currentNum if f.currentNum !== void;
currentPage = f.currentPage if f.currentPage !== void;
currentWithBack = f.currentWithBack if f.currentWithBack !== void;
chUserMode = f.chUserMode if f.chUserMode !== void;
chSpeed = f.chSpeed if f.chSpeed !== void;
actualChSpeed = f.actualChSpeed if f.actualChSpeed !== void;
beforeNoWaitActualChSpeed = f.beforeNoWaitActualChSpeed if f.beforeNoWaitActualChSpeed !== void;
beforeNoWaitChUserMode = f.beforeNoWaitChUserMode if f.beforeNoWaitChUserMode !== void;
clickSkipEnabled = f.clickSkipEnabled if f.clickSkipEnabled !== void;
nextSkipEnabled = f.nextSkipEnabled if f.nextSkipEnabled !== void;
canCancelSkipByClick = f.canCancelSkipByClick if f.canCancelSkipByClick !== void;
autoWCEnabled = f.autoWCEnabled if f.autoWCEnabled !== void;
autoWCChars = f.autoWCChars if f.autoWCChars !== void;
rightClickEnabled = f.rightClickEnabled if f.rightClickEnabled !== void;
rightClickCall = f.rightClickCall if f.rightClickCall !== void;
rightClickJump = f.rightClickJump if f.rightClickJump !== void;
rightClickTarget = f.rightClickTarget if f.rightClickTarget !== void;
rightClickStorage = f.rightClickStorage if f.rightClickStorage !== void;
rightClickName = f.rightClickName if f.rightClickName !== void;
rightClickCurrentMenuName = f.rightClickCurrentMenuName if f.rightClickCurrentMenuName !== void;
lastClickGlyphVisible = f.lastClickGlyphVisible if f.lastClickGlyphVisible !== void;
cursorDefault = f.cursorDefault if f.cursorDefault !== void;
cursorPointed = f.cursorPointed if f.cursorPointed !== void;
cursorWaitingClick = f.cursorWaitingClick if f.cursorWaitingClick !== void;
cursorDraggable = f.cursorDraggable if f.cursorDraggable !== void;
startAnchorEnabled = f.startAnchorEnabled if f.startAnchorEnabled !== void;
storeEnabled = f.storeEnabled if f.storeEnabled !== void;
restoreEnabled = f.restoreEnabled if f.restoreEnabled !== void;
currentLabel = f.currentLabel if f.currentLabel !== void;
currentPageName = f.currentPageName if f.currentPageName !== void;
// [end_restore_vars]
// perl ƒXƒNƒŠƒvƒg‚É‚æ‚Á‚ÄŽ©“®“I‚Ɉ—‚³‚ê‚È‚¢‚à‚ÌA‚¢‚‚‚©B
// Ž©“®ƒEƒFƒCƒg
autoWCWaits.assign(f.autoWCWaits) if f.autoWCWaits !== void;
// ƒ€[ƒr[
if( isMain )
{
for( var i = 0; i < numMovies; i++)
movies.restore(f.movies);
}
// ”wŒiƒŒƒCƒ„
var backlay = elm != void && elm.backlay != void && +elm.backlay;
if(backlay)
{
back.base.restore(f.foreBaseLayer);
}
else
{
fore.base.restore(f.foreBaseLayer);
back.base.restore(f.backBaseLayer);
}
// ƒƒbƒZ[ƒWƒŒƒCƒ„
allocateMessageLayers(numMessageLayers);
if(backlay)
{
for(var i = 0; i < numMessageLayers; i++)
{
back.messages.restore(f.foreMessageLayers);
}
}
else
{
for(var i = 0; i < numMessageLayers; i++)
{
fore.messages.restore(f.foreMessageLayers);
back.messages.restore(f.backMessageLayers);
}
}
if(clear)
{
for(var i = 0; i < numMessageLayers; i++)
{
fore.messages.clear();
back.messages.clear();
}
if(historyLayer.storeState)
{
historyLayer.load(f.historyData);
}
else
{
if(historyWriteEnabled)
{
if(historyLayer.everypage)
historyLayer.repage();
else
historyLayer.reline(), historyLayer.reline();
}
historyLayer.clearAction();
}
}
// ‘OŒiƒŒƒCƒ„
allocateCharacterLayers(numCharacterLayers);
if(backlay)
{
for(var i = 0; i < numCharacterLayers; i++)
{
back.layers.restore(f.foreCharacterLayers);
}
}
else
{
for(var i = 0; i < numCharacterLayers; i++)
{
fore.layers.restore(f.foreCharacterLayers);
back.layers.restore(f.backCharacterLayers);
}
}
// quake ŠÖ˜A
restoreQuake();
// bgm
if(elm === void || elm.bgm === void || +elm.bgm)
{
bgm.restore(f.bgm);
}
// Œø‰Ê‰¹
if(elm === void || elm.se === void || +elm.se)
{
for(var i = 0; i<numSEBuffers; i++)
{
se.restore(f.se);
}
}
// ƒEƒBƒ“ƒhƒEƒLƒƒƒvƒVƒ‡ƒ“
caption = f.caption;
System.title = caption;
// current ‚Ìݒ肵’¼‚µ
current = (currentPage?back:fore).messages[currentNum];
// ‰EƒNƒŠƒbƒNƒƒjƒ…[–¼
if(typeof this.rightClickMenuItem != "undefined")
rightClickMenuItem.caption = rightClickCurrentMenuName;
// restoreHook
forEachEventHook('onRestore',
function(handler, f) { handler(f.flags, f.clear, f.options); } incontextof this,
%[flags:f, clear:clear, options:elm]);
}
function restoreFlags()
{
// pcflags, pflags ‚©‚çî•ñ‚ð“Ç‚Ýo‚·
// ƒ[ƒhŽžAƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒgî•ñ‚ðƒNƒŠƒA‚·‚é
purgeMoviePeriod();
// ƒXƒiƒbƒvƒVƒ‡ƒbƒg‚Ì”jŠü
freeSnapshot();
// ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“AŽ©“®ˆÚ“®‚Ì’âŽ~
stopAllTransitions();
stopAllMoves();
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚ð‰B‚·
hideClickGlyphs();
// ƒƒbƒZ[ƒW—š—ð‚ð‰B‚·
hideHistory();
// ƒXƒLƒbƒv‚̃Lƒƒƒ“ƒZƒ‹
cancelSkip();
// pflags -> flags
(Dictionary.assignStruct incontextof flags)(pflags);
// žxŠÇ—ŠÖ˜A
storeLabelPassed = true;
nextRecordHistory = false;
stablePosibility = false;
// ƒRƒ“ƒ_ƒNƒ^
currentRecordName = "";
mainConductor.restore(pcflags.mainConductor);
extraConductor.clear();
setConductorToMain();
// “Ç‚Ýž‚Ý
internalRestoreFlags(pcflags);
// ƒƒjƒ…[ŠÖ˜A
setMenuAccessibleAll();
// ŽÀsŠJŽn
processGo();
}
function clearVariables()
{
// ƒQ[ƒ€•Ï”‚̃NƒŠƒA
(Dictionary.clear incontextof flags)();
}
//--------------------------------------------------------- ’ʉߋL˜^ŠÇ— --
function pushHistoryOfStore()
{
// ’ʉߋL˜^‚ðs‚¤
// pflags, pcflags ‚Éî•ñ‚ðŠi”[‚µ‚½Œã‚ɌĂԂ±‚Æ
if(nextRecordHistory)
{
if(stablePosibility)
{
// stablePosibility ‚ª false ‚ÌꇂÍA
// ‚»‚±‚̃‰ƒxƒ‹‚ŒʉߋL˜^‚ðs‚Á‚Ä‚à
// ‚»‚±‚æ‚è‚à‘O‚É–ß‚é‚·‚ׂª‚È‚¢‚̂ŒʉߋL˜^‚ð‚µ‚È‚¢
// Ž«‘”z—ñ‚ðì¬
var dic = %[];
// user ‚Æ core ‚ð‹L˜^
dic.user = %[];
(Dictionary.assignStruct incontextof dic.user)(pflags);
dic.core = %[];
(Dictionary.assignStruct incontextof dic.core)(pcflags);
// dic ‚ð historyOfStore ‚Ì擪‚É‘}“ü
historyOfStore.insert(0, dic);
// ‚Í‚Ýo‚½•ª‚ðíœ
if(historyOfStore.count > maxHistoryOfStore)
historyOfStore.count = maxHistoryOfStore;
}
nextRecordHistory = false;
}
}
function setToRecordHistory()
{
// ŽŸ‚Ìu•Û‘¶‰Â”\‚ȃ‰ƒxƒ‹v’ʉߎž‚É
// ’ʉߋL˜^‚ðs‚¤‚悤‚ÉÝ’è‚·‚é
// ( ‚½‚¾‚µA‚»‚Ì‚Æ‚«‚É‹L˜^‚³‚ê‚é‚Ì‚ÍAŒ»Ý‚Ìó‘Ô )
nextRecordHistory = true;
}
function isHistoryOfStoreAlive()
{
// ’ʉߋL˜^‚ª—˜—p‰Â”\‚©‚Ç‚¤‚©‚ð•Ô‚·
return historyOfStore.count;
}
function goBackHistory(ask = true)
{
// ’ʉߋL˜^‚ð‚½‚Ç‚èA–ß‚é
if(!isHistoryOfStoreAlive())
return false;
var result;
if(ask)
{
var prompt = "u"+ historyOfStore[0].core.currentPageName + "v‚Ü‚Å–ß‚è‚Ü‚·‚©?";
result = askYesNo(prompt);
}
else
{
result = true;
}
if(result)
{
// user ‚Æ core ‚ð pflags, pcflags ‚É–ß‚·
(Dictionary.assignStruct incontextof pflags)(historyOfStore[0].user);
(Dictionary.assignStruct incontextof pcflags)(historyOfStore[0].core);
// ‹L˜^‚Ì擪‚ð휂·‚é
historyOfStore.erase(0);
// ƒf[ƒ^‚ðŒ³‚ÉAžx‚ð‚½‚Ç‚é“®ì‚ð‚·‚é
restoreFlags();
return true;
}
return false;
}
//--------------------------------------------------------------- žxŠÇ— --
function createBookMarkSubMenus()
{
// užx‚ð‚½‚Ç‚évužx‚ð‚Í‚³‚ÞvˆÈ‰º‚ɃTƒuƒƒjƒ…[€–Ú‚ð’ljÁ
if(freeSaveDataMode) return; // ƒtƒŠ[ƒZ[ƒuƒ‚[ƒh‚Å‚Í‚È‚É‚à‚µ‚È‚¢
if(typeof this.storeMenu !== "undefined" && storeMenu.visible)
{
for(var i = 0; i<numBookMarks; i++)
{
var item;
storeMenu.add(item = new KAGMenuItem(this, string i, 0, onBookMarkStore,
false));
item.bmNum = i;
item.orgEnabled = false;
}
}
if(typeof this.restoreMenu !== "undefined" && restoreMenu.visible)
{
for(var i = 0; i<numBookMarks; i++)
{
var item;
restoreMenu.add(item = new KAGMenuItem(this, string i, 0, onBookMarkRestore,
false));
item.bmNum = i;
item.orgEnabled = false;
}
}
}
function setBookMarkMenuCaptions()
{
// užx‚ð‚½‚Ç‚évužx‚ð‚Í‚³‚ÞvˆÈ‰º‚̃Tƒuƒƒjƒ…[‚É
// ƒLƒƒƒvƒVƒ‡ƒ“‚ðÝ’è
// žx‚ð‹²‚Þ
if(typeof this.storeMenu !== "undefined")
{
var children = storeMenu.children;
for(var i = children.count - 1; i >= 0; i--)
{
if(bookMarkDates != '') // ‹ó•¶Žš—ñ‚Ìꇂ͞x‚ª‚È‚¢‚Æ‚¢‚¤‚±‚Æ
{
// žx‚ª‘¶Ý‚·‚é
var caption;
if(showBookMarkDate) caption = bookMarkDates + " ";
caption += bookMarkNames;
var item = children;
item.caption = caption;
item.enabled = false;
item.orgEnabled = !bookMarkProtectedStates;
}
else
{
// žx‚ª‘¶Ý‚µ‚È‚¢
var item = children;
item.caption = "(None)";
item.enabled = false;
item.orgEnabled = !bookMarkProtectedStates;
}
}
}
// žx‚ð‚½‚Ç‚é
if(typeof this.restoreMenu !== "undefined")
{
var children = restoreMenu.children;
for(var i = children.count - 1; i >= 0; i--)
{
if(bookMarkDates != '') // ‹ó•¶Žš—ñ‚Ìꇂ͞x‚ª‚È‚¢‚Æ‚¢‚¤‚±‚Æ
{
// žx‚ª‘¶Ý‚·‚é
var caption;
if(showBookMarkDate) caption = bookMarkDates + " ";
caption += bookMarkNames;
var item = restoreMenu.children;
item.caption = caption;
item.enabled = false;
item.orgEnabled = true;
}
else
{
var item = restoreMenu.children;
item.caption = "(None)";
item.enabled = false;
item.orgEnabled = false;
}
}
}
setMenuAccessibleAll();
}
function setBookMarkProtectedState(num, s)
{
// n ”Ô‚Ìžx‚Ì•ÛŒìƒtƒ‰ƒO‚ðÝ’è‚·‚é
// s = true ‚È‚ç‚Ξx‚É‘‚«ž‚Ý•ÛŒì‚ð‚·‚é
bookMarkProtectedStates[num] = s;
setBookMarkMenuCaptions();
}
function onBookMarkStore(sender)
{
// žx‚ð‚Í‚³‚Þƒƒjƒ…[‚ª‘I‘ð‚³‚ê‚½
// if(!sender.parent.accessEnabled) return;
saveBookMarkWithAsk(sender.bmNum);
}
function onBookMarkRestore(sender)
{
// žx‚ð‚½‚Ç‚éƒƒjƒ…[‚ª‘I‘ð‚³‚ê‚½
// if(!sender.parent.accessEnabled) return;
loadBookMarkWithAsk(sender.bmNum);
}
function getBookMarkPageName(num)
{
// žx”Ô† num ‚̃uƒbƒNƒ}[ƒN–¼‚𓾂é
if(bookMarkDates[num] != '') // ‹ó•¶Žš—ñ‚Ìꇂ͞x‚ª‚È‚¢‚Æ‚¢‚¤‚±‚Æ
return bookMarkNames[num];
return "(None)";
}
function getBookMarkDate(num)
{
// žx”Ô† num ‚Ì“ú•t‚𓾂é
return bookMarkDates[num];
}
function getBookMarkFileNameAtNum(num)
{
if(num >= 999) // 999 ”ÔˆÈ~‚Í“ÁŽê‚ȃf[ƒ^‚É—p‚¢‚é‚Ì‚Å
return saveDataLocation + "/" + dataName + num + ".ksd";
else
return saveDataLocation + "/" + dataName + num + (saveThumbnail?".bmp":".kdt");
}
function lockSnapshot()
{
// ƒXƒiƒbƒvƒVƒ‡ƒbƒg‚ðƒƒbƒN‚·‚é
// ‰‚߂ăXƒiƒbƒvƒVƒ‡ƒbƒg‚ªƒƒbƒN‚³‚ꂽŽž“_‚ł̉æ–Ê‚ð•Û‘¶‚·‚é
if(snapshotLockCount == 0)
{
if(snapshotLayer === void)
snapshotLayer = new Layer(this, primaryLayer);
snapshotLayer.setImageSize(scWidth, scHeight);
snapshotLayer.face = dfAlpha;
snapshotLayer.piledCopy(0, 0, kag.fore.base, 0, 0, scWidth, scHeight);
}
snapshotLockCount ++;
}
function unlockSnapshot()
{
// ƒXƒiƒbƒvƒVƒ‡ƒbƒg‚̃ƒbƒN‚ð‰ðœ‚·‚é
if(snapshotLockCount == 0)
throw new Exception("snapshotLockCount ‚ªƒAƒ“ƒ_[ƒtƒ[‚µ‚Ü‚µ‚½");
snapshotLockCount --;
if(snapshotLockCount == 0)
{
if(snapshotLayer !== void)
invalidate snapshotLayer, snapshotLayer = void;
}
}
function calcThumbnailSize()
{
// ƒTƒ€ƒlƒCƒ‹‚̃TƒCƒY‚ðŒvŽZ‚·‚é
// ‰¡•‚Í 133 ‚É
var ratio = scHeight / scWidth;
var w = thumbnailWidth;
var h = (int)(w * ratio);
// ƒTƒ€ƒlƒCƒ‹—pƒrƒbƒgƒ}ƒbƒv‚̃TƒCƒY‚ðŒvŽZ
// ƒTƒ€ƒlƒCƒ‹—p‰æ‘œ‚Í 256 F BMP ‚Ü‚½‚Í 24bit ƒtƒ‹ƒJƒ‰[ BMP
var size;
if (thumbnailDepth == 8)
size = ((((w - 1) >> 2) + 1) << 2) * h + 1024 + 54;
else
size = (((w * 3 + 3) >> 2) << 2) * h + 54;
return %[width : w, height : h, size : size];
}
function freeSnapshot()
{
// ƒXƒiƒbƒvƒVƒ‡ƒbƒg‚ð‹§“I‚É”jŠü‚µAsnapshotLockCount ‚ð 0 ‚ÉÝ’è‚·‚é
snapshotLockCount = 0;
if(snapshotLayer !== void)
invalidate snapshotLayer, snapshotLayer = void;
}
function saveBookMarkToFile(fn, savehist = true)
{
// ƒtƒ@ƒCƒ‹ fn ‚Éžx‚ð•Û‘¶‚·‚é
if(readOnlyMode) return false;
pcflags.storeTime = (new Date()).getTime(); // “ú•t‚ð•Û‘¶
// ƒZ[ƒuƒf[ƒ^‚ð‚Ü‚Æ‚ß‚é
var data = %[];
data.id = saveDataID;
data.core = pcflags;
data.user = pflags;
if(savehist) data.history = historyOfStore;
if(saveThumbnail)
{
// ƒTƒ€ƒlƒCƒ‹‚ð•Û‘¶
lockSnapshot();
try
{
// ƒTƒ€ƒlƒCƒ‹‚̃TƒCƒY‚Ü‚Åk¬
var size = calcThumbnailSize();
var tmp = new Layer(this, primaryLayer);
try
{
tmp.setImageSize(size.width, size.height);
tmp.face = dfAlpha;
tmp.stretchCopy(0, 0, size.width, size.height, snapshotLayer,
0, 0, snapshotLayer.imageWidth, snapshotLayer.imageHeight, stLinear);
/*
// ƒTƒ€ƒlƒCƒ‹‰æ‘œ‚ðƒZƒsƒA’²‚É‚µ‚Ä•Û‘¶‚·‚éꇂ̓Rƒƒ“ƒgƒAƒEƒg‚ð‰ðœ
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
*/
try
{
// ƒTƒ€ƒlƒCƒ‹‚ð•Û‘¶
tmp.saveLayerImage(fn, "bmp" + thumbnailDepth);
// ƒf[ƒ^‚ð•Û‘¶
var mode = saveDataMode;
mode += "o" + size.size; // ƒ‚[ƒh•¶Žš—ñ‚É ‘‚«ž‚݃IƒtƒZƒbƒg‚ðŽw’è
(Dictionary.saveStruct incontextof data)(fn, mode);
}
catch(e)
{
invalidate tmp;
unlockSnapshot();
System.inform("File Does not Exist (Can't Open FileA"
"Overwriting Locked)");
return false;
}
}
catch(e)
{
invalidate tmp;
throw e;
}
invalidate tmp;
}
catch(e)
{
unlockSnapshot();
throw e;
}
unlockSnapshot();
}
else
{
// ’Êí‚̃tƒ@ƒCƒ‹‚É•Û‘¶
try
{
(Dictionary.saveStruct incontextof data)(fn, saveDataMode);
}
catch(e)
{
System.inform("File Does Not Exist (Can't Open FileA"
"Overwriting Locked)");
return false;
}
}
return true;
}
function saveBookMark(num, savehist = true)
{
// žx”Ô† num ‚Éžx‚ð•Û‘¶‚·‚é
if(readOnlyMode) return false;
if(bookMarkProtectedStates[num]) return false;
var ret = saveBookMarkToFile(getBookMarkFileNameAtNum(num), savehist);
if(ret)
{
// ƒƒjƒ…[ / bookMarkNames / bookMarkDates ‚ðXV
getBookMarkInfoFromData(pcflags, num);
}
return ret;
}
function getBookMarkInfoFromData(dic, num)
{
// Ž«‘”z—ñ dic ‚©‚çžx‚̃y[ƒW–¼‚Æ“ú•t‚ð“Ç‚Ýo‚µA
// bookMarkDates[num] ‚â bookMarkNames[num] ‚ÉÝ’è‚·‚é
if(num < numBookMarks)
{
bookMarkNames[num] = dic.currentPageName;
var date = new Date();
date.setTime(dic.storeTime);
date = "%04d/%02d/%02d %02d:%02d".sprintf(
date.getYear(), date.getMonth() + 1, date.getDate(),
date.getHours(), date.getMinutes() );
bookMarkDates[num] = date;
setBookMarkMenuCaptions();
saveSystemVariables();
}
}
function loadBookMarkFromFile(fn, loaduser = true)
{
// ƒtƒ@ƒCƒ‹ fn ‚©‚çžx‚ð“Ç‚Ýž‚Þ
// loaduser ‚ª false ‚ÌŽž‚Í user ‚ð“Ç‚Ýž‚Ü‚È‚¢
try
{
if(!Storages.isExistentStorage(fn)) return false; //ƒtƒ@ƒCƒ‹‚ª‚È‚¢
var data;
var modestr;
if(saveThumbnail)
{
// Žw’èƒIƒtƒZƒbƒg‚©‚çƒf[ƒ^‚ð“Ç‚Ýž‚Þ
modestr += "o" + calcThumbnailSize().size;
}
data = Scripts.evalStorage(fn, modestr);
if(data.id != saveDataID)
{
System.inform("Try to Load Other System Data", "Error");
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)
{
System.inform("Save cannot be read, the save"
"May be corrupted or have another form"
"(" + e.message + ")", "Error");
return false;
}
restoreFlags();
return true;
}
function loadBookMark(num, loaduser = true)
{
// žx”Ô† num ‚©‚çƒf[ƒ^‚ð“Ç‚Ýo‚·
return loadBookMarkFromFile(getBookMarkFileNameAtNum(num), loaduser);
}
function saveBookMarkWithAsk(num)
{
// žx”Ô† num ‚Éžx‚ðÝ’è‚·‚é
// ‚»‚Ì‚Æ‚«AÝ’è‚·‚é‚©‚Ç‚¤‚©‚ð‚½‚¸‚Ë‚é
if(readOnlyMode) return false;
if(bookMarkProtectedStates[num]) return false;
var prompt = "OverWrite Save ";
if(num < numBookMarks) prompt += (num + 1);
if(bookMarkDates[num] != "") // bookMarkDates ‚ª‹ó•¶Žš‚Ìꇂ͞x‚Í‘¶Ý‚µ‚È‚¢
prompt += "u" + bookMarkNames[num] + "v";
prompt += "and replace withu"+ pcflags.currentPageName + "v?";
var result = askYesNo(prompt);
if(result) return saveBookMark(num);
return false;
}
function loadBookMarkWithAsk(num)
{
// žx”Ô† num ‚©‚çžx‚ð“Ç‚Ýo‚·
// ‚»‚Ì‚Æ‚«A“Ç‚Ýo‚·‚©‚Ç‚¤‚©‚ð‚½‚¸‚Ë‚é
if(num < numBookMarks && bookMarkDates[num] == "") // bookMarkDates ‚ª‹ó•¶Žš‚Ìꇂ͞x‚Í‘¶Ý‚µ‚È‚¢
return false;
var prompt = "Load Save ";
if(num < numBookMarks) prompt += (num + 1);
prompt += "u"+ bookMarkNames[num] + "v?";
var result = askYesNo(prompt);
if(result) return loadBookMark(num);
return false;
}
function saveBookMarkToFileWithAsk()
{
// ”CˆÓ‚̃tƒ@ƒCƒ‹‚Éžx‚ð•Û‘¶‚·‚é
// currentPageName ‚ðƒtƒ@ƒCƒ‹–¼‚Æ‚µ‚Ä“K‡‚·‚é‚悤‚É
// •ÏŒ`‚·‚é
var invalid = "\\/:,;*?\"<>!.";
var valid = "^FCG–Hhƒ„ID";
var initialname = saveDataLocation + "/";
var through = false;
var orgname = currentPageName;
if(lastSaveDataNameGlobal != "")
{
try
{
initialname = Storages.extractStoragePath(lastSaveDataNameGlobal);
}
catch(e)
{
initialname = saveDataLocation + "/";
}
}
if(orgname == "")
{
// žx‚ÌŒ©o‚µ‚ª‚È‚¢‚Ì‚Å
if(lastSaveDataName == "")
orgname = System.title; // System.title ‚ð‘ã‚í‚è‚ÉŽg‚¤
else
initialname = lastSaveDataName, through = true;
}
if(!through)
{
var length = orgname.length;
for(var i = 0; i < length; i++)
{
var ch = orgname;
var ind = invalid.indexOf(ch);
if(ind != -1)
initialname += valid[ind];
else if(#ch >= 32)
initialname += ch;
}
}
// •Û‘¶‚·‚éƒtƒ@ƒCƒ‹–¼‚𓾂é
var selectdata = %[
title:"žx‚ð‚Í‚³‚Þ",
filter: [saveThumbnail ?
"ƒTƒ€ƒlƒCƒ‹‰æ‘œ•t‚«žxƒf[ƒ^(*.bmp)|*.bmp" :
"žxƒf[ƒ^(*.kdt)|*.kdt"],
filterIndex : 1,
name : initialname,
initialDir : "",
defaultExt : saveThumbnail?"bmp":"kdt",
save : true,
];
if(Storages.selectFile(selectdata))
{
// •Û‘¶
saveBookMarkToFile(lastSaveDataName = lastSaveDataNameGlobal = selectdata.name);
lastSaveDataName = Storages.chopStorageExt(lastSaveDataName);
}
}
function loadBookMarkFromFileWithAsk()
{
// ”CˆÓ‚̃tƒ@ƒCƒ‹‚©‚çžx‚ð“Ç‚Ýž‚Þ
var initialdir = "";
if(lastSaveDataNameGlobal == "")
initialdir = saveDataLocation + "/";
var selectdata = %[
title:"žx‚ð‚½‚Ç‚é",
filter: [saveThumbnail ?
"ƒTƒ€ƒlƒCƒ‹‰æ‘œ•t‚«žxƒf[ƒ^(*.bmp)|*.bmp" :
"žxƒf[ƒ^(*.kdt)|*.kdt"],
filterIndex : 1,
name : lastSaveDataNameGlobal,
initialDir : initialdir,
defaultExt : saveThumbnail?"bmp":"kdt",
save : false,
];
if(Storages.selectFile(selectdata))
{
loadBookMarkFromFile(lastSaveDataName = lastSaveDataNameGlobal = selectdata.name);
lastSaveDataName = Storages.chopStorageExt(lastSaveDataName);
}
}
function copyBookMark(from, to)
{
// žx”Ô† from ‚©‚çžx”Ô† to ‚Éžx‚ðƒRƒs[‚·‚é
if(readOnlyMode) return false;
if(bookMarkProtectedStates[to]) return;
var fn = getBookMarkFileNameAtNum(from);
if(!Storages.isExistentStorage(fn)) return; //ƒtƒ@ƒCƒ‹‚ª‚È‚¢
var data = Scripts.evalStorage(fn);
fn = getBookMarkFileNameAtNum(to);
(Dictionary.saveStruct incontextof data)(fn, saveDataMode);
getBookMarkInfoFromData(data.core, to);
}
function eraseBookMark(num)
{
// žx‚ðÁ‚·
// num < numBookMarks ‚ÌŽž‚É‚µ‚©“®ì‚µ‚È‚¢‚悤‚É‚È‚Á‚½‚Ì‚Å’ˆÓ
if(num < numBookMarks)
{
if(!bookMarkProtectedStates[num])
{
bookMarkDates[num] = "";
setBookMarkMenuCaptions();
}
}
}
function tempDisableStore(elm)
{
// žx‚ðˆêŽž“I‚É•Û‘¶•s‰Â”\‚É‚·‚é
storeEnabled = true;
if(elm.store === void)
storeLabelPassed = false;
else
storeLabelPassed = !(+elm.store);
if(elm.restore == void)
restoreEnabled = true;
else
restoreEnabled = !(+elm.restore);
setMenuAccessibleAll();
}
function setStoreEnabled(enabled)
{
// žxƒƒjƒ…[‚Ì—LŒø/–³Œø‚ÌÝ’è
storeEnabled = enabled;
restoreEnabled = enabled;
setMenuAccessibleAll();
}
function setStartAnchorEnabled(enabled)
{
// uʼn‚É–ß‚év‚Ì—LŒø/–³Œø‚ÌÝ’è
startAnchorEnabled = enabled;
if(enabled) saveBookMark(999, false); // 999 ”Ô‚É•Û‘¶
setMenuAccessibleAll();
}
function goToStart()
{
// ʼn‚É–ß‚é
if(!startAnchorEnabled) return;
loadBookMark(999, false); // žx‚ð“Ç‚Ýž‚Þ
}
function goToStartWithAsk()
{
// ʼn‚É–ß‚é(Šm”F‚ ‚è)
var result = askYesNo("Return to Title?");
if(result) goToStart();
}
function tempSave(num)
{
// tempBookMarks[num] ‚ÉŒ»Ý‚Ìó‘Ô‚ð•Û‘¶‚·‚é
tempBookMarks[num] = %[];
internalStoreFlags(tempBookMarks[num]);
}
function tempLoad(num, elm)
{
// tempBookMarks[num] ‚©‚çó‘Ô‚ð“Ç‚Ýž‚Þ
internalRestoreFlags(tempBookMarks[num], false, elm);
}
function restoreBookMark(num, ask = true)
{
// KAG 2.x ŒÝŠ·—p
if(ask)
return loadBookMarkWithAsk(num);
else
return loadBookMark(num);
}
function storeBookMark(num, ask = true)
{
// KAG 2.x ŒÝŠ·—p
if(ask)
return saveBookMarkWithAsk(num);
else
return saveBookMark(num);
}
//------------------------------------------------- –¢“Ç/Šù“Ç/ƒ‰ƒxƒ‹‹L˜^ --
function setRecordLabel(storage, label)
{
// Œ»Ý‚̃‰ƒxƒ‹‚ðÝ’è‚·‚é
if(autoRecordPageShowing)
{
if(label != '')
{
if(label[0] == '*') label = label.substring(1);
if(label[1] == '-') return; // ƒ[ƒJƒ‹ƒ‰ƒxƒ‹
}
currentRecordName = 'trail_' + Storages.chopStorageExt(
Storages.extractStorageName(storage)) + '_' + label;
}
}
function incRecordLabel(count)
{
// sflags[currentRecordName]++
if(autoRecordPageShowing)
{
if(currentRecordName != "")
{
if(count)
{
if(sflags[currentRecordName] === void)
sflags[currentRecordName] = 0;
sflags[currentRecordName]++;
}
currentRecordName = "";
}
}
}
//------------------------------------------- ƒVƒXƒeƒ€‘S‘Ì‚ÉŠÖŒW‚·‚é‚à‚Ì --
function setTitle(title)
{
// ƒ^ƒCƒgƒ‹‚ðÝ’è
if(isMain) System.title = title;
caption = title;
}
function setCursor(elm)
{
// ƒ}ƒEƒXƒJ[ƒ\ƒ‹‚ÌÝ’è
var conv = function(variable, value)
{
if(value !== void)
{
if(!(typeof value == "String" &&
(value.indexOf('.cur')!=-1 || value.indexOf('.ani')!=-1) ))
value = +value;
this[variable] = value;
}
} incontextof this;
conv('cursorDefault', elm['default']);
conv('cursorPointed', elm.pointed);
conv('cursorWaitingClick', elm.click);
conv('cursorDraggable', elm.draggable);
fore.base.setDefaultCursor(cursorDefault);
back.base.setDefaultCursor(cursorDefault);
}
//---------------------------------------------------- ƒgƒŠƒKŠÇ—(TJS—p) --
function waitTrigger(elm)
{
// elm.name ‚ÅŽ¦‚³‚ꂽƒgƒŠƒK‚ð‘Ò‚Â
if((elm.canskip !== void && +elm.canskip) && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv“®ì’†
if(elm.onskip !== void) Scripts.eval(elm.onskip);
return 0; // ‚·‚®‚É•Ô‚é
}
conductor.wait(%[
click : function(arg)
{
if(arg !== void) Scripts.eval(arg);
} incontextof this,
click_arg : elm.onskip,
elm.name => function
{
} incontextof this
]);
}
else
{
conductor.wait(%[
elm.name => function
{
} incontextof this
]);
}
return -2;
}
function trigger(name)
{
// name ‚ÅŽ¦‚µ‚½ƒgƒŠƒK‚𔓮‚·‚é
conductor.trigger(name);
}
//------------------------------------------------------- ƒƒbƒZ[ƒW—š—ð --
function showHistory()
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ð•\Ž¦‚·‚é
historyLayer.parent = fore.base; // ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚Ìe‚àÄÝ’è
historyLayer.absolute = 2000000;
historyLayer.dispInit();
historyShowing = true;
if(typeof this.showHistoryMenuItem != "undefined")
showHistoryMenuItem.checked = true;
setMenuAccessibleAll();
}
function hideHistory()
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ð”ñ•\Ž¦‚É‚·‚é
historyLayer.dispUninit();
historyShowing = false;
if(typeof this.showHistoryMenuItem != "undefined")
showHistoryMenuItem.checked = false;
setMenuAccessibleAll();
lastHistoryHiddenTick = System.getTickCount();
conductor.trigger('history'); // 'history' ‚ð‘—‚é
}
function setHistoryOptions(elm)
{
// elm ‚©‚烃bƒZ[ƒW—š—ðƒŒƒCƒ„‚̃IƒvƒVƒ‡ƒ“‚ðÝ’è‚·‚é
historyWriteEnabled = +elm.output if elm.output !== void;
historyEnabled = +elm.enabled if elm.enabled !== void;
if(elm.enabled !== void && !historyEnabled)
historyLayer.clearAction();
historyLayer.setOptions(elm); // ‚»‚Ì‘¼‚̃IƒvƒVƒ‡ƒ“
setMenuAccessibleAll();
}
function showHistoryByScenario(elm)
{
// ƒƒbƒZ[ƒW—š—ð‚ðƒVƒiƒŠƒI’†‚©‚ç•\Ž¦‚³‚¹‚é
showHistory();
conductor.wait(%[ // ƒRƒ“ƒ_ƒNƒ^‚ð‘Ò‚¿‚É
history : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
return -2; // break
}
//-------------------------------------------------------------- process --
function process(file, label, countpage = true, immediate = false)
{
// Žw’èƒtƒ@ƒCƒ‹AŽw’胉ƒxƒ‹‚©‚çŽÀs‚ðŠJŽn‚·‚é
if(!usingExtraConductor) incRecordLabel(countpage);
setUserSpeed();
if(file != '')
{
// ƒtƒ@ƒCƒ‹‚ð“Ç‚Ýž‚Ý
conductor.loadScenario(file);
}
if(label != '')
{
// ƒ‰ƒxƒ‹‚Ɉړ®‚·‚é
conductor.goToLabel(label);
}
if(isFirstProcess)
{
storeFlags(); // ˆê”Ôʼn‚Ìó‘Ô‚ðƒXƒgƒA
isFirstProcess = false;
}
dm("ˆ—‚ðŠJŽn‚µ‚Ü‚·");
inSleep = false;
notifyRun();
if(conductor.status != conductor.mRun) conductor.run(immediate); // ŽÀsŠJŽn
}
function processGo()
{
// ƒRƒ“ƒ_ƒNƒ^‚ðŒ»ÝˆÊ’u‚©‚çŽÀsŠJŽn‚³‚¹‚é
dm("ˆ—‚ðŠJŽn‚µ‚Ü‚·");
inSleep = false;
notifyRun();
conductor.run(false); // ŽÀsŠJŽn
}
function processCall(file, label)
{
// Žw’èƒtƒ@ƒCƒ‹AŽw’胉ƒxƒ‹‚ðŒÄ‚Ô
// incRecordLabel(); ‚͌Ă΂Ȃ¢‚Ì‚Å’ˆÓ
if(file != '')
{
// ƒtƒ@ƒCƒ‹‚ð“Ç‚Ýž‚Ý
conductor.loadScenario(file);
}
inSleep = false;
notifyRun();
conductor.callLabel(label); // ŽÀsŠJŽn
dm("ˆ—‚ðŠJŽn‚µ‚Ü‚·");
if(conductor.status != conductor.mRun) conductor.run();
}
//------------------------------------------------- ƒRƒ“ƒ_ƒNƒ^‚̃Cƒxƒ“ƒg --
function onConductorScenarioLoad(name)
{
// ƒRƒ“ƒ_ƒNƒ^‚ªV‚µ‚¢ƒVƒiƒŠƒIƒtƒ@ƒCƒ‹‚ð“Ç‚Ýž‚Þ‘O‚É‚æ‚΂ê‚éB
// name ‚Í“Ç‚Ýž‚à‚¤‚Æ‚µ‚½ƒVƒiƒŠƒIƒtƒ@ƒCƒ‹B
// –ß‚è’l‚É•¶Žš—ñ‚ð•Ô‚·‚ÆA‚»‚ê‚ðƒVƒiƒŠƒI‚Æ‚µ‚Ä
// ƒtƒ@ƒCƒ‹‚Ì‘ã‚í‚è‚ÉŽg‚¤‚悤‚É‚È‚é‚Ì‚ÅA‚±‚±‚ɃtƒBƒ‹ƒ^‚ð‘‚‚±
// ‚Æ‚ª‚Å‚«‚éB
// true ‚ð•Ô‚·‚Æ’Êí‚̃VƒiƒŠƒIƒtƒ@ƒCƒ‹“Ç‚Ýž‚Ý‚Æ‚È‚éB
return true;
}
function onConductorScenarioLoaded(name)
{
// ƒRƒ“ƒ_ƒNƒ^‚ªV‚µ‚¢ƒVƒiƒŠƒIƒtƒ@ƒCƒ‹‚ð“Ç‚Ýž‚ñ‚¾
// if(!usingExtraConductor) incRecordLabel(true);
return true;
}
function onConductorLabel(label, page)
{
// ƒRƒ“ƒ_ƒNƒ^‚ªƒ‰ƒxƒ‹‚ð’ʉ߂µ‚½
if(!usingExtraConductor)
{
incRecordLabel(true);
setRecordLabel(conductor.curStorage, label);
}
setUserSpeed();
if(!usingExtraConductor)
{
if(!getCurrentRead() && skipMode != 4)
cancelSkip(); // –¢“ǂȂ̂ŃXƒLƒbƒv‚ð’âŽ~
currentLabel = label;
}
if(page !== void && page !== '')
{
if(page[0] == '&') page = Scripts.eval((page.substring(1)));
currentPageName = page;
}
if(page !== void)
{
pushHistoryOfStore();
stablePosibility = false;
dm(conductor.curStorage + " : ƒ‰ƒxƒ‹/ƒy[ƒW : " + label + "/" + currentPageName);
if(usingExtraConductor) throw new Exception("‰EƒNƒŠƒbƒNƒTƒuƒ‹[ƒ`ƒ““à/extraCondutor"
"ƒTƒuƒ‹[ƒ`ƒ““à‚Å‚Í•Û‘¶‰Â”\‚ȃ‰ƒxƒ‹‚ð‹Lq‚Å‚«‚Ü‚¹‚ñ");
storeFlags(), storeLabelPassed = true, setMenuAccessibleAll();
if(recordHistoryOfStore == 1) // 1 : •Û‘¶‰Â”\‚ȃ‰ƒxƒ‹‚²‚Æ
setToRecordHistory();
}
return true;
}
function onConductorJump(elm)
{
// ƒRƒ“ƒ_ƒNƒ^‚Å jump ƒ^ƒO‚ðˆ—‚·‚é‚Æ‚«
if(!usingExtraConductor) incRecordLabel(elm.countpage === void || +elm.countpage);
return true;
}
function onConductorCall(elm)
{
// ƒRƒ“ƒ_ƒNƒ^‚ª call ƒ^ƒO‚ðˆ—‚·‚é‚Æ‚«
if(!usingExtraConductor) incRecordLabel(elm.countpage !== void && +elm.countpage);
return true;
}
function onConductorReturn(elm)
{
// ƒRƒ“ƒ_ƒNƒ^‚ª return ƒ^ƒO‚ðˆ—‚·‚é‚Æ‚«
if(!usingExtraConductor) incRecordLabel(elm.countpage === void || +elm.countpage);
if(conductor === extraConductor)
{
// extraConductor ƒTƒuƒ‹[ƒ`ƒ“—p‚̃Rƒ“ƒ_ƒNƒ^‚©‚çŒÄ‚΂ê‚Ä‚¢‚é
if(conductor.callStackDepth == 1)
{
// ‚‚܂èAÅI‚Ì return ‚ªŽÀs‚³‚ꂽ‚ÆŒ¾‚¤‚±‚Æ
dm("extraConductor ƒTƒuƒ‹[ƒ`ƒ“‚©‚ç–ß‚è‚Ü‚· ...");
var run;
if(elm.storage !== void || elm.target !== void) run = true; else run = false;
returnExtraConductor(run);
if(elm.storage !== void) conductor.loadScenario(elm.storage);
if(elm.target !== void) conductor.goToLabel(elm.target);
setRecordLabel(conductor.curStorage, currentLabel = conductor.curLabel);
if(run)
{
notifyRun();
conductor.run();
}
isLeavePeriodEvent = false;
if(elm.storage !== void || elm.target !== void)
{ // return‚ÅŒ³‚̈ʒuˆÈŠO‚ɖ߂鎞‚̓sƒŠƒIƒhƒCƒxƒ“ƒg‚ðƒNƒŠƒA‚·‚éB
holdPeriodEventQueue.clear();
isWaitPeriodEvent = false;
}
if( isWaitPeriodEvent == true )
{ // [wp]‚ŃsƒŠƒIƒhƒCƒxƒ“ƒg‘Ò‚¿‚ð‚µ‚Ä‚¢‚鎞‚Ì‚ÝAƒgƒŠƒK[‚·‚é
fireMoviePeriodFromQueue();
}
return false; // return ‚ÍŽÀs‚µ‚È‚¢
}
}
return true;
}
function purgeMoviePeriod()
{
isLeavePeriodEvent = false;
holdPeriodEventQueue.clear();
isWaitPeriodEvent = false;
waitedPeriodEventStorageName = void;
}
function fireMoviePeriodFromQueue()
{
var retVal = false;
if( holdPeriodEventQueue.count > 0 )
{
if( waitedPeriodEventStorageName == conductor.curStorage && conductor == mainConductor )
{
for( var i = 0; i < holdPeriodEventQueue.count; i++ )
{
conductor.trigger( holdPeriodEventQueue );
retVal = true;
}
}
holdPeriodEventQueue.clear();
}
return retVal;
}
function onConductorAfterReturn()
{
// ƒRƒ“ƒ_ƒNƒ^‚ª return ƒ^ƒO‚ðŽÀs‚µ‚½Œã
if(!usingExtraConductor)
{
setRecordLabel(conductor.curStorage, currentLabel = conductor.curLabel);
}
setUserSpeed();
if(!usingExtraConductor)
{
if(!getCurrentRead() && skipMode != 4)
cancelSkip(); // –¢“ǂȂ̂ŃXƒLƒbƒv‚ð’âŽ~
}
}
function onConductorScript(script, scriptname, lineofs)
{
// iscript ƒ^ƒO
try
{
Scripts.exec(script, scriptname, lineofs);
}
catch(e)
{
throw new Exception(scriptname + " ‚Ì s " + lineofs + " ‚©‚çŽn‚Ü‚é"
" iscript ƒuƒƒbƒN‚ŃGƒ‰[‚ª”¶‚µ‚Ü‚µ‚½B"
"\n( Úׂ̓Rƒ“ƒ\[ƒ‹‚ðŽQÆ‚µ‚Ä‚‚¾‚³‚¢ )\n" + e.message);
}
return true;
}
function onConductorUnknownTag(tagname, elm)
{
// •s–¾‚ȃ^ƒO‚ª‚ ‚Á‚½ê‡
throw new Exception("ƒ^ƒO/ƒ}ƒNƒ \"" + tagname + "\" ‚Í‘¶Ý‚µ‚Ü‚¹‚ñ");
return 0; // ‚±‚Ì–ß‚è’l‚ÍAŠeƒ^ƒOƒnƒ“ƒhƒ‰‚ª•Ô‚·•¨‚Æ‚¨‚È‚¶
}
//----------------------------------------------------------- stable/run --
function notifyStable()
{
// ƒVƒXƒeƒ€‚ªˆÀ’è(ƒNƒŠƒbƒN‘Ò‚¿/’âŽ~)‚µ‚½‚Æ‚«‚ÉAƒnƒ“ƒhƒ‰‚ðŒÄ‚Ô
if(!inStable)
{
inStable = true;
var handlers = stableHandlers;
for(var i = handlers.count-1; i>=0; i--)
handlers();
// stableHook
forEachEventHook('onStableStateChanged',
function(handler, f) { handler(f.stable); } incontextof this,
%[stable:true]);
}
}
function notifyRun()
{
// ƒVƒXƒeƒ€‚ª‘–‚èŽn‚ß‚½‚Æ‚«‚ÉAƒnƒ“ƒhƒ‰‚ðŒÄ‚Ô
if(inStable)
{
inStable = false;
var handlers = runHandlers;
for(var i = handlers.count-1; i>=0; i--)
handlers();
// runHook
forEachEventHook('onStableStateChanged',
function(handler, f) { handler(f.stable); } incontextof this,
%[stable:false]);
if(autoMode) hideMouseCursor();
}
}
function defaultStableHandler()
{
// ƒfƒtƒHƒ‹ƒg‚Ì stable ƒnƒ“ƒhƒ‰
setMenuAccessibleAll();
}
function defaultRunHandler()
{
// ƒfƒtƒHƒ‹ƒg‚Ì run ƒnƒ“ƒhƒ‰
hideHistory();
hideClickGlyphs();
showMessageLayerByUser();
setMenuAccessibleAll();
}
//----------------------------------------------------------- •¶Žš—ñ“ü—Í --
var inputTemp;
function inputString(elm)
{
// •¶Žš—ñ‚ð“ü—Í‚·‚é
var name = elm.name;
var initial = Scripts.eval(name);
var res = System.inputString(elm.title, elm.prompt, initial);
if(res !== void)
{
// name ‚É res ‚ð‘ã“ü‚·‚é
inputTemp = res;
Scripts.eval(("(" + name + ") = kag.inputTemp"));
}
}
//-------------------------------------------------- extraConductor ˆ— --
function callExtraConductor(storage, label, onreturn)
{
// extraConductor ‚ðŽg‚Á‚ăTƒuƒ‹[ƒ`ƒ“‚ðŒÄ‚Ño‚·
onExtraConductorReturn = onreturn;
inSleepBeforeExtraConductor = inSleep; // inSleep •Û‘¶
storeMessageLayerSelProcessLock(); // ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ì storeSelProcessLock ‚ðŒÄ‚Ô
conductor = extraConductor; // ƒRƒ“ƒ_ƒNƒ^‚ðØ‚è‘Ö‚¦‚é
(Dictionary.assign incontextof extraConductor.macros)(mainConductor.macros);
// ƒ}ƒNƒ‚̓Rƒs[
usingExtraConductor = true;
if(storage == '')
{
// ƒXƒgƒŒ[ƒWŽw’肪‚È‚¢‚Ì‚ÅŒ»Ý‚̃XƒgƒŒ[ƒW‚ð“Ç‚Ýž‚Ü‚¹‚é
storage = mainConductor.curStorage;
}
// ŒÄ‚Ño‚·
conductor.clearCallStack();
processCall(storage, label);
}
function returnExtraConductor(run)
{
// extraConductor ‚̃Tƒuƒ‹[ƒ`ƒ“‚©‚ç–ß‚é
// run ‚ª true ‚Ìê‡‚Í ‘Ò‹@ó‘Ô‚Ì•œ‹A‚Ís‚í‚È‚¢
conductor.sleep(); // ’âŽ~
conductor.interrupt();
// interrupt ‚Í ƒRƒ“ƒ_ƒNƒ^‚̃Cƒxƒ“ƒg“à‚ŃRƒ“ƒ_ƒNƒ^‚ÌŽÀs‚ð
// ’âŽ~‚³‚¹‚邽‚߂̃ƒ\ƒbƒh
conductor = mainConductor; // ƒRƒ“ƒ_ƒNƒ^‚ðØ‚è‘Ö‚¦
(Dictionary.assign incontextof mainConductor.macros)(extraConductor.macros);
// ƒ}ƒNƒ‚̓Rƒs[
usingExtraConductor = false;
if(!run)
{ restoreClickGlyphState(); // ƒNƒŠƒbƒN‘Ò‚¿‹L†‚Ì•œ‹A
inSleep = inSleepBeforeExtraConductor; // inSleep •œ‹A
notifyStable();
}
restoreMessageLayerSelProcessLock(); // ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ì restoreSelProcessLock ‚ðŒÄ‚Ô
setMenuAccessibleAll();
cancelSkip();
if(onExtraConductorReturn !== void) onExtraConductorReturn();
}
//------------------------------------------------------- ‰EƒNƒŠƒbƒNˆ— --
function setRightClickOptions(elm)
{
// ‰EƒNƒŠƒbƒN‚̃IƒvƒVƒ‡ƒ“‚ðÝ’è‚·‚é
rightClickEnabled = +elm.enabled if elm.enabled !== void;
if(elm.call !== void)
{
rightClickCall = +elm.call;
if(rightClickCall) rightClickJump = false;
}
if(elm.jump !== void)
{
rightClickJump = +elm.jump;
if(rightClickJump) rightClickCall = false;
}
rightClickTarget = elm.target if elm.target !== void;
rightClickStorage = elm.storage if elm.storage !== void;
if(elm.name !== void)
{
if(typeof this.rightClickMenuItem != "undefined")
{
rightClickName = elm.name;
if(rightClickName == "default")
rightClickMenuItem.caption = rightClickCurrentMenuName = rightClickDefaultName;
else
rightClickMenuItem.caption = rightClickCurrentMenuName = rightClickName;
}
}
}
function callRightClickSubRoutine()
{
isLeavePeriodEvent = true;
// ‰EƒNƒŠƒbƒNƒTƒuƒ‹[ƒ`ƒ“‚ðŒÄ‚Ô
if(typeof this.rightClickMenuItem != "undefined")
{
rightClickMenuItem.caption = rightClickCurrentMenuName = rightClickDefaultName;
}
callExtraConductor(rightClickStorage, rightClickTarget, restoreFromRightClick);
lockMessageLayerSelProcess(); // ‘I‘ðŽˆƒƒbƒN
}
function restoreFromRightClick()
{
// ‰EƒNƒŠƒbƒNƒTƒuƒ‹[ƒ`ƒ“‚©‚甲‚¯‚é‚Æ‚«‚ɌĂ΂ê‚é
if(typeof this.rightClickMenuItem != "undefined")
{
if(rightClickName == "default")
rightClickMenuItem.caption = rightClickCurrentMenuName = rightClickDefaultName;
else
rightClickMenuItem.caption = rightClickCurrentMenuName = rightClickName;
}
}
function setConductorToMain()
{
// restore ‚ÌŽž‚ɌĂ΂êAƒRƒ“ƒ_ƒNƒ^‚ð main ‚ÉØ‚è‘Ö‚¦‚é
if(usingExtraConductor)
{
extraConductor.sleep();
extraConductor.interrupt();
conductor= mainConductor;
usingExtraConductor = false;
}
}
function jumpToRightClickTarget()
{
process(rightClickStorage, rightClickTarget);
}
function onPrimaryRightClick()
{
// ƒvƒ‰ƒCƒ}ƒŠƒŒƒCƒ„‚ʼnEƒNƒŠƒbƒN‚³‚ꂽ‚Æ‚«‚ɌĂ΂ê‚é
if(!callHook(rightClickHook))
{
if(getKeyState(VK_LBUTTON))
{
enterAutoMode();
return;
}
if(!rightClickEnabled) return;
if(inStable)
{
if(rightClickJump)
jumpToRightClickTarget();
else if(rightClickCall && conductor == mainConductor)
callRightClickSubRoutine();
else
switchMessageLayerHiddenByUser();
}
setMenuAccessibleAll();
}
}
//------------------------------------------------------- ‘OŒiƒŒƒCƒ„ˆ— --
function allocateCharacterLayers(num)
{
// ‘OŒiƒŒƒCƒ„”‚ð num ‚ÉÝ’è‚·‚é
if(fore.layers.count > num)
{
// ƒŒƒCƒ„‚ªŒ¸‚é
for(var i = num; i<fore.layers.count; i++)
{
invalidate fore.layers;
invalidate back.layers;
}
fore.layers.count = num;
back.layers.count = num;
}
else if(fore.layers.count < num)
{
// ƒŒƒCƒ„‚ª‘‚¦‚é
for(var i = fore.layers.count; i<num; i++)
{
fore.layers = new CharacterLayer(this, fore.base, "•\‘OŒiƒŒƒCƒ„" + i, i);
back.layers = new CharacterLayer(this, back.base, "— ‘OŒiƒŒƒCƒ„" + i, i);
fore.layers.setCompLayer(back.layers);
back.layers.setCompLayer(fore.layers);
}
reorderLayers();
}
numCharacterLayers = num;
}
//------------------------------------------------- ƒƒbƒZ[ƒWƒŒƒCƒ„ˆ— --
function allocateMessageLayers(num, setdefaultfont = true)
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„”‚ð num ‚ÉÝ’è‚·‚é
if(fore.messages.count > num)
{
// ƒŒƒCƒ„‚ªŒ¸‚é
for(var i = num; i<fore.messages.count; i++)
{
if(current == fore.messages || current == back.messages)
current = fore.messages[0], currentNum = 0, currentPage = 0;
invalidate fore.messages;
invalidate back.messages;
}
fore.messages.count = num;
back.messages.count = num;
}
else if(fore.messages.count < num)
{
// ƒŒƒCƒ„‚ª‘‚¦‚é
for(var i = fore.messages.count; i<num; i++)
{
fore.messages = new MessageLayer(this, fore.base, "•\ƒƒbƒZ[ƒWƒŒƒCƒ„" + i, i, true);
back.messages = new MessageLayer(this, back.base, "— ƒƒbƒZ[ƒWƒŒƒCƒ„" + i, i, true);
fore.messages.setCompLayer(back.messages);
back.messages.setCompLayer(fore.messages);
fore.messages.clear();
back.messages.clear();
}
reorderLayers();
if(setdefaultfont) setMessageLayerUserFont();
}
numMessageLayers = num;
}
function setCurrentMessageLayer(elm)
{
// Œ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚ðÝ’è
var page = getMessageLayerPageFromElm(elm);
var num = getMessageLayerNumberFromElm(elm);
currentNum = num;
currentPage = page;
if(page) current = back.messages[num]; else current = fore.messages[num];
currentWithBack = +elm.withback if elm.withback !== void;
}
function setMessageLayerPosition(elm)
{
// Œ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚̈ʒuA‘®«‚ðÝ’è
var layer = getMessageLayerObjectFromElm(elm);
elm.setPosition(elm);
}
function clearMessageLayers(resetcurrent)
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚̃NƒŠƒA
// ct ƒ^ƒO‚©‚çŒÄ‚΂ê‚é
// resetcurrent ‚ª true ‚Ìꇂ͌»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚ð
// •\0‚ÉÝ’è‚·‚é
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--) messages.clear();
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--) messages.clear();
if(resetcurrent)
{
currentNum = 0;
currentPage = 0;
current = fore.messages[0];
currentWithBack = false;
}
}
function lockMessageLayerSelProcess()
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚É ‘I‘ð‚Æprocess‚ð‹ÖŽ~‚³‚¹‚é
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--) messages.setSelProcessLock(true);
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--) messages.setSelProcessLock(true);
}
function unlockMessageLayerSelProcess()
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚Ì‘I‘ð‚ð‹–‰Â‚·‚é
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--) messages.setSelProcessLock(false);
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--) messages.setSelProcessLock(false);
}
function setMessageLayerUserFont()
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚Ì defaultAntialiased ‚Æ
// userFace ‚ðÝ’è‚·‚é
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--)
messages.defaultAntialiased = chDefaultAntialiased,
messages.userFace = chDefaultFace;
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--)
messages.defaultAntialiased = chDefaultAntialiased,
messages.userFace = chDefaultFace;
}
function storeMessageLayerSelProcessLock()
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚Ì storeSelProcessLock ‚ðŒÄ‚Ño‚·
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--) messages.storeSelProcessLock();
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--) messages.storeSelProcessLock();
}
function restoreMessageLayerSelProcessLock()
{
// ‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚Ì restoreSelProcessLock ‚ðŒÄ‚Ño‚·
var messages;
messages = fore.messages;
for(var i = messages.count-1; i >= 0; i--) messages.restoreSelProcessLock();
messages = back.messages;
for(var i = messages.count-1; i >= 0; i--) messages.restoreSelProcessLock();
}
function setMessageLayerHiddenState(b)
{
var layers;
layers = fore.messages;
for(var i = layers.count-1; i >= 0; i--) layers.setHiddenStateByUser(b);
layers = fore.layers;
for(var i = layers.count-1; i >= 0; i--) layers.setHiddenStateByUser(b);
// ƒvƒ‰ƒOƒCƒ“‚ðŒÄ‚Ô
forEachEventHook('onMessageHiddenStateChanged',
function(handler, f) { handler(f.hidden); } incontextof this,
%[hidden:b]);
}
function hideMessageLayerByUser()
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚ðˆêŽž“I‚ɉB‚·
if(messageLayerHiding) return;
setMessageLayerHiddenState(true);
if(typeof this.rightClickMenuItem !== "undefined")
rightClickMenuItem.checked = true;
messageLayerHiding = true;
fore.base.cursor = cursorWaitingClick;
setMenuAccessibleAll();
}
function showMessageLayerByUser()
{
// ˆêŽž“I‚ɉB‚³‚ê‚Ä‚¢‚½ƒƒbƒZ[ƒWƒŒƒCƒ„‚ðŒ³‚É–ß‚·
if(!messageLayerHiding) return;
setMessageLayerHiddenState(false);
if(typeof this.rightClickMenuItem !== "undefined")
rightClickMenuItem.checked = false;
messageLayerHiding = false;
conductor.trigger('message'); // 'message' ‚ð‘—‚é
if(clickWaiting)
fore.base.cursor = cursorWaitingClick;
else
fore.base.cursor = cursorDefault;
setMenuAccessibleAll();
}
function switchMessageLayerHiddenByUser()
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ì”ñ•\Ž¦/•\Ž¦‚ðØ‚è‘Ö‚¦‚é
if(messageLayerHiding) showMessageLayerByUser(); else hideMessageLayerByUser();
}
function hideMessageLayerByScenario(elm)
{
// ƒVƒiƒŠƒI‚©‚烃bƒZ[ƒW‚ðˆêŽž“I‚ɉB‚·
hideMessageLayerByUser();
conductor.wait(%[ // ƒRƒ“ƒ_ƒNƒ^‚ð‘Ò‚¿‚É
message : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
return -2; // break
}
function selectFont()
{
// ƒtƒHƒ“ƒg‚ð‘I‘ð‚·‚é
fore.base.font.face = chDefaultFace;
fore.base.font.height = -20;
var flags = fsfSameCharSet | fsfNoVertical | fsfTrueTypeOnly | fsfUseFontFace;
if(showFixedPitchOnlyInFontSelector) flags |= fsfFixedPitch;
if(fore.base.font.doUserSelect(flags, "ƒtƒHƒ“ƒg‚Ì‘I‘ð",
"ƒtƒHƒ“ƒg‚ð‘I‘ð‚µ‚Ä‚‚¾‚³‚¢", "ABCDEFGHI‚ ‚¢‚¤‚¦‚¨ˆŸˆÝ‰FŠGŒä"))
{
chDefaultFace = fore.base.font.face;
setMessageLayerUserFont();
}
}
function mapPrerenderedFont(storage)
{
// ƒŒƒ“ƒ_ƒŠƒ“ƒOς݃tƒHƒ“ƒg‚ðŒ»Ý‚Ì‘€ì‘Îۂ̃ŒƒCƒ„‚É‘I‘ð
// ‚³‚ê‚Ä‚¢‚éƒtƒHƒ“ƒg‚Ƀ}ƒbƒsƒ“ƒO‚·‚é
current.decideSizeChange();
current.lineLayer.font.mapPrerenderedFont(storage);
}
//------------------------------------------------- ƒŒƒCƒ„‚𳂵‚¢‡˜‚É --
function reorderLayers()
{
// ƒŒƒCƒ„‚𳂵‚¢‡˜‚É•À‚Ñ‘Ö‚¦‚é
var index = 1000;
for(var i = 0; i<fore.layers.count; i++)
{
fore.layers.absolute = index;
back.layers.absolute = index;
index += 1000;
}
index = 1000000;
for(var i = 0; i<fore.messages.count; i++)
{
fore.messages.absolute = index;
back.messages.absolute = index;
index += 1000;
}
historyLayer.absolute = 2000000;
}
//--------------------------------------------- ‘®«->ƒŒƒCƒ„ƒIƒuƒWƒFƒNƒg --
function getLayerFromElm(elm, prefix = '')
{
// elm ‚ÉŽw’肳‚ê‚Ä‚¢‚é page ‚Æ layer ‘®«‚©‚çAŠY“–‚·‚é
// ƒIƒuƒWƒFƒNƒg‚ð•Ô‚·
// prefix ‚É‚ÍA‘®«–¼‚Ì‘O‚ɂ‚¯‚éƒvƒŒƒtƒBƒNƒX‚ðŽw’è‚·‚é
var base;
if(elm[prefix + 'page'] == 'back') base = back; else base = fore;
var layer = elm[prefix + 'layer'];
if(layer == 'base') return base.base; // ”wŒi
if(layer[0] == 'm')
{
// message? ( ? = ”’l )
// ‚±‚±‚Å‚Í‚ ‚܂茵–§‚ɃGƒ‰[ƒ`ƒFƒbƒN‚Í‚µ‚È‚¢
if(layer == 'message') return base.messages[currentNum];
return base.messages[+layer.substr(7)];
}
return base.layers[+layer];
}
function getLayerPageFromElm(elm, backlay)
{
// getLayerFromElm ‚ÆŽ—‚Ä‚¢‚邪Apage ‘®«‚Ü‚Å‚Í‚Ý‚È‚¢B
// backlay ‚ª true ‚Ì‚Æ‚«‚Í— Afalse ‚ÌŽž‚Í•\‚̃ŒƒCƒ„‚ð•Ô‚·B
// elm.layer ‚ª void ‚ÌŽž‚Í”wŒiƒŒƒCƒ„‚ð‹A‚·
var base = backlay?back:fore;
var layer = elm.layer;
if(layer === void || layer == 'base') return base.base; // ”wŒi
if(layer[0] == 'm')
{
if(layer == 'message') return base.messages[currentNum];
return base.messages[+layer.substr(7)];
}
return base.layers[+layer];
}
function getMessageLayerPageFromElm(elm)
{
// elm ‚©‚çŠY“–‚·‚é•\/— ‰æ–ʂ̃ƒbƒZ[ƒWƒŒƒCƒ„”z—ñ‚ð•Ô‚·
if(elm.page == 'back') return 1; else return 0;
}
function getMessageLayerNumberFromElm(elm)
{
// elm ‚Ì layer ‘®«‚ÌŽ¦‚·ƒƒbƒZ[ƒWƒŒƒCƒ„”Ô†‚ð•Ô‚·
var layer = elm.layer;
if(layer === void || layer == 'message') return currentNum;
return +layer.substr(7);
}
function getMessageLayerObjectFromElm(elm)
{
// elm ‚Ì layer ‘®«‚ÌŽ¦‚·ƒƒbƒZ[ƒWƒŒƒCƒ„‚ð•Ô‚·
var page = elm.page;
var layer = elm.layer;
if(page === void && layer === void) return current;
var base;
if(page == 'back') base = back; else base = fore;
if(layer === void || layer == 'message') return base.messages[currentNum];
return base.messages[+layer.substr(7)];
}
function getMessageLayerObjectFromPageAndNumber(page, num)
{
return (page?back:fore).messages[num];
}
//----------------------------------------------------- ƒŒƒCƒ„ƒRƒs[ŠÖ˜A --
function backupLayer(elm, toback)
{
// ƒŒƒCƒ„‚Ì•\©¨— ŠÔ‚̃Rƒs[‚ðs‚¤
// toback = true ‚Ìꇂ͕\¨— Afalse ‚Ìꇂ͗ ¨•\
if(elm.layer !== void)
{
// ƒŒƒCƒ„Žw’肪‚ ‚é
getLayerPageFromElm(elm, toback).assignComp(); // ‘΂̃ŒƒCƒ„‚Ì“à—e‚ðƒRƒs[
}
else
{
// ƒŒƒCƒ„Žw’肪–³‚¢‚Ì‚Å‘S•”‚̃ŒƒCƒ„‚ðƒRƒs[
var base = toback ? back:fore;
base.base.assignComp();
var layers = base.layers, messages = base.messages;
for(var i = layers.count-1; i >= 0; i--) layers.assignComp();
for(var i = messages.count-1; i >= 0; i--) messages.assignComp();
forEachEventHook('onCopyLayer',
function(handler, f) { handler(f.toback); } incontextof this,
%[toback:toback]);
}
}
function copyLayer(elm)
{
// elm ‚É]‚Á‚Ä“¯Ží‚̃ŒƒCƒ„ŠÔ‚̃Rƒs[‚ðs‚¤
var src = getLayerFromElm(elm, 'src');
var dest = getLayerFromElm(elm, 'dest');
dest.assign(src);
}
//--------------------------------------------------- ƒAƒjƒ[ƒVƒ‡ƒ“ŠÖ˜A --
function onAnimationStopped(name, segment)
{
// ƒAƒjƒ[ƒVƒ‡ƒ“‚ª’âŽ~‚µ‚½
conductor.trigger('anim:' + name + ':' + segment);
}
function waitAnimation(elm)
{
// ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì’âŽ~‚ð‚Ü‚Â
var layer = getLayerFromElm(elm);
var seg = +elm.seg;
if(!layer.canWaitAnimStop(seg)) return 0; // ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì’âŽ~‚ð‘Ò‚Â
conductor.wait(%[
'anim:' + layer.name + ':' + seg => function
{
} incontextof this
]);
return -2;
}
//--------------------------------------------------- ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŠÖ˜A --
function onLayerTransitionCompleted(layer, dest, src)
{
// ƒŒƒCƒ„‚Ńgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ªI—¹‚µ‚½‚Æ‚«‚ɌĂ΂ê‚é
conductor.trigger('trans'); // 'trans' ‚ð‘—‚é
}
function waitTransition(elm)
{
// ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð‘Ò‚Â
if(transCount == 0) return 0; // ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð‘Ò‚Ä‚È‚¢
if((elm.canskip === void || +elm.canskip) && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv“®ì’†
stopAllTransitions();
return 0; // ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð’âŽ~‚³‚¹‚Ä‚·‚®‚É•Ô‚é
}
conductor.wait(%[
click : function
{
updateBeforeCh = 1;
stopAllTransitions(); // ‚·‚ׂẴgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚Í’âŽ~
} incontextof this,
trans : function
{
updateBeforeCh = 1;
} incontextof this
]);
}
else
{
conductor.wait(%[
trans : function
{
updateBeforeCh = 1;
} incontextof this
]);
}
return -2;
}
function stopAllTransitions()
{
// ‚·‚ׂẴgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð’âŽ~‚³‚¹‚é
var layers, messages;
fore.base.stopTransition();
layers = fore.layers, messages = fore.messages;
for(var i = layers.count-1; i >= 0; i--) layers.stopTransition();
for(var i = messages.count-1; i >= 0; i--) messages.stopTransition();
back.base.stopTransition();
layers = back.layers, messages = back.messages;
for(var i = layers.count-1; i >= 0; i--) layers.stopTransition();
for(var i = messages.count-1; i >= 0; i--) messages.stopTransition();
transCount = 0; // ˆê‰ž
}
function callExchangeInfo()
{
// ‚·‚ׂĂ̔wŒiƒŒƒCƒ„‚ð‚Ì‚¼‚•\ƒŒƒCƒ„‚ɑ΂µ‚Ä
// exchangeInfo ‚ðŒÄ‚Ô
var layers = fore.layers, messages = fore.messages;
for(var i = layers.count-1; i >= 0; i--) layers.exchangeInfo();
for(var i = messages.count-1; i >= 0; i--) messages.exchangeInfo();
}
function callAssignTransSrc()
{
// ‚·‚ׂĂ̔wŒiƒŒƒCƒ„‚ð‚Ì‚¼‚•\ƒŒƒCƒ„‚ɑ΂µ‚Ä
// assignTransSrc ‚ðŒÄ‚Ô
var layers = fore.layers, messages = fore.messages;
for(var i = layers.count-1; i >= 0; i--) layers.assignTransSrc();
for(var i = messages.count-1; i >= 0; i--) messages.assignTransSrc();
forEachEventHook('onCopyLayer',
function(handler, f) { handler(f.toback); } incontextof this,
%[toback:false]);
}
function exchangeForeBack()
{
// ƒŒƒCƒ„‚Ì— ‚Æ•\‚ðŽæ‚è‘Ö‚¦‚é
var tmp = fore;
fore = back;
back = tmp;
current = (currentPage?back:fore).messages[currentNum]; // current ‚Íݒ肵’¼‚µ
forEachEventHook('onExchangeForeBack',
function(handler, f) { handler(); } incontextof this);
}
function swapBaseLayer()
{
// ”wŒiƒŒƒCƒ„‚Ì‚Ý‚ðŽæ‚è‘Ö‚¦‚é
var tmp = fore.base;
fore.base = back.base;
back.base = tmp;
current = (currentPage?back:fore).messages[currentNum]; // current ‚Íݒ肵’¼‚µ
}
function swapCharacterLayer(id)
{
// ‘OŒiƒŒƒCƒ„‚Ì•\‚Æ— ‚ðŽæ‚è‘Ö‚¦‚é
var fl = fore.layers, bl = back.layers;
var tmp = fl[id];
fl[id] = bl[id];
bl[id] = tmp;
}
function swapMessageLayer(id)
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚Ì•\‚Æ— ‚ðŽæ‚è‘Ö‚¦‚é
var fl = fore.messages, bl = back.messages;
var tmp = fl[id];
fl[id] = bl[id];
bl[id] = tmp;
current = (currentPage?back:fore).messages[currentNum]; // current ‚Íݒ肵’¼‚µ
}
//--------------------------------------------------------- Ž©“®ˆÚ“®ŠÖ˜A --
function onLayerMoveStop()
{
// ƒŒƒCƒ„‚ÌŽ©“®ˆÚ“®‚ªI—¹‚µ‚½
conductor.trigger('move');
}
function waitMove(elm)
{
// Ž©“®ˆÚ“®‚ð‘Ò‚Â
if(moveCount == 0) return 0; // Ž©“®ˆÚ“®‚ð‘Ò‚Ä‚È‚¢
if((elm.canskip === void || +elm.canskip) && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv“®ì’†
stopAllMoves();
return 0; // Ž©“®ˆÚ“®‚ð’âŽ~‚³‚¹‚Ä‚·‚®‚É•Ô‚é
}
conductor.wait(%[
click : function
{
updateBeforeCh = 1;
stopAllMoves(); // ‚·‚ׂẴgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚Í’âŽ~
} incontextof this,
move : function
{
updateBeforeCh = 1;
} incontextof this
]);
}
else
{
conductor.wait(%[
move : function
{
updateBeforeCh = 1;
} incontextof this
]);
}
return -2;
}
function stopAllMoves()
{
// ‚·‚ׂĂ̎©“®ˆÚ“®‚ð’âŽ~‚³‚¹‚é
var layers, messages;
fore.base.stopMove();
back.base.stopMove();
layers = fore.layers, messages = fore.messages;
for(var i = layers.count-1; i >= 0; i--) layers.stopMove();
for(var i = messages.count-1; i >= 0; i--) messages.stopMove();
layers = back.layers, messages = back.messages;
for(var i = layers.count-1; i >= 0; i--) layers.stopMove();
for(var i = messages.count-1; i >= 0; i--) messages.stopMove();
moveCount = 0; // ˆê‰ž
}
//------------------------------------------------ ƒfƒBƒŒƒC/ƒXƒLƒbƒvŠÖ˜A --
function setDelay(elm)
{
// delay ƒ^ƒO‚̈—
var speed = elm.speed;
if(speed == 'nowait')
{
chSpeed = 0;
chUserMode = false;
}
else if(speed == 'user')
{
chUserMode = true;
setUserSpeed();
}
else
{
chSpeed = +speed;
chUserMode = false;
}
if(!skipMode) actualChSpeed = chSpeed;
}
function getCurrentRead()
{
// Œ»Ý‚̃VƒiƒŠƒI•”•ª‚ªŠù“Ç‚©‚Ç‚¤‚©‚ð”»’è‚·‚é
return autoRecordPageShowing && currentRecordName != "" &&
+sflags[currentRecordName] || !autoRecordPageShowing;
}
function setUserSpeed()
{
// ƒ†[ƒU‚Ì‘I‘ð‚µ‚½•¶Žš•\Ž¦ƒXƒs[ƒh‚ðÝ’è
// ‚±‚ÌŠÖ”‚ð“Ç‚ñ‚¾Žž“_‚Å‚·‚Å‚É userChSpeed ‚É‚Í
// ‚ ‚½‚炵‚¢’l‚ªÝ’肳‚ê‚Ä‚¢‚é‚Æ‚Ý‚È‚·B
// ‚ ‚é‚¢‚ÍAƒ‰ƒxƒ‹‚²‚Æ‚ÉA‚»‚Ì‹æˆæ‚ªŠù“Ç‚©–¢“Ç‚©‚Å
// •\Ž¦ƒXƒs[ƒh‚ð•Ï‚¦‚é–Ú“I‚ŌĂ΂ê‚é
if(chUserMode)
{
if(getCurrentRead())
chSpeed = userCh2ndSpeed==-1?userChSpeed:userCh2ndSpeed; // Šù“Ç
else
chSpeed = userChSpeed; // Т҂
}
if(!skipMode) actualChSpeed = chSpeed;
}
function skipToClick()
{
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚܂ŃXƒLƒbƒv
skipMode = 1;
actualChSpeed = 0;
}
function skipToPage()
{
// ‰üƒy[ƒW‘Ò‚¿‹L†‚܂ŃXƒLƒbƒv
skipMode = 2;
actualChSpeed = 0;
}
function skipToStop()
{
// ŽŸ‚Ì’âŽ~‚܂ŃXƒLƒbƒv
onPrimaryClick(); // ƒNƒŠƒbƒN‚Ì“®ì‚ðƒGƒ~ƒ…ƒŒ[ƒg‚·‚é
skipMode = 3;
actualChSpeed = 0;
}
function skipToStop2()
{
// ŽŸ‚Ì’âŽ~‚܂ŃXƒLƒbƒv(‘‘—‚胂[ƒh)
onPrimaryClick();
skipMode = 4;
actualChSpeed = 0;
}
function cancelSkip()
{
// ƒXƒLƒbƒv“®ì‚ðƒLƒƒƒ“ƒZƒ‹
skipMode = 0;
skipKeyRepressed = false;
actualChSpeed = chSpeed;
}
function enterNoWait()
{
// nowait ƒ^ƒO‚̈—
beforeNoWaitActualChSpeed = actualChSpeed;
beforeNoWaitChUserMode = chUserMode;
actualChSpeed = 0;
}
function leaveNoWait()
{
// endnowait ƒ^ƒO‚̈—
actualChSpeed = beforeNoWaitActualChSpeed;
chUserMode = beforeNoWaitChUserMode;
}
function setAutoWait(elm)
{
// Ž©“®ƒEƒFƒCƒg‚ðÝ’è‚·‚é
autoWCEnabled = +elm.enabled if elm.enabled !== void;
autoWCChars = elm.ch if elm.ch !== void;
autoWCWaits = [].split(",", elm.time) if elm.time !== void;
}
function cancelAutoMode()
{
// Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚̃Lƒƒƒ“ƒZƒ‹
if(autoMode)
{
autoMode = false;
if(typeof this.autoModeMenuItem !== "undefined")
autoModeMenuItem.checked = false;
var t = conductor.lastTagName;
if(t == 'p'){
showPageBreak();
}
else if(t == 'l'){
showLineBreak(%[canskip: false]);
}
}
}
function enterAutoMode()
{
// Ž©“®“Ç‚Ý‚·‚·‚݃‚[ƒh‚É“ü‚é
if(typeof this.autoModeMenuItem !== "undefined")
autoModeMenuItem.checked = true;
if(inStable)
onPrimaryClick();
autoMode = true;
}
//--------------------------------------------------------- ƒEƒFƒCƒgŠÖ˜A --
function resetWait()
{
// ŽžŠÔŒ´“_‚̃ŠƒZƒbƒg
timeOrigin = System.getTickCount();
}
function waitTime(waittime, canskip)
{
// waittime •ª‘Ò‚Â
if(waittime == 0) return 0;
if(canskip)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
return 0; // ƒXƒLƒbƒv’†‚Ìê‡‚Í‚È‚É‚à‚¹‚¸‚É•Ô‚é
}
conductor.waitWithTimeOut(%[
click : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
timeout : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
], waittime);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.waitWithTimeOut(%[
timeout : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
], waittime);
}
return -2; // break
}
function doWait(elm)
{
// wait ƒ^ƒO‚̈—
var waittime;
if(elm.mode == 'until')
{
// until ƒ‚[ƒh
waittime = timeOrigin + +elm.time - System.getTickCount();
if(waittime < 0) { lastWaitTime = 0; return 0; } // ‚·‚Å‚ÉŽžŠÔ‚ªŒo‰ß‚µ‚Ä‚¢‚é
lastWaitTime = waittime;
if(waittime < 6) return 0; // ‚ ‚Ü‚è‚É‘Ò‚¿ŽžŠÔ‚ª’Z‚¢‚Ì‚Å‘Ò‚½‚È‚¢
}
else
{
waittime = +elm.time;
}
return waitTime(waittime, (elm.canskip === void || +elm.canskip) && clickSkipEnabled);
}
function doWaitCh(elm)
{
// +elm.time ‚̃JƒEƒ“ƒg•ªA‘Ò‚Â
var t = elm.time;
return waitTime(actualChSpeed * (t === void ? 1 : +t),
(elm.canskip === void || +elm.canskip) && clickSkipEnabled);
}
//------------------------------------------------------------ quakeŠÖ˜A --
function doQuake(elm)
{
// elm ‚É]‚Á‚Ä quake ‚ðŠJŽn
if(elm.time !== void)
{
if(defaultQuakeTimeInChUnit)
{
if(elm.timemode == 'ms')
quakeEndTick = System.getTickCount() + +elm.time;
else
quakeEndTick = System.getTickCount() + +elm.time * chSpeed;
}
else
{
if(elm.timemode == 'delay')
quakeEndTick = System.getTickCount() + +elm.time * chSpeed;
else
quakeEndTick = System.getTickCount() + +elm.time;
}
}
else
{
quakeEndTick = -1;
}
if(elm.hmax !== void) quakeHorzMax = +elm.hmax; else quakeHorzMax = 10;
if(elm.vmax !== void) quakeVertMax = +elm.vmax; else quakeVertMax = 10;
quakeTimer.enabled = true;
quaking = true;
}
function restoreQuake()
{
// restore ‚©‚çŒÄ‚΂êAžx‚ð•Û‘¶‚µ‚½‚Æ‚«‚É—h‚ê‚Ä‚¢‚½ê‡‚Í—h‚ç‚·
if(quaking && quakeEndTick == -1)
quakeTimer.enabled =true;
}
function stopQuake()
{
// —h‚ê‚ð’âŽ~
setLayerPos(0, 0);
quakeTimer.enabled = false;
quaking = false;
conductor.trigger('quake');
}
function onQuakeTimerInterval()
{
// quakeTimer ‚É‚æ‚èŒÄ‚΂ê‚é
if(quakeEndTick != -1 && System.getTickCount() > quakeEndTick) { stopQuake(); return; }
if(historyShowing)
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„•\Ž¦’†‚Í‚³‚·‚ª‚É—h‚ê‚Ä‚¢‚ç‚ê‚È‚¢
setLayerPos(0, 0);
return;
}
var x, y;
if(quakeHorzMax == quakeVertMax)
{
// ‚¾‚¢‚½‚¢“¯‚¶
x = int(Math.random() * quakeHorzMax - quakeHorzMax);
y = int(Math.random() * quakeVertMax - quakeVertMax);
}
else if(quakeHorzMax < quakeVertMax)
{
// c—h‚ê
x = int(Math.random() * quakeHorzMax - quakeHorzMax);
y = int((quakePhase ? Math.random() : -Math.random()) * quakeVertMax);
}
else
{
// ‰¡—h‚ê
x = int((quakePhase ? Math.random() : -Math.random()) * quakeHorzMax);
y = int(Math.random() * quakeVertMax - quakeVertMax);
}
quakePhase = !quakePhase;
setLayerPos(x, y);
}
function waitQuake(elm)
{
// —h‚ꂪI—¹‚·‚é‚Ü‚Å‚Ü‚Â
if(!quaking || quakeEndTick == -1) return 0; // —h‚ê‚Ä‚¢‚È‚¯‚ê‚Α҂½‚È‚¢
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
stopQuake();
return 0; // ƒXƒLƒbƒv’†‚Ìꇂ͗h‚ê‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function
{
stopQuake(); // —h‚ê‚Í’âŽ~‚·‚é
} incontextof this,
quake : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
quake : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
return -2;
}
//------------------------------------------------------------- ƒNƒŠƒbƒN --
function onPrimaryClick()
{
// ƒvƒ‰ƒCƒ}ƒŠƒŒƒCƒ„‚ÅuƒNƒŠƒbƒN‚Ì“®ìv‚ª‚È‚É‚àƒtƒBƒ‹ƒ^ƒŠƒ“ƒO‚³‚ê‚È‚©‚Á‚½
// ‚Æ‚«Aƒvƒ‰ƒCƒ}ƒŠƒŒƒCƒ„‚©‚çŒÄ‚΂ê‚éB
clickCount ++;
if(!callHook(leftClickHook))
{
if(messageLayerHiding)
{
showMessageLayerByUser(); // ƒƒbƒZ[ƒWƒŒƒCƒ„‚ð•\Ž¦‚·‚é
}
else
{
var st = conductor.status;
var runst = conductor.mRun;
var stopst = conductor.mStop;
if(st != stopst && autoMode)
{
// Ž©“®“Ç‚Ý‚·‚·‚Ý‚Ìê‡
cancelAutoMode();
}
else if(st != stopst && canCancelSkipByClick && skipMode && skipMode != 4)
{
// ƒNƒŠƒbƒN‚É‚æ‚éƒXƒLƒbƒv‚̉𜂪‰Â”\
cancelSkip();
}
else
{
// ‚±‚ÌŽž“_‚ŃtƒBƒ‹ƒ^ƒŠƒ“ƒO‚³‚ê‚È‚¢ƒƒbƒZ[ƒW‚Í‘Ò‚¿ó‘Ԃ̃NƒŠƒA‚È‚Ì‚Å
// conductor ‚É 'click' ‚ð‘—‚è‰ðœ‚ð“`‚¦‚éB
if(!conductor.trigger('click')) // ‘Ò‚¿ó‘Ô‚Å‚È‚¢ê‡‚Í’P‚É–³Ž‹‚³‚ê‚é
{
// ƒnƒ“ƒhƒ‰‚ªŒ©‚‚©‚ç‚È‚¢‚È‚ÇAˆ—‚³‚ê‚È‚©‚Á‚½ê‡
if(st == runst && clickSkipEnabled && skipMode == 0)
{
// ƒNƒŠƒbƒN‚É‚æ‚éƒXƒLƒbƒv‚ª‰Â”\
skipToClick();
}
}
}
}
}
}
function onPrimaryClickByKey()
{
// ƒL[‚ª‰Ÿ‚³‚ꂽ‚Æ‚«ƒvƒ‰ƒCƒ}ƒŠƒŒƒCƒ„‚ðƒNƒŠƒbƒN‚µ‚½‚Ì‚Æ
// “¯‚¶“®ì‚ð‚·‚é‚ªA‚³‚ç‚Ɉꎞ“I‚Ƀ}ƒEƒXƒJ[ƒ\ƒ‹‚ð‰B‚·
onPrimaryClick();
hideMouseCursor();
}
function waitClick(elm)
{
// ƒNƒŠƒbƒN‚ð‘Ò‚Â
conductor.wait(%[
click : function
{
} incontextof this]);
return -2;
}
function onMouseDown(x, y)
{
lastMouseDownX = x;
lastMouseDownY = y;
super.onMouseDown(...);
}
//------------------------------------------------------- ƒL[ƒ{[ƒh‘€ì --
function processKeys(key, shift)
{
if(checkProceedingKey(key, shift)) return;
if(key == #'F')
{
// ŽŸ‚Ì‘I‘ðŽˆ/–¢“Ç‚Ü‚Åi‚Þ
skipToNextStopByKey();
return;
}
if(key == #'B')
{
// ‘O‚É–ß‚é
goBackByKey();
return;
}
if(key == #'A')
{
// Ž©“®“I‚É“Ç‚Ýi‚ß‚é
switchAutoModeByKey();
return;
}
if(freeSaveDataMode)
{
if(key == #'S')
{
// žx‚ð‚Í‚³‚Þ
if(typeof this.storeMenu != "undefined" && storeMenu.enabled)
storeMenu.click();
return;
}
if(key == #'L')
{
// žx‚ð‚½‚Ç‚é
if(typeof this.restoreMenu != "undefined" && restoreMenu.enabled)
restoreMenu.click();
return;
}
}
if(key == #'R' || (key == VK_UP && (shift & ssShift)))
{
// ƒƒbƒZ[ƒW—š—ð‚ð•\Ž¦
showHistoryByKey();
return;
}
if(key == VK_ESCAPE)
{
// ƒƒbƒZ[ƒW‚ðÁ‚·
if(typeof this.rightClickMenuItem != "undefined" &&
rightClickMenuItem.enabled)
{
rightClickMenuItem.click(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
return;
}
}
}
function preProcessKeys(key, shift)
{
return callHook(keyDownHook, key, shift);
}
function internalOnKeyDown(key, shift)
{
if(!preProcessKeys(key, shift)) processKeys(key, shift);
}
function checkProceedingKey(key, shift)
{
// key ‚ª“Ç‚Ý‚·‚·‚݂̃L[ ( ƒXƒy[ƒXƒL[‚©ReturnƒL[ ) ‚ÌꇂÍ
// ƒL[‚ðˆ—‚µAtrue ‚ð•Ô‚·B‚»‚¤‚Å‚È‚¯‚ê‚Î false ‚ð•Ô‚·
if(key == VK_RETURN || key == VK_SPACE)
{
// ƒL[‚ªƒƒbƒZ[ƒWƒLƒ…[‚É—‚Ü‚Á‚Ä‚éꇂª‚ ‚é‚Ì‚Å
// ŽÀÛ‚É‚»‚̃L[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚é‚Ì‚©‚Ç‚¤‚©‚ð
// getKeyState ‚ð—p‚¢‚Ä’²‚ׂé
var sg = getKeyState;
if(sg(VK_RETURN) || sg(VK_SPACE))
{
// ƒL[‚ª‰Ÿ‚³‚ê‚Ä‚½
if((shift & ssRepeat) && clickSkipEnabled &&
conductor.status == conductor.mRun)
{
// ƒL[ƒŠƒs[ƒg
if(skipMode != 4 && skipKeyRepressed)
skipToStop2(); // ‚Ü‚¾skipMode 4‚É“ü‚Á‚Ä‚¢‚È‚¢ê‡‚Í‘‘—‚胂[ƒh‚É“ü‚é
// skipKeyRepressed ‚ðƒ`ƒFƒbƒN‚·‚é‚Ì‚Í
// ˜A‘±‚µ‚ăL[ƒŠƒs[ƒg‚ª”¶‚µ‚Ä‚¢‚é‚Æ‚«‚É
// cancelSkip Œã‚ɃXƒLƒbƒv‚É“Ë“ü‚·‚é‚Ì‚ð–h‚®‚½‚ß
}
else
{
skipKeyRepressed = true;
onPrimaryClickByKey();
}
return true;
}
}
return false;
}
function skipCancelKeyPressing()
{
// ƒXƒLƒbƒv‚ð‰ðœ‚·‚é—vˆö‚Æ‚È‚éƒL[‚ ‚é‚¢‚̓}ƒEƒXƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ê‚Ä‚¢‚é‚©
var sg = getKeyState;
return sg(VK_RETURN) || sg(VK_SPACE) || sg(VK_LBUTTON);
}
function skipKeyPressing()
{
// VK_RETURN ‚ ‚é‚¢‚Í VK_SPACE ‚ª‰Ÿ‚³‚ê‚Ä‚¢‚é‚©‚Ç‚¤‚©
var sg = getKeyState;
return sg(VK_RETURN) || sg(VK_SPACE);
}
function goBackByKey()
{
if(typeof this.goBackMenuItem != "undefined" &&
goBackMenuItem.enabled)
goBackMenuItem.click(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
}
function skipToNextStopByKey()
{
if(typeof this.skipToNextStopMenuItem != "undefined" &&
skipToNextStopMenuItem.enabled)
skipToNextStopMenuItem.click(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
}
function showHistoryByKey()
{
if(typeof this.showHistoryMenuItem != "undefined" &&
showHistoryMenuItem.enabled)
showHistoryMenuItem.click(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
}
function switchAutoModeByKey()
{
if(typeof this.autoModeMenuItem != "undefined" &&
autoModeMenuItem.enabled)
autoModeMenuItem.click(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
}
function onKeyDown(key, shift)
{
if(focusedLayer === null)
internalOnKeyDown(key, shift);
super.onKeyDown(...);
}
function onMouseWheel(shift, delta, x, y)
{
// ƒzƒC[ƒ‹‚ª‰ñ“]‚µ‚½
super.onMouseWheel(...);
if(!historyLayer.visible)
{
if(delta > 0)
showHistoryByKey(); // ƒƒbƒZ[ƒW—š—ð‚ð•\Ž¦
else if(System.getTickCount() - lastHistoryHiddenTick > 150)
onPrimaryClick(); // ƒNƒŠƒbƒN‚ðƒGƒ~ƒ…ƒŒ[ƒg
// ª tick ‚ð”äŠr‚µ‚Ä‚¢‚é‚Ì‚ÍAƒƒbƒZ[ƒW—š—ð‚ð‰B‚·‘€ì‚ƃzƒC[ƒ‹‚ð
// Žè‘O‚ɉñ‚·‘€ì‚ª˜A‘±‚µ‚½ê‡‚ÉŸŽè‚É“Ç‚Ýi‚Þ‚Ì‚ð‚ ‚é’ö“x–h‚®ŽdŠ|‚¯
}
else
{
// ƒƒbƒZ[ƒW—š—ð‚ɃCƒxƒ“ƒg‚ð‚‚ê—¬‚·
historyLayer.windowMouseWheel(shift, delta, x, y);
}
}
//------------------------------------------------- ƒNƒŠƒbƒN‘Ò‚¿‹L†ˆ— --
function hideClickGlyphs()
{
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚ð”ñ•\Ž¦‚É
lineBreak.visible = false;
pageBreak.visible = false;
if(conductor == mainConductor)
{
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚Ìó‘Ô‚ð‹L˜^
lastClickGlyphVisible = false;
}
}
function storeClickGlyphState(which)
{
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚Ìî•ñ‚ðˆêŽž“I‚É‘Ò”ð
// ‚±‚̃f[ƒ^‚͉EƒNƒŠƒbƒNƒTƒuƒ‹[ƒ`ƒ“‚âextraConductorƒTƒuƒ‹[ƒ`ƒ“‚©‚ç–ß‚é‚Æ‚«‚ÉŽQÆ‚·‚é
if(conductor == mainConductor)
{
lastClickGlyphVisible = true;
lastClickGlyphMessagePage = currentPage;
lastClickGlyphMessageNum = currentNum;
lastClickGlyphWhich = which;
}
}
function restoreClickGlyphState()
{
// lastClickGlyph *** ‚Ɉꎞ“I‚É‘Ò”ð‚µ‚½ƒNƒŠƒbƒN‘Ò‚¿‹L†‚Ìî•ñ
// ‚ÉŠî‚¢‚ăNƒŠƒbƒN‘Ò‚¿‹L†‚ðÝ’è‚·‚é
if(lastClickGlyphVisible)
{
var layer = getMessageLayerObjectFromPageAndNumber
(lastClickGlyphMessagePage, lastClickGlyphMessageNum);
if(layer !== void)
{
switch(lastClickGlyphWhich)
{
case 'line':
layer.showLineBreakGlyph(lineBreak);
break;
case 'page':
layer.showPageBreakGlyph(pageBreak);
break;
}
}
}
}
function canIgnoreL()
{
// L ƒ^ƒO‚𖳎‹‚Å‚«‚é‚©‚Ç‚¤‚©
return chNonStopToPageBreak || (getCurrentRead() && ch2ndNonStopToPageBreak);
}
function showLineBreak(elm)
{
// Œ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚És‘Ò‚¿‹L†‚ð•\Ž¦‚·‚é
stablePosibility = true;
if(canIgnoreL())
{
// l ƒ^ƒO‚Ì–³Ž‹
if(elm.canskip === void || !+elm.canskip)
return (skipMode==3 || skipMode==4) ? 0 : -4;
}
if(autoMode)
{
// Ž©“®“Ç‚Ý‚·‚·‚Ý‚Ìê‡
return autoModeLineWait;
}
if(skipMode == 1) cancelSkip();
if(skipMode == 4 && !skipKeyPressing()) cancelSkip();
if(skipMode == 4) return -4;
if(skipMode) return skipCancelKeyPressing()?-4:0;
// ƒXƒLƒbƒv’†(ƒXƒLƒbƒv‚ðƒLƒƒƒ“ƒZƒ‹‚·‚é‚悤‚ȃL[‚ª‚ ‚ê‚΃XƒLƒbƒv‰ðœ
// ‚Ì‚½‚߂̃Cƒxƒ“ƒgˆ—‚Ì‹@‰ï‚ð—^‚¦‚é)
current.showLineBreakGlyph(lineBreak);
storeClickGlyphState("line");
if(!current.nodeVisible)
{
dm("Œx : ”ñ•\Ž¦‚É‚È‚Á‚Ä‚¢‚é" +
(currentPage ? "— " : "•\") + "ƒƒbƒZ[ƒWƒŒƒCƒ„" + currentNum +
"‚ÅsƒNƒŠƒbƒN‘Ò‚¿‚É‚È‚è‚Ü‚µ‚½");
}
// conductor ‚ð 'click' ‚Ü‚Å‘Ò‚¿ó‘Ô‚É
conductor.wait(%[
click : function
{
clickWaiting = false;
fore.base.cursor = cursorDefault;
notifyRun();
} incontextof this
]);
clickWaiting = true;
fore.base.cursor = cursorWaitingClick;
notifyStable();
return -2;
}
function showPageBreak(elm)
{
// Œ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚Ƀy[ƒW‘Ò‚¿‹L†‚ð•\Ž¦‚·‚é
stablePosibility = true;
if(skipMode == 1 || skipMode == 2) cancelSkip();
if(skipMode == 4 && !skipKeyPressing()) cancelSkip();
if(skipMode) return -4; // ‚¢‚Á‚½‚ñƒCƒxƒ“ƒg‚ðˆ—
if(autoMode)
{
// Ž©“®“Ç‚Ý‚·‚·‚Ý‚Ìê‡
return autoModePageWait;
}
current.showPageBreakGlyph(pageBreak);
storeClickGlyphState("page");
if(!current.nodeVisible)
{
dm("Œx : ”ñ•\Ž¦‚É‚È‚Á‚Ä‚¢‚é" +
(currentPage ? "— " : "•\") + "ƒƒbƒZ[ƒWƒŒƒCƒ„" + currentNum +
"‚Ńy[ƒWƒNƒŠƒbƒN‘Ò‚¿‚É‚È‚è‚Ü‚µ‚½");
}
// conductor ‚ð 'click' ‚Ü‚Å‘Ò‚¿ó‘Ô‚É
conductor.wait(%[
click : function
{
clickWaiting = false;
fore.base.cursor = cursorDefault;
notifyRun();
} incontextof this
]);
clickWaiting = true;
fore.base.cursor = cursorWaitingClick;
notifyStable();
return -2;
}
function showPageBreakAndClear()
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚ªÅIs‚Ü‚Å’B‚µ‚ÄŽ©“®‰üƒy[ƒW‚ª‚³‚ê‚é‚Æ‚«‚É
// ŒÄ‚΂ê‚éBŒ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚Ƀy[ƒW‘Ò‚¿‹L†‚ð•\Ž¦‚µA
// ŽÀsÄŠJŽž‚É‚Í MessageLayer.clear2 ‚ðŒÄ‚Ô
stablePosibility = true;
if(skipMode == 1 || skipMode == 2) cancelSkip();
if(skipMode == 4 && !skipKeyPressing()) cancelSkip();
var lasttagname = conductor.lastTagName;
if(!autoMode && ((!canIgnoreL() && lasttagname == 'l') || lasttagname == 'p'))
{ current.clear2(); return -5; }// ‚¢‚Á‚½‚ñƒCƒxƒ“ƒg‚ðˆ—(ƒ^ƒO‚ÍŒã‰ñ‚µ)
if(skipMode) { current.clear2(); return -5; }// ‚¢‚Á‚½‚ñƒCƒxƒ“ƒg‚ðˆ—(ƒ^ƒO‚ÍŒã‰ñ‚µ)
if(!current.nodeVisible)
{
dm("Œx : ”ñ•\Ž¦‚É‚È‚Á‚Ä‚¢‚é" +
(currentPage ? "— " : "•\") + "ƒƒbƒZ[ƒWƒŒƒCƒ„" + currentNum +
"‚ÅŽ©“®‰üƒy[ƒWƒNƒŠƒbƒN‘Ò‚¿‚É‚È‚è‚Ü‚µ‚½");
}
if(autoMode)
{
conductor.waitWithTimeOut(%[ // ƒ^ƒCƒ€ƒAƒEƒg•t‚«ƒEƒFƒCƒg
click : function
{
current.clear2(); // clear2 ‚ðŒÄ‚Ô
cancelAutoMode();
} incontextof this,
timeout : function
{
current.clear2(); // clear2 ‚ðŒÄ‚Ô
} incontextof this
], autoModePageWait <= 0 ? 1 : autoModePageWait);
return -3;
}
else
{
current.showPageBreakGlyph(pageBreak);
storeClickGlyphState("page");
// conductor ‚ð 'click' ‚Ü‚Å‘Ò‚¿ó‘Ô‚É
conductor.wait(%[
click : function
{
clickWaiting = false;
fore.base.cursor = cursorDefault;
current.clear2(); // clear2 ‚ðŒÄ‚Ô
notifyRun();
} incontextof this
]);
clickWaiting = true;
fore.base.cursor = cursorWaitingClick;
notifyStable();
return -3;
}
}
//------------------------------------------------------------- BGM ˆ— --
function onBGMFadeCompleted()
{
// BGM ‚̃tƒF[ƒh‚ªŠ®—¹‚µ‚½
conductor.trigger('bgmfade');
}
function onBGMStop()
{
// BGM ‚ª’âŽ~‚µ‚½
conductor.trigger('bgmstop');
}
function waitBGMFade(elm)
{
// BGM ‚̃tƒF[ƒhI—¹‚ð‘Ò‚Â
if(!bgm.inFading) return 0; // ƒtƒF[ƒh’†‚Å‚È‚¯‚ê‚Α҂½‚È‚¢
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
bgm.stopFade();
return 0; // ƒXƒLƒbƒv’†‚Ìꇂ̓tƒF[ƒh‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function
{
bgm.stopFade(); // ƒtƒF[ƒfƒBƒ“ƒO‚Í’âŽ~‚·‚é
} incontextof this,
bgmfade : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
bgmfade : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
return -2;
}
function waitBGMStop(elm)
{
// BGM ‚ÌĶI—¹‚ð‘Ò‚Â
if(!bgm.canWaitStop) return 0; // BGM ĶI—¹‚ð‘Ò‚Ä‚È‚¯‚ê‚΂»‚Ì‚Ü‚Ü–ß‚é
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
bgm.stop();
return 0; // ƒXƒLƒbƒv’†‚ÌꇂÍĶ‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function
{
bgm.stop(); // Ķ‚ðI—¹‚·‚é
} incontextof this,
bgmstop : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
bgmstop : function
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this
]);
}
return -2;
}
//----------------------------------------------------------- Œø‰Ê‰¹ˆ— --
function onSESoundBufferFadeCompleted(id)
{
// Œø‰Ê‰¹‚̃tƒF[ƒh‚ªI—¹‚µ‚½
conductor.trigger('sefade' + id);
}
function onSESoundBufferStop(id)
{
// Œø‰Ê‰¹‚ÌĶ‚ªI—¹‚µ‚½
conductor.trigger('sestop' + id);
}
function waitSEFade(elm)
{
var id = +elm.buf;
var buf = se[id];
if(!buf.inFading) return 0; // ƒtƒF[ƒh’†‚Å‚È‚¯‚ê‚΂»‚Ì‚Ü‚Ü–ß‚é
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
buf.stopFade();
return 0; // ƒXƒLƒbƒv’†‚Ìꇂ̓tƒF[ƒh‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function (id)
{
se[id].stopFade(); // ƒtƒF[ƒh‚ðI—¹‚·‚é
} incontextof this,
click_arg : id, // ƒnƒ“ƒhƒ‰‚ւ̈ø”
'sefade'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'sefade'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
'sefade'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'sefade'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
return -2;
}
function waitSEStop(elm)
{
var id = +elm.buf;
var buf = se[id];
if(!buf.canWaitStop()) return 0; // I—¹‚ð‘Ò‚Ä‚È‚¯‚ê‚΂»‚Ì‚Ü‚Ü•Ô‚é
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
buf.stop();
return 0; // ƒXƒLƒbƒv’†‚ÌꇂÍĶ‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function (id)
{
se[id].stop(); // Ķ‚ðI—¹‚·‚é
} incontextof this,
'click_arg' => id, // ƒnƒ“ƒhƒ‰‚ւ̈ø”
'sestop'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'sestop'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
'sestop'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'sestop'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
return -2;
}
//--------------------------------------------------------- ƒ€[ƒr[ŠÖ˜A --
function onMovieStop(id)
{
// ƒ€[ƒr[‚ÌĶ‚ªI—¹‚µ‚½
conductor.trigger('moviestop'+id);
}
function waitMovieStop(elm)
{
var id = +elm.slot;
// ƒ€[ƒr[‚ÌĶI—¹‚ð‘Ò‚Â
if(!movies[id].canWaitStop) return 0; // ƒ€[ƒr[ĶI—¹‚ð‘Ò‚Ä‚È‚¯‚ê‚΂»‚Ì‚Ü‚Ü–ß‚é
if(elm.canskip !== void && +elm.canskip && clickSkipEnabled)
{
// ƒXƒLƒbƒv‚Å‚«‚éê‡
if(skipMode)
{
// ƒXƒLƒbƒv’†‚Ìê‡
movies[id].stop();
return 0; // ƒXƒLƒbƒv’†‚ÌꇂÍĶ‚ð’âŽ~‚³‚¹‚Ä•Ô‚é
}
conductor.wait(%[
click : function (id)
{
movies[id].stop(); // Ķ‚ðI—¹‚·‚é
} incontextof this,
'click_arg' => id, // ƒnƒ“ƒhƒ‰‚ւ̈ø”
'moviestop'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'moviestop'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else
{
// ƒXƒLƒbƒv‚Å‚«‚È‚¢ê‡
conductor.wait(%[
'moviestop'+id =>
function (id)
{
// ‚â‚邱‚Æ‚È‚µ
} incontextof this,
'moviestop'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
return -2;
}
function onMoviePeriod(id,type)
{
// ƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒg‚ª”¶‚µ‚½
if( isLeavePeriodEvent != false )
{
holdPeriodEventQueue.add( 'movieperiod'+id+'_'+type );
}
else
{
conductor.trigger('movieperiod'+id+'_'+type);
}
}
function waitMoviePeriod(elm)
{
isWaitPeriodEvent = true;
waitedPeriodEventStorageName = conductor.curStorage;
var id = +elm.slot;
stablePosibility = true;
if( holdPeriodEventQueue.count > 0 )
{
var triggered = false;
for( var i = 0; i < holdPeriodEventQueue.count; i++ )
{
if( elm.for !== void )
{
if( elm.for == 'loop' )
{
if( ('movieperiod'+id+'_'+perLoop) == holdPeriodEventQueue )
triggered = true;
}
else if( elm.for == 'period' )
{
if( ('movieperiod'+id+'_'+perPeriod) == holdPeriodEventQueue )
triggered = true;
}
else if( elm.for == 'prepare' )
{
if( ('movieperiod'+id+'_'+perPrepare) == holdPeriodEventQueue )
triggered = true;
}
else if( elm.for == 'segLoop' )
{
if( ('movieperiod'+id+'_'+perSegLoop) == holdPeriodEventQueue )
triggered = true;
}
else
{
triggered == true;
}
}
else
{
triggered == true;
}
}
holdPeriodEventQueue.clear();
if( triggered == true )
{
isWaitPeriodEvent = false;
return 0;
}
}
// ƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒg‚ð‘Ò‚Â
if(!movies[id].canWaitStop) return 0; // ƒ€[ƒr[‚ªÄ¶’†‚Å‚È‚¯‚ê‚΂»‚Ì‚Ü‚Ü–ß‚é
if( elm.for !== void )
{
if( elm.for == 'loop' )
{
conductor.wait(%[
'movieperiod'+id+'_'+perLoop => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else if( elm.for == 'period' )
{
conductor.wait(%[
'movieperiod'+id+'_'+perPeriod => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else if( elm.for == 'prepare' )
{
conductor.wait(%[
'movieperiod'+id+'_'+perPrepare => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else if( elm.for == 'segLoop' )
{
conductor.wait(%[
'movieperiod'+id+'_'+perSegLoop => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
else
{
return 0; // ˆø”‚ª•Ï
}
}
else
{
conductor.wait(%[
'movieperiod'+id+'_'+perLoop => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_'+perPeriod => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_'+perPrepare => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_'+perSegLoop => function (id) { notifyRun(); isWaitPeriodEvent = false;} incontextof this,
'movieperiod'+id+'_arg' => id // ƒnƒ“ƒhƒ‰‚ւ̈ø”
]);
}
notifyStable();
return -2;
}
//------------------------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ --
function getHandlers()
{
return %[ // Ž«‘”z—ñƒIƒuƒWƒFƒNƒg
/*
ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ‚ÍA–¼‘O‚Æ‚»‚ê‚ɑΉž‚·‚éŠÖ”‚̃yƒA‚ð—ñ‹“‚·‚é‚à‚Ì‚ÅA
ŠÖ”–¼ : function(elm)
{
// ŠÖ”‚Ì’†g
} incontextof this,
‚Ì‘Ž®‚ð—p‚¢‚éB‚½‚¾‚µAŠÖ”–¼‚ª—\–ñŒê‚ÌꇂÍAuŠÖ”–¼ : v‚Å‚Í‚È‚
u"ŠÖ”–¼" => v‚ð—p‚¢‚éB
incontextof this ‚ÍAŠÖ”‚ª³‚µ‚ ‚±‚̃Nƒ‰ƒX‚Ì
ƒIƒuƒWƒFƒNƒg‚̃Rƒ“ƒeƒLƒXƒgã‚Å“®‚‚悤‚É‚·‚邽‚ß‚É•K—vB
*/
//--------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ(ƒƒbƒZ[ƒW‘€ì) --
ch : function(elm)
{
// •¶Žš•\Ž¦
var acs = actualChSpeed;
if(updateBeforeCh)
{
if(acs) { updateBeforeCh--; return -5; } else { updateBeforeCh--; }
}
var text = elm.text;
if(currentWithBack) current.comp.processCh(text);
if(current.processCh(text))
{
return showPageBreakAndClear();
}
if(historyWriteEnabled) historyLayer.store(text);
if(autoWCEnabled)
{
// Ž©“®ƒEƒFƒCƒg
var ind;
if((ind = autoWCChars.indexOf(text)) != -1)
{
return int(acs * autoWCWaits[ind]);
}
}
return acs;
} incontextof this,
graph : function(elm)
{
// ƒOƒ‰ƒtƒBƒbƒN‚𕶎š‚Æ‚µ‚Ä•\Ž¦
var acs = actualChSpeed;
if(updateBeforeCh)
{
if(acs) { updateBeforeCh--; return -5; } else { updateBeforeCh--; }
}
if(currentWithBack) current.comp.processGraph(elm);
if(current.processGraph(elm))
{
return showPageBreakAndClear();
}
if(historyWriteEnabled && elm.alt !== void) historyLayer.store(elm.alt);
return acs;
} incontextof this,
hch : function(elm)
{
// c’†‰¡
var acs = actualChSpeed;
if(updateBeforeCh)
{
if(acs) { updateBeforeCh--; return -5; } else { updateBeforeCh--; }
}
var text = elm.text;
var expand = elm.expand !== void && +elm.expand;
if(currentWithBack) current.comp.putHorizonCh(text, expand);
if(current.putHorizonCh(text, expand))
{
return showPageBreakAndClear();
}
if(historyWriteEnabled) historyLayer.store(text);
return acs;
} incontextof this,
r : function(elm)
{
// ‰üs
if(historyWriteEnabled) historyLayer.reline();
if(currentWithBack) current.comp.processReturn();
if(current.processReturn())
{
var ret = showPageBreakAndClear();
// ‰üs‚Ípending‚µ‚È‚¢
if(ret == -5)
ret = -4;
else if(ret == -3)
ret = -2;
return ret;
}
return actualChSpeed;
} incontextof this,
ruby : function(elm)
{
// ŽŸ‚Ì•¶Žš‚ɑ΂·‚郋ƒrÝ’è
if(currentWithBack) current.comp.setRuby(elm.text);
current.setRuby(elm.text);
return 0;
} incontextof this,
font : function(elm)
{
// ƒtƒHƒ“ƒgÝ’è
if(currentWithBack) current.comp.setFont(elm);
current.setFont(elm);
return 0;
} incontextof this,
deffont : function(elm)
{
// ƒfƒtƒHƒ‹ƒg‚̃tƒHƒ“ƒgÝ’è
if(currentWithBack) current.comp.setDefaultFont(elm);
current.setDefaultFont(elm);
return 0;
} incontextof this,
resetfont : function(elm)
{
// ƒtƒHƒ“ƒg‚̃ŠƒZƒbƒg
if(currentWithBack) current.comp.resetFont();
current.resetFont();
return 0;
} incontextof this,
style : function(elm)
{
// ƒXƒ^ƒCƒ‹Ý’è
if(currentWithBack) current.comp.setStyle(elm);
current.setStyle(elm);
return 0;
} incontextof this,
defstyle : function(elm)
{
// ƒfƒtƒHƒ‹ƒg‚̃Xƒ^ƒCƒ‹Ý’è
if(currentWithBack) current.comp.setDefaultStyle(elm);
current.setDefaultStyle(elm);
return 0;
} incontextof this,
resetstyle : function(elm)
{
// ƒXƒ^ƒCƒ‹‚̃ŠƒZƒbƒg
if(currentWithBack) current.comp.resetStyle();
current.resetStyle();
return 0;
} incontextof this,
link : function(elm)
{
// ƒnƒCƒp[ƒŠƒ“ƒN‚ÌŠJŽn
if(currentWithBack) current.comp.beginHyperLink(elm);
current.beginHyperLink(elm);
return 0;
} incontextof this,
endlink : function(elm)
{
// ƒnƒCƒp[ƒŠƒ“ƒN‚ÌI—¹
if(currentWithBack) current.comp.endHyperLink(elm);
current.endHyperLink(elm);
return 0;
} incontextof this,
button : function(elm)
{
// ƒOƒ‰ƒtƒBƒJƒ‹ƒ{ƒ^ƒ“
if(currentWithBack) current.comp.addButton(elm);
current.addButton(elm);
return 0;
} incontextof this,
edit : function(elm)
{
// ’Pˆês•ÒW
if(currentWithBack) current.comp.addEdit(elm);
current.addEdit(elm);
return 0;
} incontextof this,
checkbox : function(elm)
{
// ’Pˆês•ÒW
if(currentWithBack) current.comp.addCheckBox(elm);
current.addCheckBox(elm);
return 0;
} incontextof this,
commit : function(elm)
{
// ƒtƒH[ƒ€—v‘f‚̃Rƒ~ƒbƒg
current.commit();
return 0;
} incontextof this,
l : function(elm)
{
// sƒNƒŠƒbƒN‘Ò‚¿
return showLineBreak(elm);
} incontextof this,
p : function(elm)
{
// ƒy[ƒWƒNƒŠƒbƒN‘Ò‚¿
if(historyWriteEnabled) historyLayer.reline();
return showPageBreak(elm);
} incontextof this,
current : function(elm)
{
// ‘€ì‘Îۂ̃ƒbƒZ[ƒWƒŒƒCƒ„‚ÌŽw’è
setCurrentMessageLayer(elm);
return 0;
} incontextof this,
position : function(elm)
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚̈ʒuA‘®«‚ðÝ’è
getMessageLayerObjectFromElm(elm).setPosition(elm);
return 0;
} incontextof this,
ct : function(elm)
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚̃ŠƒZƒbƒg(‚·‚ׂẴƒbƒZ[ƒWƒŒƒCƒ„‚̃NƒŠƒA‚Æ
// current ‚̃ŠƒZƒbƒg)
if(historyWriteEnabled) historyLayer.repage();
clearMessageLayers(true);
return 0;
} incontextof this,
cm : function(elm)
{
// ƒƒbƒZ[ƒWƒŒƒCƒ„‚̃ŠƒZƒbƒg‚ðs‚¤‚ªAct ‚̂悤‚É
// current ‚̃ŠƒZƒbƒg‚Ís‚í‚È‚¢‚à‚Ì
if(historyWriteEnabled) historyLayer.repage();
clearMessageLayers(false);
return 0;
} incontextof this,
er : function(elm)
{
// Œ»Ý‚̃ƒbƒZ[ƒWƒŒƒCƒ„‚̃NƒŠƒA
if(historyWriteEnabled) historyLayer.repage();
if(currentWithBack) current.comp.clear();
current.clear();
return 0;
} incontextof this,
indent : function(elm)
{
// ƒCƒ“ƒfƒ“ƒg‚ÌÝ’è
if(currentWithBack) current.comp.setIndent();
current.setIndent();
if(historyWriteEnabled) historyLayer.beginIndent();
return 0;
} incontextof this,
endindent : function(elm)
{
// ƒCƒ“ƒfƒ“ƒg‚̉ðœ
if(currentWithBack) current.comp.resetIndent();
current.resetIndent();
if(historyWriteEnabled) historyLayer.endIndent();
return 0;
} incontextof this,
delay : function(elm)
{
// •¶Žš•\Ž¦‘¬“x‚ÌŽw’è
setDelay(elm);
return 0;
} incontextof this,
nowait : function(elm)
{
// ˆêŽž“I‚Ƀm[ƒEƒFƒCƒg‚ÅŽÀs
enterNoWait();
return 0;
} incontextof this,
endnowait : function(elm)
{
// nowait ‚̉ðœ
leaveNoWait();
return 0;
} incontextof this,
locate : function(elm)
{
// •¶Žš•\Ž¦ˆÊ’u‚ðŽw’è
if(currentWithBack) current.comp.locate(elm.x, elm.y);
current.locate(elm.x, elm.y);
return 0;
} incontextof this,
glyph : function(elm)
{
// ƒNƒŠƒbƒN‘Ò‚¿‹L†‚ðŽw’è
current.setGlyph(elm);
return 0;
} incontextof this,
locklink : function(elm)
{
// ƒŠƒ“ƒN‚̃ƒbƒN
lockMessageLayerSelProcess();
return 0;
} incontextof this,
unlocklink : function(elm)
{
// ƒŠƒ“ƒN‚̃Aƒ“ƒƒbƒN
unlockMessageLayerSelProcess();
return 0;
} incontextof this,
//----------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ(ƒVƒXƒeƒ€‘€ì) --
loadplugin : function(elm)
{
// ƒvƒ‰ƒOƒCƒ“‚Ì“Ç‚Ýž‚Ý
Plugins.link(elm.module);
dm("ƒvƒ‰ƒOƒCƒ“‚ð“Ç‚Ýž‚Ý‚Ü‚µ‚½ : " + elm.module);
return 0;
} incontextof this,
title : function(elm)
{
// ƒ^ƒCƒgƒ‹‚ÌÝ’è
setTitle(elm.name);
return 0;
} incontextof this,
s : function(elm)
{
// ŽÀs’âŽ~
stablePosibility = true;
cancelSkip();
if(!usingExtraConductor) incRecordLabel(true);
inSleep = true;
if(recordHistoryOfStore == 2) // 2 : ‘I‘ðŽˆ ( @s ƒ^ƒO ) ‚²‚Æ
setToRecordHistory();
notifyStable();
return -1;
} incontextof this,
clickskip : function(elm)
{
// ƒNƒŠƒbƒNƒXƒLƒbƒv‚ÌÝ’è
clickSkipEnabled = +elm.enabled;
return 0;
} incontextof this,
nextskip : function(elm)
{
// ŽŸ‚Ì‘I‘ðŽˆ(/–¢“Ç)‚Ü‚Åi‚Þ‚ÌÝ’è
nextSkipEnabled = +elm.enabled;
return 0;
} incontextof this,
cancelskip : function(elm)
{
// ƒXƒLƒbƒv‚̉ðœ
cancelSkip();
return 0;
} incontextof this,
cancelautomode : function(elm)
{
// uŽ©“®“I‚É“Ç‚Ýi‚Þv‚̉ðœ
cancelAutoMode();
return 0;
} incontextof this,
resetwait : function(elm)
{
// ŽžŠÔŒ´“_‚ÌÝ’è
resetWait();
return 0;
} incontextof this,
wait : function(elm)
{
// ƒEƒFƒCƒg
return doWait(elm);
} incontextof this,
wc : function(elm)
{
// Žw’蕶Žš•ª‚̃EƒFƒCƒg
return doWaitCh(elm);
} incontextof this,
waitclick : function(elm)
{
// ƒNƒŠƒbƒN‚ð‘Ò‚Â
return waitClick(elm);
} incontextof this,
rclick : function(elm)
{
// ‰EƒNƒŠƒbƒN‚Ì“®ìÝ’è
setRightClickOptions(elm);
return 0;
} incontextof this,
history : function(elm)
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ÌÝ’è
setHistoryOptions(elm);
return 0;
} incontextof this,
showhistory : function(elm)
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚Ì•\Ž¦
return showHistoryByScenario(elm);
} incontextof this,
hr : function(elm)
{
// ƒƒbƒZ[ƒW—š—ðƒŒƒCƒ„‚ɉüs‚ðo—Í
if(historyWriteEnabled)
{
if(elm.repage !== void && +elm.repage)
historyLayer.repage();
else
historyLayer.reline();
}
return 0;
} incontextof this,
hact : function(elm)
{
// ƒƒbƒZ[ƒW—š—ð‚ɃAƒNƒVƒ‡ƒ“‚ðÝ’è
if(historyWriteEnabled)
historyLayer.setNewAction(elm.exp);
return 0;
} incontextof this,
endhact : function(elm)
{
// ƒƒbƒZ[ƒW—š—ð‚̃AƒNƒVƒ‡ƒ“‚ðƒNƒŠƒA
if(historyWriteEnabled)
historyLayer.clearAction();
return 0;
} incontextof this,
hidemessage : function(elm)
{
// ƒƒbƒZ[ƒW‚ðˆêŽž“I‚ɉB‚·
return hideMessageLayerByScenario(elm);
} incontextof this,
quake : function(elm)
{
// —h‚ê
doQuake(elm);
return 0;
} incontextof this,
stopquake : function(elm)
{
// —h‚ê‚Ì’âŽ~
stopQuake();
return 0;
} incontextof this,
wq : function(elm)
{
// —h‚ê‚Ì’âŽ~‚ð‘Ò‚Â
return waitQuake(elm);
} incontextof this,
autowc : function(elm)
{
// Ž©“®ƒEƒFƒCƒg
setAutoWait(elm);
return 0;
} incontextof this,
cursor : function(elm)
{
// ƒ}ƒEƒXƒJ[ƒ\ƒ‹‚Ì•ÏX
setCursor(elm);
return 0;
} incontextof this,
close : function(elm)
{
// ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚é
closeByScript(elm);
return -2;
} incontextof this,
copybookmark : function(elm)
{
// žx‚ðƒRƒs[
copyBookMark(+elm.from, +elm.to);
return 0;
} incontextof this,
erasebookmark : function(elm)
{
// žx‚ðíœ
eraseBookMark(+elm.place);
return 0;
} incontextof this,
disablestore : function(elm)
{
// žx‚ðˆêŽž“I‚ÉŽg—p•s‰Â‚É
tempDisableStore(elm);
return 0;
} incontextof this,
store : function(elm)
{
// žx‚ÌŽg—p•s‰ÂEŽg—p‰Â‚ðÝ’è‚·‚é
setStoreEnabled(+elm.enabled);
return 0;
} incontextof this,
load : function(elm)
{
// žx‚Ì“Ç‚Ýž‚Ý
if(elm.ask !== void && +elm.ask)
loadBookMarkWithAsk(+elm.place);
else
loadBookMark(+elm.place);
return -4;
} incontextof this,
save : function(elm)
{
// žx‚Ì“Ç‚Ýž‚Ý
if(elm.ask !== void && +elm.ask)
saveBookMarkWithAsk(+elm.place);
else
saveBookMark(+elm.place);
return -4;
} incontextof this,
startanchor : function(elm)
{
// uʼn‚É–ß‚év‚ÌŽg—p•s‰ÂEŽg—p‰Â‚ðÝ’è‚·‚é
setStartAnchorEnabled(elm.enabled === void || +elm.enabled);
return 0;
} incontextof this,
gotostart : function(elm)
{
// uʼn‚É–ß‚év
if(elm.ask !== void && +elm.ask)
goToStartWithAsk();
else
goToStart();
return -4;
} incontextof this,
goback : function(elm)
{
// ’ʉߋL˜^‚ð–ß‚é
if(elm.ask !== void && +elm.ask)
goBackHistory(true);
else
goBackHistory(false);
return -4;
} incontextof this,
record : function(elm)
{
// ’ʉߋL˜^‚ð‚·‚é
setToRecordHistory();
return 0;
} incontextof this,
tempsave : function(elm)
{
// ó‘Ԃ̃ƒ‚ƒŠ‚Ö‚Ì•Û‘¶
tempSave(+elm.place);
return 0;
} incontextof this,
tempload : function(elm)
{
// ó‘Ԃ̃ƒ‚ƒŠ‚Ö‚Ì•Û‘¶
tempLoad(+elm.place, elm);
//elm.se === void || +elm.se, elm.bgm === void || +elm.bgm,
//elm.backlay !== void && +elm.backlay);
return 0;
} incontextof this,
mappfont : function(elm)
{
// ƒŒƒ“ƒ_ƒŠƒ“ƒOς݃tƒHƒ“ƒg‚ðŒ»Ý‚̃tƒHƒ“ƒg‚Ƀ}ƒbƒsƒ“ƒO
mapPrerenderedFont(elm.storage);
return 0;
} incontextof this,
locksnapshot : function(elm)
{
// ‰æ–ʂ̃XƒiƒbƒvƒVƒ‡ƒbƒg‚ðƒƒbƒN‚·‚é
lockSnapshot();
return 0;
} incontextof this,
unlocksnapshot : function(elm)
{
// ‰æ–ʂ̃XƒiƒbƒvƒVƒ‡ƒbƒg‚̃ƒbƒN‚ð‰ðœ‚·‚é
unlockSnapshot();
return 0;
} incontextof this,
//------------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ(ƒŒƒCƒ„‘€ì) --
image : function(elm)
{
// ‰æ‘œ“Ç‚Ýž‚Ý
updateBeforeCh = 1;
var start = System.getTickCount();
getLayerFromElm(elm).loadImages(elm);
dm(elm.storage + " ‚Ì“Ç‚Ýž‚Ý‚É " + (System.getTickCount() - start) + "ms ‚©‚©‚è‚Ü‚µ‚½");
return 0;
} incontextof this,
img : function(elm)
{
// ‰æ‘œ“Ç‚Ýž‚Ý(image‚Æ‚¨‚È‚¶)
updateBeforeCh = 1;
var start = System.getTickCount();
getLayerFromElm(elm).loadImages(elm);
dm(elm.storage + " ‚Ì“Ç‚Ýž‚Ý‚É " + (System.getTickCount() - start) + "ms ‚©‚©‚è‚Ü‚µ‚½");
return 0;
} incontextof this,
pimage : function(elm)
{
// •”•ª’ljÁ‰æ‘œ“Ç‚Ýž‚Ý
getLayerFromElm(elm).loadPartialImage(elm);
return 0;
} incontextof this,
ptext : function(elm)
{
// ”wŒi/‘OŒiƒŒƒCƒ„‚Ö‚Ì•¶Žš•`‰æ
getLayerFromElm(elm).drawReconstructibleText(elm);
return 0;
} incontextof this,
freeimage : function(elm)
{
// ‰æ‘œ‚̃NƒŠƒA
updateBeforeCh = 1;
getLayerFromElm(elm).freeImage(elm);
return 0;
} incontextof this,
animstart : function(elm)
{
// ƒAƒjƒ[ƒVƒ‡ƒ“‚ÌŠJŽn
updateBeforeCh = 1;
getLayerFromElm(elm).startAnim(elm);
return 0;
} incontextof this,
animstop : function(elm)
{
// ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì’âŽ~
updateBeforeCh = 1;
getLayerFromElm(elm).stopAnim(+elm.seg);
return 0;
} incontextof this,
wa : function(elm)
{
// ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì’âŽ~‘Ò‚¿
return waitAnimation(elm);
} incontextof this,
mapimage : function(elm)
{
// ƒNƒŠƒbƒJƒuƒ‹ƒ}ƒbƒv‚̗̈æ‰æ‘œ‚ð“Ç‚Ýž‚Þ
getLayerFromElm(elm).loadProvinceImage(elm.storage);
return 0;
} incontextof this,
mapaction : function(elm)
{
// ƒNƒŠƒbƒJƒuƒ‹ƒ}ƒbƒv‚̗̈æƒAƒNƒVƒ‡ƒ“’è‹`‚ð“Ç‚Ýž‚Þ
getLayerFromElm(elm).loadProvinceActions(elm.storage);
return 0;
} incontextof this,
mapdisable : function(elm)
{
// ƒNƒŠƒbƒJƒuƒ‹ƒ}ƒbƒv‚𖳌ø‚É‚·‚é
getLayerFromElm(elm).clearProvinceActions();
return 0;
} incontextof this,
backlay : function(elm)
{
// ƒŒƒCƒ„‚ð— ‰æ–ʂɃRƒs[
updateBeforeCh = 1;
backupLayer(elm, true);
return 0;
} incontextof this,
forelay : function(elm)
{
// ƒŒƒCƒ„‚ð•\‰æ–ʂɃRƒs[
updateBeforeCh = 1;
backupLayer(elm, false);
return 0;
} incontextof this,
copylay : function(elm)
{
// “¯Ží‚̃ŒƒCƒ„“¯Žm‚̃Rƒs[
updateBeforeCh = 1;
copyLayer(elm);
return 0;
} incontextof this,
layopt : function(elm)
{
// ƒŒƒCƒ„‚̃IƒvƒVƒ‡ƒ“‚ðÝ’è
updateBeforeCh = 1;
getLayerFromElm(elm).setOptions(elm);
return 0;
} incontextof this,
trans : function(elm)
{
// ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ÌŠJŽn
getLayerPageFromElm(elm, false).beginTransition(elm);
return 0;
} incontextof this,
wt : function(elm)
{
// ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð‘Ò‚Â
return waitTransition(elm);
} incontextof this,
stoptrans : function(elm)
{
// ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“‚ð’âŽ~‚·‚é
stopAllTransitions();
return 0;
} incontextof this,
move : function(elm)
{
// Ž©“®ˆÚ“®‚ÌŠJŽn
getLayerFromElm(elm).beginMove(elm);
return 0;
} incontextof this,
wm : function(elm)
{
// Ž©“®ˆÚ“®‚ð‘Ò‚Â
return waitMove(elm);
} incontextof this,
stopmove : function(elm)
{
// Ž©“®ˆÚ“®‚ð’âŽ~‚·‚é
stopAllMoves();
return 0;
} incontextof this,
laycount : function(elm)
{
updateBeforeCh = 1;
allocateCharacterLayers(+elm.layers) if elm.layers !== void;
allocateMessageLayers(+elm.messages) if elm.messages !== void;
return 0;
} incontextof this,
//------------------------------ ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ(Œø‰Ê‰¹EBGMEƒrƒfƒI‘€ì) --
playbgm : function(elm)
{
// BGM ‚̉‰‘t
bgm.play(elm);
return 0;
} incontextof this,
stopbgm : function(elm)
{
// BGM ‚Ì’âŽ~
bgm.stop();
return 0;
} incontextof this,
pausebgm : function(elm)
{
// BGM ‚̈ꎞ’âŽ~
bgm.pause();
return 0;
} incontextof this,
resumebgm : function(elm)
{
// BGM ‚ÌÄŠJ
bgm.resume();
return 0;
} incontextof this,
fadeinbgm : function(elm)
{
// BGM ‚̃tƒF[ƒhƒCƒ“
bgm.fadeIn(elm);
return 0;
} incontextof this,
fadeoutbgm : function(elm)
{
// BGM ‚̃tƒF[ƒhƒAƒEƒg
bgm.fadeOut(elm);
return 0;
} incontextof this,
fadebgm : function(elm)
{
// BGM ‚ÌŽw’艹—ʂ܂ł̃tƒF[ƒh
bgm.fade(elm);
return 0;
} incontextof this,
xchgbgm : function(elm)
{
// BGM ‚Ì“ü‚ê‘Ö‚¦/ƒNƒƒXƒtƒF[ƒh
bgm.exchange(elm);
return 0;
} incontextof this,
bgmopt : function(elm)
{
// BGM ‚̃IƒvƒVƒ‡ƒ“Ý’è
bgm.setOptions(elm);
return 0;
} incontextof this,
wb : function(elm)
{
// BGM ‚̃tƒF[ƒhI—¹‘Ò‚¿
return waitBGMFade(elm);
} incontextof this,
wl : function(elm)
{
// BGM ‚ÌĶI—¹‘Ò‚¿
return waitBGMStop(elm);
} incontextof this,
playse : function(elm)
{
// Œø‰Ê‰¹‚ÌĶ
se[+elm.buf].play(elm);
return 0;
} incontextof this,
stopse : function(elm)
{
// Œø‰Ê‰¹‚Ì’âŽ~
se[+elm.buf].stop();
return 0;
} incontextof this,
fadeinse : function(elm)
{
// Œø‰Ê‰¹‚̃tƒF[ƒhƒCƒ“Ķ
se[+elm.buf].fadeIn(elm);
return 0;
} incontextof this,
fadeoutse : function(elm)
{
// Œø‰Ê‰¹‚̃tƒF[ƒhƒAƒEƒg
se[+elm.buf].fadeOut(elm);
return 0;
} incontextof this,
fadese : function(elm)
{
// Œø‰Ê‰¹‚̃tƒF[ƒh
se[+elm.buf].fade(elm);
return 0;
} incontextof this,
seopt : function(elm)
{
// Œø‰Ê‰¹‚̃tƒF[ƒh
se[+elm.buf].setOptions(elm);
return 0;
} incontextof this,
wf : function(elm)
{
// Œø‰Ê‰¹‚̃tƒF[ƒhI—¹‘Ò‚¿
return waitSEFade(elm);
} incontextof this,
ws : function(elm)
{
// Œø‰Ê‰¹‚ÌĶI—¹‘Ò‚¿
return waitSEStop(elm);
} incontextof this,
video : function(elm)
{
// ƒ€[ƒr[‚̃IƒvƒVƒ‡ƒ“‚ðÝ’è‚·‚é
movies[+elm.slot].setOptions(elm);
return 0;
} incontextof this,
playvideo : function(elm)
{
// ƒ€[ƒr[‚ðĶ‚·‚é
movies[+elm.slot].play(elm.storage);
return 0;
} incontextof this,
stopvideo : function(elm)
{
// ƒ€[ƒr[‚ð’âŽ~‚·‚é
movies[+elm.slot].stop();
return 0;
} incontextof this,
openvideo : function(elm)
{
// ƒ€[ƒr[Ķ‚Ì€”õ‚ð‚·‚é
movies[+elm.slot].open(elm.storage);
return 0;
} incontextof this,
wv : function(elm)
{
// ƒ€[ƒr[‚ÌĶI—¹‚ð‘Ò‚Â
return waitMovieStop(elm);
} incontextof this,
// Start: Add: T.Imoto
wp : function(elm)
{
// ƒ€[ƒr[‚̃sƒŠƒIƒhƒCƒxƒ“ƒg‚ð‘Ò‚Â
return waitMoviePeriod(elm);
} incontextof this,
pausevideo : function(elm)
{
movies[+elm.slot].pause();
return 0;
} incontextof this,
resumevideo : function(elm)
{
movies[+elm.slot].resume();
return 0;
} incontextof this,
preparevideo : function(elm)
{
movies[+elm.slot].prepare();
return 0;
} incontextof this,
rewindvideo : function(elm)
{
movies[+elm.slot].rewind();
return 0;
} incontextof this,
videolayer : function(elm)
{
movies[+elm.slot].storeLayer( elm.layer, elm.page, elm.channel );
movies[+elm.slot].setVideoLayer(getLayerFromElm(elm),elm);
return 0;
} incontextof this,
clearvideolayer : function(elm)
{
movies[+elm.slot].cancelLayer( elm.channel );
movies[+elm.slot].setVideoLayer(null,elm);
return 0;
} incontextof this,
videosegloop : function(elm)
{
movies[+elm.slot].setSegment(elm);
return 0;
} incontextof this,
cancelvideosegloop : function(elm)
{
movies[+elm.slot].cancelSegmentLoop();
return 0;
} incontextof this,
videoevent : function(elm)
{
movies[+elm.slot].setPeriod(elm);
return 0;
} incontextof this,
cancelvideoevent : function(elm)
{
movies[+elm.slot].cancelPeriodEvent();
return 0;
} incontextof this,
// End: Add: T.Imoto
//--------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ(•Ï”ETJS ‘€ì) --
eval : function(elm)
{
// Ž®‚Ì•]‰¿
Scripts.eval(elm.exp);
return 0;
} incontextof this,
trace : function(elm)
{
// Ž®‚̃gƒŒ[ƒX•\Ž¦
var exp = elm.exp;
var result = Scripts.eval(exp);
dm("¥[trace] expression=\"" + exp + "\" type of result=" + typeof result +
" result=" + result);
return 0;
} incontextof this,
input : function(elm)
{
// •¶Žš—ñ‚Ì“ü—Í
inputString(elm);
return 0;
} incontextof this,
clearsysvar : function(elm)
{
// ƒVƒXƒeƒ€•Ï”‚̃NƒŠƒA
clearSystemVariables();
return 0;
} incontextof this,
clearvar : function(elm)
{
// ƒQ[ƒ€•Ï”‚̃NƒŠƒA
clearVariables();
return 0;
} incontextof this,
waittrig : function(elm)
{
// ƒgƒŠƒK‚ð‘Ò‚Â
return waitTrigger(elm);
} incontextof this,
//----------------------------------------------- ƒ^ƒOƒnƒ“ƒhƒ‰ŒQ‚ÌI‚í‚è --
interrupt : function(elm) { return -2; } incontextof this ];
}
}
// TJS ƒXƒNƒŠƒvƒg‚Í‚±‚±‚ÅI‚í‚è
"
END_OF_TJS_SCRIPT
# "; /*
# assign ‚ŃRƒs[‚·‚ׂ«•Ï”‚ÌĶ¬‚ðs‚¤ perl ƒXƒNƒŠƒvƒg
open FH, "MainWindow.tjs" or die;
undef($/);
$content = <FH>;
$list_store = '';
$list_restore = '';
while($content =~ /\/\*C\*\/var\s+(\w+)/gs)
{
$list_store .= "\t\tf.$1 = $1;\n";
$list_restore .= "\t\t$1 = f.$1 if f.$1 !== void;\n";
}
$content =~
s/\t\t\/\/ \[start_store_vars\]\n.*?\t\t\/\/ \[end_store_vars\]/\t\t\/\/ \[start_store_vars\]\n$list_store\t\t\/\/ \[end_store_vars\]/s;
$content =~
s/\t\t\/\/ \[start_restore_vars\]\n.*?\t\t\/\/ \[end_restore_vars\]/\t\t\/\/ \[start_restore_vars\]\n$list_restore\t\t\/\/ \[end_restore_vars\]/s;
open FH, ">MainWindow.tjs" or die;
print FH $content;
# */