Share settings page helpers, add GUI cursor/scale API

- move create_trackbar_setting/update_trackbar_label/create_checkbox from
  settings_audio/display/graphics pages to core:settings_common module
- GUI scale trackbar shows the really applied scale, e.g. '3 (effective 2)'
- add gui.get_scale(), gui.get_max_scale(), gui.get_cursor_pos() (UI units);
  document that input.get_mouse_pos() returns window pixels
- InventoryView default color is defined once (InventoryView::DEFAULT_COLOR)
  instead of duplicated literals; 'color' attribute still overrides it
This commit is contained in:
loki5512344 2026-10-03 13:12:30 +00:00
parent 851c1a0e27
commit 33e132a231
15 changed files with 173 additions and 123 deletions

View file

@ -55,7 +55,8 @@ end, document.root)
input.get_mouse_pos() --> {int, int}
```
Returns cursor screen position.
Returns cursor screen position in window pixels.
To get position in UI units (affected by GUI scale) use `gui.get_cursor_pos()`.
```lua
input.get_mouse_delta() --> {int, int}