微件:ScenarioSimulator:修订间差异
跳到导航
跳到搜索
小无编辑摘要 |
小无编辑摘要 |
||
第15行: | 第15行: | ||
<div class="button_style" id="button_auto" style="right:100px;" onclick="txt_auto()">自动▶</div> | <div class="button_style" id="button_auto" style="right:100px;" onclick="txt_auto()">自动▶</div> | ||
<div class="button_style" id="button_reset" style="right:0px;color:#808080;" onclick="txt_reset()">重置▶</div> | <div class="button_style" id="button_reset" style="right:0px;color:#808080;" onclick="txt_reset()">重置▶</div> | ||
<div | <div id="pic_back" style="display:block;width:800px;height:450px;" onclick="txt_click(0)"></div> | ||
<div class="char_style" id="pic_char_1" style="display:none;" onclick="txt_click(1)"> | |||
<div class="char_style" id="pic_char_1" style="display:none;" onclick="txt_click( | |||
<div id="pic_char" style="float:left;position:absolute;left:200px;top:25px;width:400px;height:400px;"></div></div> | <div id="pic_char" style="float:left;position:absolute;left:200px;top:25px;width:400px;height:400px;"></div></div> | ||
<div class="char_style" id="pic_char_2" style="display:none;" onclick="txt_click( | <div class="char_style" id="pic_char_2" style="display:none;" onclick="txt_click(2)"> | ||
<div id="pic_char_left" style="float:left;position:absolute;left:100px;top:25px;width:400px;height:400px;"></div> | <div id="pic_char_left" style="float:left;position:absolute;left:100px;top:25px;width:400px;height:400px;"></div> | ||
<div id="pic_char_right" style="float:right;position:absolute;right:100px;top:25px;width:400px;height:400px;"></div></div> | <div id="pic_char_right" style="float:right;position:absolute;right:100px;top:25px;width:400px;height:400px;"></div></div> | ||
<div | <div id="dialog_main" style="position:absolute;width:790px;right:5px; bottom:5px;background-color:rgba(0,0,0,.8);" onclick="txt_click()"> | ||
<div style="position:absolute;text-align:right;width:150px;height:60px;padding:5px 10px 0px 10px;color:#929292;font-size:18px;" id="txt_name">剧情模拟器</div> | <div style="position:absolute;text-align:right;width:150px;height:60px;padding:5px 10px 0px 10px;color:#929292;font-size:18px;" id="txt_name">剧情模拟器</div> | ||
<div style="float:right;height:60px;width:600px;background-color:rgba(0,0,0,.85);padding:5px 10px 0px 10px;color:white;font-size:15px;" id="txt_output">单击开始剧情回顾</div> | <div style="float:right;height:60px;width:600px;background-color:rgba(0,0,0,.85);padding:5px 10px 0px 10px;color:white;font-size:15px;" id="txt_output">单击开始剧情回顾</div> | ||
第29行: | 第28行: | ||
<style> | <style> | ||
.char_style{ | .char_style{ | ||
background-clip:"padding-box"; | background-clip:"padding-box"; | ||
} | } | ||
.button_style{ | .button_style{ | ||
position:absolute; | position:absolute; | ||
float:right; | float:right; | ||
第46行: | 第40行: | ||
padding:0px 5px; | padding:0px 5px; | ||
text-align:left; | text-align:left; | ||
} | } | ||
</style> | </style> | ||
第67行: | 第48行: | ||
//(window.RLQ = window.RLQ || []).push(function () { | //(window.RLQ = window.RLQ || []).push(function () { | ||
//$(document).ready(function() { | //$(document).ready(function() { | ||
var txt_now = 0,txt_num = 0,txt_num_max = 0 | var txt_now = 0,txt_num = 0,txt_num_max = 0; | ||
var timer_id,flag_timer = false; | var timer_id,flag_timer = false; | ||
var timer_id_auto,timer_id_wait,flag_auto = false; | var timer_id_auto,timer_id_wait,flag_auto = false; | ||
第79行: | 第60行: | ||
try | try | ||
{ | { | ||
data_temp = document.getElementById("datas_txt").innerHTML; | |||
data_txt = data_temp.split("\n"); | data_txt = data_temp.split("\n"); | ||
} | } | ||
第153行: | 第127行: | ||
system_enabled = false; | system_enabled = false; | ||
reset_enabled = true; | reset_enabled = true; | ||
document.getElementById("button_reset").style | document.getElementById("button_reset").style = "right:0px;" | ||
if(flag_auto == true) | if(flag_auto == true) | ||
{ | { | ||
第189行: | 第163行: | ||
auto_stop(); | auto_stop(); | ||
} | } | ||
document.getElementById("pic_back"). | document.getElementById("pic_back").innerHTML = ""; | ||
document.getElementById("pic_char_1").style | document.getElementById("pic_char_1").style = "display:none;"; | ||
document.getElementById("pic_char_2").style | document.getElementById("pic_char_2").style = "display:none;"; | ||
document.getElementById("txt_name").innerHTML = "剧情模拟器"; | document.getElementById("txt_name").innerHTML = "剧情模拟器"; | ||
document.getElementById("txt_output").innerHTML = "剧情模拟已结束,单击将重新开始剧情回顾"; | document.getElementById("txt_output").innerHTML = "剧情模拟已结束,单击将重新开始剧情回顾"; | ||
system_enabled = true; | system_enabled = true; | ||
reset_enabled = false; | reset_enabled = false; | ||
document.getElementById("button_reset").style | document.getElementById("button_reset").style = "right:0px;color:#808080;" | ||
txt_now = 0; | txt_now = 0; | ||
txt_num_max = 0; | txt_num_max = 0; | ||
return; | return; | ||
} | |||
else if(data_txt[txt_now].indexOf(":") > 0) | |||
{ | |||
place = data_txt[txt_now].indexOf(":"); | |||
// console.log(data_txt[txt_now].substr(0,place)); | |||
document.getElementById("txt_name").innerHTML = data_txt[txt_now].substr(0,place); | |||
txt_num = place + 1; | |||
} | } | ||
//check | //check | ||
第209行: | 第190行: | ||
else if (debug == false) | else if (debug == false) | ||
{ | { | ||
ret = txt_check(); | ret = txt_check(); | ||
} | } | ||
if(ret == 1) | |||
{ | { | ||
txt_now++; | txt_now++; | ||
txt_next(); | txt_next(); | ||
} | } | ||
if(txt_now < txt_max && txt_now >= 0) | else if(txt_now < txt_max && txt_now >= 0) | ||
{ | { | ||
txt_dynamic(50); | txt_dynamic(50); | ||
第244行: | 第205行: | ||
{ | { | ||
var place = 0,temp = ""; | var place = 0,temp = ""; | ||
if(data_txt[txt_now].startsWith("[clear]")) | if(data_txt[txt_now].startsWith("[clear]")) | ||
{ | { | ||
document.getElementById("pic_back"). | document.getElementById("pic_back").innerHTML = ""; | ||
document.getElementById("pic_char_1").style | document.getElementById("pic_char_1").style = "display:none;"; | ||
document.getElementById("pic_char_2").style | document.getElementById("pic_char_2").style = "display:none;"; | ||
return 1; | return 1; | ||
} | } | ||
else if(data_txt[txt_now].startsWith("[clear_back]")) | else if(data_txt[txt_now].startsWith("[clear_back]")) | ||
{ | { | ||
document.getElementById("pic_back"). | document.getElementById("pic_back").innerHTML = ""; | ||
return 1; | return 1; | ||
} | } | ||
else if(data_txt[txt_now].startsWith("[clear_char]")) | else if(data_txt[txt_now].startsWith("[clear_char]")) | ||
{ | { | ||
document.getElementById("pic_char_1").style | document.getElementById("pic_char_1").style = "display:none;"; | ||
document.getElementById("pic_char_2").style | document.getElementById("pic_char_2").style = "display:none;"; | ||
return 1; | return 1; | ||
} | } | ||
第274行: | 第228行: | ||
temp = data_txt[txt_now].substr(place); | temp = data_txt[txt_now].substr(place); | ||
document.getElementById("pic_back").innerHTML = "<img alt=\"" + temp + "\" width=\"800\" height=\"450\" src=\"" + data_pic_back[temp] + "\">"; | document.getElementById("pic_back").innerHTML = "<img alt=\"" + temp + "\" width=\"800\" height=\"450\" src=\"" + data_pic_back[temp] + "\">"; | ||
return 1; | return 1; | ||
} | } | ||
第282行: | 第235行: | ||
temp = data_txt[txt_now].substr(place); | temp = data_txt[txt_now].substr(place); | ||
document.getElementById("pic_char").innerHTML = "<img alt=\"" + temp + "\" width=\"400\" height=\"400\" src=\"" + data_pic_char[temp] + "\">"; | document.getElementById("pic_char").innerHTML = "<img alt=\"" + temp + "\" width=\"400\" height=\"400\" src=\"" + data_pic_char[temp] + "\">"; | ||
document.getElementById("pic_char_1").style | document.getElementById("pic_char_1").style = "display:block;"; | ||
document.getElementById("pic_char_2").style | document.getElementById("pic_char_2").style = "display:none;"; | ||
return 1; | return 1; | ||
} | } | ||
第297行: | 第250行: | ||
{ | { | ||
console.error("Command analyze failed."); | console.error("Command analyze failed."); | ||
return | return; | ||
} | } | ||
pic_left=temp[0]; | pic_left=temp[0]; | ||
第305行: | 第258行: | ||
if (data_txt[txt_now].startsWith("[char_left]")) | if (data_txt[txt_now].startsWith("[char_left]")) | ||
{ | { | ||
char_left.style | char_left.style = "float:left;position:absolute;left:100px;top:25px;width:400px;height:400px;"; | ||
char_right.style | char_right.style = "display:none;"; | ||
} | } | ||
else if (data_txt[txt_now].startsWith("[char_right]")) | else if (data_txt[txt_now].startsWith("[char_right]")) | ||
{ | { | ||
char_right.style | char_right.style = "float:right;position:absolute;right:100px;top:25px;width:400px;height:400px;"; | ||
char_left.style | char_left.style = "display:none;"; | ||
} | } | ||
else if (data_txt[txt_now].startsWith("[char_both]")) | else if (data_txt[txt_now].startsWith("[char_both]")) | ||
{ | { | ||
char_left.style | char_left.style = "float:left;position:absolute;left:100px;top:25px;width:400px;height:400px;"; | ||
char_right.style | char_right.style = "float:right;position:absolute;right:100px;top:25px;width:400px;height:400px;"; | ||
} | } | ||
document.getElementById("pic_char_1").style | document.getElementById("pic_char_1").style = "display:none;"; | ||
document.getElementById("pic_char_2").style | document.getElementById("pic_char_2").style = "display:block;"; | ||
return 1; | return 1; | ||
} | } | ||
第331行: | 第284行: | ||
} | } | ||
reset_enabled = true; | reset_enabled = true; | ||
document.getElementById("button_reset").style | document.getElementById("button_reset").style = "right:0px;" | ||
if(flag_auto == false) | if(flag_auto == false) | ||
{ | { | ||
第366行: | 第319行: | ||
txt_stop(); | txt_stop(); | ||
} | } | ||
document.getElementById("pic_back"). | document.getElementById("pic_back").innerHTML = ""; | ||
document.getElementById("pic_char_1").style | document.getElementById("pic_char_1").style = "display:none;"; | ||
document.getElementById("pic_char_2").style | document.getElementById("pic_char_2").style = "display:none;"; | ||
document.getElementById("txt_name").innerHTML = "剧情模拟器"; | document.getElementById("txt_name").innerHTML = "剧情模拟器"; | ||
document.getElementById("txt_output").innerHTML = "剧情模拟已重置,单击开始剧情回顾"; | document.getElementById("txt_output").innerHTML = "剧情模拟已重置,单击开始剧情回顾"; | ||
reset_enabled = false; | reset_enabled = false; | ||
document.getElementById("button_reset").style | document.getElementById("button_reset").style = "right:0px;color:#808080;" | ||
txt_now = 0; | txt_now = 0; | ||
txt_num_max = 0; | txt_num_max = 0; | ||
第415行: | 第368行: | ||
function txt_dynamic(interval) | function txt_dynamic(interval) | ||
{ | { | ||
txt_num_max = data_txt[txt_now].length; | |||
flag_timer = true; | flag_timer = true; | ||
timer_id = setInterval("timer1()",50); | timer_id = setInterval("timer1()",50); | ||
第430行: | 第376行: | ||
if (txt_num < txt_num_max) | if (txt_num < txt_num_max) | ||
{ | { | ||
txt_temp = txt_temp + data_txt[txt_now].substr(txt_num,1); | |||
document.getElementById("txt_output").innerHTML = txt_temp; | document.getElementById("txt_output").innerHTML = txt_temp; | ||
txt_num++; | txt_num++; | ||
第460行: | 第399行: | ||
} | } | ||
var data_command = data_txt[txt_now].match("^\\[\\s*(?:(.*)\\((.*)\\)|(?:([\\.|\\w]*)|(.*)))\\s*\\]\\s*(.*)"); //COMMAND REGEX | var data_command = data_txt[txt_now].match("^\\[\\s*(?:(.*)\\((.*)\\)|(?:([\\.|\\w]*)|(.*)))\\s*\\]\\s*(.*)"); //COMMAND REGEX | ||
return 0; | return 0; | ||
} | } | ||
</script> | </script> | ||
</includeonly> | </includeonly> |