@tastic/shell 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/index.js +5 -4
- package/dist/index.mjs +5 -4
- package/package.json +5 -5
- package/src/components/OpponentPicker.tsx +1 -1
- package/src/screens/HomeScreen.tsx +1 -1
- package/src/screens/LoadoutScreen.tsx +5 -2
package/README.md
CHANGED
|
@@ -11,6 +11,11 @@ How to Play and stats tabs into the same screens.
|
|
|
11
11
|
The stats screen's player picker is always there, with no profile yet too: Everyone, each profile
|
|
12
12
|
(and Guest, with `guestStats`, once one exists), then Manage, which opens the Profiles screen.
|
|
13
13
|
|
|
14
|
+
Every seat button names its seat in a small caption over it (0.20.0+, on `@tastic/profile` 0.29.0 and
|
|
15
|
+
`@tastic/hud` 0.40.0), as the stats screen's PLAYER and GAME pickers do: PLAYER over seat 1's button on
|
|
16
|
+
Home and in a loadout with one person, PLAYER 1 and PLAYER 2 in 2 Player's halves, and OPPONENT over
|
|
17
|
+
player 1's opponent button.
|
|
18
|
+
|
|
14
19
|
Built from the shell PuckTastic and DuelTastic each carried in `src/shell/` (made identical on
|
|
15
20
|
2026-10-28), so the packs and the next ones (CardTastic) share one copy. Part of the `@tastic`
|
|
16
21
|
package ecosystem, on [`@tastic/hud`](https://github.com/jayrdeaton/react-native-hud),
|
package/dist/index.js
CHANGED
|
@@ -695,7 +695,7 @@ function OpponentPicker({ idPrefix, host, choices, seatTwo, onSeatTwoChange, cpu
|
|
|
695
695
|
const size = (0, import_profile6.getOptionPickerContentSize)(options, colorSection);
|
|
696
696
|
const useAlign = usePickerAlign ?? import_lobby.useZoneClampedAlign;
|
|
697
697
|
const align = useAlign(host.openId === pickerId, size.width, size.height);
|
|
698
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native4.View, { style: [styles2.button, host.openId === pickerId && styles2.buttonOpen], children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_profile6.OptionPicker, { id: pickerId, host, options, value, onChange: handleChange, color: drawn, dark, icon, colorSection, alignOverride: align, triggerStyle }) });
|
|
698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native4.View, { style: [styles2.button, host.openId === pickerId && styles2.buttonOpen], children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_profile6.OptionPicker, { id: pickerId, host, caption: "Opponent", options, value, onChange: handleChange, color: drawn, dark, icon, colorSection, alignOverride: align, triggerStyle }) });
|
|
699
699
|
}
|
|
700
700
|
var styles2 = import_react_native4.StyleSheet.create({
|
|
701
701
|
// Its own column, so a row of seat buttons doesn't stretch the pill to the tallest of them.
|
|
@@ -960,7 +960,8 @@ function LoadoutScreen({ game }) {
|
|
|
960
960
|
const p1ControlOpen = controlsHost.openId === P1_CONTROL_ID;
|
|
961
961
|
const controlLook = { accentColor: themeColors.tertiary, mutedColor: fgMuted, dark };
|
|
962
962
|
const p1Control = loadout.seatControl(1, controlsHost, { ...controlLook, seatColor: p1Drawn });
|
|
963
|
-
const
|
|
963
|
+
const p1Caption = p2IsHuman ? "Player 1" : "Player";
|
|
964
|
+
const p1Panel = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lobby2.PlayerSetupPanel, { idPrefix: "p1", caption: p1Caption, host: controlsHost, color: p1Color, onColorChange: handleP1ColorChange, swatches: import_auto_paper5.defaultColors, takenColor: p2Exists ? p2Color : void 0, allowSwapTaken: mode === "vsCpu", colorCaption: pack.colorCaption, isHuman: true, dark, showReadyButton: false, profiles, selectedProfileId: lastSelected[1], takenProfileId: p2IsHuman ? lastSelected[2] : null, guestLabel: pack.guestLabel ?? "P1", nullLabel: pack.nullLabel, onProfileSelect: handleP1ProfileSelect, onManageProfiles: () => import_expo_router7.router.push(profilesHref(1)), previewValue: seatPreview, triggerStyle, useSeatPickerAlign: seatPickerAlign }, `p1-${layoutKey}`);
|
|
964
965
|
const opponentPicker = game.seatTwo && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(OpponentPicker, { idPrefix: "p1", host: controlsHost, choices: game.seatTwo, seatTwo, onSeatTwoChange: changeSeatTwo, cpuDifficulty: loadout.cpuDifficulty, color: p2Color, onColorChange: handleP2ColorChange, swatches: import_auto_paper5.defaultColors, takenColor: p1Color, allowSwapTaken: mode === "vsCpu", dark, previewValue: seatPreview, triggerStyle, usePickerAlign: seatPickerAlign }, `opponent-${layoutKey}`);
|
|
965
966
|
const toggleP1Ready = () => setReady((r) => ({ ...r, 1: !r[1] }));
|
|
966
967
|
const readyInOptions = !p2IsHuman && !!loadout.drawsReady;
|
|
@@ -992,7 +993,7 @@ function LoadoutScreen({ game }) {
|
|
|
992
993
|
const optionsPopoverOpen = controlsHost.openId !== null && loadout.optionIds.includes(controlsHost.openId);
|
|
993
994
|
const sharedControls = showMetaInSharedBand ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lobby2.SharedActionBand, { onBack: import_core6.safeBack, onSettings: () => setSettingsOpen(true), onRandomize: loadout.randomize, onReset: loadout.reset, fg, popoverOpen: optionsPopoverOpen, children: optionsRow }) : optionsRow;
|
|
994
995
|
const p2Control = p2IsHuman ? loadout.seatControl(2, p2Host, { ...controlLook, seatColor: p2Drawn }) : void 0;
|
|
995
|
-
const p2Panel = p2IsHuman && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lobby2.PlayerSetupPanel, { idPrefix: "p2", host: p2Host, color: p2Color, onColorChange: handleP2ColorChange, swatches: import_auto_paper5.defaultColors, takenColor: p1Color, colorCaption: pack.colorCaption, isHuman: true, ready: ready[2], onToggleReady: () => setReady((r) => ({ ...r, 2: !r[2] })), dark, secondPicker: p2Control, secondPickerId: p2Control ? P2_CONTROL_ID : void 0, profiles, selectedProfileId: lastSelected[2], takenProfileId: lastSelected[1], guestLabel: pack.guestLabel ?? "P2", nullLabel: pack.nullLabel, onProfileSelect: handleP2ProfileSelect, previewValue: seatPreview, triggerStyle, readySurfaceColor: readySurface }, "p2-zones");
|
|
996
|
+
const p2Panel = p2IsHuman && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lobby2.PlayerSetupPanel, { idPrefix: "p2", caption: "Player 2", host: p2Host, color: p2Color, onColorChange: handleP2ColorChange, swatches: import_auto_paper5.defaultColors, takenColor: p1Color, colorCaption: pack.colorCaption, isHuman: true, ready: ready[2], onToggleReady: () => setReady((r) => ({ ...r, 2: !r[2] })), dark, secondPicker: p2Control, secondPickerId: p2Control ? P2_CONTROL_ID : void 0, profiles, selectedProfileId: lastSelected[2], takenProfileId: lastSelected[1], guestLabel: pack.guestLabel ?? "P2", nullLabel: pack.nullLabel, onProfileSelect: handleP2ProfileSelect, previewValue: seatPreview, triggerStyle, readySurfaceColor: readySurface }, "p2-zones");
|
|
996
997
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native6.View, { style: [styles3.container, { backgroundColor: bg }], children: [
|
|
997
998
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native6.View, { style: [styles3.frame, !showMetaInSharedBand && { paddingTop: HEADER_TOP + HEADER_ROW_HEIGHT + insets.top }], children: [
|
|
998
999
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_chrome6.PressAwayOverlay, { active: controlsHost.openId !== null, onPress: controlsHost.close }),
|
|
@@ -1315,7 +1316,7 @@ function HomeMenu() {
|
|
|
1315
1316
|
const usePickerAlign = pack.usePickerAlign ?? noPickerAlign;
|
|
1316
1317
|
const pickerSize = (0, import_profile9.getProfilePickerContentSize)(profiles.length, true, colorSection);
|
|
1317
1318
|
const pickerAlign = usePickerAlign(pickerHost.openId === `${SEAT_ONE_PICKER}-profile`, pickerSize.width, pickerSize.height);
|
|
1318
|
-
const picker = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_profile9.ProfilePicker, { idPrefix: SEAT_ONE_PICKER, host: pickerHost, profiles, selectedId: lastSelected[1], color: p1Drawn, dark, guestLabel: pack.guestLabel ?? "P1", nullLabel: pack.nullLabel, onSelect: (profile) => selectProfile(1, profile?.id ?? null), onManage: () => import_expo_router9.router.push(profilesHref(1)), colorSection, alignOverride: pickerAlign, triggerStyle });
|
|
1319
|
+
const picker = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_profile9.ProfilePicker, { idPrefix: SEAT_ONE_PICKER, host: pickerHost, caption: "Player", profiles, selectedId: lastSelected[1], color: p1Drawn, dark, guestLabel: pack.guestLabel ?? "P1", nullLabel: pack.nullLabel, onSelect: (profile) => selectProfile(1, profile?.id ?? null), onManage: () => import_expo_router9.router.push(profilesHref(1)), colorSection, alignOverride: pickerAlign, triggerStyle });
|
|
1319
1320
|
const pressAway = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_chrome7.PressAwayOverlay, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles4.pressAway });
|
|
1320
1321
|
const RulesSheet = rulesGame?.Rules;
|
|
1321
1322
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native9.View, { style: [styles4.container, { backgroundColor: bg }], children: [
|
package/dist/index.mjs
CHANGED
|
@@ -616,7 +616,7 @@ function OpponentPicker({ idPrefix, host, choices, seatTwo, onSeatTwoChange, cpu
|
|
|
616
616
|
const size = getOptionPickerContentSize(options, colorSection);
|
|
617
617
|
const useAlign = usePickerAlign ?? useZoneClampedAlign;
|
|
618
618
|
const align = useAlign(host.openId === pickerId, size.width, size.height);
|
|
619
|
-
return /* @__PURE__ */ jsx13(View2, { style: [styles2.button, host.openId === pickerId && styles2.buttonOpen], children: /* @__PURE__ */ jsx13(OptionPicker, { id: pickerId, host, options, value, onChange: handleChange, color: drawn, dark, icon, colorSection, alignOverride: align, triggerStyle }) });
|
|
619
|
+
return /* @__PURE__ */ jsx13(View2, { style: [styles2.button, host.openId === pickerId && styles2.buttonOpen], children: /* @__PURE__ */ jsx13(OptionPicker, { id: pickerId, host, caption: "Opponent", options, value, onChange: handleChange, color: drawn, dark, icon, colorSection, alignOverride: align, triggerStyle }) });
|
|
620
620
|
}
|
|
621
621
|
var styles2 = StyleSheet2.create({
|
|
622
622
|
// Its own column, so a row of seat buttons doesn't stretch the pill to the tallest of them.
|
|
@@ -881,7 +881,8 @@ function LoadoutScreen({ game }) {
|
|
|
881
881
|
const p1ControlOpen = controlsHost.openId === P1_CONTROL_ID;
|
|
882
882
|
const controlLook = { accentColor: themeColors.tertiary, mutedColor: fgMuted, dark };
|
|
883
883
|
const p1Control = loadout.seatControl(1, controlsHost, { ...controlLook, seatColor: p1Drawn });
|
|
884
|
-
const
|
|
884
|
+
const p1Caption = p2IsHuman ? "Player 1" : "Player";
|
|
885
|
+
const p1Panel = /* @__PURE__ */ jsx15(PlayerSetupPanel, { idPrefix: "p1", caption: p1Caption, host: controlsHost, color: p1Color, onColorChange: handleP1ColorChange, swatches: defaultColors2, takenColor: p2Exists ? p2Color : void 0, allowSwapTaken: mode === "vsCpu", colorCaption: pack.colorCaption, isHuman: true, dark, showReadyButton: false, profiles, selectedProfileId: lastSelected[1], takenProfileId: p2IsHuman ? lastSelected[2] : null, guestLabel: pack.guestLabel ?? "P1", nullLabel: pack.nullLabel, onProfileSelect: handleP1ProfileSelect, onManageProfiles: () => router4.push(profilesHref(1)), previewValue: seatPreview, triggerStyle, useSeatPickerAlign: seatPickerAlign }, `p1-${layoutKey}`);
|
|
885
886
|
const opponentPicker = game.seatTwo && /* @__PURE__ */ jsx15(OpponentPicker, { idPrefix: "p1", host: controlsHost, choices: game.seatTwo, seatTwo, onSeatTwoChange: changeSeatTwo, cpuDifficulty: loadout.cpuDifficulty, color: p2Color, onColorChange: handleP2ColorChange, swatches: defaultColors2, takenColor: p1Color, allowSwapTaken: mode === "vsCpu", dark, previewValue: seatPreview, triggerStyle, usePickerAlign: seatPickerAlign }, `opponent-${layoutKey}`);
|
|
886
887
|
const toggleP1Ready = () => setReady((r) => ({ ...r, 1: !r[1] }));
|
|
887
888
|
const readyInOptions = !p2IsHuman && !!loadout.drawsReady;
|
|
@@ -913,7 +914,7 @@ function LoadoutScreen({ game }) {
|
|
|
913
914
|
const optionsPopoverOpen = controlsHost.openId !== null && loadout.optionIds.includes(controlsHost.openId);
|
|
914
915
|
const sharedControls = showMetaInSharedBand ? /* @__PURE__ */ jsx15(SharedActionBand, { onBack: safeBack, onSettings: () => setSettingsOpen(true), onRandomize: loadout.randomize, onReset: loadout.reset, fg, popoverOpen: optionsPopoverOpen, children: optionsRow }) : optionsRow;
|
|
915
916
|
const p2Control = p2IsHuman ? loadout.seatControl(2, p2Host, { ...controlLook, seatColor: p2Drawn }) : void 0;
|
|
916
|
-
const p2Panel = p2IsHuman && /* @__PURE__ */ jsx15(PlayerSetupPanel, { idPrefix: "p2", host: p2Host, color: p2Color, onColorChange: handleP2ColorChange, swatches: defaultColors2, takenColor: p1Color, colorCaption: pack.colorCaption, isHuman: true, ready: ready[2], onToggleReady: () => setReady((r) => ({ ...r, 2: !r[2] })), dark, secondPicker: p2Control, secondPickerId: p2Control ? P2_CONTROL_ID : void 0, profiles, selectedProfileId: lastSelected[2], takenProfileId: lastSelected[1], guestLabel: pack.guestLabel ?? "P2", nullLabel: pack.nullLabel, onProfileSelect: handleP2ProfileSelect, previewValue: seatPreview, triggerStyle, readySurfaceColor: readySurface }, "p2-zones");
|
|
917
|
+
const p2Panel = p2IsHuman && /* @__PURE__ */ jsx15(PlayerSetupPanel, { idPrefix: "p2", caption: "Player 2", host: p2Host, color: p2Color, onColorChange: handleP2ColorChange, swatches: defaultColors2, takenColor: p1Color, colorCaption: pack.colorCaption, isHuman: true, ready: ready[2], onToggleReady: () => setReady((r) => ({ ...r, 2: !r[2] })), dark, secondPicker: p2Control, secondPickerId: p2Control ? P2_CONTROL_ID : void 0, profiles, selectedProfileId: lastSelected[2], takenProfileId: lastSelected[1], guestLabel: pack.guestLabel ?? "P2", nullLabel: pack.nullLabel, onProfileSelect: handleP2ProfileSelect, previewValue: seatPreview, triggerStyle, readySurfaceColor: readySurface }, "p2-zones");
|
|
917
918
|
return /* @__PURE__ */ jsxs4(View3, { style: [styles3.container, { backgroundColor: bg }], children: [
|
|
918
919
|
/* @__PURE__ */ jsxs4(View3, { style: [styles3.frame, !showMetaInSharedBand && { paddingTop: HEADER_TOP + HEADER_ROW_HEIGHT + insets.top }], children: [
|
|
919
920
|
/* @__PURE__ */ jsx15(PressAwayOverlay, { active: controlsHost.openId !== null, onPress: controlsHost.close }),
|
|
@@ -1236,7 +1237,7 @@ function HomeMenu() {
|
|
|
1236
1237
|
const usePickerAlign = pack.usePickerAlign ?? noPickerAlign;
|
|
1237
1238
|
const pickerSize = getProfilePickerContentSize(profiles.length, true, colorSection);
|
|
1238
1239
|
const pickerAlign = usePickerAlign(pickerHost.openId === `${SEAT_ONE_PICKER}-profile`, pickerSize.width, pickerSize.height);
|
|
1239
|
-
const picker = /* @__PURE__ */ jsx17(ProfilePicker, { idPrefix: SEAT_ONE_PICKER, host: pickerHost, profiles, selectedId: lastSelected[1], color: p1Drawn, dark, guestLabel: pack.guestLabel ?? "P1", nullLabel: pack.nullLabel, onSelect: (profile) => selectProfile(1, profile?.id ?? null), onManage: () => router5.push(profilesHref(1)), colorSection, alignOverride: pickerAlign, triggerStyle });
|
|
1240
|
+
const picker = /* @__PURE__ */ jsx17(ProfilePicker, { idPrefix: SEAT_ONE_PICKER, host: pickerHost, caption: "Player", profiles, selectedId: lastSelected[1], color: p1Drawn, dark, guestLabel: pack.guestLabel ?? "P1", nullLabel: pack.nullLabel, onSelect: (profile) => selectProfile(1, profile?.id ?? null), onManage: () => router5.push(profilesHref(1)), colorSection, alignOverride: pickerAlign, triggerStyle });
|
|
1240
1241
|
const pressAway = /* @__PURE__ */ jsx17(PressAwayOverlay2, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles4.pressAway });
|
|
1241
1242
|
const RulesSheet = rulesGame?.Rules;
|
|
1242
1243
|
return /* @__PURE__ */ jsxs5(View4, { style: [styles4.container, { backgroundColor: bg }], children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tastic/shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "The app around a pack of React Native games, two-seat or for one player: Home, the loadout, the stats screen, Profiles and Settings, the pack's Redux store and its root providers, driven by one PackDefinition",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"@tastic/achievements": "^0.6.1",
|
|
87
87
|
"@tastic/core": "^0.17.0",
|
|
88
88
|
"@tastic/edge-guard": "^0.2.1",
|
|
89
|
-
"@tastic/hud": "^0.
|
|
90
|
-
"@tastic/profile": "^0.
|
|
89
|
+
"@tastic/hud": "^0.40.0",
|
|
90
|
+
"@tastic/profile": "^0.29.0",
|
|
91
91
|
"@tastic/split-screen": "^0.6.0",
|
|
92
92
|
"@testing-library/react-native": "^14.1.0",
|
|
93
93
|
"@types/jest": "30.0.0",
|
|
@@ -138,8 +138,8 @@
|
|
|
138
138
|
"@tastic/achievements": ">=0.6.0",
|
|
139
139
|
"@tastic/core": ">=0.16.0",
|
|
140
140
|
"@tastic/edge-guard": ">=0.2.0",
|
|
141
|
-
"@tastic/hud": ">=0.
|
|
142
|
-
"@tastic/profile": ">=0.
|
|
141
|
+
"@tastic/hud": ">=0.40.0",
|
|
142
|
+
"@tastic/profile": ">=0.29.0",
|
|
143
143
|
"@tastic/split-screen": ">=0.5.5",
|
|
144
144
|
"expo-audio": ">=58.0.11",
|
|
145
145
|
"expo-blur": ">=58.0.4",
|
|
@@ -95,7 +95,7 @@ export function OpponentPicker({ idPrefix, host, choices, seatTwo, onSeatTwoChan
|
|
|
95
95
|
|
|
96
96
|
return (
|
|
97
97
|
<View style={[styles.button, host.openId === pickerId && styles.buttonOpen]}>
|
|
98
|
-
<OptionPicker id={pickerId} host={host} options={options} value={value} onChange={handleChange} color={drawn} dark={dark} icon={icon} colorSection={colorSection} alignOverride={align} triggerStyle={triggerStyle} />
|
|
98
|
+
<OptionPicker id={pickerId} host={host} caption='Opponent' options={options} value={value} onChange={handleChange} color={drawn} dark={dark} icon={icon} colorSection={colorSection} alignOverride={align} triggerStyle={triggerStyle} />
|
|
99
99
|
</View>
|
|
100
100
|
)
|
|
101
101
|
}
|
|
@@ -171,7 +171,7 @@ function HomeMenu() {
|
|
|
171
171
|
const pickerAlign = usePickerAlign(pickerHost.openId === `${SEAT_ONE_PICKER}-profile`, pickerSize.width, pickerSize.height)
|
|
172
172
|
|
|
173
173
|
// A pack can leave seat 1's button off Home (PackDefinition.homePlayerPicker)
|
|
174
|
-
const picker = <ProfilePicker idPrefix={SEAT_ONE_PICKER} host={pickerHost} profiles={profiles} selectedId={lastSelected[1]} color={p1Drawn} dark={dark} guestLabel={pack.guestLabel ?? 'P1'} nullLabel={pack.nullLabel} onSelect={(profile: Profile | null) => selectProfile(1, profile?.id ?? null)} onManage={() => router.push(profilesHref(1))} colorSection={colorSection} alignOverride={pickerAlign} triggerStyle={triggerStyle} />
|
|
174
|
+
const picker = <ProfilePicker idPrefix={SEAT_ONE_PICKER} host={pickerHost} caption='Player' profiles={profiles} selectedId={lastSelected[1]} color={p1Drawn} dark={dark} guestLabel={pack.guestLabel ?? 'P1'} nullLabel={pack.nullLabel} onSelect={(profile: Profile | null) => selectProfile(1, profile?.id ?? null)} onManage={() => router.push(profilesHref(1))} colorSection={colorSection} alignOverride={pickerAlign} triggerStyle={triggerStyle} />
|
|
175
175
|
|
|
176
176
|
// Closes seat 1's menu on a press anywhere but the menu and its button. Where it's mounted matters on
|
|
177
177
|
// a phone, where zIndex only orders the children of one parent: the menu lives inside the scroller in
|
|
@@ -183,7 +183,10 @@ export function LoadoutScreen({ game }: { game: LoadoutGame }) {
|
|
|
183
183
|
const p1Control = loadout.seatControl(1, controlsHost, { ...controlLook, seatColor: p1Drawn })
|
|
184
184
|
// Seat 1's button alone: player 1's controls and Ready sit under the row it shares with the
|
|
185
185
|
// opponent button, centered under both.
|
|
186
|
-
|
|
186
|
+
// Each seat button names its seat (Jay, 2026-11-25, as the stats screen's PLAYER and GAME pills): PLAYER with
|
|
187
|
+
// one person, PLAYER 1 and PLAYER 2 in 2 Player's halves, and OPPONENT over player 1's opponent button.
|
|
188
|
+
const p1Caption = p2IsHuman ? 'Player 1' : 'Player'
|
|
189
|
+
const p1Panel = <PlayerSetupPanel key={`p1-${layoutKey}`} idPrefix='p1' caption={p1Caption} host={controlsHost} color={p1Color} onColorChange={handleP1ColorChange} swatches={defaultColors} takenColor={p2Exists ? p2Color : undefined} allowSwapTaken={mode === 'vsCpu'} colorCaption={pack.colorCaption} isHuman dark={dark} showReadyButton={false} profiles={profiles} selectedProfileId={lastSelected[1]} takenProfileId={p2IsHuman ? lastSelected[2] : null} guestLabel={pack.guestLabel ?? 'P1'} nullLabel={pack.nullLabel} onProfileSelect={handleP1ProfileSelect} onManageProfiles={() => router.push(profilesHref(1))} previewValue={seatPreview} triggerStyle={triggerStyle} useSeatPickerAlign={seatPickerAlign} />
|
|
187
190
|
// Who sits in seat 2, player 1's to pick in every mode. A game for one player (no seatTwo) has none:
|
|
188
191
|
// seat 1's button stands alone.
|
|
189
192
|
const opponentPicker = game.seatTwo && <OpponentPicker key={`opponent-${layoutKey}`} idPrefix='p1' host={controlsHost} choices={game.seatTwo} seatTwo={seatTwo} onSeatTwoChange={changeSeatTwo} cpuDifficulty={loadout.cpuDifficulty} color={p2Color} onColorChange={handleP2ColorChange} swatches={defaultColors} takenColor={p1Color} allowSwapTaken={mode === 'vsCpu'} dark={dark} previewValue={seatPreview} triggerStyle={triggerStyle} usePickerAlign={seatPickerAlign} />
|
|
@@ -234,7 +237,7 @@ export function LoadoutScreen({ game }: { game: LoadoutGame }) {
|
|
|
234
237
|
// A person in seat 2: their own seat button (Player 2 or a profile, never the CPU), controls and
|
|
235
238
|
// Ready, in their half.
|
|
236
239
|
const p2Control = p2IsHuman ? loadout.seatControl(2, p2Host, { ...controlLook, seatColor: p2Drawn }) : undefined
|
|
237
|
-
const p2Panel = p2IsHuman && <PlayerSetupPanel key='p2-zones' idPrefix='p2' host={p2Host} color={p2Color} onColorChange={handleP2ColorChange} swatches={defaultColors} takenColor={p1Color} colorCaption={pack.colorCaption} isHuman ready={ready[2]} onToggleReady={() => setReady((r) => ({ ...r, 2: !r[2] }))} dark={dark} secondPicker={p2Control} secondPickerId={p2Control ? P2_CONTROL_ID : undefined} profiles={profiles} selectedProfileId={lastSelected[2]} takenProfileId={lastSelected[1]} guestLabel={pack.guestLabel ?? 'P2'} nullLabel={pack.nullLabel} onProfileSelect={handleP2ProfileSelect} previewValue={seatPreview} triggerStyle={triggerStyle} readySurfaceColor={readySurface} />
|
|
240
|
+
const p2Panel = p2IsHuman && <PlayerSetupPanel key='p2-zones' idPrefix='p2' caption='Player 2' host={p2Host} color={p2Color} onColorChange={handleP2ColorChange} swatches={defaultColors} takenColor={p1Color} colorCaption={pack.colorCaption} isHuman ready={ready[2]} onToggleReady={() => setReady((r) => ({ ...r, 2: !r[2] }))} dark={dark} secondPicker={p2Control} secondPickerId={p2Control ? P2_CONTROL_ID : undefined} profiles={profiles} selectedProfileId={lastSelected[2]} takenProfileId={lastSelected[1]} guestLabel={pack.guestLabel ?? 'P2'} nullLabel={pack.nullLabel} onProfileSelect={handleP2ProfileSelect} previewValue={seatPreview} triggerStyle={triggerStyle} readySurfaceColor={readySurface} />
|
|
238
241
|
|
|
239
242
|
return (
|
|
240
243
|
<View style={[styles.container, { backgroundColor: bg }]}>
|