diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 84856302..04b714f1 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -871,8 +871,15 @@ GLOBAL_LIST_EMPTY(external_rsc_urls) if(IsAdminAdvancedProcCall()) return var/list/verblist = list() + + var/list/verbstoprocess = verbs.Copy() + if(mob) + verbstoprocess += mob.verbs + for(var/AM in mob.contents) + var/atom/movable/thing = AM + verbstoprocess += thing.verbs verb_tabs.Cut() - for(var/thing in (verbs + mob?.verbs)) + for(var/thing in verbstoprocess) var/procpath/verb_to_init = thing if(!verb_to_init) continue diff --git a/config/config.txt b/config/config.txt index f548b087..a5d6d297 100644 --- a/config/config.txt +++ b/config/config.txt @@ -477,7 +477,7 @@ DISABLE_HIGH_POP_MC_MODE_AMOUNT 60 ## By default, this is 15x15, which gets simplified to 7 by BYOND, as it is a 1:1 screen ratio. ## For reference, Goonstation uses a resolution of 21x15 for it's widescreen mode. ## Do note that changing this value will affect the title screen. The title screen will have to be updated manually if this is changed. -DEFAULT_VIEW 21x15 +DEFAULT_VIEW 20x15 ## Enable Dynamic mode DYNAMIC_MODE \ No newline at end of file diff --git a/html/statbrowser.html b/html/statbrowser.html index f1758943..b55cfd49 100644 --- a/html/statbrowser.html +++ b/html/statbrowser.html @@ -4,6 +4,7 @@ Stat Browser + @@ -170,6 +177,51 @@ if (!String.prototype.trim) { }; } +/*\ +|*| +|*| Polyfill which enables the passage of arbitrary arguments to the +|*| callback functions of JavaScript timers (HTML5 standard syntax). +|*| +|*| https://developer.mozilla.org/en-US/docs/DOM/window.setInterval +|*| +|*| Syntax: +|*| var timeoutID = window.setTimeout(func, delay[, arg1, arg2, ...]); +|*| var timeoutID = window.setTimeout(code, delay); +|*| var intervalID = window.setInterval(func, delay[, arg1, arg2, ...]); +|*| var intervalID = window.setInterval(code, delay); +|*| +\*/ +(function() { + setTimeout(function(arg1) { + if (arg1 === 'test') { + // feature test is passed, no need for polyfill + return; + } + var __nativeST__ = window.setTimeout; + window.setTimeout = function(vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */ ) { + var aArgs = Array.prototype.slice.call(arguments, 2); + return __nativeST__(vCallback instanceof Function ? function() { + vCallback.apply(null, aArgs); + } : vCallback, nDelay); + }; + }, 0, 'test'); + + var interval = setInterval(function(arg1) { + clearInterval(interval); + if (arg1 === 'test') { + // feature test is passed, no need for polyfill + return; + } + var __nativeSI__ = window.setInterval; + window.setInterval = function(vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */ ) { + var aArgs = Array.prototype.slice.call(arguments, 2); + return __nativeSI__(vCallback instanceof Function ? function() { + vCallback.apply(null, aArgs); + } : vCallback, nDelay); + }; + }, 0, 'test'); +}()) + // Browser passthrough code --------------------------------------------------- if (window.location) { var anti_spam = []; // wow I wish I could use e.repeat but IE is dumb and doesn't have it. @@ -181,10 +233,12 @@ if (window.location) { if(e.which) { if(!anti_spam[e.which]) { anti_spam[e.which] = true; - var href = "?__keydown=" + e.which; - if(e.ctrlKey === false) href += "&ctrlKey=0" - else if(e.ctrlKey === true) href += "&ctrlKey=1" - window.location.href = href; + var key = String.fromCharCode(e.which); + var x = event.x || event.clientX; + var y = event.y || event.clientY; + if(x || y ) // if either of these exist this is happening after a click + return; + window.location.href = "byond://winset?command=keyDown " + e.key; } } }); @@ -195,10 +249,14 @@ if (window.location) { return; if(e.which) { anti_spam[e.which] = false; - var href = "?__keyup=" + e.which; - if(e.ctrlKey === false) href += "&ctrlKey=0" - else if(e.ctrlKey === true) href += "&ctrlKey=1" - window.location.href = href; + var key = String.fromCharCode(e.which); + + var x = event.x || event.clientX; + var y = event.y || event.clientY; + if( x || y ) // if either of these exist this is happening after a click + return; + + window.location.href = "byond://winset?command=keyUp " + e.key; } }); } @@ -227,6 +285,8 @@ var sqdl2 = []; var permanent_tabs = []; // tabs that won't be cleared by wipes var turfcontents = []; var turfname = ""; +var imageRetryDelay = 50; +var imageRetryLimit = 50; var menu = document.querySelector('#menu'); var under_menu = document.querySelector('#under_menu'); @@ -337,6 +397,14 @@ function verbs_cat_check(cat) { } } +function findVerbindex(name, verblist) { + for(var i = 0; i < verblist.length; i++) { + var part = verblist[i]; + if(part[1] == name) + return i; + } +} + function wipe_verbs() { verbs = [["", ""]]; verb_tabs = []; @@ -348,10 +416,9 @@ function add_verb_list(v) { to_add.sort(); // sort what we're adding for(var i = 0; i < to_add.length; i++) { var part = to_add[i]; + if(findVerbindex(part[1], verbs)) + continue; if(verb_tabs.includes(part[0])){ - if(verbs.includes(part)){ - continue; - } verbs.push(part); if(current_tab == part[0]) { draw_verbs(part[0]); // redraw if we added a verb to the tab we're currently in @@ -392,7 +459,7 @@ function init_verbs(c, v) { do_update = true; } if(v) { - verbs = JSON.parse(v); + add_verb_list(v); verbs.sort(); // sort them if(do_update) { draw_verbs(current_tab); @@ -674,6 +741,22 @@ function update_listedturf(TC) { draw_listedturf(); } +function iconError(E) { + var that = this; + setTimeout(function() { + var current_attempts = that.id; // a bit of a hack, change this if we need to call on img id's later + if(!current_attempts) + that.id = 1; + if (current_attempts > imageRetryLimit) + return; + var src = that.src; + that.src = null; + that.src = src + '#' + current_attempts; + that.id++; + draw_listedturf(); + }, imageRetryDelay); +} + function draw_listedturf() { var statcontentdiv = document.getElementById("statcontent"); statcontentdiv[textContentKey] = ""; @@ -683,6 +766,7 @@ function draw_listedturf() { if(part[2]) { var img = document.createElement("img"); img.src = part[2]; + img[addEventListenerKey]("onerror", iconError()); table.appendChild(img); } var b = document.createElement("div");