Reaktivierung haengt nur noch am Redesign, nicht am Grund
Ein CC, der nicht redesignt wurde, existiert unveraendert weiter und kommt
deshalb immer gratis zurueck - egal ob der Spieler inaktiv war oder die
Einheit voruebergehend aus dem Spiel genommen wurde. Bisher kostete der Fall
OTHER ein Guthaben, was die Regel unnoetig verkompliziert hat.
Damit der zweite Fall brauchbar wird, haelt inactiveNote den Grund im Klartext
fest ("Einheit bis Maerz entfernt"); die Notiz steht an der CC-Karte und wird
beim Reaktivieren wieder geleert.
This commit is contained in:
@@ -18,7 +18,7 @@ export const SOURCE_LABEL: Record<CreditSource, string> = {
|
||||
export const REASON_LABEL: Record<InactiveReason, string> = {
|
||||
PLAYER_INACTIVITY: 'Spieler-Inaktivitaet',
|
||||
REWORKED: 'Redesignt',
|
||||
OTHER: 'Sonstiger Grund',
|
||||
OTHER: 'Anderer Grund',
|
||||
};
|
||||
|
||||
export const PLAN_LABEL: Record<ImportPlan, string> = {
|
||||
|
||||
@@ -57,6 +57,7 @@ export interface Character {
|
||||
loreText: string | null;
|
||||
status: CharacterStatus;
|
||||
inactiveReason: InactiveReason | null;
|
||||
inactiveNote: string | null;
|
||||
lineageId: string;
|
||||
predecessorId: number | null;
|
||||
predecessor: CharacterRef | null;
|
||||
|
||||
@@ -197,7 +197,8 @@ export default function PlayerDetail() {
|
||||
) : (
|
||||
<ul className="cc-list">
|
||||
{inactive.map((character) => {
|
||||
const free = character.inactiveReason === 'PLAYER_INACTIVITY';
|
||||
// Nur ein redesignter CC existiert im Original nicht mehr.
|
||||
const free = character.inactiveReason !== 'REWORKED';
|
||||
return (
|
||||
<li key={character.id} className="cc-item is-inactive">
|
||||
<div>
|
||||
@@ -213,6 +214,9 @@ export default function PlayerDetail() {
|
||||
· Ersetzt durch {character.successors.map((s) => s.name).join(', ')}
|
||||
</span>
|
||||
)}
|
||||
{character.inactiveNote && (
|
||||
<p className="lore">{character.inactiveNote}</p>
|
||||
)}
|
||||
<p className="muted small">
|
||||
{free
|
||||
? 'Kommt gratis zurueck — kostet kein Guthaben.'
|
||||
@@ -367,12 +371,12 @@ export default function PlayerDetail() {
|
||||
character={dialog.character}
|
||||
busy={busy}
|
||||
onClose={() => setDialog({ type: 'none' })}
|
||||
onSubmit={(reason) =>
|
||||
onSubmit={(reason, note) =>
|
||||
void run(
|
||||
() =>
|
||||
api(`/api/characters/${dialog.character.id}/deactivate`, {
|
||||
method: 'POST',
|
||||
body: { reason },
|
||||
body: { reason, ...(note.trim() ? { note: note.trim() } : {}) },
|
||||
}),
|
||||
`"${dialog.character.name}" ist jetzt inaktiv.`,
|
||||
)
|
||||
@@ -383,7 +387,7 @@ export default function PlayerDetail() {
|
||||
{dialog.type === 'reactivatePaid' && (
|
||||
<KindChoiceModal
|
||||
title={`"${dialog.character.name}" reaktivieren`}
|
||||
hint="Dieser CC existiert im Original nicht mehr. Die Reaktivierung kostet ein Guthaben."
|
||||
hint="Dieser CC wurde redesignt und existiert im Original nicht mehr. Die Reaktivierung kostet ein Guthaben."
|
||||
kinds={['REDESIGN_KULANZ', 'REDESIGN_PAID', 'CC']}
|
||||
balances={detail.balances}
|
||||
busy={busy}
|
||||
@@ -617,20 +621,22 @@ function DeactivateModal({
|
||||
character: Character;
|
||||
busy: boolean;
|
||||
onClose: () => void;
|
||||
onSubmit: (reason: 'PLAYER_INACTIVITY' | 'OTHER') => void;
|
||||
onSubmit: (reason: 'PLAYER_INACTIVITY' | 'OTHER', note: string) => void;
|
||||
}) {
|
||||
const [reason, setReason] = useState<'PLAYER_INACTIVITY' | 'OTHER'>('PLAYER_INACTIVITY');
|
||||
const [note, setNote] = useState('');
|
||||
|
||||
return (
|
||||
<Modal title={`"${character.name}" deaktivieren`} onClose={onClose}>
|
||||
<form
|
||||
onSubmit={(event) => {
|
||||
event.preventDefault();
|
||||
onSubmit(reason);
|
||||
onSubmit(reason, note);
|
||||
}}
|
||||
>
|
||||
<Notice kind="info">
|
||||
Der Grund entscheidet, ob die spaetere Reaktivierung kostenlos ist.
|
||||
Der CC bleibt unveraendert und kommt spaeter in beiden Faellen gratis zurueck. Nur ein
|
||||
Redesign macht ihn kostenpflichtig — das laeuft aber ueber die Redesign-Aktion.
|
||||
</Notice>
|
||||
|
||||
<div className="radio-group">
|
||||
@@ -643,7 +649,7 @@ function DeactivateModal({
|
||||
/>
|
||||
<span>
|
||||
<strong>Spieler-Inaktivitaet</strong>
|
||||
<span className="muted"> — vom Server geputzt, kommt gratis zurueck</span>
|
||||
<span className="muted"> — vom Server geputzt, weil der Spieler laenger weg war</span>
|
||||
</span>
|
||||
</label>
|
||||
<label className="radio">
|
||||
@@ -654,12 +660,22 @@ function DeactivateModal({
|
||||
onChange={() => setReason('OTHER')}
|
||||
/>
|
||||
<span>
|
||||
<strong>Sonstiger Grund</strong>
|
||||
<span className="muted"> — Reaktivierung kostet ein Guthaben</span>
|
||||
<strong>Anderer Grund</strong>
|
||||
<span className="muted"> — etwa eine voruebergehend entfernte Einheit</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label htmlFor="deactivate-note">
|
||||
Notiz {reason === 'OTHER' ? '(empfohlen)' : '(optional)'}
|
||||
</label>
|
||||
<input
|
||||
id="deactivate-note"
|
||||
value={note}
|
||||
onChange={(event) => setNote(event.target.value)}
|
||||
placeholder="z. B. Einheit bis Maerz entfernt"
|
||||
/>
|
||||
|
||||
<div className="form-actions">
|
||||
<button type="button" className="btn btn-ghost" onClick={onClose}>
|
||||
Abbrechen
|
||||
|
||||
Reference in New Issue
Block a user