Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

launcher: add label showing pause status #665

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Cubittus
Copy link
Contributor

@Cubittus Cubittus commented Apr 1, 2023

This adds a label that displays pause or unpause depending on game state. It is enabled or disabled according to the state of the input editfield

This add a label that displays `pause` or `unpause` depending on game state.  It is enabled or disabled according to the state of the input editfield
@myk002
Copy link
Member

myk002 commented Apr 2, 2023

image

I see a few issues with this that we'd need to figure out:

  1. when the launcher window is resized smaller, the history search becomes unusable (see screenshot)
  2. unlike all other labels with the green hotkey hint, this label is not clickable to trigger the pause/unpause action
  3. the pause/unpause label changes state even when a world is not loaded
  4. the hotkey hint says "Space", but this is misleading. it's only space at the beginning of a line or double space anywhere else. this may need more words to explain than just "Space"

What do you think of adding this Label underneath the current run and history search widgets and moving the help panel down a tile? that would give you a bit more room to explain the mechanics of pausing/unpausing.

@Cubittus
Copy link
Contributor Author

Cubittus commented Apr 2, 2023

Thanks - I'll make the following changes:

  • Move the Alt+s:history line below Enter:run.
  • Make the Space:un/pause clickable
  • Make it disabled when there is no loaded fort
  • Add a sentence to the Help text at the end of the first paragraph:
    You can press space to unpause or pause a loaded fort (press space twice while typing a command).

@Cubittus Cubittus marked this pull request as draft April 2, 2023 06:25
- Move history field down
- Add help text for space to pause
- Disable pause label when no fort loaded
- Add click handler
- Toggle pen colors instead of disabling label so that click continues to work
@Cubittus Cubittus marked this pull request as ready for review April 2, 2023 10:43
@Cubittus
Copy link
Contributor Author

Cubittus commented Apr 2, 2023

This should resolve DFHack/dfhack#3125

@myk002 myk002 linked an issue Apr 2, 2023 that may be closed by this pull request
end
self:update_pause_label(false)
end
function EditPanel:enable_pause_label()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of changing the colors, how about changing the hotkey hint from "Space" to "Double Space"? That might make the intent a little clearer.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ehhhhhh i don't know if "Double Space" would necessarily make it "clearer". It would be descriptive, but doesn't necessarily explain why the user has to press spacebar twice for it to unpause.

the real reason is, like, because after the first space, the second is passed to the game or something? There has to be a better way to convey this

gui/launcher.lua Outdated
widgets.EditField{
view_id='search',
frame={l=13, t=3, r=1},
frame={l=1, t=4, r=1},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure about this change. @TaxiService what do you think?

image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like, moving those two things on a new line does makes sense for readability, but...

...are there solutions that don't require adding a Space: unpause hotkeylabel at all?
and- is it worth it to increase that area's height by 1 just for this?

self.subviews.pauselabel.text[1].text = (df.global.pause_state ~= willchange) and 'unpause' or 'pause'
else
self:disable_pause_label()
self.subviews.pauselabel.text[1].text = 'no fort loaded'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably disable the Label in this case so it doesn't react on hover.
image

@TaxiService
Copy link

TaxiService commented Apr 4, 2023

Like, sorry to pop in like this, but consider this:
Untitled-1

since the original problem was, like, if i remember correctly...

"i can't tell when spacebar will be input in the command line or un/pause the game"

like, what if we had a little message that appears in the corner of the frame, informing the player whenever spacebar won't unpause?

this would have to dynamically appear/disappear as soon as spacebar would be able to un/pause, but doing this would let us not add "bloat" to the gui, and train the player to look in the lower-left corner of the UI for shit related to un/pausing.
(since other windows will show a PAUSE FORCED message in that area, in some cases)

edit: ps: like, this mockup says "SPACEBAR CAPTURED", but i'm sure there's a better way to put it. My wordsmithing skill is like... dabbling
edit: pps: also you could play around with colors a bit... or even make colors blink like the cl cursor
edit: ppps: also-- i'm not saying this HAS to be the solution; i'm asking... what do you guys think about this? Does this make any sense to you? Would something like this help in solving the ux issue?
edit: pppps: by the way, a functionality like this could become a standard for frames in general, and appear on any future window

@myk002
Copy link
Member

myk002 commented Apr 4, 2023

What I like about Cubittus's design is that the indicator is close to where the player's eyes are going to be when typing. If the launcher window is maximized (double click on the title bar) then the lower left corner is a long way away. A commandline can involve a lot of spaces, and the indicator can flash back and forth several times. whatever we do, it shouldn't be too distracting. My main worry is the crowding of elements in a tool that needs to be very clean.

@TaxiService
Copy link

A commandline can involve a lot of spaces, and the indicator can flash back and forth several times. whatever we do, it shouldn't be too distracting.

it shouldn't be too distracting, but it should be a bit distracting. 🤔 Like, in the sense that by interacting with the command line and observing how that label behaves, the user would naturally get an intuition for when spacebar would and wouldn't un/pause.

My main worry is the crowding of elements in a tool that needs to be very clean.

and indeed, i think that adding that Space: unpause thing up there would kind of make that area more "crowded"
the label down there shouldn't even collide with the PAUSE FORCED label, because if pause-forced is on, spacebar can't unpause!

What I like about Cubittus's design is that the indicator is close to where the player's eyes are going to be when typing. If the launcher window is maximized (double click on the title bar) then the lower left corner is a long way away.

that is true. And this is why it should probably be noticeable enough to be seen, but not distracting enough to be bothersome.

Like, maybe we could have it so that the first time the spacebar is captured, and up until the first other keyboard input, the label is like LCYAN; then after the second input, it becomes DGRAY. 🤔

or, you know, some other kind of measure to make the thing be noticeable at first, but ignorable once you know what it does.

like-- all of this can be achieved even with the Spacebar: unpause thing in the middle of the command line area, eh.
i'm just trying to think if there's anything else we can do 🤔
(also i'm not even sure if anything i'm saying makes any sense, remember to ask other people as well!)

@Cubittus
Copy link
Contributor Author

Cubittus commented Apr 4, 2023

Thanks for all the feedback!
I've played around with a couple of changes.
The video below shows three possibilities:

  • The current (The pause label is hidden when no fort is loaded now)
  • Moving the pause label above the commandline
  • Changing the pause label to only show the current state, but still toggling the highlight as you type

Regarding discoverability of space-to-pause there is a new line added to the default help page.
Anyone opening the tool for the first time will read this in the first paragraph.

dfpause.mp4

@TaxiService
Copy link

TaxiService commented Apr 4, 2023

you know... the first of those three proposal is growing on me.
i mean having Space: un/pause next to Enter: run on the same line, above Alt+s: History search:

That said, i like how you found solutions that do not increase that area's height by putting the label next to the minimize hotkey!
but i'm not sure if i like how they look. 🤔 (the second and third proposals)
like, i mean: the placement is genius, but visually it makes that area feel a bit messier. If i had to choose between these three options i'd probably pick the first one.

I kinda like the third proposal's lack of an hotkeylabel, but maybe not having the hotkeylabel makes "why is this thing there" a little unclear in this case. 🤔
(btw, the minimize button thing should probably be reworked eventually; we need to find more a consistent solution for all windows that can be minimized)

so in the end my feedback is this:

  • the first proposal is alright!
  • i still believe that coming up with a more "reusable" solution like having a label like the PAUSE FORCED one, would be better in the long run. 🤔 (if you feel it's too far from the text input field, we could move both the "PAUSE FORCED" and this "SPACEBAR CAPTURED" labels in the top-left corner of the window, for all windows!)

in any case, i'd like to hear more people's opinions on this.

ps: hell, the label i imagine could even just be something like (TYPING) popping up in the top-left corner whenever keyboard focus is on a text field 🤔 this would definitely solve this issue and any other issues related to not-knowing-where-my-input-is-going
it could look something like in these mockups:
Untitled-1
maybe it'd look better if it was typing... with an ellipsis and no parentheses 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
3 participants