Skip to content

Commit

Permalink
kirilllive
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirilllive committed Dec 10, 2024
1 parent bf34b89 commit 63897f3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
7 changes: 3 additions & 4 deletions plugins/screen_control.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
let tue_screen_control=true;
tuesday.addEventListener('mouseup',function(e){
// if(tue_screen_control && e.pageX > tuesday.offsetWidth/3 ){
if(tue_screen_control){//} && e.pageX > tuesday.offsetWidth/3 ){
if(story_json[tue_story][scene].dialogs==0 || check_choice(story_json[tue_story][scene].dialogs)){go_story()}
// } else if( story_json[tue_story][scene].dialogs==0 || check_choice(story_json[tue_story][scene].dialogs) && tue_screen_control){back_story()};
} //else if( story_json[tue_story][scene].dialogs==0 || check_choice(story_json[tue_story][scene].dialogs) && tue_screen_control){back_story()};
tue_screen_control=true;
});
tuesday.addEventListener('script_loaded',function(event){
if(document.getElementById('tue_back')){tue_back.style.pointerEvents='none'};
if(document.getElementById('tue_next')){tue_next.style.pointerEvents='none'};
var buttons=document.getElementById("tuesday").getElementsByClassName("tue_controll");
for(var i=0;i < buttons.length;i++){buttons[i].setAttribute('onmouseup','tue_screen_control=false;');}
for(var i=0;i < buttons.length;i++){buttons[i].setAttribute('onmousedown','tue_screen_control=false;');}
});
38 changes: 26 additions & 12 deletions tuesday_visual.html
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@
},"screen_control":{
"name":"Screen control",
"text":"switches dialogue by click to screen.",
"code":"let tue_screen_control=!0;tuesday.addEventListener('mouseup',function(e){(0==story_json[tue_story][scene].dialogs||check_choice(story_json[tue_story][scene].dialogs))&&go_story(),tue_screen_control=!0}),tuesday.addEventListener('script_loaded',function(e){document.getElementById('tue_back')&&(tue_back.style.pointerEvents='none'),document.getElementById('tue_next')&&(tue_next.style.pointerEvents='none');for(var t=document.getElementById('tuesday').getElementsByClassName('tue_controll'),n=0;n<t.length;n++)t[n].setAttribute('onmouseup','tue_screen_control=false;')});"
"code":"let tue_screen_control=!0;tuesday.addEventListener(\"mouseup\",function(e){tue_screen_control&&(0==story_json[tue_story][scene].dialogs||check_choice(story_json[tue_story][scene].dialogs))&&go_story(),tue_screen_control=!0}),tuesday.addEventListener(\"script_loaded\",function(e){document.getElementById(\"tue_next\")&&(tue_next.style.pointerEvents=\"none\");for(var t=document.getElementById(\"tuesday\").getElementsByClassName(\"tue_controll\"),n=0;n<t.length;n++)t[n].setAttribute(\"onmousedown\",\"tue_screen_control=false;\")});"
},"speech":{
"name":"Speech",
"text":"Speech synthesis TTS<br>reading text with a synthesized voice",
Expand Down Expand Up @@ -1627,7 +1627,7 @@
x.classList.add("toast_anim");
}
function about(){
var html="<div class='window' style='padding:24px 16px 0px 16px;width:422px;'><div><div class='window_close icon icon_close' onclick='modal_window(\"close\")'></div></div><div align='center'><p style='font-size:22px;'>Tuesday JS visual novel engine</p><hr><p>Release: 51</p>"
var html="<div class='window' style='padding:24px 16px 0px 16px;width:422px;'><div><div class='window_close icon icon_close' onclick='modal_window(\"close\")'></div></div><div align='center'><p style='font-size:22px;'>Tuesday JS visual novel engine</p><hr><p>Release: 52</p>"
+"<table style=' border-spacing:10px;border-collapse:separate; width: 100%;'><tr><td align='right' colspan='1'>E-Mail:</td><td align='left' colspan='2'><a href='mailto:[email protected]' target='_blank'>[email protected]</a></td></tr><tr><td align='right' colspan='1'>WebSite:</td><td align='left' colspan='3'><a href='https://kirilllive.github.io/tuesday-js' target='_blank'>kirilllive.github.io/tuesday-js</a></td></tr> <tr><td align='right' colspan='1'>Tutorial:</td><td align='left' colspan='3'><a href='https://kirilllive.github.io/tuesday-js/doc_editor.html#quick_tutorial' target='_blank'>kirilllive.github.io/tuesday-js/doc_editor</a></td></tr><tr>"
+"<td class='button_menu' style='border-radius:16px;width:33%;height:64px' align='center'><a href='https://github.com/Kirilllive/tuesday-js' target='_blank'><svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 256 256' style='filter:var(--ft);'><path d='M128,0C57,0 0,57 0,128c0,57 37,104 88,121 6,1 9,-3 9,-6 0,-3-0,-13-0,-24C64,225 56,212 53,204 52,201 45,189 40,186c-4,-2-11,-8-0,-8 10,-0 17,9 20,13 12,19 30,14 37,11 1,-8 4,-14 8,-17-28,-3-58,-14-58,-63 0,-14 5,-25 13,-34-1,-3-6,-16 1,-34 0,0 11,-3 35,13 10,-3 21,-4 32,-4 11,0 22,1 32,4 24,-17 35,-13 35,-13 7,18 3,31 1,34 8,9 13,20 13,34 0,49-30,60-58,63 5,4 9,12 9,24 0,17-0,31-0,35 0,3 2,7 9,6C219,232 256,184 256,128 256,57 199,0 128,0Z' fill='#000' /></svg></a></td>"
+"<td class='button_menu' style='border-radius:16px;width:33%;height:64px' align='center'><a href='https://www.reddit.com/r/TuesdayJS/' target='_blank'> <svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 116 116' style='filter:var(--ft);'><path fill='#000' transform='translate(-82,-80)' d='m 195.7,139.8 c 0,-6.8 -5.5,-12.2 -12.2,-12.2 -3.3,0 -6.3,1.3 -8.5,3.4 -8.4,-6 -19.9,-9.9 -32.7,-10.4 l 5.6,-26.2 18.2,3.9 c 0.2,4.6 4,8.3 8.7,8.3 4.8,0 8.7,-3.9 8.7,-8.7 0,-4.8 -3.9,-8.7 -8.7,-8.7 -3.4,0 -6.4,2 -7.8,4.9 l -20.3,-4.3 c -0.6,-0.1 -1.2,0 -1.6,0.3 -0.5,0.3 -0.8,0.8 -0.9,1.4 l -6.2,29.2 c -13,0.4 -24.7,4.3 -33.2,10.4 -2.2,-2.1 -5.2,-3.4 -8.5,-3.4 -6.8,0 -12.2,5.5 -12.2,12.2 0,5 3,9.2 7.2,11.1 -0.2,1.2 -0.3,2.4 -0.3,3.7 0,18.8 21.9,34.1 48.9,34.1 27,0 48.9,-15.2 48.9,-34.1 0,-1.2 -0.1,-2.5 -0.3,-3.7 4.2,-1.9 7.2,-6.2 7.2,-11.2 z m -83.8,8.7 c 0,-4.8 3.9,-8.7 8.7,-8.7 4.8,0 8.7,3.9 8.7,8.7 0,4.8 -3.9,8.7 -8.7,8.7 -4.8,0.1 -8.7,-3.9 -8.7,-8.7 z m 48.7,23.1 c -6,6 -17.4,6.4 -20.7,6.4 -3.4,0 -14.8,-0.5 -20.7,-6.4 -0.9,-0.9 -0.9,-2.3 0,-3.2 0.9,-0.9 2.3,-0.9 3.2,0 3.8,3.8 11.8,5.1 17.5,5.1 5.7,0 13.8,-1.3 17.5,-5.1 0.9,-0.9 2.3,-0.9 3.2,0 0.8,0.9 0.8,2.3 0,3.2 z M 159,157.3 c -4.8,0 -8.7,-3.9 -8.7,-8.7 0,-4.8 3.9,-8.7 8.7,-8.7 4.8,0 8.7,3.9 8.7,8.7 0,4.7 -3.9,8.7 -8.7,8.7 z'/></svg></a></td>"
Expand Down Expand Up @@ -5185,19 +5185,33 @@
let box_x,box_y,box_width,box_height;
document.onkeydown=function(e){
e=e||window.event;
if(e.keyCode == '27'){if(add_element.style.visibility=="visible"){menu_add.style.visibility='hidden';}else if(window_zone.style.visibility=="visible"){modal_window("close")}}
else if(e.keyCode == '13'){{if(objFocus){if(!f){scene_scroll=false;saveResize();}else{eval(f)};}}}
else if(e.keyCode == '38'){if(objFocus){scene_view.style.overflow='hidden';s.style.top=(s.offsetTop-((e.shiftKey)?10:1))+'px';moveSave=true;}}
else if(e.keyCode == '40'){if(objFocus){scene_view.style.overflow='hidden';s.style.top=(s.offsetTop+((e.shiftKey)?10:1))+'px';moveSave=true;}}
else if(e.keyCode == '37'){if(objFocus){scene_view.style.overflow='hidden';s.style.left=(s.offsetLeft-((e.shiftKey)?10:1))+'px';moveSave=true;}}
else if(e.keyCode == '39'){if(objFocus){scene_view.style.overflow='hidden';s.style.left=(s.offsetLeft+((e.shiftKey)?10:1))+'px';moveSave=true;}}
if(e.keyCode=='27'){if(add_element.style.visibility=="visible"){menu_add.style.visibility='hidden';}else if(window_zone.style.visibility=="visible"){modal_window("close")} else if(objFocus){ menu_element.style.visibility='hidden';scen_edit_update(true);} }
else if(e.keyCode=='13'){{if(objFocus){if(!f){scene_scroll=false;saveResize();}else{eval(f)};}}}
else if(e.keyCode=='8'||e.keyCode=='46'){if(objFocus){scene_scroll=false;let a=(story_script.parameters.buttons.lastIndexOf(arr_e)>=0)?story_script.parameters:(arr_l[arr_n].objects)?arr_l[arr_n].objects:story_script[scen_data[0]][scen_data[1]].dialogs[scen_data[2]-1];
if(arr_l[arr_n]&&arr_l[arr_n].objects){ a.splice(a.lastIndexOf(arr_e),1);ho_update();
}else if(a.buttons){a.buttons.splice(a.buttons.lastIndexOf(arr_e),1);menu_element.style.visibility='hidden';scen_edit_update(true);
}else if(arr_e.url){a.art.splice(a.art.lastIndexOf(arr_e),1);menu_element.style.visibility='hidden';scen_edit_update(true);
}else{a.choice.splice(a.choice.lastIndexOf(arr_e),1);menu_element.style.visibility='hidden';scen_edit_update(true);
};state_save();}
}
else if(e.keyCode=='68'){if(objFocus){scene_scroll=false;let a=(story_script.parameters.buttons.lastIndexOf(arr_e)>=0)?story_script.parameters:(arr_l[arr_n].objects)?arr_l[arr_n].objects:story_script[scen_data[0]][scen_data[1]].dialogs[scen_data[2]-1];
if(arr_l[arr_n]&&arr_l[arr_n].objects){a.splice(a.lastIndexOf(arr_e),0,JSON.parse(JSON.stringify(a[a.lastIndexOf(arr_e)])));ho_update();
}else if(a.buttons){a.buttons.splice(a.buttons.lastIndexOf(arr_e),0,JSON.parse(JSON.stringify(a.buttons[a.buttons.lastIndexOf(arr_e)])));menu_element.style.visibility='hidden';scen_edit_update(true);
}else if(arr_e.url){a.art.splice(a.art.lastIndexOf(arr_e),0,JSON.parse(JSON.stringify(a.art[a.art.lastIndexOf(arr_e)])));menu_element.style.visibility='hidden';scen_edit_update(true);
}else{a.choice.splice(a.choice.lastIndexOf(arr_e),0,JSON.parse(JSON.stringify(a.choice[a.choice.lastIndexOf(arr_e)])));menu_element.style.visibility='hidden';scen_edit_update(true);
};state_save();}
}
else if(e.keyCode=='38'){if(objFocus){scene_view.style.overflow='hidden';s.style.top=(s.offsetTop-((e.shiftKey)?10:1))+'px';moveSave=true;}}
else if(e.keyCode=='40'){if(objFocus){scene_view.style.overflow='hidden';s.style.top=(s.offsetTop+((e.shiftKey)?10:1))+'px';moveSave=true;}}
else if(e.keyCode=='37'){if(objFocus){scene_view.style.overflow='hidden';s.style.left=(s.offsetLeft-((e.shiftKey)?10:1))+'px';moveSave=true;}}
else if(e.keyCode=='39'){if(objFocus){scene_view.style.overflow='hidden';s.style.left=(s.offsetLeft+((e.shiftKey)?10:1))+'px';moveSave=true;}}
}
document.onkeyup=function(e){
e=e||window.event;
if(e.keyCode == '38'){if(objFocus){scene_view.style.overflow='scroll';}}
else if(e.keyCode == '40'){if(objFocus){scene_view.style.overflow='scroll'}}
else if(e.keyCode == '37'){if(objFocus){scene_view.style.overflow='scroll'}}
else if(e.keyCode == '39'){if(objFocus){scene_view.style.overflow='scroll'}}
if(e.keyCode=='38'){if(objFocus){scene_view.style.overflow='scroll';}}
else if(e.keyCode=='40'){if(objFocus){scene_view.style.overflow='scroll'}}
else if(e.keyCode=='37'){if(objFocus){scene_view.style.overflow='scroll'}}
else if(e.keyCode=='39'){if(objFocus){scene_view.style.overflow='scroll'}}
}
s.onmousedown=function(e){
if(e.button==1){e.preventDefault();}
Expand Down

0 comments on commit 63897f3

Please sign in to comment.