ID:155737
 
Allo.

Note: I was unsure where this belonged exactly since it is kind of a mashup between the 3 different areas of the forum (Dev howto, code probs, design philo) so ill post it here and hope for some responses.

So im using Divine Travellers library for the additional mouse functions. Mainly for Shift Left/right clicks, and norm left/right clicks.

Now with this demo to get the right clicking to work properly you need to either set the popup_menu to 0 in the global settings or set it to send right clicks to proc on the map.. I chose to go with the popup_menu 0 in the actual code so that i can get it to work on both the map and grid interfaces.

Ok with that aside time for the main question for the purpose of this please refer to the following scenario

Scenario:: Player One drops 5 essences which is a stacked item so it is classified as one item and is simply placed there. Now they go to drop a sword without moving so the sword and essences are both on the same tile. But stacked onto each other.

Problem:: Now if you were player two and you walked along if i did not use the library and was not using a custom right click popup (using tooltip library for this purpose) it would show the items as such..
Right Click >
Essence > Get
Sword > Get
in its own default dialogue.

Now since im using the tooltip demo it is by default launching it on right click and as such making you unable to see multiple items on one turf.


How would i go about avoiding this dilemma while still maintaining a clean and staying true to what im currently using the tooltips for.

(Right click shows Name, description and an option for.. Get, Bank, Drop, Store (depending on certain parameters))

I appreciate any help as usual, But please do not post if you are unable to provide proper insight as i believe it hinders the ability to get further help on the matter.

~Midget
It'll pickup item which player clicks, unless it's physically impossible to do, or if you have some alpha around item on ground.

If you want menu, you could create menu by putting together on-screen objects.
In response to Zaoshi
Yes i am aware that it will pick up whichever item the player clicks.. Well in this case its right click and then they also have to click get inside the tooltip or direct left click for pickup.

But what im wanting to do is possibly replicate the default right click that byond offers when there is multiple atoms on one tile (Mob, object etc etc)..
In response to Midgetbuster
Oh that, I'm sorry. I kinda skipped reading topic.

item/RightClick()
//define list
var/list/itemsOnGround = list()

//loop through all objects at same location as current object and add them to the list
for(var/item/I in loc)
itemsOnGround += I

//show menu so player can choose what to pickup
usr.showPickUpMenu(itemsOnGround)
In response to Zaoshi
Arr yeah that looks like it would do the job.

Not sure how i would wanna display it though.. I may just do it on leftclick, will autograb if its one item at the location or if there are multiples make a list..

but leave right clicking purely as a displaying purpose. not even sure if i want right click when the item is not inside the user anyway, like the name alone should be enough as far as im concerned.

But we shall see i guess.. and if i was to do it id want it to look decent most likely end up using screen objects for it though and make like some form of "loot box" i guess not sure to be honest

In response to Midgetbuster
Well you could make left click take the item if there's only one item on ground in that tile.
But if there's more, it moves items somewhere else (so others can't pickup them), popup appears for player and he chooses what to take. If he didn't take any of the items, they appear on ground again once he closes menu. (imagine as player takes bag, searches through it choosing what to take, then dumps what he doesn't need).