ID:162391
 
Applicable Configuration:
BYOND Version: 412.977 (I think)
Operating System: Vista


Descriptive Problem Summary:
Client.Click() not working for grid cells.
Numbered Steps to Reproduce Problem:
1. Make sure Slider has an icon, and make an interface file with a grid named grid1 on it, make sure its at least, 3x1.

2. If you have a map and you click on anything it will output the name, and some other information. However when you try to click on the grid it doesn't output anything.


Code Snippet (if applicable) to Reproduce Problem:
obj
Slider
icon = 'Budget.dmi'
icon_state = ""
name = "Slider"
//On world start
world
New()
sleep(10)
for(var/mob/m in world)
var/Slider = new/obj/Slider
m<<output(Slider,"grid1:3,1")

client
Click(A,B,C)
usr << "You clicked [A] [B] [C]"
..()

Note: I edited some parts of this code while posting, so if it generates an error it is probably a simple character error.


Expected Results:
client.click() on the grid cell outputs some kind of formatting that is usable. According to click.click, it should work for all of the following:

location: the client stat panel, location (turf) of object on map, grid cell, or other control-specific info


Actual Results:
According to the client.click() in the reference, this is suppose to work for the interface as well. Unfortunately if you click anything that is not on the map, it returns nothing. Even grid cells, which are listed as something that will work, do not.

If this is incorrect or im using something wrong please tell me so.
As stated in the skin reference, you can't reliably use temporary objects in a grid. Yet you are doing so. This is not a bug.

And why in the world would you send such output to every mob instead of to every client? It's possible to have a lot of mobs, but likely you won't have that many clients.

Lummox JR
In response to Lummox JR
But if the object is not being changed during runtime, how is that using a temporary object? Also, the mob for() loop was just for testing, it would be changed later. But this does not address the problem of using click() on an empty grid cell. Even though in the help menu it says that you can click on a grid cell.

Lummox JR wrote:
As stated in the skin reference, you can't reliably use temporary objects in a grid. Yet you are doing so. This is not a bug.

And why in the world would you send such output to every mob instead of to every client? It's possible to have a lot of mobs, but likely you won't have that many clients.

Lummox JR
In response to Strawgate
My impression is that adding an object to the interface does not protect it against garbage collection. Therefore, it gets deleted once the proc is over, and no longer works. Just giving mobs a list of objects that are displayed in their interface should prevent this.
In response to Garthor
This does fix the issue of not being able to click an object. However, i still don't have a solution for putting a background and an object in the same cell, or getting rid of the name of an object when it's outputted to the grid cell, or even better would be being able to get the coordinates of an empty grid cell when its clicked.