Repository navigation
Conversation
SilasD
left a comment
There was a problem hiding this comment.
The brush painting code looks solid.
I am requesting removal of the dynamic menu text positioning (the element hiding), in favor of graying out elements that don't affect the current operation mode.
| if type(k) == "string" then | ||
| if k:startswith("level_increase") or k:startswith("level_decrease") then |
There was a problem hiding this comment.
hmm, okay, why are we doing this?
A: seems to be because we we want to adjust both level_decrease and level_decrease_glyph, an dthe same for level_increase and level_increase_glyph.
not sure I like this. I guess it's no worse than the other layout elements, which are also hardcoded.
I'm tempted to say 'use a callback to calculate this dynamically' but that is kind of advanced.
so the effect of this code is to hide the "Decrease radius" and "Increase radius" labels if the Paint mode is Area.
this is opposed to just graying out both labels, the way that "Increase level" is grayed out when the liquid level is 7/7.
the effect here is that UI elements appear and disappear as modes change.
(later) Okay, I've been thinking about this off-and-on for most of a day. I don't like hiding those labels. I strongly believe menu-like UI elements should gray out when they are not valid input.
Important
Please change the label code so that the Increase radius and Decrease radius labels gray out when not valid.
I think that means this entire function can be deleted.
| end | ||
|
|
||
|
|
||
| return ([[Click to spawn %s with %s/7 %s]]):format( |
There was a problem hiding this comment.
Tip
There's no need for this to use [[longstring]] marks, "double-quotes" are preferred.
| return ([[Click to spawn %s with %s/7 %s]]):format( | |
| return ("Click to spawn %s with %s/7 %s"):format( |
| function SpawnLiquid:increaseBrushSize() | ||
| self.brush_radius = math.min(self.brush_radius + 1, 10) | ||
| end | ||
|
|
||
| function SpawnLiquid:decreaseBrushSize() | ||
| self.brush_radius = math.max(self.brush_radius - 1, 0) | ||
| end | ||
|
|
||
|
|
There was a problem hiding this comment.
Note
setting the brush radius to 1, 2, 3, 4, etc. results in brush sizes of 1x1, 3x3, 5x5, 7x7, etc.
radius 10 yields a brush of 21x21, I think.
it might be useful to increment it by 0.5, which would also yield brush sizes of 2x2, 4x4, 6x6, etc.
the minimum would still have to be 1
This adds a brush size property when the
gui/liquidsmode is set to Drag or Click. In these modes the brush can also be changed to either a square or round brushliquids-brush-compressed.mp4
Additional Changes
This includes a small fix where the UI and actual paint mode were out of sync when
gui/liquidswas first opened.