-
Notifications
You must be signed in to change notification settings - Fork 191
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
Make workorder-recheck
work again
#797
Conversation
make `workorder-recheck` work again, add a widget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome back! I've honestly missed your work!
|
||
local function set_current_inactive() | ||
local scrConditions = df.global.game.main_interface.info.work_orders.conditions | ||
if scrConditions.open then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the condition that would allow the overlay to be shown or the focus string to match below. I suppose it doesn't hurt terribly to check it again, but I don't think it's necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it in case something went terribly wrong. I guess the only possible scenario is if the overlay would somehow be active when it shouldn't...
workorder-recheck.lua
Outdated
self:addviews{ | ||
widgets.HotkeyLabel{ | ||
frame={t=0, l=0}, | ||
label='recheck', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though I understand the need for making this label short, "recheck" might be too short for players to grok. I'd want some input from people on the Discord server about what would be best here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about "re-check conditions" for this label? or maybe "request manager review"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"request conditions re-check"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or just "request re-check"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another option is the new screenshots of how that might look here: DFHack/dfhack#3655 example code: https://github.com/DFHack/dfhack/blob/9cb764b847f0dd0129e47d80b28e3c2c750b8738/plugins/lua/zone.lua#L1000 |
is there a way to find where elements are on a screen? I discovered the tabs can be 1 or 2 lines, which makes positioning tricky |
You can try this:
You can use dfhack.screen.readTile() to get what's on the screen at that position. The position you check should be relative to your overlay self.frame_rect (iirc) |
that would work if
And passing Am I missing something? |
Hmm, I'm not sure. What does devel/inspect-screen say for those tiles? |
you know what, maybe test for text (the edit: changed coordinates from (7, 8) to (7, 7) so the check will be the same in ascii mode |
DFHack/dfhack#3670 will improve the |
the textbox is now correctly positioned in all 4 cases ( { graphics, ASCII } x { one row, two rows} ) |
workorder-recheck.lua
Outdated
self:addviews{ | ||
widgets.HotkeyLabel{ | ||
frame={t=0, l=0}, | ||
label='recheck', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about "re-check conditions" for this label? or maybe "request manager review"?
Co-authored-by: Myk <myk.taylor@gmail.com>
Co-authored-by: Myk <myk.taylor@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. Thanks!
This repairs the
workorder-recheck.lua
script and adds an overlay to the work order conditions screen.