mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 15:40:51 +01:00
Inventory updates
This commit is contained in:
parent
9122dec1fd
commit
19ac905902
@ -11,10 +11,10 @@ import { LocalizeText } from '../../utils/LocalizeText';
|
||||
import { InventoryContextProvider } from './context/InventoryContext';
|
||||
import { InventoryMessageHandler } from './InventoryMessageHandler';
|
||||
import { InventoryTabs, InventoryViewProps } from './InventoryView.types';
|
||||
import { initialInventoryBadge, inventoryBadgeReducer } from './reducers/InventoryBadgeReducer';
|
||||
import { initialInventoryBot, inventoryBotReducer } from './reducers/InventoryBotReducer';
|
||||
import { initialInventoryFurniture, inventoryFurnitureReducer } from './reducers/InventoryFurnitureReducer';
|
||||
import { initialInventoryPet, inventoryPetReducer } from './reducers/InventoryPetReducer';
|
||||
import { initialInventoryBadge, InventoryBadgeReducer } from './reducers/InventoryBadgeReducer';
|
||||
import { initialInventoryBot, InventoryBotReducer } from './reducers/InventoryBotReducer';
|
||||
import { initialInventoryFurniture, InventoryFurnitureReducer } from './reducers/InventoryFurnitureReducer';
|
||||
import { initialInventoryPet, InventoryPetReducer } from './reducers/InventoryPetReducer';
|
||||
import { isObjectMoverRequested, setObjectMoverRequested } from './utils/InventoryUtilities';
|
||||
import { InventoryBadgeView } from './views/badge/InventoryBadgeView';
|
||||
import { InventoryBotView } from './views/bot/InventoryBotView';
|
||||
@ -29,10 +29,10 @@ export const InventoryView: FC<InventoryViewProps> = props =>
|
||||
const [ currentTab, setCurrentTab ] = useState<string>(tabs[0]);
|
||||
const [ roomSession, setRoomSession ] = useState<IRoomSession>(null);
|
||||
const [ roomPreviewer, setRoomPreviewer ] = useState<RoomPreviewer>(null);
|
||||
const [ furnitureState, dispatchFurnitureState ] = useReducer(inventoryFurnitureReducer, initialInventoryFurniture);
|
||||
const [ botState, dispatchBotState ] = useReducer(inventoryBotReducer, initialInventoryBot);
|
||||
const [ petState, dispatchPetState ] = useReducer(inventoryPetReducer, initialInventoryPet);
|
||||
const [ badgeState, dispatchBadgeState ] = useReducer(inventoryBadgeReducer, initialInventoryBadge);
|
||||
const [ furnitureState, dispatchFurnitureState ] = useReducer(InventoryFurnitureReducer, initialInventoryFurniture);
|
||||
const [ botState, dispatchBotState ] = useReducer(InventoryBotReducer, initialInventoryBot);
|
||||
const [ petState, dispatchPetState ] = useReducer(InventoryPetReducer, initialInventoryPet);
|
||||
const [ badgeState, dispatchBadgeState ] = useReducer(InventoryBadgeReducer, initialInventoryBadge);
|
||||
|
||||
const onInventoryEvent = useCallback((event: InventoryEvent) =>
|
||||
{
|
||||
@ -97,11 +97,6 @@ export const InventoryView: FC<InventoryViewProps> = props =>
|
||||
}
|
||||
}, []);
|
||||
|
||||
function hideInventory(): void
|
||||
{
|
||||
setIsVisible(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<InventoryContextProvider value={ { furnitureState, dispatchFurnitureState, botState, dispatchBotState, petState, dispatchPetState, badgeState, dispatchBadgeState } }>
|
||||
<InventoryMessageHandler />
|
||||
@ -111,7 +106,7 @@ export const InventoryView: FC<InventoryViewProps> = props =>
|
||||
<div className="d-flex flex-grow-1 justify-content-center align-items-center">
|
||||
<div className="h4 m-0 text-white text-shadow">{ LocalizeText('inventory.title') }</div>
|
||||
</div>
|
||||
<div className="cursor-pointer" onClick={ hideInventory }>
|
||||
<div className="cursor-pointer" onClick={ event => setIsVisible(false) }>
|
||||
<i className="fas fa-times"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -37,7 +37,7 @@ export const initialInventoryBadge: IInventoryBadgeState = {
|
||||
activeBadges: []
|
||||
}
|
||||
|
||||
export const inventoryBadgeReducer: Reducer<IInventoryBadgeState, IInventoryBadgeAction> = (state, action) =>
|
||||
export const InventoryBadgeReducer: Reducer<IInventoryBadgeState, IInventoryBadgeAction> = (state, action) =>
|
||||
{
|
||||
switch(action.type)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ export const initialInventoryBot: IInventoryBotState = {
|
||||
botItems: []
|
||||
}
|
||||
|
||||
export const inventoryBotReducer: Reducer<IInventoryBotState, IInventoryBotAction> = (state, action) =>
|
||||
export const InventoryBotReducer: Reducer<IInventoryBotState, IInventoryBotAction> = (state, action) =>
|
||||
{
|
||||
switch(action.type)
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ export const initialInventoryFurniture: IInventoryFurnitureState = {
|
||||
groupItems: []
|
||||
}
|
||||
|
||||
export const inventoryFurnitureReducer: Reducer<IInventoryFurnitureState, IInventoryFurnitureAction> = (state, action) =>
|
||||
export const InventoryFurnitureReducer: Reducer<IInventoryFurnitureState, IInventoryFurnitureAction> = (state, action) =>
|
||||
{
|
||||
switch(action.type)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ export const initialInventoryPet: IInventoryPetState = {
|
||||
petItems: []
|
||||
}
|
||||
|
||||
export const inventoryPetReducer: Reducer<IInventoryPetState, IInventoryPetAction> = (state, action) =>
|
||||
export const InventoryPetReducer: Reducer<IInventoryPetState, IInventoryPetAction> = (state, action) =>
|
||||
{
|
||||
switch(action.type)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user