You can press & hold the keys for pixel shifting now

This commit is contained in:
DragonTrance
2022-11-12 14:21:49 -05:00
parent c7b547982b
commit 7cb0031a36
3 changed files with 25 additions and 20 deletions
+1 -1
View File
@@ -15,4 +15,4 @@
movement_dir &= ~(NORTH|SOUTH)
if((movement_dir & EAST) && (movement_dir & WEST))
movement_dir &= ~(EAST|WEST)
user.Move(get_step(src, movement_dir), movement_dir)
user.Move(get_step(src, movement_dir), movement_dir)
+1 -1
View File
@@ -88,4 +88,4 @@
if(holder)
holder.keyLoop(src)
if(mob.focus)
mob.focus.keyLoop(src)
mob.focus.keyLoop(src)
+23 -18
View File
@@ -58,31 +58,20 @@
user.body_l_leg()
return
if(client.keys_held["Ctrl"])
//!shift for pixel shifting
if(client.keys_held["Ctrl"] && !client.keys_held["Shift"])
switch(SSinput.movement_keys[_key])
if(NORTH)
if(client.keys_held["Shift"])
northshift()
else
northface()
northface()
return
if(SOUTH)
if(client.keys_held["Shift"])
southshift()
else
southface()
southface()
return
if(WEST)
if(client.keys_held["Shift"])
westshift()
else
westface()
westface()
return
if(EAST)
if(client.keys_held["Shift"])
eastshift()
else
eastface()
eastface()
return
return ..()
@@ -91,4 +80,20 @@
if("Alt")
toggle_move_intent()
return
return ..()
return ..()
/// Mostly used for pixel shift right now
/mob/keyLoop(client/user)
var/direction = NONE
for(var/_key in user.keys_held)
direction = direction | SSinput.movement_keys[_key]
if(user.keys_held["Ctrl"] && user.keys_held["Shift"])
switch(direction)
if(NORTH)
northshift()
if(SOUTH)
southshift()
if(WEST)
westshift()
if(EAST)
eastshift()