I'm trying to make a Grid, that has objects inside of it that are clickable.
For example:
Object 1 icon: Description
Object 2 icon: Descirption
etc.
The icon is supposed to be a representation of an action, like attacking or Searching, etc. and when you click it, the corresponding action is performed.
I've created objects,
obj
player
attack
var/mob/player/owner
basic
name = "Basic Attack"
icon = 'skillboxes.dmi'
icon_state = "basic"
Click()
owner.attack()
For example this one above. The idea is that it gets added to a player list (var/obj/player/attack/list/attacks, for example), it creates a new version of the object above, adds it to the player.attacks (Obviously setting the owner to the player), and when clicked in the grid, the action is performed.
Everything works fine, except I cannot get it in the Grid. I can get an image in the grid, but then it's not clickable, or I can get just the name "Basic Attack" in the grid, but I want both. I want "[icon] Basic Attack" in the grid, so that the player clicks the icon, and performs the action.
Is there any way to do this? I've been trying for a while, it's not working...I can't get the actual object to appear in the grid...that's basically what I want. I want the grid to house the object, so that you can click it and do whatever.