[Ready for Review] Admin lua scripting (#65635)

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
Y0SH1M4S73R
2022-07-19 15:45:23 -07:00
committed by GitHub
co-authored by Mothblocks
parent a6723944c1
commit 4e6e1f090e
46 changed files with 2161 additions and 15 deletions
@@ -3,11 +3,11 @@
/proc/_abs(A)
return abs(A)
/proc/_animate(atom/A, set_vars, time = 10, loop = 1, easing = LINEAR_EASING, flags = null)
var/mutable_appearance/MA = new()
for(var/v in set_vars)
MA.vars[v] = set_vars[v]
animate(A, appearance = MA, time, loop, easing, flags)
/proc/_animate(atom/target, set_vars, time = 10, loop = 1, easing = LINEAR_EASING, flags = null)
if(target)
animate(target, appearance = set_vars, time, loop, easing, flags)
else
animate(appearance = set_vars, time, easing = easing, flags)
/proc/_arccos(A)
return arccos(A)
@@ -253,7 +253,34 @@
/proc/_winset(player, control_id, params)
winset(player, control_id, params)
/proc/_winget(player, control_id, params)
winget(player, control_id, params)
/proc/_text2path(text)
return text2path(text)
/proc/_turn(dir, angle)
return turn(dir, angle)
/// For some reason, an atom's contents are a kind of list that auxtools can't work with as a list
/// This proc returns a copy of contents that is an ordinary list
/proc/_contents(atom/thing)
var/list/ret = list()
if(istype(thing))
ret += thing.contents
return ret
/// Auxtools REALLY doesn't know how to handle filters as values;
/// when passed as arguments to auxtools-called procs, they aren't simply treated as nulls -
/// they don't even count towards the length of args.
/// For example, calling some_proc([a filter], foo, bar) from auxtools
/// is equivalent to calling some_proc(foo, bar). Thus, we can't use _animate directly on filters.
/// Use this to perform animation steps on a filter. Consecutive steps on the same filter can be
/// achieved by calling _animate with no target.
/proc/_animate_filter(atom/target, filter_index, set_vars, time = 10, loop = 1, easing = LINEAR_EASING, flags = null)
if(!istype(target))
return
if(!filter_index || filter_index < 1 || filter_index > length(target.filters))
return
animate(target.filters[filter_index], appearance = set_vars, time, loop, easing, flags)