Skip to content

Commit

Permalink
kirilllive
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirilllive committed Nov 19, 2023
1 parent 7897372 commit e4c1771
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 21 deletions.
1 change: 1 addition & 0 deletions index.html

Large diffs are not rendered by default.

62 changes: 56 additions & 6 deletions translate/en_tuesday_visual.html

Large diffs are not rendered by default.

62 changes: 56 additions & 6 deletions translate/es_tuesday_visual.html

Large diffs are not rendered by default.

62 changes: 56 additions & 6 deletions translate/ja_tuesday_visual.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions translate/ru_tuesday_visual.html
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@
var dataStr="<!DOCTYPE html><html><head>"+((par[2]!=0)?"<link rel='shortcut icon' href='"+par[2]+"' type='image/x-icon'>":"")+"<meta charset='UTF-8'><meta name='viewport' content='initial-scale="+((story_script.parameters.scale)?story_script.parameters.scale:1)+",width=device-width,height=device-height,viewport-fit=cover,maximum-scale="+((story_script.parameters.scale)?story_script.parameters.scale:1)+",user-scalable=no'><style>"+((story_script.parameters.css)?story_script.parameters.css:"")+fonts+" "+((par[0]!=0)?"*{font-family:"+par[0]+";} ":"")+"body {"+((par[1]!=0)?"font-size:"+par[1]:"")+";background-color:var(--wn);border-collapse:collapse;border:none;margin:0;padding:0;border:0;border-spacing:0px;user-select:none;}<\/style><\/head><body><div id='tuesday' style='width:100%;height:100vh;'> <\/div><script type='text/javascript'>"+runtime+plugins_code+"<\/script>"+plugins_file+"<script>let story_novel="+story_preview+";load_story('data',story_novel);<\/script><\/body><\/html>";
build_zip(dataStr)
}else if(tip==2){
var dataStr="data:application/javascript;charset=utf-8,"+encodeURIComponent("const TelegramApi=require(\"node-telegram-bot-api\"),story_json="+JSON.stringify(story_build)+",tue_bot=new TelegramApi(story_json.parameters.telegram,{polling:!0});var tue_languare,tue_story,next_button,tue_scene=0,tue_dialog=0;const start=async()=>{function makeStory(chatId){var texts=\"\",buttons=[],block=story_json[tue_story][tue_scene];if(block.dialogs[tue_dialog].js&&eval(block.dialogs[tue_dialog].js),block.legacy_choice){for(var i=0;i<block.legacy_choice.length;i++){var choice_n=block.legacy_choice[i][0],choice_s=block.legacy_choice[i][1],choice_v=block.legacy_choice[i][2],choice_g=block.legacy_choice[i][3];if(\">\"==choice_s&&story_json.parameters.variables[choice_n]>choice_v){\"tue_go\"!=choice_g?go_to(choice_g):next_scene();break}if(\"<\"==choice_s&&story_json.parameters.variables[choice_n]<choice_v){\"tue_go\"!=choice_g?go_to(choice_g):next_scene();break}if(\"=\"==choice_s&&story_json.parameters.variables[choice_n]==choice_v){\"tue_go\"!=choice_g?go_to(choice_g):next_scene();break}else if(block.legacy_choice[i].go_to){block.legacy_choice[i].go_to&&\"tue_go\"!=block.legacy_choice[i].go_to?go_to(block.legacy_choice[i].go_to):next_scene();break}else if(i==block.legacy_choice.length-1){next_scene();break}}function go_to(e){story_json[e]?(tue_scene=0,tue_dialog=0,tue_story=e,makeStory(chatId)):e.includes(\",\")?(tue_story=(go=e.split(\",\"))[0],tue_dialog=go[2],tue_scene=go[1],makeStory(chatId)):\"tue_go\"===e&&makeStory(chatId)}function next_scene(){tue_scene++,tue_dialog=0,makeStory(chatId)}}else{for(i=0;i<block.dialogs.length-tue_dialog+1;i++){if(block.dialogs[tue_dialog].variables)for(var v=0;v<block.dialogs[tue_dialog].variables.length;v++){var choice_n=block.dialogs[tue_dialog].variables[v][0];\"add\"==block.dialogs[tue_dialog].variables[v][1]?story_json.parameters.variables[choice_n]+=block.dialogs[tue_dialog].variables[v][2]:\"set\"==block.dialogs[tue_dialog].variables[v][1]&&(story_json.parameters.variables[choice_n]=block.dialogs[tue_dialog].variables[v][2])}if(block.dialogs[tue_dialog].choice){texts+=values_button(block.dialogs[tue_dialog].text?(block.dialogs[tue_dialog].text[tue_languare]?block.dialogs[tue_dialog].text[tue_languare]:block.dialogs[tue_dialog].text)+\"\\n\\n\":block.dialogs[tue_dialog].text_add?(block.dialogs[tue_dialog].text_add[tue_languare]?block.dialogs[tue_dialog].text_add[tue_languare]:block.dialogs[tue_dialog].text_add)+\"\\n\\n\":\"?\");for(var e=block.dialogs[tue_dialog].choice.length-1;e>=0;e--)!block.dialogs[tue_dialog].choice[e].url&&\"tue_no\"!=block.dialogs[tue_dialog].choice[e].go_to&&show_if(block.dialogs[tue_dialog].choice[e])&&buttons.push([{text:block.dialogs[tue_dialog].choice[e].text&&data_la(block.dialogs[tue_dialog].choice[e].text).length>0?values_button(data_la(block.dialogs[tue_dialog].choice[e].text)):\"choice \"+e,callback_data:(\"tue_go\"!=block.dialogs[tue_dialog].choice[e].go_to?block.dialogs[tue_dialog].choice[e].go_to:tue_story+\",\"+tue_scene+\",\"+(parseInt(tue_dialog)+1)).toString()}]);tue_dialog++;break}texts+=values_button(block.dialogs[tue_dialog].text?(block.dialogs[tue_dialog].text[tue_languare]?block.dialogs[tue_dialog].text[tue_languare]:block.dialogs[tue_dialog].text)+\"\\n\\n\":block.dialogs[tue_dialog].text_add?(block.dialogs[tue_dialog].text_add[tue_languare]?block.dialogs[tue_dialog].text_add[tue_languare]:block.dialogs[tue_dialog].text_add)+\"\\n\\n\":\"\"),tue_dialog++}0==buttons.length&&block.dialogs.length==tue_dialog&&story_json[tue_story].length>tue_scene+1&&(tue_scene++,tue_dialog=0,buttons.push([{text:next_button,callback_data:\"tue_go\"}]));var background=data_la(block.background_image);background?tue_bot.sendPhoto(chatId,background,{caption:texts,reply_markup:JSON.stringify({inline_keyboard:buttons})}):tue_bot.sendMessage(chatId,texts,{reply_markup:JSON.stringify({inline_keyboard:buttons})})}}tue_bot.setMyCommands([{command:\"/start\",description:\"Restart\"}]),tue_bot.on(\"message\",async e=>{let t=e.text,a=e.chat.id;if(\"/start\"===t){tue_languare=story_json.parameters.languares.includes(e.from.language_code)?e.from.language_code:story_json.parameters.languares[0];for(var o=0;o<story_json.parameters.buttons.length;o++)if(\"tue_next\"==story_json.parameters.buttons[o].name){next_button=story_json.parameters.buttons[o].text?data_la(story_json.parameters.buttons[o].text):\"next\";break}tue_scene=0,tue_dialog=0,tue_story=story_json.parameters.launch_story,makeStory(a)}}),tue_bot.on(\"callback_query\",async e=>{let t=e.data,a=e.message.chat.id;story_json[t]?(tue_scene=0,tue_dialog=0,tue_story=t,makeStory(a)):t.includes(\",\")?(tue_story=(go=t.split(\",\"))[0],tue_dialog=go[2],tue_scene=go[1],makeStory(a)):\"tue_go\"===t&&makeStory(a)})};function data_la(e){var t=!!e&&(e[tue_languare]?e[tue_languare]:e);return t.length>0&&t}function show_if(e){if(show=!0,e.show_if){e=e.show_if;for(var t=1;t<e.length;t++){var a=e[t][0],o=e[t][1],s=void 0!==story_json.parameters.variables[e[t][2]]?story_json.parameters.variables[e[t][2]]:e[t][2];if(\"=\"==o){if(story_json.parameters.variables[a]!=s){show=!1;break}}else if(\">\"==o){if(story_json.parameters.variables[a]<=s){show=!1;break}}else if(\"<\"==o&&story_json.parameters.variables[a]>=s){show=!1;break}if(!show)break}show=e[0]?show:!show}return show}function values_button(e){let t=e.matchAll(/<(.*?)>/g);t=Array.from(t);for(var a=0;a<t.length;a++){let o=t[a];e=e.replace(o[0],story_json.parameters.variables[o[1]])}return e}start();"+((story_script.parameters.js)?story_script.parameters.js:""));
var dataStr="data:application/javascript;charset=utf-8,"+encodeURIComponent("const TelegramApi=require(\"node-telegram-bot-api\"),story_json="+JSON.stringify(story_build)+",tue_bot=new TelegramApi(story_json.parameters.telegram,{polling:!0});var tue_languare,tue_story,next_button,tue_scene=0,tue_dialog=0;const start=async()=>{function go_to(e,t){story_json[e]?(tue_scene=0,tue_dialog=0,tue_story=e,makeStory(t)):e.includes(\",\")?(tue_story=(go=e.split(\",\"))[0],tue_dialog=go[2],tue_scene=go[1],makeStory(t)):\"tue_go\"===e&&makeStory(t)}function next_scene(e){tue_scene++,tue_dialog=0,makeStory(e)}function makeStory(chatId){var texts=\"\",buttons=[],block=story_json[tue_story][tue_scene];if(block.dialogs&&block.dialogs[tue_dialog].js&&eval(block.dialogs[tue_dialog].js),block.random_choice){let choice_g=block.random_choice[Math.floor(Math.random()*block.random_choice.length)][1];\"tue_go\"!=choice_g?go_to(choice_g,chatId):next_scene(chatId)}else if(block.legacy_choice)for(var i=0;i<block.legacy_choice.length;i++){var choice_n=block.legacy_choice[i][0],choice_s=block.legacy_choice[i][1],choice_v=block.legacy_choice[i][2],choice_g=block.legacy_choice[i][3];if(\">\"==choice_s&&story_json.parameters.variables[choice_n]>choice_v){\"tue_go\"!=choice_g?go_to(choice_g,chatId):next_scene(chatId);break}if(\"<\"==choice_s&&story_json.parameters.variables[choice_n]<choice_v){\"tue_go\"!=choice_g?go_to(choice_g,chatId):next_scene(chatId);break}if(\"=\"==choice_s&&story_json.parameters.variables[choice_n]==choice_v){\"tue_go\"!=choice_g?go_to(choice_g,chatId):next_scene(chatId);break}else if(block.legacy_choice[i].go_to){block.legacy_choice[i].go_to&&\"tue_go\"!=block.legacy_choice[i].go_to?go_to(block.legacy_choice[i].go_to,chatId):next_scene(chatId);break}else if(i==block.legacy_choice.length-1){next_scene(chatId);break}}else{for(i=0;i<block.dialogs.length-tue_dialog+1;i++){if(block.dialogs[tue_dialog].variables)for(var v=0;v<block.dialogs[tue_dialog].variables.length;v++){var choice_n=block.dialogs[tue_dialog].variables[v][0];\"add\"==block.dialogs[tue_dialog].variables[v][1]?story_json.parameters.variables[choice_n]+=block.dialogs[tue_dialog].variables[v][2]:\"set\"==block.dialogs[tue_dialog].variables[v][1]&&(story_json.parameters.variables[choice_n]=block.dialogs[tue_dialog].variables[v][2])}if(block.dialogs[tue_dialog].choice){texts+=values_button(block.dialogs[tue_dialog].text?(block.dialogs[tue_dialog].text[tue_languare]?block.dialogs[tue_dialog].text[tue_languare]:block.dialogs[tue_dialog].text)+\"\\n\\n\":block.dialogs[tue_dialog].text_add?(block.dialogs[tue_dialog].text_add[tue_languare]?block.dialogs[tue_dialog].text_add[tue_languare]:block.dialogs[tue_dialog].text_add)+\"\\n\\n\":\"?\");for(var e=block.dialogs[tue_dialog].choice.length-1;e>=0;e--)!block.dialogs[tue_dialog].choice[e].url&&\"tue_no\"!=block.dialogs[tue_dialog].choice[e].go_to&&show_if(block.dialogs[tue_dialog].choice[e])&&buttons.push([{text:block.dialogs[tue_dialog].choice[e].text&&data_la(block.dialogs[tue_dialog].choice[e].text).length>0?values_button(data_la(block.dialogs[tue_dialog].choice[e].text)):\"choice \"+e,callback_data:(\"tue_go\"!=block.dialogs[tue_dialog].choice[e].go_to?block.dialogs[tue_dialog].choice[e].go_to:tue_story+\",\"+tue_scene+\",\"+(parseInt(tue_dialog)+1)).toString()}]);tue_dialog++;break}texts+=values_button(block.dialogs[tue_dialog].text?(block.dialogs[tue_dialog].text[tue_languare]?block.dialogs[tue_dialog].text[tue_languare]:block.dialogs[tue_dialog].text)+\"\\n\\n\":block.dialogs[tue_dialog].text_add?(block.dialogs[tue_dialog].text_add[tue_languare]?block.dialogs[tue_dialog].text_add[tue_languare]:block.dialogs[tue_dialog].text_add)+\"\\n\\n\":\"\"),tue_dialog++}0==buttons.length&&block.dialogs.length==tue_dialog&&story_json[tue_story].length>tue_scene+1&&(tue_scene++,tue_dialog=0,buttons.push([{text:next_button,callback_data:\"tue_go\"}]));var background=data_la(block.background_image);background?tue_bot.sendPhoto(chatId,background,{caption:texts,reply_markup:JSON.stringify({inline_keyboard:buttons})}):tue_bot.sendMessage(chatId,texts,{reply_markup:JSON.stringify({inline_keyboard:buttons})})}}tue_bot.setMyCommands([{command:\"/start\",description:\"Restart\"}]),tue_bot.on(\"message\",async e=>{let t=e.text,a=e.chat.id;if(\"/start\"===t){tue_languare=story_json.parameters.languares.includes(e.from.language_code)?e.from.language_code:story_json.parameters.languares[0];for(var o=0;o<story_json.parameters.buttons.length;o++)if(\"tue_next\"==story_json.parameters.buttons[o].name){next_button=story_json.parameters.buttons[o].text?data_la(story_json.parameters.buttons[o].text):\"next\";break}tue_scene=0,tue_dialog=0,tue_story=story_json.parameters.launch_story,makeStory(a)}}),tue_bot.on(\"callback_query\",async e=>{let t=e.data,a=e.message.chat.id;story_json[t]?(tue_scene=0,tue_dialog=0,tue_story=t,makeStory(a)):t.includes(\",\")?(tue_story=(go=t.split(\",\"))[0],tue_dialog=go[2],tue_scene=go[1],makeStory(a)):\"tue_go\"===t&&makeStory(a)})};function data_la(e){var t=!!e&&(e[tue_languare]?e[tue_languare]:e);return t.length>0&&t}function show_if(e){if(show=!0,e.show_if){e=e.show_if;for(var t=1;t<e.length;t++){var a=e[t][0],o=e[t][1],s=void 0!==story_json.parameters.variables[e[t][2]]?story_json.parameters.variables[e[t][2]]:e[t][2];if(\"=\"==o){if(story_json.parameters.variables[a]!=s){show=!1;break}}else if(\">\"==o){if(story_json.parameters.variables[a]<=s){show=!1;break}}else if(\"<\"==o&&story_json.parameters.variables[a]>=s){show=!1;break}if(!show)break}show=e[0]?show:!show}return show}function values_button(e){let t=e.matchAll(/<(.*?)>/g);t=Array.from(t);for(var a=0;a<t.length;a++){let o=t[a];e=e.replace(o[0],story_json.parameters.variables[o[1]])}return e}start();"+((story_script.parameters.js)?story_script.parameters.js:""));
download_files('index.js',dataStr)
modal_window("close")
if(story_script.base){delete story_script.base;delete story_script.base_sound;}
Expand Down Expand Up @@ -2674,7 +2674,7 @@
}
function random_choice_edit(){
let var_if="";
for(var i=0;i<arr_l[arr_n].random_choice.length;i++){var_if+="<tr><td><select class='random_block'>"+option_block(arr_l[arr_n].random_choice[i][1],0)+"</select></td><td style='width:40px;cursor:pointer;' onclick=\"var a=this.closest('tr');a.parentElement.removeChild(a);\" title='delet' class='icon icon_del'></td></tr>"}
for(var i=0;i<arr_l[arr_n].random_choice.length;i++){var_if+="<tr><td><select class='random_block'>"+option_block(arr_l[arr_n].random_choice[i][1],0)+"</select></td><td style='width:24px;cursor:pointer;background-position:right center;' onclick=\"var a=this.closest('tr');a.parentElement.removeChild(a);\" title='delet' class='icon icon_del'></td></tr>"}
var html="<div class='window' style='min-width:128px;padding-bottom:8px;'><div class='win_head'>Случайный выбор<div class='window_close icon icon_close' onclick='modal_window(\"close\")'></div></div><hr style='margin:0;'> <br><div style='max-height:70vh;overflow-x:hidden;overflow-y:auto;'><table width='100%' id='random_choice_edit'><tbody>"
+var_if+"</tbody></table><div aling='center' onclick=\"random_choice_new()\" class='icon icon_add' style='margin-top:16px;height:26px;width:26px;cursor:pointer;'></div> </div><br><table class='big_button' width='256px' onclick='random_choice_apply()'><tbody><tr><td width='42px' class='icon icon_ok'></td><td align='center'>Применить</td><td width='42px'></td></tr></tbody></table></div>"
modal_window("open",html);
Expand All @@ -2685,7 +2685,7 @@
let td2=document.createElement("td");
var td7=document.createElement("td");
td2.innerHTML="<select class='random_block'>"+option_block(story_script.parameters.launch_story,0)+"</select>";
td7.style="width:40px;cursor:pointer;";
td7.style="width:24px;cursor:pointer;background-position:right center;";
td7.title="delet";
td7.className="icon icon_del";
td7.setAttribute("onclick","var a=this.closest('tr');a.parentElement.removeChild(a);");
Expand Down

0 comments on commit e4c1771

Please sign in to comment.