mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-31 10:22:36 +01:00
Update triggers
This commit is contained in:
parent
49131d0137
commit
7e54c5a219
@ -47,4 +47,6 @@ export function GetWiredTriggerLayout(code: number): JSX.Element
|
|||||||
case WiredTriggerLayout.TOGGLE_FURNI:
|
case WiredTriggerLayout.TOGGLE_FURNI:
|
||||||
return <WiredTriggerToggleFurniView />;
|
return <WiredTriggerToggleFurniView />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -18,27 +18,31 @@ export const WiredTriggerAvatarEnterRoomView: FC<{}> = props =>
|
|||||||
|
|
||||||
const save = useCallback(() =>
|
const save = useCallback(() =>
|
||||||
{
|
{
|
||||||
if(avatarMode === 1)
|
if(avatarMode === 1) setStringParam(username);
|
||||||
setStringParam(username);
|
else setStringParam('');
|
||||||
else
|
|
||||||
setStringParam('');
|
|
||||||
}, [ username, avatarMode, setStringParam ]);
|
}, [ username, avatarMode, setStringParam ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
||||||
|
<div className="form-group">
|
||||||
|
<label className="fw-bold">{ LocalizeText('wiredfurni.params.picktriggerer') }</label>
|
||||||
<div className="form-check">
|
<div className="form-check">
|
||||||
<input className="form-check-input" type="radio" name="avatarMode" id="avatarMode0" checked={ avatarMode === 0 } onChange={() => setAvatarMode(0)} />
|
<input className="form-check-input" type="radio" name="avatarMode" id="avatarMode0" checked={ (avatarMode === 0) } onChange={ event => setAvatarMode(0) } />
|
||||||
<label className="form-check-label" htmlFor="avatarMode0">
|
<label className="form-check-label" htmlFor="avatarMode0">
|
||||||
{ LocalizeText('wiredfurni.params.anyavatar') }
|
{ LocalizeText('wiredfurni.params.anyavatar') }
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="form-check">
|
<div className="form-check">
|
||||||
<input className="form-check-input" type="radio" name="avatarMode" id="avatarMode1" checked={ avatarMode === 1 } onChange={() => setAvatarMode(1)} />
|
<input className="form-check-input" type="radio" name="avatarMode" id="avatarMode1" checked={ (avatarMode === 1) } onChange={ event => setAvatarMode(1) } />
|
||||||
<label className="form-check-label" htmlFor="avatarMode1">
|
<label className="form-check-label" htmlFor="avatarMode1">
|
||||||
{ LocalizeText('wiredfurni.params.certainavatar') }
|
{ LocalizeText('wiredfurni.params.certainavatar') }
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{ avatarMode === 1 && <input type="text" className="form-control form-control-sm" value={ username } onChange={ event => setUsername(event.target.value) } /> }
|
</div>
|
||||||
|
{ (avatarMode === 1) &&
|
||||||
|
<div className="form-group">
|
||||||
|
<input type="text" className="form-control form-control-sm" value={ username } onChange={ event => setUsername(event.target.value) } />
|
||||||
|
</div> }
|
||||||
</WiredTriggerBaseView>
|
</WiredTriggerBaseView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -25,12 +25,12 @@ export const WiredTriggerAvatarSaysSomethingView: FC<{}> = props =>
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
||||||
<div className="form-group">
|
<div className="form-group mb-2">
|
||||||
<label className="fw-bold">{ LocalizeText('wiredfurni.params.whatissaid') }</label>
|
<label className="fw-bold">{ LocalizeText('wiredfurni.params.whatissaid') }</label>
|
||||||
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } />
|
||||||
</div>
|
</div>
|
||||||
<hr className="my-1 mb-2 bg-dark" />
|
<div className="form-group">
|
||||||
<div className="fw-bold">{ LocalizeText('wiredfurni.params.picktriggerer') }</div>
|
<label className="fw-bold">{ LocalizeText('wiredfurni.params.picktriggerer') }</label>
|
||||||
<div className="form-check">
|
<div className="form-check">
|
||||||
<input className="form-check-input" type="radio" name="triggererAvatar" id="triggererAvatar0" checked={ triggererAvatar === 0 } onChange={() => setTriggererAvatar(0)} />
|
<input className="form-check-input" type="radio" name="triggererAvatar" id="triggererAvatar0" checked={ triggererAvatar === 0 } onChange={() => setTriggererAvatar(0)} />
|
||||||
<label className="form-check-label" htmlFor="triggererAvatar0">
|
<label className="form-check-label" htmlFor="triggererAvatar0">
|
||||||
@ -43,6 +43,7 @@ export const WiredTriggerAvatarSaysSomethingView: FC<{}> = props =>
|
|||||||
{ GetSessionDataManager().userName }
|
{ GetSessionDataManager().userName }
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</WiredTriggerBaseView>
|
</WiredTriggerBaseView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,5 @@ import { WiredTriggerBaseView } from '../base/WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerAvatarWalksOffFurniView: FC<{}> = props =>
|
export const WiredTriggerAvatarWalksOffFurniView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return (
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ null } />;
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ null }></WiredTriggerBaseView>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,5 @@ import { WiredTriggerBaseView } from '../base/WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerAvatarWalksOnFurniView: FC<{}> = props =>
|
export const WiredTriggerAvatarWalksOnFurniView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return (
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ null } />;
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ null }></WiredTriggerBaseView>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,5 @@ import { WiredTriggerBaseView } from '../base/WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerCollisionView: FC<{}> = props =>
|
export const WiredTriggerCollisionView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return (
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null }></WiredTriggerBaseView>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Slider from 'rc-slider/lib/Slider';
|
import Slider from 'rc-slider/lib/Slider';
|
||||||
import { FC, useCallback, useEffect, useState } from 'react';
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { GetWiredTimeLocale } from '../../../common/GetWiredTimeLocale';
|
||||||
import { useWiredContext } from '../../../context/WiredContext';
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
import { WiredFurniType } from '../../../WiredView.types';
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
import { WiredTriggerBaseView } from '../base/WiredTriggerBaseView';
|
import { WiredTriggerBaseView } from '../base/WiredTriggerBaseView';
|
||||||
@ -22,14 +23,12 @@ export const WiredTriggeExecuteOnceView: FC<{}> = props =>
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
||||||
<div className="fw-bold">{ LocalizeText('wiredfurni.params.settime', [ 'seconds' ], [ time.toString() ]) }</div>
|
<div className="fw-bold">{ LocalizeText('wiredfurni.params.settime', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</div>
|
||||||
<Slider
|
<Slider
|
||||||
defaultValue={ time }
|
value={ time }
|
||||||
dots={ true }
|
|
||||||
min={ 1 }
|
min={ 1 }
|
||||||
max={ 60 }
|
max={ 1200 }
|
||||||
onChange={ event => setTime(event) }
|
onChange={ event => setTime(event) } />
|
||||||
/>
|
|
||||||
</WiredTriggerBaseView>
|
</WiredTriggerBaseView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { FriendlyTime } from 'nitro-renderer';
|
||||||
import Slider from 'rc-slider/lib/Slider';
|
import Slider from 'rc-slider/lib/Slider';
|
||||||
import { FC, useCallback, useEffect, useState } from 'react';
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
@ -22,14 +23,12 @@ export const WiredTriggeExecutePeriodicallyLongView: FC<{}> = props =>
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
||||||
<div className="fw-bold">{ LocalizeText('wiredfurni.params.setlongtime', [ 'time' ], [ time.toString() ]) }</div>
|
<div className="fw-bold">{ LocalizeText('wiredfurni.params.setlongtime', [ 'time' ], [ FriendlyTime.format(time * 5).toString() ]) }</div>
|
||||||
<Slider
|
<Slider
|
||||||
defaultValue={ time }
|
value={ time }
|
||||||
dots={ true }
|
|
||||||
min={ 1 }
|
min={ 1 }
|
||||||
max={ 600 }
|
max={ 120 }
|
||||||
onChange={ event => setTime(event) }
|
onChange={ event => setTime(event) } />
|
||||||
/>
|
|
||||||
</WiredTriggerBaseView>
|
</WiredTriggerBaseView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Slider from 'rc-slider/lib/Slider';
|
import Slider from 'rc-slider/lib/Slider';
|
||||||
import { FC, useCallback, useEffect, useState } from 'react';
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { GetWiredTimeLocale } from '../../../common/GetWiredTimeLocale';
|
||||||
import { useWiredContext } from '../../../context/WiredContext';
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
import { WiredFurniType } from '../../../WiredView.types';
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
import { WiredTriggerBaseView } from '../base/WiredTriggerBaseView';
|
import { WiredTriggerBaseView } from '../base/WiredTriggerBaseView';
|
||||||
@ -22,14 +23,12 @@ export const WiredTriggeExecutePeriodicallyView: FC<{}> = props =>
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
||||||
<div className="fw-bold">{ LocalizeText('wiredfurni.params.settime', [ 'seconds' ], [ time.toString() ]) }</div>
|
<div className="fw-bold">{ LocalizeText('wiredfurni.params.settime', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</div>
|
||||||
<Slider
|
<Slider
|
||||||
defaultValue={ time }
|
value={ time }
|
||||||
dots={ true }
|
|
||||||
min={ 1 }
|
min={ 1 }
|
||||||
max={ 60 }
|
max={ 60 }
|
||||||
onChange={ event => setTime(event) }
|
onChange={ event => setTime(event) }/>
|
||||||
/>
|
|
||||||
</WiredTriggerBaseView>
|
</WiredTriggerBaseView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,5 @@ import { WiredTriggerBaseView } from '../base/WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerGameEndsView: FC<{}> = props =>
|
export const WiredTriggerGameEndsView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return (
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null }></WiredTriggerBaseView>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,5 @@ import { WiredTriggerBaseView } from '../base/WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerGameStartsView: FC<{}> = props =>
|
export const WiredTriggerGameStartsView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return (
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null }></WiredTriggerBaseView>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -24,13 +24,11 @@ export const WiredTriggeScoreAchievedView: FC<{}> = props =>
|
|||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
||||||
<div className="fw-bold">{ LocalizeText('wiredfurni.params.setscore', [ 'points' ], [ points.toString() ]) }</div>
|
<div className="fw-bold">{ LocalizeText('wiredfurni.params.setscore', [ 'points' ], [ points.toString() ]) }</div>
|
||||||
<Slider
|
<Slider
|
||||||
defaultValue={ points }
|
value={ points }
|
||||||
dots={ true }
|
|
||||||
min={ 1 }
|
min={ 1 }
|
||||||
max={ 1000 }
|
max={ 1000 }
|
||||||
step={ 1 }
|
step={ 1 }
|
||||||
onChange={ event => setPoints(event) }
|
onChange={ event => setPoints(event) } />
|
||||||
/>
|
|
||||||
</WiredTriggerBaseView>
|
</WiredTriggerBaseView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,5 @@ import { WiredTriggerBaseView } from '../base/WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerToggleFurniView: FC<{}> = props =>
|
export const WiredTriggerToggleFurniView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return (
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ null } />;
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ null }></WiredTriggerBaseView>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user