client
Topic(href,href_list[],hsrc)
if(hsrc) return ..()
if(href=="mapfocus") //return focus to the map
winset(src, null, "focus=map")
else return ..()
Problem description:
In my inventory system I have a grid and a browser element. The grid element contains 32x32 blocks which have the images of my items within. Clicking the images sends a byond:// topic call which causes the item clicked to be selected.
There's no problem with this. My browser element updates just fine and shows the icon, name, description and commands (verbs) of the item. I can even click the verbs to execute them.
The issue is with focus. Whenever I click anywhere within the browser element, it automatically shifts focus to that element. Then the player can't walk around on the map.
To fix this glitch I've decided to use a bit of Javascript: if someone clicks anywhere within the browser element, or presses any of the keys on their keyboard if focus is on that element, it will automatically call the topic code above.
I've tested this- the topic code works fine. What doesn't work is the code winset(src, null, "focus=map"). It doesn't return focus to the map! Even typing the full path instead of just "map" (in my case "default_map.map") doesn't work.
Am I doing something wrong, or is this feature simply not available? If it isn't, is there any way I could get the desired behavior to work?
-- Data
I don't under stand?
Shouldn't calling
bring focus back to the map control? If not sorry that I couldn't help.