mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
Merge upstream/Dev: fortune wheel settings popup + radio toggle
Adopt upstream wheel redo (Settings popup gated by acc_wheeladmin, RareValues becomes view-only) and the radio enable/disable config gate. Drop the broken orphaned duplicates under user-settings/fortune-wheel and user-settings/rare-values (wrong relative import depth, unused, failed typecheck). Soundboard / radio / background editor untouched.
This commit is contained in:
@@ -1,36 +1,35 @@
|
||||
import { AvailableCommandsEvent, GetCommunication } from '@nitrots/nitro-renderer';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { CommandDefinition } from '../../../api';
|
||||
import { CommandDefinition, LocalizeText } from '../../../api';
|
||||
import { createNitroStore } from '../../../state/createNitroStore';
|
||||
import { useMessageEvent } from '../../events';
|
||||
|
||||
// Client-only commands are static; safe to keep at module scope.
|
||||
const CLIENT_COMMANDS: CommandDefinition[] = [
|
||||
// Effetti stanza
|
||||
{ key: 'shake', description: 'Scuoti la stanza' },
|
||||
{ key: 'rotate', description: 'Ruota la stanza' },
|
||||
{ key: 'zoom', description: 'Zoom stanza' },
|
||||
{ key: 'flip', description: 'Reset zoom' },
|
||||
{ key: 'iddqd', description: 'Reset zoom' },
|
||||
{ key: 'screenshot', description: 'Screenshot stanza' },
|
||||
{ key: 'togglefps', description: 'Toggle FPS' },
|
||||
// Espressioni
|
||||
{ key: 'd', description: 'Ridi (VIP)' },
|
||||
{ key: 'kiss', description: 'Manda un bacio (VIP)' },
|
||||
{ key: 'jump', description: 'Salta (VIP)' },
|
||||
{ key: 'idle', description: 'Vai in idle' },
|
||||
{ key: 'sign', description: 'Mostra cartello' },
|
||||
// Gestione stanza
|
||||
{ key: 'furni', description: 'Furni chooser' },
|
||||
{ key: 'chooser', description: 'User chooser' },
|
||||
{ key: 'floor', description: 'Floor editor' },
|
||||
{ key: 'bcfloor', description: 'Floor editor' },
|
||||
{ key: 'pickall', description: 'Raccogli tutti i furni' },
|
||||
{ key: 'ejectall', description: 'Espelli tutti i furni' },
|
||||
{ key: 'settings', description: 'Impostazioni stanza' },
|
||||
const CLIENT_COMMANDS: { key: string; descriptionKey: string }[] = [
|
||||
// Room effects
|
||||
{ key: 'shake', descriptionKey: 'chatcmd.client.shake' },
|
||||
{ key: 'rotate', descriptionKey: 'chatcmd.client.rotate' },
|
||||
{ key: 'zoom', descriptionKey: 'chatcmd.client.zoom' },
|
||||
{ key: 'flip', descriptionKey: 'chatcmd.client.flip' },
|
||||
{ key: 'iddqd', descriptionKey: 'chatcmd.client.iddqd' },
|
||||
{ key: 'screenshot', descriptionKey: 'chatcmd.client.screenshot' },
|
||||
{ key: 'togglefps', descriptionKey: 'chatcmd.client.togglefps' },
|
||||
// Expressions
|
||||
{ key: 'd', descriptionKey: 'chatcmd.client.laugh' },
|
||||
{ key: 'kiss', descriptionKey: 'chatcmd.client.kiss' },
|
||||
{ key: 'jump', descriptionKey: 'chatcmd.client.jump' },
|
||||
{ key: 'idle', descriptionKey: 'chatcmd.client.idle' },
|
||||
{ key: 'sign', descriptionKey: 'chatcmd.client.sign' },
|
||||
// Room management
|
||||
{ key: 'furni', descriptionKey: 'chatcmd.client.furni' },
|
||||
{ key: 'chooser', descriptionKey: 'chatcmd.client.chooser' },
|
||||
{ key: 'floor', descriptionKey: 'chatcmd.client.floor' },
|
||||
{ key: 'bcfloor', descriptionKey: 'chatcmd.client.floor' },
|
||||
{ key: 'pickall', descriptionKey: 'chatcmd.client.pickall' },
|
||||
{ key: 'ejectall', descriptionKey: 'chatcmd.client.ejectall' },
|
||||
{ key: 'settings', descriptionKey: 'chatcmd.client.settings' },
|
||||
// Info
|
||||
{ key: 'client', description: 'Info client' },
|
||||
{ key: 'nitro', description: 'Info client' },
|
||||
{ key: 'client', descriptionKey: 'chatcmd.client.info' },
|
||||
{ key: 'nitro', descriptionKey: 'chatcmd.client.info' },
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -110,11 +109,12 @@ export const useChatCommandSelector = (chatValue: string) =>
|
||||
|
||||
const allCommands = useMemo(() =>
|
||||
{
|
||||
const merged = [ ...serverCommands ];
|
||||
const merged: CommandDefinition[] = [ ...serverCommands ];
|
||||
|
||||
for(const clientCmd of CLIENT_COMMANDS)
|
||||
{
|
||||
if(!merged.some(cmd => cmd.key === clientCmd.key)) merged.push(clientCmd);
|
||||
if(merged.some(cmd => cmd.key === clientCmd.key)) continue;
|
||||
merged.push({ key: clientCmd.key, description: LocalizeText(clientCmd.descriptionKey) });
|
||||
}
|
||||
|
||||
return merged.sort((a, b) => a.key.localeCompare(b.key));
|
||||
|
||||
Reference in New Issue
Block a user