Made swap hands use screen object

Made swap hands use screen object
Also now blindness is restricting your ability to click
You can shoot at darkness now, it calculates the turf you want to shoot
Added toggleable verb into the prefs tab for autoclick
Made proc that calculates turf from screen loc and origin turf
This commit is contained in:
Razharas
2015-06-04 07:47:20 +03:00
parent 7535df4063
commit fea00718a0
11 changed files with 38 additions and 22 deletions
+11
View File
@@ -1304,3 +1304,14 @@ var/list/WALLITEMS = list(
"lime","darkgreen","cyan","navy","teal","purple","indigo")
else
return "white"
/proc/screen_loc2turf(scr_loc, turf/origin)
var/tX = text2list(scr_loc, ",")
var/tY = text2list(tX[2], ":")
var/tZ = origin.z
tY = tY[1]
tX = text2list(tX[1], ":")
tX = tX[1]
tX = max(1, min(256, origin.x + (text2num(tX) - (world.view + 1))))
tY = max(1, min(256, origin.y + (text2num(tY) - (world.view + 1))))
return locate(tX, tY, tZ)
+1
View File
@@ -134,6 +134,7 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
mymob.blind.layer = 0
mymob.blind.mouse_opacity = 1
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen_gen.dmi'
+1
View File
@@ -38,6 +38,7 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
mymob.blind.layer = 0
mymob.blind.mouse_opacity = 1
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen_gen.dmi'
+1 -1
View File
@@ -282,7 +282,7 @@
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
mymob.blind.mouse_opacity = 0
mymob.blind.mouse_opacity = 1
mymob.blind.layer = 0
mymob.damageoverlay = new /obj/screen()
+1
View File
@@ -120,6 +120,7 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
mymob.blind.layer = 0
mymob.blind.mouse_opacity = 1
mymob.damageoverlay = new /obj/screen()
mymob.damageoverlay.icon = 'icons/mob/screen_full.dmi'
+1
View File
@@ -12,6 +12,7 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
mymob.blind.layer = 0
mymob.blind.mouse_opacity = 1
mymob.client.screen = null
mymob.client.screen += list(mymob.blind)
+1
View File
@@ -136,6 +136,7 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
mymob.blind.layer = 0
mymob.blind.mouse_opacity = 1
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen_gen.dmi'
+6 -6
View File
@@ -276,13 +276,13 @@
/obj/screen/Click(location, control, params)
if(!usr) return 1
if(name == "Reset Machine") //I don't know what this is, CTRL+F has the only entry right here in this file, so I'm going to leave it in case it is something important
usr.unset_machine()
var/list/modifiers = params2list(params)
if(modifiers["middle"] && istype(usr, /mob/living/carbon))
var/mob/living/carbon/C = usr
C.swap_hand()
else
return 0
var/turf/T = screen_loc2turf(modifiers["screen-loc"], get_turf(usr))
T.Click(location, control, params)
return 1
/obj/screen/inventory/Click()
+5 -11
View File
@@ -22,16 +22,15 @@
*/
/client/MouseDown(object,location,control,params)
if(mob && prefs && prefs.autoclick_delay && object && istype(mob, /mob/living/carbon))
if(mob && prefs && prefs.autoclick_delay && object && !istype(object, /obj/screen) && istype(mob, /mob/living/carbon))
var/mob/living/carbon/C = mob
if(!C.get_active_hand())
return ..()
C.is_mouse_down = object
spawn()
while(C.is_mouse_down == object)
while(C && C.is_mouse_down == object)
if(!C.get_active_hand())
return ..()
C.ClickOn(C.is_mouse_down, params)
sleep(1)
return
sleep(world.tick_lag)
/client/MouseDrag(src_object,over_object,src_location,over_location,src_control,over_control,params)
if(over_object)
@@ -39,11 +38,6 @@
/client/MouseUp(object,location,control,params)
if(mob)
if(!object)
var/list/modifiers = params2list(params)
if(modifiers["middle"])
mob.MiddleClickOn()
return
if(istype(mob, /mob/living/carbon))
var/mob/living/carbon/C = mob
C.is_mouse_down = null
+1 -4
View File
@@ -830,10 +830,7 @@ datum/preferences
toggles ^= SOUND_ADMINHELP
if("autoclick")
if(autoclick_delay)
autoclick_delay = 0
else
autoclick_delay = AUTOCLICK_DELAY
autoclick_delay = !autoclick_delay
if("ui")
switch(UI_style)
@@ -1,4 +1,13 @@
//toggles
/client/verb/toggle_autoclick()
set name = "Toggle Autoclick"
set category = "Preferences"
set desc = ".Enable or disable autoclick"
prefs.autoclick_delay = !prefs.autoclick_delay
src << "You have [prefs.autoclick_delay ? "enabled" : "disabled"] autoclick."
prefs.save_preferences()
feedback_add_details("admin_verb","TAC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/toggle_ghost_ears()
set name = "Show/Hide GhostEars"
set category = "Preferences"