In response to NightJumper88
The best I can think to do is put a solid icon with alpha value of 1 everywhere on the client.screen and when Click() is called on that object, you get the screen.loc and translate that to the location on the map.

#define IGNORE_AREAS 1
#define ceil(n) (-round(-n))
#define isclient(n) istype(n, /client)

client
var
lastclicked
view_x
view_y

verb/AddCanvas()
src.addCanvas()

proc/addCanvas()
if(isnum(src.view))
src.view_x = 2 * src.view + 1
src.view_y = src.view_x
else if(istext(src.view))
var/comma = findText(src.view, ",")
src.view_x = text2num(copytext(src.view, 1, comma))
src.view_y = text2num(copytext(src.view, comma +1))
else
world.log << "lolwtf @ client.addCanvas()"
return 0
for(var/x=1 to src.view_x) for(var/y=1 to src.view_y) new /obj/screen_canvas(src, x, y)

obj/screen_canvas
var/screen_x
var/screen_y
icon = 'cursor.dmi'
icon_state = "State"
layer = 1024
New(var/client/C, var/sx, var/sy)
if(!C || !isclient(C) || !sx || !sy) return 0
src.screen_x = sx
src.screen_y = sy
src.screen_loc = "[sx],[sy]"
C.screen += src
. = ..()

Click(location, control, params)
var/turf_x = src.screen_x + (usr.client.virtual_eye:x - ceil(usr.client.view_x/2)) - 1
var/turf_y = src.screen_y + (usr.client.virtual_eye:y - ceil(usr.client.view_y/2)) - 1
var/turf/t = locate(turf_x, turf_y, usr.z)
if(t)
var/list/p = params2list(params)
var/px = p["icon-x"]
var/py = p["icon-y"]
var/list/L = Sort(t.contents, /proc/compareLayersInverse)
if(L.len)
for(var/atom/movable/a in L)
if(!a.icon) continue
var/icon/i = new(a.icon)
if(i.GetPixel(text2num(px), text2num(py), a.icon_state, a.dir))
usr.client.lastclicked = a
return a.Click(location, control, params)
usr.client.lastclicked = t
return t.Click(location, control, params)
return 0

DblClick(location, control, params)
var/turf_x = src.screen_x + (usr.client.virtual_eye:x - ceil(usr.client.view_x/2)) - 1
var/turf_y = src.screen_y + (usr.client.virtual_eye:y - ceil(usr.client.view_y/2)) - 1
var/turf/t = locate(turf_x, turf_y, usr.z)
if(t)
var/list/p = params2list(params)
var/px = p["icon-x"]
var/py = p["icon-y"]
var/list/L = Sort(t.contents, /proc/compareLayersInverse)
if(L.len)
for(var/atom/movable/a in L)
if(!a.icon) continue
var/icon/i = new(a.icon)
if(i.GetPixel(text2num(px), text2num(py), a.icon_state, a.dir))
if(usr.client.lastclicked == a)
usr.client.lastclicked = null
return a.DblClick(location, control, params)
else
usr.client.lastclicked = a
return a.Click(location, control, params)
if(usr.client.lastclicked == t)
usr.client.lastclicked = null
return t.DblClick(location, control, params)
else
usr.client.lastclicked = t
return t.Click(location, control, params)
return 0


proc/compareLayers(var/atom/movable/A, var/atom/movable/B)
ASSERT(A && istype(A) && B && istype(B))
if(A.layer < B.layer) return 1
if(A.layer == B.layer)
if((isobj(A) && isobj(B)) || (ismob(A) && ismob(B))) return 0
if(ismob(A)) return -1
else return 1
if(A.layer > B.layer) return -1

proc/compareLayersInverse(var/atom/movable/A, var/atom/movable/B)
ASSERT(A && istype(A) && B && istype(B))
return compareLayers(B, A)

proc/Sort(var/list/L, var/function)
if(!L || !islist(L) || !function) return 0
if(L.len <= 1) return L
var/list/backup = L.Copy()
var/list/newone = list(L[1])
backup -= backup[1]
for(var/evaluate in backup)
var/added = 0
for(var/i=1 to newone.len)
var/check = newone[i]
var/order = call(function)(evaluate, check)
world << order
if(order>=0)
newone.Insert(i, evaluate)
added = 1
break
if(!added) newone += evaluate
return newone


See if you can work with that, but I suggest using something other than Click() unless Click() is a must. This is destined to be slow.
In response to Popisfizzy
You have got to be frickin' kidding me. :/
See [link]
In response to CaptFalcon33035
Hey, did you realize who you were replying to?
It's a bit confusing when you reply to the wrong post...
In response to Naokohiro
I replied to exactly who I wanted to.
In response to CaptFalcon33035
lolowned ;P And that implementation is still not as perfect, while clever.
Not sure on others reply since I haven't read them, but as for the question, a simple solution comes to my mind. Why not make an icon that's transparent, as in every other pixel is in black or dark color (can't think of the right word), and then once it's night, add the overlay of that to the client screen? That way, nothing but you client screen is really getting effected.
In response to DisturbedSixx
DisturbedSixx wrote:
Why not make an icon that's transparent, as in every other pixel is in black or dark color...

No. EDIT: I guess I forgot to add this. Alpha transparency is SO much nicer looking.

That way, nothing but you client screen is really getting effected.

Really it is. Go play Mystic Journey during one of it's night cycles. Every fifth pixel is black. You might be able to click on things, but you have like a 20% chance of missing, assuming your not 'aiming.'
In response to Hiro the Dragon King
But, really now, that's fixed with the mouse_opacity var.
But, I have to agree that alpha transparency does look nicer.
An effect I was using is kind of like the old checkerboard pixel pattern, except the normally opaque pixels are partially transparent. Creates an interesting effect reminiscent of being under water or something.
However, I was only using that to differentiate between my different areas that were adjacent to eachother while still having them match the blank areas of the map editor. (Made their icons null in their New() proc.)
In response to CaptFalcon33035
We already established that he should use the mouse_opacity var =]
Page: 1 2