Inventory updates

This commit is contained in:
Bill 2021-04-30 00:29:37 -04:00
parent 9122dec1fd
commit 19ac905902
5 changed files with 13 additions and 18 deletions

View File

@ -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>

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{