feat(ui): popovers, tooltips, progress; the render3d backend installs itself; duplicate names caught first
- `popover`: a top layer that keeps the pointer and the keyboard, closed by a press outside or Esc. - `title` tooltips after half a second's rest, styled by .ui-tooltip. - `<progress>` and `<meter>`. - Atlases take rows and number cells, and importing ludic.ui/render3d.ludic is enough to draw with render3d. - The compiler reports two declarations of one name before it type-checks, so a package global clashing with a program's reads as that, not as 29 type errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1dad96102a
commit
0a7525b125
24 changed files with 243 additions and 21 deletions
3
examples/library/ui_popover_parts/Verbs.lss
Normal file
3
examples/library/ui_popover_parts/Verbs.lss
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
.page { width: 300px; height: 200px; gap: 4px }
|
||||
.verbs { top: 40px; left: 10px; width: 120px }
|
||||
progress { width: 200px }
|
||||
6
examples/library/ui_popover_parts/Verbs.ludic
Normal file
6
examples/library/ui_popover_parts/Verbs.ludic
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Verbs.ludic - a grid cell that opens a popover of verbs
|
||||
component Verbs {
|
||||
state open: bool = false
|
||||
state used: string = "none"
|
||||
state health: int = 30
|
||||
}
|
||||
11
examples/library/ui_popover_parts/Verbs.xml
Normal file
11
examples/library/ui_popover_parts/Verbs.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<div class="page">
|
||||
<button id="cell" on-click="set open = true">Axe</button>
|
||||
<if test="{open}">
|
||||
<div popover class="verbs" on-close="set open = false">
|
||||
<button on-click="set used = 'drop'; set open = false">Drop</button>
|
||||
<button on-click="set used = 'give'; set open = false">Give</button>
|
||||
</div>
|
||||
</if>
|
||||
<progress value="{health}" max="{100}"/>
|
||||
<p title="how much is left">{used} {open}</p>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue