diff --git a/TODO.md b/TODO.md index daee294..f0c2668 100644 --- a/TODO.md +++ b/TODO.md @@ -2,7 +2,7 @@ - [x] **Clean up ruff E701 warnings** -- [ ] **Modal name popup**. When a Pi-Rat gains a name, they get a modal popup they have to fill out before continuing, rather than an optional box on their character sheet +- [x] **Modal name popup**. When a Pi-Rat gains a name, they get a modal popup they have to fill out before continuing, rather than an optional box on their character sheet - [ ] **Cancel Revise**. In character creation, if you click "Revise" and then don't want to make any changes after all, there should be a cancel button that throws away any edits you've made since you clicked revise. diff --git a/frontend/src/components/NameModal.svelte b/frontend/src/components/NameModal.svelte new file mode 100644 index 0000000..03abb5f --- /dev/null +++ b/frontend/src/components/NameModal.svelte @@ -0,0 +1,88 @@ + + +{#if state.player.needs_name} + +{/if} + + diff --git a/frontend/src/components/scene/CharacterSheet.svelte b/frontend/src/components/scene/CharacterSheet.svelte index 65a9231..2020b63 100644 --- a/frontend/src/components/scene/CharacterSheet.svelte +++ b/frontend/src/components/scene/CharacterSheet.svelte @@ -5,7 +5,6 @@ export let state; let error = ''; - let newNameInput = ''; let pvpOpponentId = ''; let pvpCard = ''; @@ -21,19 +20,6 @@ // What the chosen duel card becomes as a temporary Obstacle for the defender $: pvpCardObstacle = cardObstacleInfo(pvpCard, $obstacleTable); - async function submitNewName() { - if (!newNameInput.trim()) return; - error = ''; - try { - await apiRequest(`/game/${state.game.id}/player/${state.player.id}/set-name`, 'POST', { - new_name: newNameInput.trim() - }); - newNameInput = ''; - } catch(e) { - error = e.message; - } - } - async function createPvp() { error = ''; try { @@ -83,17 +69,6 @@ {/if} - {#if state.player.needs_name} -
-

🏴‍☠️ You Earned a Name!

-

You completed your second objective and ranked up! What is your new Pirate Name?

-
- - -
-
- {/if} - {#if state.player.tax_banned}

🚫 You failed a refused Tax — no more Gat/Name Taxes for you this scene.

diff --git a/frontend/src/pages/Dashboard.svelte b/frontend/src/pages/Dashboard.svelte index 946d705..b879e80 100644 --- a/frontend/src/pages/Dashboard.svelte +++ b/frontend/src/pages/Dashboard.svelte @@ -16,6 +16,7 @@ import RecruitPhase from '../components/RecruitPhase.svelte'; import GameOverPhase from '../components/GameOverPhase.svelte'; import EventLog from '../components/EventLog.svelte'; + import NameModal from '../components/NameModal.svelte'; export let params = {}; let gameId = params.id; @@ -210,6 +211,7 @@
+ {:else if !error}

Loading game state...