Skip to content

Commit

Permalink
kirilllive
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirilllive committed Apr 20, 2024
1 parent 66cb720 commit 9617813
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
11 changes: 7 additions & 4 deletions translate/en_tuesday_visual.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
.icon_paste{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='0 0 64 64'%3e%3cpath fill='none' stroke='%23000' stroke-width='3' stroke-linejoin='round' d='M33,39L54,60M55,47V61H41M46,38V14a4,4,0,0,0-4-4H36v4H18V10H12a4,4,0,0,0-4,4V48a4,4,0,0,0,4,4H31M36,18V7H31a4,4,0,0,0-8,0H18V18H36Z'/%3e%3c/svg%3e")}
.icon_undo{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='0 0 64 64'%3e%3cpath fill='none' stroke='%23000' stroke-width='3' stroke-linejoin='round' d='M17,29L5,17,17,5M6,17H37c11.322,0,20,6.678,20,18S48.322,53,37,53H17'/%3e%3c/svg%3e")}
.icon_cut{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='0 0 64 64'%3e%3cg fill='none' stroke='%23000' stroke-width='3' stroke-linejoin='round'%3e%3cpath d='M34,34V2l6,12V34m0,6V54m-6-8V40M53.984,40.016h-40l-12-6h44'/%3e%3ccircle cx='32' cy='54' r='8'/%3e%3ccircle cx='54' cy='32' r='8'/%3e%3c/g%3e%3c/svg%3e")}
.icon_map{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='0 0 128 128'%3e%3cpath fill='none' stroke='%23000' stroke-width='6' stroke-linejoin='round' d='M96,26L127,37v88L85,111,43,125,1,111V23L43,37l12-4M85,52v58M43,124V38M75,67S54,38,54,26a21,21,0,0,1,42,0C96,38,75,67,75,67Zm0-50a8,8,0,1,0,8,8A8,8,0,0,0,75,17Z'/%3e%3c/svg%3e")}
.icon_map{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='-1 -1 66 66'%3e%3cpath fill='none' fill-opacity='0' stroke='%23000' stroke-width='3' stroke-linejoin='round' stroke-linecap='round' d='M43,62L22,52,2,62V13L22,3,43,13,63,3V52Z M43,19v8M22,17V9 M43,34v8M22,32V24 M43,49v8M22,47V39'/%3e%3c/svg%3e")}
.icon_replace{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='0 0 64 64'%3e%3cpath fill='none' fill-opacity='0' stroke='%23000' stroke-width='3' stroke-linejoin='round' d='M4,42l7-7,7,7M60,22l-7,7-7-7M30,56C20,56,11,46,11,36M33,8C44,8,53,17,53,28M38,58L47,38,56,58M9,27L26,6M27,27L10,6M41,51H53'/%3e%3c/svg%3e")}
.icon-telegram{filter:var(--ft);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='0 0 512 512'%3e %3cpath fill='none' fill-opacity='0' stroke='%23000' stroke-width='14' stroke-linejoin='round' stroke-linecap='round' d='M8,244L496,51,415,455,194,312,386,144,126.294,287.247ZM126,287l68,149,1-124M193,436l84-70'/%3e%3c/svg%3e")}
.bg_1{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3e%3cpath stroke-opacity='0.4' stroke='%23fff' stroke-width='1' d='M0,1H64M0,17H64M0,49H64M0,9H64M0,41H64M0,25H64M0,57H64M1-4V64M49-4V64M17-4V64M57-4V64M25-4V64M41-4V64M9-4V64'/%3e%3cpath stroke-opacity='1' stroke='%23fff' stroke-width='1' d='M-1,32H68M32-4V65'/%3e%3c/svg%3e")}
Expand Down Expand Up @@ -852,7 +852,7 @@
},"game_pad":{
"name":"GamePad",
"text":"Support for external game controllers",
"code":"let gamepad,gamepadPress,gamepad_choice=-1,gamepad_choices,gamepad_cursor=0;function select_choice(e){if(0==gamepad_cursor){gamepad_choices=story_json[tue_story][scene].terrain_map?tuesday.getElementsByClassName(\"tue_map_item\"):tuesday.getElementsByClassName(\"tue_choice\"),(gamepad_cursor=document.createElement(\"div\")).style.position=\"absolute\",gamepad_cursor.style.pointerEvents=\"none\",gamepad_cursor.id=\"gamepad_cursor\";let a=story_json.parameters.gamepad.cursor;gamepad_cursor.innerHTML=\"<div \"+(a[6].length>0?\"class='\"+a[6]+\"'\":\"\")+\" style='\"+(a[5].length>0?a[5]+\";\":\"\")+(\"\"!=a[0]?\" background-size:100% 100%;background-repeat:no-repeat;background-position:center;background-image:url(\"+art_data(a[0])+\");\":\"\")+\"pointer-events:none;position:absolute;top:\"+a[1]+\";left:\"+a[2]+\";\"+(0!=a[3]?\"width:\"+a[3]+\";\":\"\")+(0!=a[3]?\"height:\"+a[3]+\";\":\"\")+\"'></div>\",story_json[tue_story][scene].terrain_map?tue_map.appendChild(gamepad_cursor):tuesday.appendChild(gamepad_cursor)}if(\"hidden\"!=gamepad_choices[gamepad_choice=gamepad_choice+e>=gamepad_choices.length?0:gamepad_choice+e<0?gamepad_choices.length-1:gamepad_choice+e].style.visibility&&(story_json[tue_story][scene].terrain_map||gamepad_choices[gamepad_choice].onclick.toString().includes(\"go_to\")||gamepad_choices[gamepad_choice].onclick.toString().includes(\"go_story\")||gamepad_choices[gamepad_choice].onclick.toString().includes(\"tue_load_autosave\")||gamepad_choices[gamepad_choice].onclick.toString().includes(\"load_stag\"))){if(gamepad_cursor.style.left=gamepad_choices[gamepad_choice].style.left,gamepad_cursor.style.top=gamepad_choices[gamepad_choice].style.top,gamepad_cursor.style.right=gamepad_choices[gamepad_choice].style.right,gamepad_cursor.style.bottom=gamepad_choices[gamepad_choice].style.bottom,gamepad_cursor.style.width=gamepad_choices[gamepad_choice].style.width,gamepad_cursor.style.height=gamepad_choices[gamepad_choice].style.height,gamepad_cursor.style.padding=gamepad_choices[gamepad_choice].style.padding,gamepad_cursor.style.zIndex=gamepad_choices[gamepad_choice].style.zIndex,gamepad_cursor.style.transform=gamepad_choices[gamepad_choice].style.transform,story_json[tue_story][scene].terrain_map){let c=gamepad_choices[gamepad_choice].getBoundingClientRect();tue_world.scrollTop=tue_world.scrollTop+(c.top-tuesday.clientHeight/2),tue_world.scrollLeft=tue_world.scrollLeft+(c.left-tuesday.clientWidth/2)}}else select_choice(e)}function gamepad_cursor_cler(){gamepad_cursor.remove(),gamepad_cursor=0,gamepad_choice=-1}tuesday.addEventListener(\"creation_dialog\",function(e){0!=gamepad_cursor&&gamepad_cursor_cler()}),window.addEventListener(\"keydown\",function(e){37==(e=e.keyCode)?story_json[tue_story][scene].terrain_map||0!=story_json[tue_story][scene].dialogs.length&&!check_choice(story_json[tue_story][scene].dialogs)?select_choice(1):story_json.parameters.key&&story_json.parameters.key.next||back_story():39==e?story_json[tue_story][scene].terrain_map||0!=story_json[tue_story][scene].dialogs.length&&!check_choice(story_json[tue_story][scene].dialogs)?select_choice(-1):story_json.parameters.key&&story_json.parameters.key.back||go_story():38==e?(story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs))&&select_choice(1):40==e?(story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs))&&select_choice(-1):13==e||32==e?0!=gamepad_cursor&&(gamepad_choices[gamepad_choice].click(),story_json[tue_story][scene].terrain_map&&gamepad_cursor_cler()):27!=e||story_json.parameters.key&&story_json.parameters.key.launch_story||go_to(story_json.parameters.launch_story)}),window.addEventListener(\"gamepadconnected\",function(e){let a=()=>{for(gamepad of navigator.getGamepads()){if(!gamepad)continue;let e=gamepad.buttons.some(e=>e.pressed);gamepadPress!==e&&(gamepadPress=e,gamepad.buttons[14].pressed?story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs)?select_choice(1):back_story():gamepad.buttons[15].pressed?story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs)?select_choice(-1):go_story():gamepad.buttons[12].pressed?(story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs))&&select_choice(1):gamepad.buttons[13].pressed?(story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs))&&select_choice(-1):gamepad.buttons[1].pressed||gamepad.buttons[2].pressed||gamepad.buttons[3].pressed||gamepad.buttons[0].pressed?0!=gamepad_cursor&&(gamepad_choices[gamepad_choice].click(),story_json[tue_story][scene].terrain_map&&gamepad_cursor_cler()):(gamepad.buttons[8].pressed||gamepad.buttons[9].pressed)&&(go_to(story_json.parameters.launch_story),story_json[tue_story][scene].terrain_map&&gamepad_cursor_cler()))}requestAnimationFrame(a)};a()});"
"code":"let gamepad,gamepadPress,gamepad_choice=-1,gamepad_choices,gamepad_cursor=0;function select_choice(e){if(0==gamepad_cursor){gamepad_choices=story_json[tue_story][scene].terrain_map?tuesday.getElementsByClassName(\"tue_map_item\"):tuesday.getElementsByClassName(\"tue_choice\"),(gamepad_cursor=document.createElement(\"div\")).style.position=\"absolute\",gamepad_cursor.style.pointerEvents=\"none\",gamepad_cursor.id=\"gamepad_cursor\";let a=story_json.parameters.gamepad.cursor;gamepad_cursor.innerHTML=\"<div \"+(a[6].length>0?\"class='\"+a[6]+\"'\":\"\")+\" style='\"+(a[5].length>0?a[5]+\";\":\"\")+(\"\"!=a[0]?\" background-size:100% 100%;background-repeat:no-repeat;background-position:center;background-image:url(\"+art_data(a[0])+\");\":\"\")+\"pointer-events:none;position:absolute;top:\"+a[1]+\";left:\"+a[2]+\";\"+(0!=a[3]?\"width:\"+a[3]+\";\":\"\")+(0!=a[3]?\"height:\"+a[4]+\";\":\"\")+\"'></div>\",story_json[tue_story][scene].terrain_map?tue_map.appendChild(gamepad_cursor):tuesday.appendChild(gamepad_cursor)}if(\"hidden\"!=gamepad_choices[gamepad_choice=gamepad_choice+e>=gamepad_choices.length?0:gamepad_choice+e<0?gamepad_choices.length-1:gamepad_choice+e].style.visibility&&(story_json[tue_story][scene].terrain_map||gamepad_choices[gamepad_choice].onclick.toString().includes(\"go_to\")||gamepad_choices[gamepad_choice].onclick.toString().includes(\"go_story\")||gamepad_choices[gamepad_choice].onclick.toString().includes(\"tue_load_autosave\")||gamepad_choices[gamepad_choice].onclick.toString().includes(\"load_stag\"))){if(gamepad_cursor.style.left=gamepad_choices[gamepad_choice].style.left,gamepad_cursor.style.top=gamepad_choices[gamepad_choice].style.top,gamepad_cursor.style.right=gamepad_choices[gamepad_choice].style.right,gamepad_cursor.style.bottom=gamepad_choices[gamepad_choice].style.bottom,gamepad_cursor.style.width=gamepad_choices[gamepad_choice].style.width,gamepad_cursor.style.height=gamepad_choices[gamepad_choice].style.height,gamepad_cursor.style.padding=gamepad_choices[gamepad_choice].style.padding,gamepad_cursor.style.zIndex=gamepad_choices[gamepad_choice].style.zIndex,gamepad_cursor.style.transform=gamepad_choices[gamepad_choice].style.transform,story_json[tue_story][scene].terrain_map){let c=gamepad_choices[gamepad_choice].getBoundingClientRect();tue_world.scrollTop=tue_world.scrollTop+(c.top-tuesday.clientHeight/2),tue_world.scrollLeft=tue_world.scrollLeft+(c.left-tuesday.clientWidth/2)}}else select_choice(e)}function gamepad_cursor_cler(){gamepad_cursor.remove(),gamepad_cursor=0,gamepad_choice=-1}tuesday.addEventListener(\"creation_dialog\",function(e){0!=gamepad_cursor&&gamepad_cursor_cler()}),window.addEventListener(\"keydown\",function(e){37==(e=e.keyCode)?story_json[tue_story][scene].terrain_map||0!=story_json[tue_story][scene].dialogs.length&&!check_choice(story_json[tue_story][scene].dialogs)?select_choice(1):story_json.parameters.key&&story_json.parameters.key.next||back_story():39==e?story_json[tue_story][scene].terrain_map||0!=story_json[tue_story][scene].dialogs.length&&!check_choice(story_json[tue_story][scene].dialogs)?select_choice(-1):story_json.parameters.key&&story_json.parameters.key.back||go_story():38==e?(story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs))&&select_choice(1):40==e?(story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs))&&select_choice(-1):13==e||32==e?0!=gamepad_cursor&&(gamepad_choices[gamepad_choice].click(),story_json[tue_story][scene].terrain_map&&gamepad_cursor_cler()):27!=e||story_json.parameters.key&&story_json.parameters.key.launch_story||go_to(story_json.parameters.launch_story)}),window.addEventListener(\"gamepadconnected\",function(e){let a=()=>{for(gamepad of navigator.getGamepads()){if(!gamepad)continue;let e=gamepad.buttons.some(e=>e.pressed);gamepadPress!==e&&(gamepadPress=e,gamepad.buttons[14].pressed?story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs)?select_choice(1):back_story():gamepad.buttons[15].pressed?story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs)?select_choice(-1):go_story():gamepad.buttons[12].pressed?(story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs))&&select_choice(1):gamepad.buttons[13].pressed?(story_json[tue_story][scene].terrain_map||!check_choice(story_json[tue_story][scene].dialogs))&&select_choice(-1):gamepad.buttons[1].pressed||gamepad.buttons[2].pressed||gamepad.buttons[3].pressed||gamepad.buttons[0].pressed?0!=gamepad_cursor&&(gamepad_choices[gamepad_choice].click(),story_json[tue_story][scene].terrain_map&&gamepad_cursor_cler()):(gamepad.buttons[8].pressed||gamepad.buttons[9].pressed)&&(go_to(story_json.parameters.launch_story),story_json[tue_story][scene].terrain_map&&gamepad_cursor_cler()))}requestAnimationFrame(a)};a()});"
},"hidden_objects":{
"name":"Hidden objects",
"text":"player must find items from a list that are hidden within a scene",
Expand Down Expand Up @@ -2419,7 +2419,10 @@
var a=story_script[scen_data[0]][scen_data[1]][arr_n],p=[(ho_canvas.offsetWidth-ho_room.offsetWidth)/2,(ho_canvas.offsetHeight-ho_room.offsetHeight)/2];
if(arr_n=="hidden_objects"){a.objects.push({"position":[(ho_preview.scrollLeft-p[0])+(ho_preview.clientWidth/2),(ho_preview.scrollTop-p[1])+(ho_preview.clientHeight/2)],"size":[128,128],"art":"","fit":"contain","name":""});
file_catalog('','img','hois_art'+(a.objects.length-1),'','story_script[scen_data[0]][scen_data[1]].'+arr_n+'.objects['+(a.objects.length-1)+'].art');}
else{a.objects.push({"go_to":"tue_go","position":[(ho_preview.scrollLeft-p[0])+(ho_preview.clientWidth/2),(ho_preview.scrollTop-p[1])+(ho_preview.clientHeight/2)],"size":[128,128],"art":"","fit":"contain","name":"label","indent_text":"8px"});}
else{
let c=a.objects[a.objects.length-1];
if(c){c=JSON.parse(JSON.stringify(c));c.go_to="tue_go";c.position=[(ho_preview.scrollLeft-p[0])+(ho_preview.clientWidth/2),(ho_preview.scrollTop-p[1])+(ho_preview.clientHeight/2)];c.name="label";a.objects.push(c);}
else {a.objects.push({"go_to":"tue_go","position":[(ho_preview.scrollLeft-p[0])+(ho_preview.clientWidth/2),(ho_preview.scrollTop-p[1])+(ho_preview.clientHeight/2)],"size":[128,128],"art":"","fit":"contain","name":"label","indent_text":"8px"});}}
tool_update='ho_new(1)';ho_update();
}else if(s==1){
var a=story_script[scen_data[0]][scen_data[1]][arr_n].objects,image = new Image();
Expand Down Expand Up @@ -4892,7 +4895,7 @@
for(i=0;i<li_v.length;i++){
if(li_v[i].checked&&plugins_list[li_v[i].id] ){
story_script.parameters.plugins.push(li_v[i].id);
if(li_v[i].id=="game_pad"&&!story_script.parameters.gamepad){story_script.parameters.gamepad = {"cursor": ["","50%","-24px","24px","24px","border-radius:50%;background-color:#000;",""]}}
if(li_v[i].id=="game_pad"&&!story_script.parameters.gamepad){story_script.parameters.gamepad = {"cursor": ["","50%","-24px","24px","24px","border-radius:50%;background-color:#000;border:2px solid #fff;",""]}}
else if(li_v[i].id=="tue_aspect_ratio"&&!story_script.parameters.resolutions){story_script.parameters.resolutions = [800,600,"#000",""]}
}
}
Expand Down
Loading

0 comments on commit 9617813

Please sign in to comment.