ID:133300
 
In the process of updating my code to use datums Ive come across several times not being able to use datums for things that I would really like to because i cant use any form of click on a datum. I think it would be a very nice feature if we could somehow use click on a datum.
NightJumper88 wrote:
In the process of updating my code to use datums Ive come across several times not being able to use datums for things that I would really like to because i cant use any form of click on a datum. I think it would be a very nice feature if we could somehow use click on a datum.

A datum is abstract; therefore you can't click one. You can only click an atom because an atom is a "physical" object.

Lummox JR
In response to Lummox JR
Yeah i know its abstract but it would be nice to be able to do something with it at the same time, for example I would like to use datums for my quest system cause they really dont need to be objects and dont need to waste objects on it, but im displaying your quest in a grid and wanted to be able to click on a quest in the grid and output the info about below. With an object its easy, but I havent been able to come up with a work around for it and it really would be nice to use datums for this
In response to NightJumper88
You can always set the parent_type of the datum to be an /atom...
Quest

Quest stuff here

Information // Make this display the information. as an example
parent_type = /atom // Make /Quest/Information have the properties of /atom... as if it was /atom/Quest/Information

Click()
world << "Somebody touched me :O! I feel violated :("
In response to GhostAnime
yeah but then it is an atom and defeates the purpose
In response to NightJumper88
Couldn't you use a browser element instead of a grid, enabling full visual, interactive functionality with little overhead (object oriented code).
Or, you could consider one object per client as visual representation of all datums.
Maybe buttons/labels?
In response to Schnitzelnagler
The browser could possible be worked out, Im not too sure I hate working with the browser and have eliminated it from my source (not good with HTML and XML) so not sure how i would do that (also not sure on how it would decrease overhead either but w/e)

As for one object to represent I would be displaying all the quest at the same time so i couldnt have one object represent all of them at the same time. And there isnt gonna be a set number of datums either they could have anywhere from 0-25 at any given time so using labels or buttons wouldnt really work thats why i used a grid
In response to Lummox JR
Maybe not even a click function for the datums but a select function for grid, say we can click on a cell and it will return whatever is in the grid not just objects, that way we can call datum procs by selecting the quest.

I tried to see if something like this would work but the click proc doesnt even register unless you click an object.
In response to NightJumper88
NightJumper88 wrote:
As for one object to represent I would be displaying all the quest at the same time so i couldnt have one object represent all of them at the same time.

You could run a compromise and display one at a time, represented by one object, but provide two buttons to switch for- and backwards through the quests?

NightJumper88 wrote:
And there isnt gonna be a set number of datums either they could have anywhere from 0-25 at any given time so using labels or buttons wouldnt really work

Why would that not work?
It's not like you can't create them at runtime?
In response to NightJumper88
NightJumper88 wrote:
yeah but then it is an atom and defeates the purpose

What purpose, exactly? You're still avoiding a huge amount of variables/behavior/procedures that movable atoms have (or movable atoms and mobs, or movable atoms and objs).

Use atoms if you want something to be clickable, or don't use Click() ;)
To sum up the replies to this thread, this request doesn't really make sense. There's no way to even try to implement clicking on datums, because datums have no appearance... you're going to click on what, exactly?

You can use whatever kinds of objects for your implementations. In fact, everything you can do with a datum, you can do with an atom (and you can also do more). So nothing's stopping you from even eliminating your datum and "porting" the code of it off to a new atom. Datums are just often preferred to be used for the very reason they are abstract; if you're making objects that silently work in the background and manage things, they don't need to be atoms and be cluttered with things like icons, a location, etc.

So, there's the answer, but note, as also mentioned in this thread, there is another option for clickability in DM, being HTML (even JavaScript if so need be) and using Topic(). Most if not all controls support HTML now, so that shouldn't be a problem <small>(you don't even have to use a browser control, you could put links in eg a grid)</small>. Just note you still can't use the mouse procs this way, and you also have no way to implement dragging of icons as such like this, but clicking would work fine through this method if you so desired.