GetClick

by Garthor
Simple proc to easily grab the next object a player clicks
Version 1 · Date Added: 7/07/09

If you wish to download this library for your Linux/Mac installation, enter the following on your command line:

DreamDownload byond://Garthor.GetClick##version=1

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Garthor.GetClick##version=1

GetClick() is a mob proc that greatly simplifies the process of getting input through clicks. It may be called at any time and the proc will wait (similar to input()) until the player clicks a new object. As a practical example of usage:

mob/verb/Fireball()
    src << "Select a target"
    
    client.mouse_pointer_icon = 'select.dmi'
    var/mob/target = GetClick()
    client.mouse_pointer_icon = null
    
    if(ismob(target))
        src.fireball(M)