- { canModify &&
+ { canModify &&
<>
- { STICKIE_COLORS.map(color =>
- {
- return
updateColor(color) } style={ { backgroundColor: ColorUtils.makeColorHex(color) } } />
- }) }
+ { type == 'post_it' &&
+ <>
+ { STICKIE_COLORS.map(color =>
+ {
+ return
updateColor(color) } style={ { backgroundColor: ColorUtils.makeColorHex(color) } } />
+ }) }
+ > }
> }
diff --git a/src/components/room/widgets/furniture/FurnitureWidgets.scss b/src/components/room/widgets/furniture/FurnitureWidgets.scss
index a129da04..e7d8bdf2 100644
--- a/src/components/room/widgets/furniture/FurnitureWidgets.scss
+++ b/src/components/room/widgets/furniture/FurnitureWidgets.scss
@@ -161,6 +161,26 @@
background-position: -2px -184px;
}
+ &.stickie-christmas {
+ background-image: url("../../../../assets/images/room-widgets/stickie-widget/stickie-christmas.png");
+ }
+
+ &.stickie-shakesp {
+ background-image: url("../../../../assets/images/room-widgets/stickie-widget/stickie-shakesp.png");
+ }
+
+ &.stickie-dreams {
+ background-image: url("../../../../assets/images/room-widgets/stickie-widget/stickie-dreams.png");
+ }
+
+ &.stickie-heart {
+ background-image: url("../../../../assets/images/room-widgets/stickie-widget/stickie-heart.png");
+ }
+
+ &.stickie-juninas {
+ background-image: url("../../../../assets/images/room-widgets/stickie-widget/stickie-juninas.png");
+ }
+
&.stickie-close {
width: 10px;
height: 10px;
@@ -202,7 +222,7 @@
font-weight: bold;
font-size: 16px;
text-shadow: 0px 1px white;
-
+
&.engraving-lock-3 {
background-position: 0px -210px;
color: #614110;
@@ -262,7 +282,7 @@
.youtube-video-container {
//min-height: 366px;
-
+
.empty-video {
background-color: black;
color: white;
diff --git a/src/components/wired/views/WiredBaseView.tsx b/src/components/wired/views/WiredBaseView.tsx
index 6227c669..1128f19e 100644
--- a/src/components/wired/views/WiredBaseView.tsx
+++ b/src/components/wired/views/WiredBaseView.tsx
@@ -19,7 +19,7 @@ export const WiredBaseView: FC
> = props =>
const [ wiredName, setWiredName ] = useState(null);
const [ wiredDescription, setWiredDescription ] = useState(null);
const [ needsSave, setNeedsSave ] = useState(false);
- const { trigger = null, setTrigger = null, setIntParams = null, setStringParam = null, setFurniIds = null, saveWired = null } = useWired();
+ const { trigger = null, setTrigger = null, setIntParams = null, setStringParam = null, setFurniIds = null, setAllowsFurni = null, saveWired = null } = useWired();
const onClose = () => setTrigger(null);
@@ -83,6 +83,11 @@ export const WiredBaseView: FC> = props =>
}
}, [ trigger, hasSpecialInput, requiresFurni, setIntParams, setStringParam, setFurniIds ]);
+ useEffect(() =>
+ {
+ setAllowsFurni(requiresFurni);
+ }, [ requiresFurni, setAllowsFurni ]);
+
return (
diff --git a/src/components/wired/views/actions/WiredActionBotTalkToAvatarView.tsx b/src/components/wired/views/actions/WiredActionBotTalkToAvatarView.tsx
index f2866e05..ebebe2d1 100644
--- a/src/components/wired/views/actions/WiredActionBotTalkToAvatarView.tsx
+++ b/src/components/wired/views/actions/WiredActionBotTalkToAvatarView.tsx
@@ -1,5 +1,5 @@
import { FC, useEffect, useState } from 'react';
-import { LocalizeText, WiredFurniType, WIRED_STRING_DELIMETER } from '../../../../api';
+import { GetConfiguration, LocalizeText, WiredFurniType, WIRED_STRING_DELIMETER } from '../../../../api';
import { Column, Flex, Text } from '../../../../common';
import { useWired } from '../../../../hooks';
import { WiredActionBaseView } from './WiredActionBaseView';
@@ -35,7 +35,7 @@ export const WiredActionBotTalkToAvatarView: FC<{}> = props =>
{ LocalizeText('wiredfurni.params.message') }
- setMessage(event.target.value) } />
+ ('wired.action.bot.talk.to.avatar.max.length', 64) } value={ message } onChange={ event => setMessage(event.target.value) } />
diff --git a/src/components/wired/views/actions/WiredActionBotTalkView.tsx b/src/components/wired/views/actions/WiredActionBotTalkView.tsx
index b457c431..cd2d28ec 100644
--- a/src/components/wired/views/actions/WiredActionBotTalkView.tsx
+++ b/src/components/wired/views/actions/WiredActionBotTalkView.tsx
@@ -1,5 +1,5 @@
import { FC, useEffect, useState } from 'react';
-import { LocalizeText, WiredFurniType, WIRED_STRING_DELIMETER } from '../../../../api';
+import { GetConfiguration, LocalizeText, WiredFurniType, WIRED_STRING_DELIMETER } from '../../../../api';
import { Column, Flex, Text } from '../../../../common';
import { useWired } from '../../../../hooks';
import { WiredActionBaseView } from './WiredActionBaseView';
@@ -35,7 +35,7 @@ export const WiredActionBotTalkView: FC<{}> = props =>
{ LocalizeText('wiredfurni.params.message') }
- setMessage(event.target.value) } />
+ ('wired.action.bot.talk.max.length', 64) } value={ message } onChange={ event => setMessage(event.target.value) } />
diff --git a/src/components/wired/views/actions/WiredActionChatView.tsx b/src/components/wired/views/actions/WiredActionChatView.tsx
index b570af7f..ed256dc5 100644
--- a/src/components/wired/views/actions/WiredActionChatView.tsx
+++ b/src/components/wired/views/actions/WiredActionChatView.tsx
@@ -1,5 +1,5 @@
import { FC, useEffect, useState } from 'react';
-import { LocalizeText, WiredFurniType } from '../../../../api';
+import { GetConfiguration, LocalizeText, WiredFurniType } from '../../../../api';
import { Column, Text } from '../../../../common';
import { useWired } from '../../../../hooks';
import { WiredActionBaseView } from './WiredActionBaseView';
@@ -20,7 +20,7 @@ export const WiredActionChatView: FC<{}> = props =>
{ LocalizeText('wiredfurni.params.message') }
- setMessage(event.target.value) } maxLength={ 100 } />
+ setMessage(event.target.value) } maxLength={ GetConfiguration('wired.action.chat.max.length', 100) } />
);
diff --git a/src/components/wired/views/actions/WiredActionKickFromRoomView.tsx b/src/components/wired/views/actions/WiredActionKickFromRoomView.tsx
index e16b6684..c9bd10c8 100644
--- a/src/components/wired/views/actions/WiredActionKickFromRoomView.tsx
+++ b/src/components/wired/views/actions/WiredActionKickFromRoomView.tsx
@@ -1,5 +1,5 @@
import { FC, useEffect, useState } from 'react';
-import { LocalizeText, WiredFurniType } from '../../../../api';
+import { GetConfiguration, LocalizeText, WiredFurniType } from '../../../../api';
import { Column, Text } from '../../../../common';
import { useWired } from '../../../../hooks';
import { WiredActionBaseView } from './WiredActionBaseView';
@@ -20,7 +20,7 @@ export const WiredActionKickFromRoomView: FC<{}> = props =>
{ LocalizeText('wiredfurni.params.message') }
- setMessage(event.target.value) } maxLength={ 100 } />
+ setMessage(event.target.value) } maxLength={ GetConfiguration('wired.action.kick.from.room.max.length', 100) } />
);
diff --git a/src/components/wired/views/actions/WiredActionMuteUserView.tsx b/src/components/wired/views/actions/WiredActionMuteUserView.tsx
index e34bd60a..1665036b 100644
--- a/src/components/wired/views/actions/WiredActionMuteUserView.tsx
+++ b/src/components/wired/views/actions/WiredActionMuteUserView.tsx
@@ -1,6 +1,6 @@
import { FC, useEffect, useState } from 'react';
import ReactSlider from 'react-slider';
-import { LocalizeText, WiredFurniType } from '../../../../api';
+import { GetConfiguration, LocalizeText, WiredFurniType } from '../../../../api';
import { Column, Text } from '../../../../common';
import { useWired } from '../../../../hooks';
import { WiredActionBaseView } from './WiredActionBaseView';
@@ -36,7 +36,7 @@ export const WiredActionMuteUserView: FC<{}> = props =>
{ LocalizeText('wiredfurni.params.message') }
- setMessage(event.target.value) } maxLength={ 100 } />
+ setMessage(event.target.value) } maxLength={ GetConfiguration('wired.action.mute.user.max.length', 100) } />
);
diff --git a/src/hooks/catalog/useCatalog.ts b/src/hooks/catalog/useCatalog.ts
index 25d0d26d..1cb43237 100644
--- a/src/hooks/catalog/useCatalog.ts
+++ b/src/hooks/catalog/useCatalog.ts
@@ -874,6 +874,13 @@ const useCatalogState = () =>
{
if(!searchResult && currentPage && (currentPage.pageId === -1)) openPageById(previousPageId);
}, [ searchResult, currentPage, previousPageId, openPageById ]);
+
+ useEffect(() =>
+ {
+ if(!currentOffer) return;
+
+ setPurchaseOptions({ quantity: 1, extraData: null, extraParamRequired: false, previewStuffData: null });
+ }, [ currentOffer ]);
useEffect(() =>
{
diff --git a/src/hooks/rooms/widgets/furniture/useFurnitureStackHeightWidget.ts b/src/hooks/rooms/widgets/furniture/useFurnitureStackHeightWidget.ts
index 0ac47137..3f8c851d 100644
--- a/src/hooks/rooms/widgets/furniture/useFurnitureStackHeightWidget.ts
+++ b/src/hooks/rooms/widgets/furniture/useFurnitureStackHeightWidget.ts
@@ -24,7 +24,7 @@ const useFurnitureStackHeightWidgetState = () =>
const updateHeight = (height: number, server: boolean = false) =>
{
if(!height) height = 0;
-
+
height = Math.abs(height);
if(!server) ((height > MAX_HEIGHT) && (height = MAX_HEIGHT));
diff --git a/src/hooks/rooms/widgets/furniture/useFurnitureStickieWidget.ts b/src/hooks/rooms/widgets/furniture/useFurnitureStickieWidget.ts
index f1e89134..7cc15975 100644
--- a/src/hooks/rooms/widgets/furniture/useFurnitureStickieWidget.ts
+++ b/src/hooks/rooms/widgets/furniture/useFurnitureStickieWidget.ts
@@ -10,6 +10,7 @@ const useFurnitureStickieWidgetState = () =>
const [ category, setCategory ] = useState(-1);
const [ color, setColor ] = useState('0');
const [ text, setText ] = useState('');
+ const [ type, setType ] = useState('');
const [ canModify, setCanModify ] = useState(false);
const onClose = () =>
@@ -18,6 +19,7 @@ const useFurnitureStickieWidgetState = () =>
setCategory(-1);
setColor('0');
setText('');
+ setType('');
setCanModify(false);
}
@@ -44,7 +46,7 @@ const useFurnitureStickieWidgetState = () =>
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);
if(!roomObject) return;
-
+
const data = roomObject.model.getValue(RoomObjectVariable.FURNITURE_ITEMDATA);
if(data.length < 6) return;
@@ -66,6 +68,7 @@ const useFurnitureStickieWidgetState = () =>
setCategory(event.category);
setColor(color || '0');
setText(text || '');
+ setType(roomObject.type || 'post_it');
setCanModify(GetRoomSession().isRoomOwner || GetSessionDataManager().isModerator || IsOwnerOfFurniture(roomObject));
});
@@ -76,7 +79,7 @@ const useFurnitureStickieWidgetState = () =>
onClose();
});
- return { objectId, color, text, canModify, updateColor, updateText, trash, onClose };
+ return { objectId, color, text, type, canModify, updateColor, updateText, trash, onClose };
}
export const useFurnitureStickieWidget = useFurnitureStickieWidgetState;
diff --git a/src/hooks/session/useSessionInfo.ts b/src/hooks/session/useSessionInfo.ts
index faff5dca..911e4d0c 100644
--- a/src/hooks/session/useSessionInfo.ts
+++ b/src/hooks/session/useSessionInfo.ts
@@ -1,7 +1,7 @@
import { FigureUpdateEvent, RoomUnitChatStyleComposer, UserInfoDataParser, UserInfoEvent, UserSettingsEvent } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { useBetween } from 'use-between';
-import { SendMessageComposer } from '../../api';
+import { GetSessionDataManager, SendMessageComposer } from '../../api';
import { useMessageEvent } from '../events';
const useSessionInfoState = () =>
@@ -9,6 +9,8 @@ const useSessionInfoState = () =>
const [ userInfo, setUserInfo ] = useState(null);
const [ userFigure, setUserFigure ] = useState(null);
const [ chatStyleId, setChatStyleId ] = useState(0);
+ const [ userRespectRemaining, setUserRespectRemaining ] = useState(0);
+ const [ petRespectRemaining, setPetRespectRemaining ] = useState(0);
const updateChatStyleId = (styleId: number) =>
{
@@ -17,12 +19,28 @@ const useSessionInfoState = () =>
SendMessageComposer(new RoomUnitChatStyleComposer(styleId));
}
+ const respectUser = (userId: number) =>
+ {
+ GetSessionDataManager().giveRespect(userId);
+
+ setUserRespectRemaining(GetSessionDataManager().respectsLeft);
+ }
+
+ const respectPet = (petId: number) =>
+ {
+ GetSessionDataManager().givePetRespect(petId);
+
+ setPetRespectRemaining(GetSessionDataManager().respectsPetLeft);
+ }
+
useMessageEvent(UserInfoEvent, event =>
{
const parser = event.getParser();
setUserInfo(parser.userInfo);
setUserFigure(parser.userInfo.figure);
+ setUserRespectRemaining(parser.userInfo.respectsRemaining);
+ setPetRespectRemaining(parser.userInfo.respectsPetRemaining);
});
useMessageEvent(FigureUpdateEvent, event =>
@@ -39,7 +57,7 @@ const useSessionInfoState = () =>
setChatStyleId(parser.chatType);
});
- return { userInfo, userFigure, chatStyleId, updateChatStyleId };
+ return { userInfo, userFigure, chatStyleId, userRespectRemaining, petRespectRemaining, respectUser, respectPet, updateChatStyleId };
}
export const useSessionInfo = () => useBetween(useSessionInfoState);
diff --git a/src/hooks/wired/useWired.ts b/src/hooks/wired/useWired.ts
index 43f91f11..c4628f45 100644
--- a/src/hooks/wired/useWired.ts
+++ b/src/hooks/wired/useWired.ts
@@ -1,7 +1,7 @@
import { ConditionDefinition, Triggerable, TriggerDefinition, UpdateActionMessageComposer, UpdateConditionMessageComposer, UpdateTriggerMessageComposer, WiredActionDefinition, WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent, WiredSaveSuccessEvent } from '@nitrots/nitro-renderer';
import { useEffect, useState } from 'react';
import { useBetween } from 'use-between';
-import { IsOwnerOfFloorFurniture, LocalizeText, SendMessageComposer, WiredSelectionVisualizer } from '../../api';
+import { IsOwnerOfFloorFurniture, LocalizeText, SendMessageComposer, WiredFurniType, WiredSelectionVisualizer } from '../../api';
import { useMessageEvent } from '../events';
import { useNotification } from '../notification';
@@ -12,6 +12,7 @@ const useWiredState = () =>
const [ stringParam, setStringParam ] = useState('');
const [ furniIds, setFurniIds ] = useState([]);
const [ actionDelay, setActionDelay ] = useState(0);
+ const [ allowsFurni, setAllowsFurni ] = useState(WiredFurniType.STUFF_SELECTION_OPTION_NONE);
const { showConfirm = null } = useNotification();
const saveWired = () =>
@@ -51,7 +52,7 @@ const useWiredState = () =>
const selectObjectForWired = (objectId: number, category: number) =>
{
- if(!trigger) return;
+ if(!trigger || !allowsFurni) return;
if(objectId <= 0) return;
@@ -122,10 +123,11 @@ const useWiredState = () =>
return [];
});
+ setAllowsFurni(WiredFurniType.STUFF_SELECTION_OPTION_NONE);
}
}, [ trigger ]);
- return { trigger, setTrigger, intParams, setIntParams, stringParam, setStringParam, furniIds, setFurniIds, actionDelay, setActionDelay, saveWired, selectObjectForWired };
+ return { trigger, setTrigger, intParams, setIntParams, stringParam, setStringParam, furniIds, setFurniIds, actionDelay, setActionDelay, setAllowsFurni, saveWired, selectObjectForWired };
}
export const useWired = () => useBetween(useWiredState);