Skip to content

Commit 116757e

Browse files
use new setMain
1 parent 97a966f commit 116757e

4 files changed

Lines changed: 5 additions & 12 deletions

File tree

scripts/ui/phud/phone.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,11 @@ export default defineUI("phud_phone", (ns) => {
115115
.anims(animRef("phud_phone", "anim__jeb_loop_show__0"))
116116
.variable("$condition", prefix(4, "#value", "loop"));
117117

118-
const [, finalNs] = ns.add(
118+
return ns.setMain(
119119
panel("main")
120120
.anchor("left_middle")
121121
.offset(8, 0)
122122
.size(64, 64)
123123
.controls(icons, backgrounds, jebBackground)
124124
);
125-
return finalNs;
126125
});

scripts/ui/phud/phud.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,5 @@ export default defineUI("phud", (ns) => {
116116
.bindings(...siblingBindings())
117117
.controls(...elementRefs());
118118

119-
const [, finalNs] = ns1.add(
120-
panel("main").fullSize().controls(renderers, elements)
121-
);
122-
return finalNs;
119+
return ns1.setMain(panel("main").fullSize().controls(renderers, elements));
123120
});

scripts/ui/phud/sidebar.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default defineUI("phud_sidebar", (ns) => {
121121
.variable("var_index", varRef("pokemon_active_index"))
122122
.controls(activeIcon);
123123

124-
const [pokemonSlotTemplate] = ns1.add(
124+
const [pokemonSlotTemplate, ns2] = ns1.add(
125125
panel("pokemon_sidebar_pokemon")
126126
.size("default", 30)
127127
.variableDefaults({
@@ -164,7 +164,7 @@ export default defineUI("phud_sidebar", (ns) => {
164164

165165
pokemonHolder.controls(...controls);
166166

167-
const [, finalNs] = ns1.add(
167+
return ns2.setMain(
168168
image("main", "textures/ui/sidebar/dock")
169169
.anchor("right_middle")
170170
.size("default", "80%")
@@ -175,5 +175,4 @@ export default defineUI("phud_sidebar", (ns) => {
175175
.controls(pokemonHolder)
176176
.bindings(...phudVisibility("#sidebar"))
177177
);
178-
return finalNs;
179178
});

scripts/ui/pokemon/pc.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ export default defineUI("pc", (ns) => {
250250
.size(71, "100%c")
251251
.controls(iconBox, panel("spacer").size("default", 0.5), actionButtonBox);
252252

253-
// Main PC layout
254-
const [, finalNs] = ns.add(
253+
return ns.setMain(
255254
stackPanel("main", "horizontal")
256255
.offset("25%", "25%")
257256
.controls(
@@ -262,5 +261,4 @@ export default defineUI("pc", (ns) => {
262261
rightContentNs
263262
)
264263
);
265-
return finalNs;
266264
});

0 commit comments

Comments
 (0)