wip(0.S2): migrate - a var nothing writes becomes a let; a state is keyed by its module, directory or program, so every program's plan agrees; paths normalized; program states named SceneDemoState / scene_demo_st; the LSP reads state, mut and entry/handler parameters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3eda72e8c2
commit
5ffe50ed02
463 changed files with 72045 additions and 67421 deletions
|
|
@ -28,15 +28,19 @@ export property UiInput {
|
|||
down_right: bool = false # the other mouse buttons held
|
||||
down_middle: bool = false
|
||||
}
|
||||
function in_read(ui_st: mut UiState) -> void {
|
||||
if ui_st.in_given {
|
||||
ui_st.in_given = false
|
||||
var in_now: UiInput = new UiInput
|
||||
var in_was_down: bool = false
|
||||
var in_last: UiInput = new UiInput
|
||||
var in_given: bool = false
|
||||
function in_read() -> void {
|
||||
if in_given {
|
||||
in_given = false
|
||||
return
|
||||
}
|
||||
ui_st.in_was_down = ui_st.in_now.down
|
||||
ui_st.in_last = ui_st.in_now
|
||||
in_was_down = in_now.down
|
||||
in_last = in_now
|
||||
let i = new UiInput
|
||||
if ui_st.ui_be != null and ui_st.ui_be.input {
|
||||
if ui_be != null and ui_be.input {
|
||||
i.x = float(Input.mouse_x())
|
||||
i.y = float(Input.mouse_y())
|
||||
i.down = Input.mouse_down(0)
|
||||
|
|
@ -57,8 +61,8 @@ function in_read(ui_st: mut UiState) -> void {
|
|||
i.key = in_any_key()
|
||||
in_held(i)
|
||||
}
|
||||
in_repeat(ui_st, i)
|
||||
ui_st.in_now = i
|
||||
in_repeat(i)
|
||||
in_now = i
|
||||
}
|
||||
function in_any_key() -> int {
|
||||
for k in 8 .. 167 {
|
||||
|
|
@ -67,10 +71,10 @@ function in_any_key() -> int {
|
|||
return 0
|
||||
}
|
||||
# this frame's input, given by a test or a host that reads its own
|
||||
export function ui_input(ui_st: mut UiState, i: UiInput) -> void {
|
||||
ui_st.in_was_down = ui_st.in_now.down
|
||||
ui_st.in_last = ui_st.in_now
|
||||
in_repeat(ui_st, i)
|
||||
ui_st.in_now = i
|
||||
ui_st.in_given = true
|
||||
export function ui_input(i: UiInput) -> void {
|
||||
in_was_down = in_now.down
|
||||
in_last = in_now
|
||||
in_repeat(i)
|
||||
in_now = i
|
||||
in_given = true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue