RandallDavis / roll20-roomScript

Script using Roll20's API to automatically manage rooms, walls, and interactive doors.
1 stars 2 forks source link

Intuitive interface in handout instead of chat #41

Closed RandallDavis closed 9 years ago

Fantell commented 9 years ago

first off, I think a basic page needs to be put together for testing, to check how having a handout feels and whether it is worth continuing with this line of thought - it has to be tested for both a 'normal' handout, and a 'popped out' window; If it works well with a popped out handout, then I think we may have a winner.

Fantell commented 9 years ago

layout: not much different to what you have here. instead of a macro button to run the script, however, I think having the first line of the handout displaying a refresh command of some sort that will force an update to the handout in pretty much the same way the chat window re-displays the options available for the selected graphic/object that is being manipulated. those menus don't need to change, though you will potentially be able to now dynamically update the sections as you execute the commands

example: a defined room is selected, and the refresh button is pressed to let the script know to update the handout (it COULD be automated, but seeing as you won't be needing the handout all the time, it would just be a waste of resources IMO) as it is a defined room selected, it displays the options for that room - left side, right side, top, bottom, and all the buttons for those rooms listed under each heading. by activating the leftside, the script fires back and changes the handout in response, so that it updates and now shows that the leftside is defined, and what that definition is, as well as an option to reset it to nothing again.

note: this is another point we will have to test - the dynamic updating may require the handout to be closed and reopened; I am unsure on how roll20 handles the api and handouts that are already open.

RandallDavis commented 9 years ago

Whatever was sent to the chat window can now be sent to an automatically updating handout (with some minor formatting differences). It updates while open but the links fail if it's popped out. A state variable determines where the output should go.

RandallDavis commented 9 years ago

It's ugly, but it's functional. I'm not sure how much can be done with the look of it. It might be possible to imbed images or other styling to get the concept of buttons (as opposed to links) in, and there also might be a way to get text highlighting in place, but sniffing out the text of a handout that the API can access shows that all of this is being stripped out.

RandallDavis commented 9 years ago

I have a very slight improvement in place - the links now look more like the buttons in the regular chat.

Fantell commented 9 years ago

niiice. been busy, sorry, but I HAVE been testing. I REALLY like the way it looks, raw or not, in the handout.

the only thing missing I think is a refresh button on each page of the handout (basically a button that will run !api-room from within the handout itself) so that you don't have to have it on the macro bar as well to refresh the page. Which also leads us to having the script automatically refresh the page to the current settings after each command, so that for example when you lock a door through adhoc door actions, the script triggers its base setting again, updating it. currently it executes the command, but needs the user to manually refresh it with !api-room command in chat so that it switches from a button saying lock to a button saying unlock.

Fantell commented 9 years ago

oh, and a possible fix for the buttons wrapping awqwardly is to rename them: Room: DeleteRoom // this change is just so that it stands out in the menu as different to the next. also, see notes at bottom of page._

Left Side Wall Empty_Side Open_Door Closed_Door

and so on. The underscore would force the entire button to a new line if forced to wrap, unless completely impossible to do, making it much easier to read when in smaller windows. I also think that limiting it to two buttons before starting your next line will make things look quite nice, without losing focus and making a naturally smaller feeling window.

Also thinking about being cheeky and asking you to code in a quick switch on the page; basically setting the menu location as a variable and then clearing the page entirely, printing out a confirmation of deletion before actually deleting the item. I can't even count how many times i've deleted the room i'm working on because it looks the same as the rest :P

RandallDavis commented 9 years ago

I still have hopes for figuring out ways to get the HTML converted to work in both chat and handouts the same - that might be enough to fix wrapping, etc.

As far as refreshes, I think it would be better to just automatically run !api-room any time you use the API to change the state of an object... I have a separate ticket for that. It would work the same for chat / handouts.

RandallDavis commented 9 years ago

Okay - these are visually in good shape now with identical functionality to the chat UI.