Skip to content

Commit

Permalink
fix TS tests. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Apr 25, 2024
1 parent 6800da7 commit 6ab7509
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
15 changes: 7 additions & 8 deletions Assets/Script/Test/ContactTSX.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,14 @@ threadLoop(function() -- 79
changed, receivingContact = ImGui.Checkbox("Receiving Contact", receivingContact) -- 89
if changed then -- 89
if disk.current then -- 89
print(receivingContact) -- 92
disk.current.receivingContact = receivingContact -- 93
end -- 93
if label.current then -- 93
label.current.text = "" -- 96
end -- 96
end -- 96
disk.current.receivingContact = receivingContact -- 92
end -- 92
if label.current then -- 92
label.current.text = "" -- 95
end -- 95
end -- 95
end -- 84
) -- 84
return false -- 100
return false -- 99
end) -- 79
return ____exports -- 79
1 change: 0 additions & 1 deletion Assets/Script/Test/ContactTSX.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ threadLoop(() => {
[changed, receivingContact] = ImGui.Checkbox("Receiving Contact", receivingContact);
if (changed) {
if (disk.current) {
print(receivingContact);
disk.current.receivingContact = receivingContact;
}
if (label.current) {
Expand Down
12 changes: 7 additions & 5 deletions Assets/Script/Test/YarnTS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ scroll:slot( -- 38
scroll.position = Vec2(w / 2, h / 2) -- 39
w = w - 200 -- 40
h = h - 20 -- 41
local label = tolua.cast(scroll.view.children.first, "Label") -- 42
local ____tolua_cast_3 = tolua.cast -- 42
local ____opt_1 = scroll.view.children -- 42
local label = ____tolua_cast_3(____opt_1 and ____opt_1.first, "Label") -- 42
if label ~= nil then -- 42
label.textWidth = w - fontSize -- 44
end -- 44
Expand All @@ -60,8 +62,8 @@ scroll:slot( -- 38
scroll.area:addChild(border) -- 49
end -- 38
) -- 38
local ____opt_1 = Label("sarasa-mono-sc-regular", fontSize) -- 38
local label = ____opt_1 and ____opt_1:addTo(scroll.view) -- 51
local ____opt_4 = Label("sarasa-mono-sc-regular", fontSize) -- 38
local label = ____opt_4 and ____opt_4:addTo(scroll.view) -- 51
if label then -- 51
label.alignment = "Left" -- 53
label.textWidth = width - fontSize -- 54
Expand Down Expand Up @@ -183,8 +185,8 @@ local windowFlags = { -- 150
"NoMove" -- 155
} -- 155
threadLoop(function() -- 157
local ____App_visualSize_3 = App.visualSize -- 158
local width = ____App_visualSize_3.width -- 158
local ____App_visualSize_6 = App.visualSize -- 158
local width = ____App_visualSize_6.width -- 158
ImGui.SetNextWindowPos( -- 159
Vec2(width - 10, 10), -- 159
"Always", -- 159
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Test/YarnTS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ scroll.slot("AlignLayout", (w: number, h: number) => {
scroll.position = Vec2(w / 2, h / 2);
w -= 200;
h -= 20;
const label = tolua.cast(scroll.view.children.first, TypeName.Label);
const label = tolua.cast(scroll.view.children?.first, TypeName.Label);
if (label !== null) {
label.textWidth = w - fontSize;
}
Expand Down

0 comments on commit 6ab7509

Please sign in to comment.