-
Notifications
You must be signed in to change notification settings - Fork 199
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
add gui/biomes: a way to see where one biome ends and another begins #637
Conversation
TymurGubayev
commented
Mar 12, 2023
•
edited
Loading
edited
- selected biome is highlighted on the map
- the "tooltip" window under the legend is shown on mouse-hover
This is not quite finished (see tasks), but I'll need help with them.
|
long time no see! welcome back! I have not figured out a way to change the color of text being applied to map tiles. It might be possible, but I think you'll be better off using the "on/off" icons that TaxiService provided us. run the minimap is always in the upper right corner and is always the same size. You can just use a frame attached to the right edge at a constant offset from the top and you'll be fine. I've found in the past that overlaying the entire visible map from Lua can be slow. If performance is an issue here, feel free to extend pathable.cpp with another API endpoint for this tool. Much of the logic you need is already there. |
gui/biomes.lua
Outdated
|
||
local TITLE = "Biomes" | ||
|
||
BiomeVisualizerLegend = nil -- for debugging purposes |
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.
for clearing the script environment for debugging/dev purposes, consider using devel/clear-script-env
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 probably don't understand this. Right now, if I make a change in the script, or more specifically in the BiomeVisualizerLegend
-class, I execute gui/biomes
, and the changes are immediately applied. How would I use devel/clear-script-env
instead? Execute first the clear-sript-env
and then gui/biomes
?.. I don't remember, how can I chain commands in dfhack console?
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.
you'd only need to use devel/clear-script-env
if you had previously set a global in the script and an update removes the global. for example, if you had function MyClass:onInput(keys)
but then you remove the function, it will still be defined and active until you run devel/clear-script-env
(or reload the game). If you just change an existing function definition, then there's no problem.
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.
well, then I have to think about whether I set a global or not, and since most of the time I do not, I'll definitely forget the one time I do.
also, if you like the behavior of |
@TymurGubayev have you made any progress on this? I'd love to get it into the next beta! |
@myk002 right, I need to finish this one. I'll try to do it this weekend. |
Few other minor changes
Other minor tweaks and an attempt at slightly improving performance via caching biome region info
Updated version is almost done, there are few things to still do though.
|
I'll respond to the others in the review, but this one I think is expected. At least I've run into it before and I think there's a mantis bug for it. Biomes in the air are the same as the region up and left from the current embark area (or something like that). Are the blocks where biome info is missing also in the air? |
gui/biomes.lua
Outdated
|
||
-------------------------------------------------------------------------------- | ||
|
||
if RELOAD then TooltipWindow = nil end |
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.
yeah, this is the kind of stuff you'd use gui/clear-script-env
for
gui/biomes.lua
Outdated
view_id = 'label', | ||
frame = {t = 0, h = 1000}, | ||
auto_height = false, | ||
--wtf??? without this the label is always a single line |
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 means that updateLayout()
calls are not getting to this widget. If you call the TooltipWindow
's updateLayout()
when the main panel's updateLayout()
is called, then they should stay in sync. However, resizing from the line between the two "windows" is not a common UX style, and nothing else in DFHack does it that way. Maybe you could add the tooltip as a widget in BiomeVisualizerLegend
, like how gui/control-panel
does it? That would simplify the structure quite a bit. You can still specify an interior frame (gui.INTERIOR_FRAME
) around the tooltip panel, if you wish.
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.
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.
Note that the hotkeys panel is not resizable -- nor is the buildingplan panel, which also has that dual-frame look. For a resizable window, I think what you want is a single exterior frame with possibly a thinner interior frame around the tooltip. Otherwise it isn't obvious where the player should go to resize the window. You can still make the extended info disappear and the window shrink when it's not hovered, but I'd actually recommend leaving it. The player can always resize the window or dragging it around if it's in the way.
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 can't figure out how to make the window shrink dynamically :(
I'll try a version just showing the info
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.
yes they are |
Co-authored-by: Myk <[email protected]>
Co-authored-by: Myk <[email protected]>
Co-authored-by: Myk <[email protected]>
ok, then it's probably not worth worrying about. this is almost certainly a vanilla bug |
:) It only actually has 3, other ones are in the air |
Are you on Discord? figuring out what to do with those phantom biomes might be a good topic for discussion. Should they be hidden in the list? Optionally hidden, with a message saying that they are likely to be buggy? Showing them as identical to the "real" biomes might be confusing. |
I was for a bit on Discord, but I'm not sure I like it there, especially for discussions such as this one. I think how to show the phantom biomes should depend on what happens if you manage to create a farm up there. I'm most curious about the missing biomes: will the game explode or will it treat them like ice? I'm not any good at such science experiments. |
|
||
local z = z or df.global.window_z | ||
|
||
--for z = 0, maxZ do |
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.
no longer used? also the corresponding --end
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.
yes, it was too slow. I'd like to leave it there for future reference though.
Other minor changes Co-authored-by: Myk <[email protected]>
|
dfhack/dfhack commit fe8bd4fa786369f7a95ae7925fc992095cc1fb2d may be informative (part of DFHack/dfhack#3663) |
unsuspend might be a good model to follow for the new textures api: |
could you rebase onto current master and add a changelog entry for the new tool? |
well, I have an idea about that actually: this happens if I cut the 8x12 "on" indicator and place it in the top left corner on a different 32x32 png image with a transparent background.
I'd much prefer the 3rd approach, especially since we already have half of the required API: |
I tried (1) for the Adding another texture map to our art directory wouldn't be onerous. It's 5k for 5 If you'd like to finish up the dynamic texture API, that would be cool, but I'm not sure if we should wait for that for this PR -- I'd rather get this released sooner rather than later. |
:tags: fort inspection map | ||
|
||
This script shows the boundaries of the biome regions on the map. | ||
Hover over a biome entry in the list to get detailed info about it. |
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 also allowing the player to hover the mouse cursor over the map to select the region in the list? If the keyboard cursors are used and the mouse hasn't moved, then that can take precedence to move the list cursor. Then when the mouse moves, it can be the selector again.
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.
implemented... Now that I re-read your comment, probably not exactly what you had in mind, but hopefully close enough
all assets should go in the dfhack repo in the |
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.
love it. Great job!
yay! |