Update mannequin widget

This commit is contained in:
Bill 2021-10-07 01:43:17 -04:00
parent 5b8b576950
commit d932c410de

View File

@ -15,12 +15,9 @@ const MODE_PEER: number = 2;
const MODE_NO_CLUB: number = 3; const MODE_NO_CLUB: number = 3;
const MODE_WRONG_GENDER: number = 4; const MODE_WRONG_GENDER: number = 4;
const ACTION_CLOSE: number = 0;
const ACTION_SET_NAME: number = 1; const ACTION_SET_NAME: number = 1;
const ACTION_LOAD_FIGURE: number = 2; const ACTION_WEAR: number = 2;
const ACTION_WEAR: number = 3; const ACTION_SAVE: number = 3;
const ACTION_SAVE: number = 4;
const ACTION_BACK: number = 5;
const MANNEQUIN_FIGURE = ['hd', 99999, [ 99998 ]]; const MANNEQUIN_FIGURE = ['hd', 99999, [ 99998 ]];
const MANNEQUIN_CLOTHING_PART_TYPES = [ const MANNEQUIN_CLOTHING_PART_TYPES = [
@ -173,16 +170,15 @@ export const FurnitureMannequinView: FC<{}> = props =>
<NitroCardHeaderView headerText={ LocalizeText('mannequin.widget.title') } onCloseClick={ event => setMode(MODE_NONE) } /> <NitroCardHeaderView headerText={ LocalizeText('mannequin.widget.title') } onCloseClick={ event => setMode(MODE_NONE) } />
<NitroCardContentView> <NitroCardContentView>
<NitroLayoutGrid> <NitroLayoutGrid>
<NitroLayoutGridColumn className="justify-content-center align-items-center" size={ 4 }> <NitroLayoutGridColumn className="justify-content-center align-items-center" overflow="hidden" size={ 4 }>
<FurnitureMannequinPreviewView figure={ renderedFigure } clubLevel={ renderedClubLevel } /> <FurnitureMannequinPreviewView figure={ renderedFigure } clubLevel={ renderedClubLevel } />
</NitroLayoutGridColumn> </NitroLayoutGridColumn>
<NitroLayoutGridColumn size={ 8 }> <NitroLayoutGridColumn className="justify-content-between" overflow="hidden" size={ 8 }>
{ (mode === MODE_CONTROLLER) && { (mode === MODE_CONTROLLER) &&
<NitroLayoutFlexColumn className="justify-content-between h-100"> <>
<NitroLayoutFlex className="justify-content-between align-items-center"> <NitroLayoutFlexColumn gap={ 1 } overflow="auto">
{/* <i className="small fas fa-pencil-alt me-2 text-black" /> */}
<input type="text" className="form-control" value={ name } onChange={ event => setName(event.target.value) } onKeyDown={ event => handleKeyDown(event) } /> <input type="text" className="form-control" value={ name } onChange={ event => setName(event.target.value) } onKeyDown={ event => handleKeyDown(event) } />
</NitroLayoutFlex> </NitroLayoutFlexColumn>
<NitroLayoutFlexColumn gap={ 1 }> <NitroLayoutFlexColumn gap={ 1 }>
<NitroLayoutButton variant="success" onClick={ event => setMode(MODE_UPDATE) }> <NitroLayoutButton variant="success" onClick={ event => setMode(MODE_UPDATE) }>
{ LocalizeText('mannequin.widget.style') } { LocalizeText('mannequin.widget.style') }
@ -191,10 +187,10 @@ export const FurnitureMannequinView: FC<{}> = props =>
{ LocalizeText('mannequin.widget.wear') } { LocalizeText('mannequin.widget.wear') }
</NitroLayoutButton> </NitroLayoutButton>
</NitroLayoutFlexColumn> </NitroLayoutFlexColumn>
</NitroLayoutFlexColumn> } </> }
{ (mode === MODE_UPDATE) && { (mode === MODE_UPDATE) &&
<NitroLayoutFlexColumn className="justify-content-between h-100"> <>
<NitroLayoutFlexColumn gap={ 1 }> <NitroLayoutFlexColumn gap={ 1 } overflow="auto">
<NitroLayoutBase className="text-black fw-bold"> <NitroLayoutBase className="text-black fw-bold">
{ name } { name }
</NitroLayoutBase> </NitroLayoutBase>
@ -210,10 +206,10 @@ export const FurnitureMannequinView: FC<{}> = props =>
{ LocalizeText('mannequin.widget.save') } { LocalizeText('mannequin.widget.save') }
</NitroLayoutButton> </NitroLayoutButton>
</NitroLayoutFlex> </NitroLayoutFlex>
</NitroLayoutFlexColumn> } </> }
{ (mode === MODE_PEER) && { (mode === MODE_PEER) &&
<NitroLayoutFlexColumn className="justify-content-between h-100"> <>
<NitroLayoutFlexColumn gap={ 1 }> <NitroLayoutFlexColumn gap={ 1 } overflow="auto">
<NitroLayoutBase className="text-black fw-bold"> <NitroLayoutBase className="text-black fw-bold">
{ name } { name }
</NitroLayoutBase> </NitroLayoutBase>
@ -224,7 +220,7 @@ export const FurnitureMannequinView: FC<{}> = props =>
<NitroLayoutButton variant="success" onClick={ event => processAction(ACTION_WEAR) }> <NitroLayoutButton variant="success" onClick={ event => processAction(ACTION_WEAR) }>
{ LocalizeText('mannequin.widget.wear') } { LocalizeText('mannequin.widget.wear') }
</NitroLayoutButton> </NitroLayoutButton>
</NitroLayoutFlexColumn> } </> }
{ (mode === MODE_NO_CLUB) && { (mode === MODE_NO_CLUB) &&
<NitroLayoutBase className="text-black"> <NitroLayoutBase className="text-black">
{ LocalizeText('mannequin.widget.clubnotification') } { LocalizeText('mannequin.widget.clubnotification') }