Merge pull request #10272 from Razharas/DarkClick

Fixes clicks in darkness
This commit is contained in:
Cheridan
2015-07-04 12:17:10 -05:00
16 changed files with 68 additions and 26 deletions
+1 -1
View File
@@ -43,4 +43,4 @@
#define BE_GANG 4096
#define BE_SHADOWLING 8192
#define BE_ABDUCTOR 16384
#define BE_REVENANT 32768
#define BE_REVENANT 32768
+13
View File
@@ -1324,6 +1324,18 @@ var/list/WALLITEMS = list(
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(world.maxx, origin.x + (text2num(tX) - (world.view + 1))))
tY = max(1, min(world.maxy, origin.y + (text2num(tY) - (world.view + 1))))
return locate(tX, tY, tZ)
/proc/IsValidSrc(var/A)
if(istype(A, /datum))
var/datum/B = A
@@ -1331,3 +1343,4 @@ var/list/WALLITEMS = list(
if(istype(A, /client))
return 1
return 0
+17
View File
@@ -309,3 +309,20 @@
else
if(dx > 0) dir = EAST
else dir = WEST
/obj/screen/click_catcher
icon = 'icons/mob/screen_full.dmi'
icon_state = "passage0"
layer = 0
mouse_opacity = 2
screen_loc = "CENTER-7,CENTER-7"
/obj/screen/click_catcher/Click(location, control, params)
var/list/modifiers = params2list(params)
if(modifiers["middle"] && istype(usr, /mob/living/carbon))
var/mob/living/carbon/C = usr
C.swap_hand()
else
var/turf/T = screen_loc2turf(modifiers["screen-loc"], get_turf(usr))
T.Click(location, control, params)
return 1
+3 -2
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 = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen_gen.dmi'
@@ -146,8 +147,8 @@
mymob.zone_sel.icon = 'icons/mob/screen_alien.dmi'
mymob.zone_sel.update_icon()
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.healths, nightvisionicon, alien_plasma_display, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += adding + other
mymob.client.screen += mymob.client.void
+4 -2
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 = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen_gen.dmi'
@@ -50,7 +51,8 @@
mymob.zone_sel.icon = 'icons/mob/screen_alien.dmi'
mymob.zone_sel.update_icon()
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += list( mymob.zone_sel, mymob.healths, nightvisionicon, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += adding + other
mymob.client.screen += adding + other
mymob.client.screen += mymob.client.void
+2 -1
View File
@@ -77,5 +77,6 @@
mymob.zone_sel.icon = ui_style
mymob.zone_sel.update_icon()
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += mymob.client.void
mymob.client.screen += adding
+2 -1
View File
@@ -305,10 +305,11 @@
mymob.zone_sel.icon = ui_style
mymob.zone_sel.update_icon()
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.internals, mymob.healths, mymob.healthdoll, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += adding + hotkeybuttons
mymob.client.screen += mymob.client.void
inventory_shown = 0;
+3 -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 = 0
mymob.damageoverlay = new /obj/screen()
mymob.damageoverlay.icon = 'icons/mob/screen_full.dmi'
@@ -141,7 +142,7 @@
mymob.zone_sel.icon = ui_style
mymob.zone_sel.update_icon()
mymob.client.screen = null
mymob.client.screen = list()
using = new /obj/screen/resist()
using.icon = ui_style
@@ -150,3 +151,4 @@
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.internals, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += adding + other
mymob.client.screen += mymob.client.void
+5 -3
View File
@@ -12,9 +12,11 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += list(mymob.blind)
mymob.client.screen += mymob.client.void
/datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen_midnight.dmi')
@@ -30,6 +32,6 @@
blobhealthdisplay.screen_loc = ui_internal
blobhealthdisplay.layer = 20
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay)
mymob.client.screen += mymob.client.void
+3 -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 = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen_gen.dmi'
@@ -148,10 +149,11 @@
mymob.zone_sel.icon = 'icons/mob/screen_cyborg.dmi'
mymob.zone_sel.update_icon()
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += list(mymob.zone_sel, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += adding + other
mymob.client.screen += mymob.client.void
return
-11
View File
@@ -274,17 +274,6 @@
overlays.Cut()
overlays += image('icons/mob/screen_gen.dmi', "[selecting]")
/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()
else
return 0
return 1
/obj/screen/inventory/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
+4 -1
View File
@@ -40,5 +40,8 @@
preload_rsc = PRELOAD_RSC
var/global/obj/screen/click_catcher/void
// Used by html_interface module.
var/hi_last_pos
var/hi_last_pos
+5
View File
@@ -169,6 +169,11 @@ var/next_external_rsc = 0
send_resources()
if(!void)
void = new()
screen += void
if(prefs.lastchangelog != changelog_hash) //bolds the changelog button on the interface so we know there are updates.
src << "<span class='info'>You have unread updates in the changelog.</span>"
if(config.aggressive_changelog)
@@ -65,7 +65,8 @@
/mob/living/simple_animal/Login()
if(src && src.client)
src.client.screen = null
src.client.screen = list()
client.screen += client.void
..()
/mob/living/simple_animal/updatehealth()
+3 -1
View File
@@ -29,7 +29,7 @@
world.update_status()
client.images = null //remove the images such as AIs being unable to see runes
client.screen = null //remove hud items just in case
client.screen = list() //remove hud items just in case
if(hud_used) del(hud_used) //remove the hud objects
hud_used = new /datum/hud(src)
@@ -54,6 +54,8 @@
if(ckey in deadmins)
verbs += /client/proc/readmin
client.screen += client.void
// Calling update_interface() in /mob/Login() causes the Cyborg to immediately be ghosted; because of winget().
// Calling it in the overriden Login, such as /mob/living/Login() doesn't cause this.
/mob/proc/update_interface()
+1
View File
@@ -492,6 +492,7 @@ var/list/slot_equipment_priority = list( \
log_game("[usr.key] AM failed due to disconnect.")
return
client.screen.Cut()
client.screen += client.void
if(!client)
log_game("[usr.key] AM failed due to disconnect.")
return