feat(BlockPosSetting): Add button to set coordinates#262
Conversation
… under the cursor
beanbag44
left a comment
There was a problem hiding this comment.
please test the code before publishing a pr
src/main/kotlin/com/lambda/config/settings/complex/BlockPosSetting.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/lambda/config/settings/complex/BlockPosSetting.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/lambda/config/settings/complex/BlockPosSetting.kt
Outdated
Show resolved
Hide resolved
| } | ||
| lambdaTooltip(setting.description) | ||
| sameLine() | ||
| button("Set") { |
There was a problem hiding this comment.
this displays even when the dropdown is closed
There was a problem hiding this comment.
That is on purpose. The idea is that you need to expand the tree node to see the coordinates. Otherwise coordinates will always show.
src/main/kotlin/com/lambda/config/settings/complex/BlockPosSetting.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/lambda/config/settings/complex/BlockPosSetting.kt
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| fun trySetValue(newValue: R) { | ||
| fun trySetValue(newValue: R, logResponse: Boolean = true) { |
There was a problem hiding this comment.
i dont think a logResponse parameter is required here. The button has the tooltip to explain what it does and the built-in log functionality offers an option to revert to the old value
There was a problem hiding this comment.
I did it this way because the default response in chat shows coordinates of the setting you changed
|
hm ok i see the point of the drop-down and different chat command now. The drop-down / button combination is still buggy though. When hovering over the drop-down, the highlight bar goes through the button, and i think for most people, they wont be clicking the button while streaming for example as its too close to opening the drop-down and leaking coordinates. Its prob best just to keep the set button in the drop-down. Maybe there could be an option once we add a Client module to obfuscate coordinates in settings unless clicked to edit them. Then the button could definitely be placed inside the drop-down, or even remove the drop-down as a whole. |
|
im still not a huge fan of overriding the default command print in chat as it completely removes the guarantee of an undo button. Im not sure the best way to do this, maybe adding an open command print function to SettingCore which appends the undo on the end would be a good way of keeping coherence between setting commands. For now i think just stick with the standard command and we can come up with a more flexible system in the future |
Sets coordinates in the BlockPosSetting to the block you are currently looking at. Don't have to type out coordinates in chat anymore.