@rpg-engine/long-bow 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"long-bow.cjs.production.min.js","sources":["../src/constants/uiFonts.ts","../src/components/Button.tsx","../src/components/RPGUIContainer.tsx","../src/components/shared/SpriteFromAtlas.tsx","../src/components/Item/Inventory/ErrorBoundary.tsx","../src/components/Arrow/SelectArrow.tsx","../src/components/shared/Ellipsis.tsx","../src/components/PropertySelect/PropertySelect.tsx","../src/components/Character/CharacterSelection.tsx","../src/components/shared/Column.tsx","../src/components/Chat/Chat.tsx","../src/components/Input.tsx","../src/components/Chatdeprecated/ChatDeprecated.tsx","../src/constants/uiColors.ts","../src/components/Shortcuts/SingleShortcut.ts","../src/components/Shortcuts/useShortcutCooldown.ts","../src/components/CircularController/CircularController.tsx","../src/hooks/useOutsideAlerter.ts","../src/components/RangeSlider.tsx","../src/components/DraggableContainer.tsx","../src/components/InputRadio.tsx","../src/libs/itemCounter.ts","../src/components/Abstractions/ModalPortal.tsx","../src/components/RelativeListMenu.tsx","../src/components/Item/Cards/MobileItemTooltip.tsx","../src/components/Item/Inventory/itemContainerHelper.ts","../src/components/Item/Inventory/ItemSlot.tsx","../src/components/Item/Cards/ItemInfo.tsx","../src/components/Item/Cards/ItemInfoDisplay.tsx","../src/components/Item/Cards/ItemTooltip.tsx","../src/components/Item/Cards/ItemInfoWrapper.tsx","../src/components/CraftBook/CraftingRecipe.tsx","../src/components/CraftBook/CraftBook.tsx","../src/components/Dropdown.tsx","../src/components/DropdownSelectorContainer.tsx","../src/components/Equipment/EquipmentSet.tsx","../src/components/Abstractions/SlotsContainer.tsx","../src/components/NPCDialog/NPCMultiDialog.tsx","../src/components/Item/Inventory/ItemQuantitySelector.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/components/itemSelector/ItemSelector.tsx","../src/components/ListMenu.tsx","../src/components/Marketplace/MarketplaceRows.tsx","../src/components/Marketplace/Marketplace.tsx","../src/components/NPCDialog/NPCDialog.tsx","../src/hooks/useEventListener.ts","../src/components/typography/DynamicText.tsx","../src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx","../src/components/ProgressBar.tsx","../src/components/QuestInfo/QuestInfo.tsx","../src/components/QuestList.tsx","../src/components/RPGUIRoot.tsx","../src/components/Shortcuts/Shortcuts.tsx","../src/components/SimpleProgressBar.tsx","../src/components/SkillProgressBar.tsx","../src/components/SkillsContainer.tsx","../src/components/Spellbook/cards/SpellInfo.tsx","../src/libs/CastingTypeHelper.ts","../src/components/Spellbook/cards/SpellInfoDisplay.tsx","../src/components/Spellbook/cards/MobileSpellTooltip.tsx","../src/components/Spellbook/cards/SpellTooltip.tsx","../src/components/Spellbook/cards/SpellInfoWrapper.tsx","../src/components/Spellbook/Spell.tsx","../src/components/Spellbook/Spellbook.tsx","../src/components/TimeWidget/DayNightPeriod/DayNightPeriod.tsx","../src/components/TimeWidget/TimeWidget.tsx","../src/components/TradingMenu/TradingItemRow.tsx","../src/components/TradingMenu/TradingMenu.tsx","../src/components/Truncate.tsx","../src/constants/uiDevices.ts","../src/components/NPCDialog/NPCDialogText.tsx","../src/libs/StringHelpers.ts","../src/components/HistoryDialog.tsx","../src/components/CheckButton.tsx","../src/components/RadioButton.tsx","../src/components/TextArea.tsx"],"sourcesContent":["export const uiFonts = {\r\n size: {\r\n xxsmall: '8px',\r\n xsmall: '9px',\r\n small: '12px',\r\n medium: '14px',\r\n large: '16px',\r\n xLarge: '18px',\r\n xxLarge: '20px',\r\n xxxLarge: '24px',\r\n },\r\n};\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\n\r\nexport enum ButtonTypes {\r\n RPGUIButton = 'rpgui-button',\r\n RPGUIGoldButton = 'rpgui-button golden',\r\n}\r\n\r\nexport interface IButtonProps\r\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\r\n disabled?: boolean;\r\n children: React.ReactNode;\r\n buttonType: ButtonTypes;\r\n onPointerDown?: (e: any) => void;\r\n}\r\n\r\nexport const Button = ({\r\n disabled = false,\r\n children,\r\n buttonType,\r\n onPointerDown,\r\n ...props\r\n}: IButtonProps) => {\r\n return (\r\n <ButtonContainer\r\n className={`${buttonType}`}\r\n disabled={disabled}\r\n {...props}\r\n onPointerDown={onPointerDown}\r\n >\r\n <p>{children}</p>\r\n </ButtonContainer>\r\n );\r\n};\r\n\r\nconst ButtonContainer = styled.button`\r\n height: 45px;\r\n font-size: ${uiFonts.size.small};\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nexport enum RPGUIContainerTypes {\r\n Framed = 'framed',\r\n FramedGold = 'framed-golden',\r\n FramedGold2 = 'framed-golden-2',\r\n FramedGrey = 'framed-grey',\r\n}\r\nexport interface IRPGUIContainerProps {\r\n type: RPGUIContainerTypes;\r\n children: React.ReactNode;\r\n width?: string;\r\n height?: string;\r\n className?: string;\r\n}\r\n\r\nexport const RPGUIContainer: React.FC<IRPGUIContainerProps> = ({\r\n children,\r\n type,\r\n width = '50%',\r\n height,\r\n className,\r\n}) => {\r\n return (\r\n <Container\r\n width={width}\r\n height={height || 'auto'}\r\n className={`rpgui-container ${type} ${className}`}\r\n >\r\n {children}\r\n </Container>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n width: string;\r\n height: string;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n height: ${props => props.height};\r\n width: ${({ width }) => width};\r\n display: flex;\r\n flex-wrap: wrap;\r\n image-rendering: pixelated;\r\n`;\r\n","import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\n\r\ninterface IProps {\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n spriteKey: string;\r\n width?: number;\r\n height?: number;\r\n grayScale?: boolean;\r\n opacity?: number;\r\n onPointerDown?: () => void;\r\n containerStyle?: any;\r\n imgStyle?: any;\r\n imgScale?: number;\r\n imgClassname?: string;\r\n}\r\n\r\nexport const SpriteFromAtlas: React.FC<IProps> = ({\r\n atlasJSON,\r\n atlasIMG,\r\n spriteKey,\r\n width = GRID_WIDTH,\r\n height = GRID_HEIGHT,\r\n imgScale = 2,\r\n imgStyle,\r\n onPointerDown,\r\n containerStyle,\r\n grayScale = false,\r\n opacity = 1,\r\n imgClassname,\r\n}) => {\r\n //! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).\r\n //!Due to React's limitations, we cannot import it from the public folder directly!\r\n\r\n const spriteData =\r\n atlasJSON.frames[spriteKey] || atlasJSON.frames['others/no-image.png'];\r\n\r\n if (!spriteData) throw new Error(`Sprite ${spriteKey} not found in atlas!`);\r\n\r\n return (\r\n <Container\r\n width={width}\r\n height={height}\r\n hasHover={grayScale}\r\n onPointerDown={onPointerDown}\r\n style={containerStyle}\r\n >\r\n <ImgSprite\r\n className={`sprite-from-atlas-img ${imgClassname || ''}`}\r\n atlasIMG={atlasIMG}\r\n frame={spriteData.frame}\r\n scale={imgScale}\r\n grayScale={grayScale}\r\n opacity={opacity}\r\n style={imgStyle}\r\n />\r\n </Container>\r\n );\r\n};\r\n\r\ninterface IImgSpriteProps {\r\n atlasIMG: any;\r\n frame: {\r\n x: number;\r\n y: number;\r\n w: number;\r\n h: number;\r\n };\r\n scale: number;\r\n grayScale: boolean;\r\n opacity: number;\r\n}\r\n\r\ninterface IContainerProps {\r\n width: number;\r\n height: number;\r\n hasHover: boolean;\r\n}\r\n\r\nconst Container = styled.div`\r\n width: ${(props: IContainerProps) => props.width}px;\r\n height: ${(props: IContainerProps) => props.height}px;\r\n ${(props: IContainerProps) =>\r\n !props.hasHover\r\n ? `&:hover {\r\n filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg);\r\n }`\r\n : ``}\r\n`;\r\n\r\nconst ImgSprite = styled.div<IImgSpriteProps>`\r\n width: ${props => props.frame.w}px;\r\n height: ${props => props.frame.h}px;\r\n background-image: url(${props => props.atlasIMG});\r\n background-position: -${props => props.frame.x}px -${props => props.frame.y}px;\r\n transform: scale(${props => props.scale});\r\n position: relative;\r\n top: 8px;\r\n left: 8px;\r\n filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};\r\n opacity: ${props => props.opacity};\r\n`;\r\n","import React, { Component, ErrorInfo, ReactNode } from 'react';\r\nimport atlasJSON from '../../../mocks/atlas/items/items.json';\r\nimport atlasIMG from '../../../mocks/atlas/items/items.png';\r\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\r\n\r\ninterface Props {\r\n children?: ReactNode;\r\n}\r\n\r\ninterface State {\r\n hasError: boolean;\r\n}\r\n\r\nexport class ErrorBoundary extends Component<Props, State> {\r\n public state: State = {\r\n hasError: false,\r\n };\r\n\r\n public static getDerivedStateFromError(_: Error): State {\r\n // Update state so the next render will show the fallback UI.\r\n return { hasError: true };\r\n }\r\n\r\n public componentDidCatch(error: Error, errorInfo: ErrorInfo) {\r\n console.error('Uncaught error:', error, errorInfo);\r\n }\r\n\r\n public render() {\r\n if (this.state.hasError) {\r\n return (\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={'others/no-image.png'}\r\n imgScale={3}\r\n />\r\n );\r\n }\r\n\r\n return this.props.children;\r\n }\r\n}\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport LeftArrowClickIcon from './img/arrow01-left-clicked.png';\r\nimport LeftArrowIcon from './img/arrow01-left.png';\r\nimport RightArrowClickIcon from './img/arrow01-right-clicked.png';\r\nimport RightArrowIcon from './img/arrow01-right.png';\r\n\r\nexport interface ArrowBarProps extends React.HTMLAttributes<HTMLDivElement> {\r\n direction: 'right' | 'left';\r\n onPointerDown: () => void;\r\n size?: number;\r\n}\r\n\r\nexport const SelectArrow: React.FC<ArrowBarProps> = ({\r\n direction = 'left',\r\n size,\r\n onPointerDown,\r\n ...props\r\n}) => {\r\n return (\r\n <>\r\n {direction === 'left' ? (\r\n <LeftArrow\r\n size={size}\r\n onPointerDown={() => onPointerDown()}\r\n {...props}\r\n ></LeftArrow>\r\n ) : (\r\n <RightArrow\r\n size={size}\r\n onPointerDown={() => onPointerDown()}\r\n {...props}\r\n ></RightArrow>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\ninterface IArrowProps {\r\n size?: number;\r\n}\r\n\r\nconst LeftArrow = styled.span<IArrowProps>`\r\n background-image: url(${LeftArrowIcon});\r\n background-size: 100% 100%;\r\n left: 0;\r\n position: absolute;\r\n width: ${props => props.size || 40}px;\r\n height: ${props => props.size || 42}px;\r\n :active {\r\n background-image: url(${LeftArrowClickIcon});\r\n }\r\n z-index: 2;\r\n`;\r\n\r\nconst RightArrow = styled.span<IArrowProps>`\r\n background-image: url(${RightArrowIcon});\r\n right: 0;\r\n position: absolute;\r\n width: ${props => props.size || 40}px;\r\n height: ${props => props.size || 42}px;\r\n background-size: 100% 100%;\r\n :active {\r\n background-image: url(${RightArrowClickIcon});\r\n }\r\n z-index: 2;\r\n`;\r\n\r\nexport default SelectArrow;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\n\r\ninterface IProps {\r\n children: React.ReactNode;\r\n maxLines: 1 | 2 | 3;\r\n maxWidth: string;\r\n fontSize?: string;\r\n center?: boolean;\r\n}\r\n\r\nexport const Ellipsis = ({\r\n children,\r\n maxLines,\r\n maxWidth,\r\n fontSize,\r\n center,\r\n}: IProps) => {\r\n return (\r\n <Container maxWidth={maxWidth} fontSize={fontSize} center={center}>\r\n <div className={`ellipsis-${maxLines}-lines`}>{children}</div>\r\n </Container>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n maxWidth?: string;\r\n fontSize?: string;\r\n center?: boolean;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n .ellipsis-1-lines {\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n max-width: ${props => props.maxWidth};\r\n font-size: ${props => props.fontSize};\r\n\r\n ${props => props.center && `margin: 0 auto;`}\r\n }\r\n .ellipsis-2-lines {\r\n display: -webkit-box;\r\n max-width: ${props => props.maxWidth}px;\r\n\r\n height: 25px;\r\n margin: 0 auto;\r\n line-height: 1;\r\n -webkit-line-clamp: 2;\r\n -webkit-box-orient: vertical;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n font-size: ${props => props.fontSize};\r\n }\r\n .ellipsis-3-lines {\r\n display: -webkit-box;\r\n max-width: ${props => props.maxWidth}px;\r\n\r\n height: 43px;\r\n margin: 0 auto;\r\n line-height: 1;\r\n -webkit-line-clamp: 3;\r\n -webkit-box-orient: vertical;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n font-size: ${props => props.fontSize};\r\n }\r\n`;\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport SelectArrow from '../Arrow/SelectArrow';\r\nimport { Ellipsis } from '../shared/Ellipsis';\r\n\r\nexport interface IPropertySelectProps {\r\n availableProperties: Array<IPropertiesProps>;\r\n selectedProperty?: IPropertiesProps;\r\n children?: React.ReactNode;\r\n onChange: (selectedProperty: IPropertiesProps) => void;\r\n}\r\n\r\nexport interface IPropertiesProps {\r\n id: string;\r\n name: string;\r\n}\r\n\r\nexport const PropertySelect: React.FC<IPropertySelectProps> = ({\r\n availableProperties,\r\n onChange,\r\n}) => {\r\n const [currentIndex, setCurrentIndex] = useState(0);\r\n const propertiesLength = availableProperties.length - 1;\r\n\r\n const onLeftClick = () => {\r\n if (currentIndex === 0) setCurrentIndex(propertiesLength);\r\n else setCurrentIndex(index => index - 1);\r\n };\r\n const onRightClick = () => {\r\n if (currentIndex === propertiesLength) setCurrentIndex(0);\r\n else setCurrentIndex(index => index + 1);\r\n };\r\n\r\n useEffect(() => {\r\n onChange(availableProperties[currentIndex]);\r\n }, [currentIndex]);\r\n\r\n useEffect(() => {\r\n setCurrentIndex(0);\r\n }, [JSON.stringify(availableProperties)]);\r\n\r\n const getCurrentSelectionName = () => {\r\n const item = availableProperties[currentIndex];\r\n if (item) {\r\n return item.name;\r\n }\r\n return '';\r\n };\r\n\r\n return (\r\n <Container>\r\n <TextOverlay>\r\n <p>\r\n <Item>\r\n <Ellipsis maxLines={1} maxWidth=\"60%\" center>\r\n {getCurrentSelectionName()}\r\n </Ellipsis>\r\n </Item>\r\n </p>\r\n </TextOverlay>\r\n <div className=\"rpgui-progress-track\"></div>\r\n\r\n <SelectArrow direction=\"left\" onPointerDown={onLeftClick}></SelectArrow>\r\n <SelectArrow direction=\"right\" onPointerDown={onRightClick}></SelectArrow>\r\n </Container>\r\n );\r\n};\r\n\r\nconst Item = styled.span`\r\n font-size: 1rem;\r\n color: white;\r\n text-align: center;\r\n z-index: 1;\r\n position: absolute;\r\n top: 12px;\r\n width: 100%;\r\n\r\n p {\r\n margin: 0 auto;\r\n font-size: ${uiFonts.size.small};\r\n }\r\n`;\r\n\r\nconst TextOverlay = styled.div`\r\n width: 100%;\r\n position: relative;\r\n`;\r\n\r\ninterface IContainerProps {\r\n percentageWidth?: number;\r\n minWidth?: number;\r\n style?: Record<string, any>;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n position: relative;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: start;\r\n align-items: flex-start;\r\n min-width: 100px;\r\n width: 40%;\r\n`;\r\n\r\nexport default PropertySelect;\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\n\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\n\r\nimport { ErrorBoundary } from '../Item/Inventory/ErrorBoundary';\r\nimport PropertySelect, {\r\n IPropertiesProps,\r\n} from '../PropertySelect/PropertySelect';\r\n\r\nexport interface ICharacterProps {\r\n name: string;\r\n textureKey: string;\r\n}\r\n\r\nexport interface ICharacterSelectionProps {\r\n availableCharacters: ICharacterProps[];\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n onChange: (textureKey: string) => void;\r\n}\r\n\r\nexport const CharacterSelection: React.FC<ICharacterSelectionProps> = ({\r\n availableCharacters,\r\n atlasJSON,\r\n atlasIMG,\r\n onChange,\r\n}) => {\r\n const propertySelectValues = availableCharacters.map((item) => {\r\n return {\r\n id: item.textureKey,\r\n name: item.name,\r\n };\r\n });\r\n\r\n const [selectedValue, setSelectedValue] = useState<IPropertiesProps>();\r\n const [selectedSpriteKey, setSelectedSpriteKey] = useState('');\r\n\r\n const onSelectedValueChange = () => {\r\n const textureKey = selectedValue ? selectedValue.id : '';\r\n const spriteKey = textureKey ? textureKey + '/down/standing/0.png' : '';\r\n\r\n if (spriteKey === selectedSpriteKey) {\r\n return;\r\n }\r\n\r\n setSelectedSpriteKey(spriteKey);\r\n onChange(textureKey);\r\n };\r\n\r\n useEffect(() => {\r\n onSelectedValueChange();\r\n }, [selectedValue]);\r\n\r\n useEffect(() => {\r\n setSelectedValue(propertySelectValues[0]);\r\n }, [availableCharacters]);\r\n\r\n return (\r\n <Container>\r\n {selectedSpriteKey && atlasIMG && atlasJSON && (\r\n <ErrorBoundary>\r\n <SpriteFromAtlas\r\n spriteKey={selectedSpriteKey}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n imgScale={4}\r\n height={80}\r\n width={64}\r\n containerStyle={{\r\n display: 'flex',\r\n alignItems: 'center',\r\n paddingBottom: '15px',\r\n }}\r\n imgStyle={{\r\n left: '22px',\r\n }}\r\n />\r\n </ErrorBoundary>\r\n )}\r\n <PropertySelect\r\n availableProperties={propertySelectValues}\r\n onChange={(value) => {\r\n setSelectedValue(value);\r\n }}\r\n />\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n image-rendering: pixelated;\r\n`;\r\n\r\nexport default CharacterSelection;\r\n","import styled from 'styled-components';\r\n\r\ninterface IColumn {\r\n flex?: number;\r\n alignItems?: string;\r\n justifyContent?: string;\r\n flexWrap?: string;\r\n}\r\n\r\nexport const Column = styled.div<IColumn>`\r\n flex: ${props => props.flex || 'auto'};\r\n display: flex;\r\n flex-wrap: ${props => props.flexWrap || 'nowrap'};\r\n align-items: ${props => props.alignItems || 'flex-start'};\r\n justify-content: ${props => props.justifyContent || 'flex-start'};\r\n`;\r\n","import { IChatMessage } from '@rpg-engine/shared';\r\nimport dayjs from 'dayjs';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { ErrorBoundary } from 'react-error-boundary';\r\nimport { RxPaperPlane } from 'react-icons/rx';\r\nimport styled from 'styled-components';\r\nimport { Column } from '../shared/Column';\r\n\r\ninterface IEmitter {\r\n _id: string;\r\n name: string;\r\n}\r\n\r\ninterface IStyles {\r\n textColor?: string;\r\n buttonColor?: string;\r\n buttonBackgroundColor?: string;\r\n width?: string;\r\n height?: string;\r\n}\r\n\r\nexport interface IChatProps {\r\n chatMessages: IChatMessage[];\r\n onSendChatMessage: (message: string) => void;\r\n onCloseButton: () => void;\r\n onFocus?: () => void;\r\n onBlur?: () => void;\r\n opacity?: number;\r\n sendMessage: boolean;\r\n styles?: IStyles;\r\n}\r\n\r\nexport const Chat: React.FC<IChatProps> = ({\r\n chatMessages,\r\n onSendChatMessage,\r\n onFocus,\r\n onBlur,\r\n styles = {\r\n textColor: '#c65102',\r\n buttonColor: '#005b96',\r\n buttonBackgroundColor: 'rgba(0,0,0,.2)',\r\n width: '80%',\r\n height: 'auto',\r\n },\r\n}) => {\r\n const [message, setMessage] = useState('');\r\n\r\n useEffect(() => {\r\n scrollChatToBottom();\r\n }, []);\r\n\r\n useEffect(() => {\r\n scrollChatToBottom();\r\n }, [chatMessages]);\r\n\r\n const scrollChatToBottom = () => {\r\n const scrollingElement = document.querySelector('.chat-body');\r\n if (scrollingElement) {\r\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\r\n }\r\n };\r\n\r\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\r\n event.preventDefault();\r\n if (!message || message.trim() === '') return;\r\n onSendChatMessage(message);\r\n setMessage('');\r\n };\r\n const getInputValue = (value: string) => {\r\n setMessage(value);\r\n };\r\n\r\n const onRenderMessageLines = (\r\n emitter: IEmitter,\r\n createdAt: string | undefined,\r\n message: string\r\n ) => {\r\n return `${dayjs(createdAt || new Date()).format('HH:mm')} ${\r\n emitter?.name ? `${emitter.name}: ` : 'Unknown: '\r\n } ${message}`;\r\n };\r\n\r\n const onRenderChatMessages = (chatMessages: IChatMessage[]) => {\r\n return chatMessages?.length ? (\r\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\r\n <Message color={styles?.textColor || '#c65102'} key={`${_id}_${index}`}>\r\n {onRenderMessageLines(emitter, createdAt as string, message)}\r\n </Message>\r\n ))\r\n ) : (\r\n <Message color={styles?.textColor || '#c65102'}>\r\n No messages available.\r\n </Message>\r\n );\r\n };\r\n\r\n return (\r\n <ChatContainer\r\n width={styles?.width || '80%'}\r\n height={styles?.height || 'auto'}\r\n >\r\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\r\n <MessagesContainer className=\"chat-body\">\r\n {onRenderChatMessages(chatMessages)}\r\n </MessagesContainer>\r\n\r\n <Form onSubmit={handleSubmit}>\r\n <Column flex={70}>\r\n <TextField\r\n value={message}\r\n id=\"inputMessage\"\r\n onChange={e => getInputValue(e.target.value)}\r\n height={20}\r\n type=\"text\"\r\n autoComplete=\"off\"\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n onPointerDown={onFocus}\r\n autoFocus\r\n />\r\n </Column>\r\n <Column justifyContent=\"flex-end\">\r\n <Button\r\n buttonColor={styles?.buttonColor || '#005b96'}\r\n buttonBackgroundColor={\r\n styles?.buttonBackgroundColor || 'rgba(0,0,0,.5)'\r\n }\r\n id=\"chat-send-button\"\r\n style={{ borderRadius: '20%' }}\r\n >\r\n <RxPaperPlane size={15} />\r\n </Button>\r\n </Column>\r\n </Form>\r\n </ErrorBoundary>\r\n </ChatContainer>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n width: string;\r\n height: string;\r\n}\r\n\r\ninterface IMessageProps {\r\n color: string;\r\n}\r\n\r\ninterface IButtonProps {\r\n buttonColor: string;\r\n buttonBackgroundColor: string;\r\n}\r\n\r\nconst ChatContainer = styled.div<IContainerProps>`\r\n height: ${props => props.height};\r\n width: ${({ width }) => width};\r\n padding: 10px;\r\n background-color: rgba(0, 0, 0, 0.2);\r\n height: auto;\r\n`;\r\n\r\nconst TextField = styled.input`\r\n width: 100%;\r\n background-color: rgba(0, 0, 0, 0.25) !important;\r\n border: none !important;\r\n max-height: 28px !important;\r\n`;\r\n\r\nconst MessagesContainer = styled.div`\r\n height: 70%;\r\n margin-bottom: 10px;\r\n .chat-body {\r\n max-height: auto;\r\n overflow-y: auto;\r\n }\r\n`;\r\n\r\nconst Message = styled.div<IMessageProps>`\r\n margin-bottom: 8px;\r\n color: ${({ color }) => color};\r\n`;\r\n\r\nconst Form = styled.form`\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n align-items: center;\r\n`;\r\n\r\nconst Button = styled.button<IButtonProps>`\r\n color: ${({ buttonColor }) => buttonColor};\r\n background-color: ${({ buttonBackgroundColor }) => buttonBackgroundColor};\r\n width: 28px;\r\n height: 28px;\r\n border: none !important;\r\n`;\r\n","import React from 'react';\r\n\r\nexport interface IInputProps\r\n extends React.DetailedHTMLProps<\r\n React.InputHTMLAttributes<HTMLInputElement>,\r\n HTMLInputElement\r\n > {\r\n innerRef?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\nexport const Input: React.FC<IInputProps> = ({ ...props }) => {\r\n const { innerRef, ...rest } = props;\r\n\r\n return <input {...rest} ref={props.innerRef} />;\r\n};\r\n","import { IChatMessage } from '@rpg-engine/shared';\r\nimport dayjs from 'dayjs';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { ErrorBoundary } from 'react-error-boundary';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { Input } from '../Input';\r\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { Column } from '../shared/Column';\r\n\r\ninterface IEmitter {\r\n _id: string;\r\n name: string;\r\n}\r\nexport interface IChatDeprecatedProps {\r\n chatMessages: IChatMessage[];\r\n onSendChatMessage: (message: string) => void;\r\n onCloseButton: () => void;\r\n onFocus?: () => void;\r\n onBlur?: () => void;\r\n opacity?: number;\r\n width?: string;\r\n height?: string;\r\n}\r\n\r\nexport const ChatDeprecated: React.FC<IChatDeprecatedProps> = ({\r\n chatMessages,\r\n onSendChatMessage,\r\n opacity = 1,\r\n width = '100%',\r\n height = '250px',\r\n onCloseButton,\r\n onFocus,\r\n onBlur,\r\n}) => {\r\n const [message, setMessage] = useState('');\r\n\r\n useEffect(() => {\r\n scrollChatToBottom();\r\n }, []);\r\n\r\n useEffect(() => {\r\n scrollChatToBottom();\r\n }, [chatMessages]);\r\n\r\n const scrollChatToBottom = () => {\r\n const scrollingElement = document.querySelector('.chat-body');\r\n if (scrollingElement) {\r\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\r\n }\r\n };\r\n\r\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\r\n event.preventDefault();\r\n onSendChatMessage(message);\r\n setMessage('');\r\n };\r\n const getInputValue = (value: string) => {\r\n setMessage(value);\r\n };\r\n\r\n const onRenderMessageLines = (\r\n emitter: IEmitter,\r\n createdAt: string | undefined,\r\n message: string\r\n ) => {\r\n return `${dayjs(createdAt || new Date()).format('HH:mm')} ${\r\n emitter?.name ? `${emitter.name}: ` : 'Unknown: '\r\n } ${message}`;\r\n };\r\n\r\n const onRenderChatMessages = (chatMessages: IChatMessage[]) => {\r\n return chatMessages?.length ? (\r\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\r\n <MessageText key={`${_id}_${index}`}>\r\n {onRenderMessageLines(emitter, createdAt as string, message)}\r\n </MessageText>\r\n ))\r\n ) : (\r\n <MessageText>No messages available.</MessageText>\r\n );\r\n };\r\n\r\n return (\r\n <Container>\r\n <CustomContainer\r\n type={RPGUIContainerTypes.FramedGrey}\r\n width={width}\r\n height={height}\r\n className=\"chat-container\"\r\n opacity={opacity}\r\n >\r\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\r\n {onCloseButton && (\r\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\r\n )}\r\n <RPGUIContainer\r\n type={RPGUIContainerTypes.FramedGrey}\r\n width={'100%'}\r\n height={'80%'}\r\n className=\"chat-body dark-background\"\r\n >\r\n {onRenderChatMessages(chatMessages)}\r\n </RPGUIContainer>\r\n\r\n <Form onSubmit={handleSubmit}>\r\n <Column flex={70}>\r\n <CustomInput\r\n value={message}\r\n id=\"inputMessage\"\r\n onChange={e => getInputValue(e.target.value)}\r\n height={20}\r\n className=\"chat-input dark-background\"\r\n type=\"text\"\r\n autoComplete=\"off\"\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n />\r\n </Column>\r\n <Column justifyContent=\"flex-end\">\r\n <Button\r\n buttonType={ButtonTypes.RPGUIButton}\r\n id=\"chat-send-button\"\r\n >\r\n Send\r\n </Button>\r\n </Column>\r\n </Form>\r\n </ErrorBoundary>\r\n </CustomContainer>\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n position: relative;\r\n`;\r\n\r\nconst CloseButton = styled.div`\r\n position: absolute;\r\n top: 2px;\r\n right: 0px;\r\n color: white;\r\n z-index: 22;\r\n font-size: 0.7rem;\r\n`;\r\n\r\nconst CustomInput = styled(Input)`\r\n height: 30px;\r\n width: 100%;\r\n\r\n .rpgui-content .input {\r\n min-height: 39px;\r\n }\r\n`;\r\n\r\ninterface ICustomContainerProps {\r\n opacity: number;\r\n}\r\n\r\nconst CustomContainer = styled(RPGUIContainer)`\r\n display: block;\r\n\r\n opacity: ${(props: ICustomContainerProps) => props.opacity};\r\n\r\n &:hover {\r\n opacity: 1;\r\n }\r\n\r\n .dark-background {\r\n background-color: ${uiColors.darkGray} !important;\r\n }\r\n\r\n .chat-body {\r\n &.rpgui-container.framed-grey {\r\n background: unset;\r\n }\r\n max-height: 170px;\r\n overflow-y: auto;\r\n }\r\n`;\r\n\r\nconst Form = styled.form`\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n align-items: center;\r\n`;\r\n\r\nconst MessageText = styled.p`\r\n display: block !important;\r\n width: 100%;\r\n font-size: ${uiFonts.size.xsmall} !important;\r\n overflow-y: auto;\r\n margin: 0;\r\n`;\r\n","export const uiColors = {\r\n lightGray: '#888',\r\n gray: '#4E4A4E',\r\n darkGray: '#3e3e3e',\r\n darkYellow: '#FFC857',\r\n yellow: '#FFFF00',\r\n orange: '#D27D2C',\r\n cardinal: '#C5283D',\r\n red: '#D04648',\r\n darkRed: '#442434',\r\n raisinBlack: '#191923',\r\n navyBlue: '#0E79B2',\r\n purple: '#6833A3',\r\n darkPurple: '#522761',\r\n blue: '#597DCE',\r\n darkBlue: '#30346D',\r\n brown: '#854C30',\r\n lightGreen: '#66cd1c',\r\n brownGreen: '#346524',\r\n};\r\n","import styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\n\r\nexport const SingleShortcut = styled.button`\r\n width: 3rem;\r\n height: 3rem;\r\n background-color: ${uiColors.lightGray};\r\n border: 2px solid ${uiColors.darkGray};\r\n border-radius: 50%;\r\n text-transform: uppercase;\r\n font-size: 0.7rem;\r\n font-weight: bold;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n\r\n span {\r\n pointer-events: none;\r\n }\r\n\r\n .mana {\r\n position: absolute;\r\n top: -5px;\r\n right: 0;\r\n font-size: 0.65rem;\r\n color: ${uiColors.blue};\r\n }\r\n\r\n .qty {\r\n position: absolute;\r\n top: -5px;\r\n right: 0;\r\n font-size: 0.65rem;\r\n }\r\n\r\n .magicWords {\r\n margin-top: 4px;\r\n }\r\n\r\n .keyboard {\r\n position: absolute;\r\n bottom: -5px;\r\n left: 0;\r\n font-size: 0.65rem;\r\n color: ${uiColors.yellow};\r\n }\r\n\r\n .onCooldown {\r\n color: ${uiColors.gray};\r\n }\r\n\r\n .cooldown {\r\n position: absolute;\r\n z-index: 1;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n border-radius: inherit;\r\n background-color: rgba(0 0 0 / 60%);\r\n font-size: 0.7rem;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n color: ${uiColors.darkYellow};\r\n }\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: ${uiColors.darkGray};\r\n }\r\n\r\n &:active {\r\n background-color: ${uiColors.gray};\r\n border-color: ${uiColors.yellow};\r\n }\r\n\r\n &:disabled {\r\n opacity: 0.5;\r\n }\r\n`;\r\n","import { useEffect, useRef, useState } from \"react\";\r\n\r\nexport const useShortcutCooldown = (onShortcutCast: (index: number) => void) => {\r\n const [shortcutCooldown, setShortcutCooldown] = useState(0);\r\n const cooldownTimeout = useRef<NodeJS.Timeout | null>(null);\r\n\r\n const handleShortcutCast = (index: number) => {\r\n console.log(shortcutCooldown);\r\n if (shortcutCooldown <= 0) setShortcutCooldown(1.5);\r\n onShortcutCast(index);\r\n };\r\n\r\n useEffect(() => {\r\n if (cooldownTimeout.current) clearTimeout(cooldownTimeout.current);\r\n\r\n if (shortcutCooldown > 0) {\r\n cooldownTimeout.current = setTimeout(() => {\r\n setShortcutCooldown(shortcutCooldown - 0.1);\r\n }, 100);\r\n }\r\n }, [shortcutCooldown]);\r\n\r\n return { shortcutCooldown, handleShortcutCast };\r\n};","import {\r\n getItemTextureKeyPath,\r\n IItem,\r\n IItemContainer,\r\n IRawSpell,\r\n IShortcut,\r\n ShortcutType,\r\n} from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\nimport { SingleShortcut } from '../Shortcuts/SingleShortcut';\r\nimport { useShortcutCooldown } from '../Shortcuts/useShortcutCooldown';\r\n\r\nexport type CircularControllerProps = {\r\n onActionClick: () => void;\r\n onCancelClick: () => void;\r\n onShortcutClick: (index: number) => void;\r\n mana: number;\r\n shortcuts: IShortcut[];\r\n inventory?: IItemContainer | null;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n spellCooldowns?: Record<string, number>;\r\n};\r\n\r\nexport const CircularController: React.FC<CircularControllerProps> = ({\r\n onActionClick,\r\n onCancelClick,\r\n onShortcutClick,\r\n mana,\r\n shortcuts,\r\n inventory,\r\n atlasIMG,\r\n atlasJSON,\r\n spellCooldowns,\r\n}) => {\r\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\r\n onShortcutClick\r\n );\r\n\r\n const onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\r\n const target = e.target as HTMLButtonElement;\r\n target?.classList.add('active');\r\n };\r\n\r\n const onTouchEnd = (\r\n action: () => void,\r\n e: React.TouchEvent<HTMLButtonElement>\r\n ) => {\r\n const target = e.target as HTMLButtonElement;\r\n setTimeout(() => {\r\n target?.classList.remove('active');\r\n }, 100);\r\n action();\r\n };\r\n\r\n const renderShortcut = (i: number) => {\r\n const buildClassName = (classBase: string, isOnCooldown: boolean) => {\r\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\r\n };\r\n\r\n let variant = '';\r\n\r\n if (i === 0) variant = 'top';\r\n else if (i >= 3) variant = `bottom-${i - 3}`;\r\n\r\n const onShortcutClickBinded =\r\n shortcuts[i]?.type !== ShortcutType.None\r\n ? handleShortcutCast.bind(null, i)\r\n : () => {};\r\n\r\n const isOnShortcutCooldown = shortcutCooldown > 0;\r\n\r\n if (shortcuts[i]?.type === ShortcutType.Item) {\r\n const payload = shortcuts[i]?.payload as IItem | undefined;\r\n\r\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\r\n\r\n if (inventory) {\r\n Object.keys(inventory.slots).forEach(i => {\r\n const index = parseInt(i);\r\n\r\n if (inventory.slots[index]?.key === payload?.key) {\r\n itemsFromEquipment.push(inventory.slots[index]);\r\n }\r\n });\r\n }\r\n\r\n const totalQty = itemsFromEquipment.reduce(\r\n (acc, item) => acc + (item?.stackQty || 1),\r\n 0\r\n );\r\n\r\n return (\r\n <StyledShortcut\r\n key={i}\r\n onTouchStart={onTouchStart}\r\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\r\n disabled={false}\r\n className={variant}\r\n >\r\n {isOnShortcutCooldown && (\r\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\r\n )}\r\n {payload && (\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: payload.texturePath,\r\n texturePath: payload.texturePath,\r\n stackQty: payload.stackQty || 1,\r\n isStackable: payload.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n width={32}\r\n height={32}\r\n imgScale={1.4}\r\n imgStyle={{ left: '4px' }}\r\n containerStyle={{ pointerEvents: 'none' }}\r\n />\r\n )}\r\n <span className={buildClassName('qty', isOnShortcutCooldown)}>\r\n {totalQty}\r\n </span>\r\n </StyledShortcut>\r\n );\r\n }\r\n\r\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\r\n\r\n const spellCooldown = !payload\r\n ? 0\r\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\r\n shortcutCooldown;\r\n const cooldown =\r\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\r\n const isOnCooldown = cooldown > 0 && !!payload;\r\n\r\n return (\r\n <StyledShortcut\r\n key={i}\r\n onTouchStart={onTouchStart}\r\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\r\n disabled={mana < (payload?.manaCost ?? 0)}\r\n className={variant}\r\n >\r\n {isOnCooldown && (\r\n <span className=\"cooldown\">\r\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\r\n </span>\r\n )}\r\n <span className={buildClassName('mana', isOnCooldown)}>\r\n {payload && payload.manaCost}\r\n </span>\r\n <span className=\"magicWords\">\r\n {payload?.magicWords.split(' ').map(word => word[0])}\r\n </span>\r\n </StyledShortcut>\r\n );\r\n };\r\n\r\n return (\r\n <ButtonsContainer>\r\n <ShortcutsContainer>\r\n {Array.from({ length: 6 }).map((_, i) => renderShortcut(i))}\r\n </ShortcutsContainer>\r\n <Button\r\n onTouchStart={onTouchStart}\r\n onTouchEnd={onTouchEnd.bind(null, onActionClick)}\r\n >\r\n <div className=\"rpgui-icon sword\" />\r\n </Button>\r\n\r\n <CancelButton\r\n onTouchStart={onTouchStart}\r\n onTouchEnd={onTouchEnd.bind(null, onCancelClick)}\r\n >\r\n <span>X</span>\r\n </CancelButton>\r\n </ButtonsContainer>\r\n );\r\n};\r\n\r\nconst Button = styled.button`\r\n width: 4.3rem;\r\n height: 4.3rem;\r\n background-color: ${uiColors.lightGray};\r\n border: 2px solid ${uiColors.darkGray};\r\n border-radius: 50%;\r\n text-transform: uppercase;\r\n font-size: 0.7rem;\r\n font-weight: bold;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n transition: all 0.1s;\r\n margin-top: -3rem;\r\n\r\n &.active {\r\n background-color: ${uiColors.gray};\r\n border-color: ${uiColors.yellow};\r\n }\r\n\r\n .sword {\r\n transform: rotate(-45deg);\r\n height: 2.5rem;\r\n width: 1.9rem;\r\n pointer-events: none;\r\n }\r\n`;\r\n\r\nconst CancelButton = styled(Button)`\r\n width: 3rem;\r\n height: 3rem;\r\n font-size: 0.8rem;\r\n\r\n span {\r\n margin-top: 4px;\r\n margin-left: 2px;\r\n pointer-events: none;\r\n }\r\n`;\r\n\r\nconst ButtonsContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 0.5rem;\r\n`;\r\n\r\nconst ShortcutsContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 0.5rem;\r\n flex-direction: column;\r\n margin-top: 3rem;\r\n\r\n .top {\r\n transform: translate(93%, 25%);\r\n }\r\n\r\n .bottom-0 {\r\n transform: translate(93%, -25%);\r\n }\r\n\r\n .bottom-1 {\r\n transform: translate(-120%, calc(-5.5rem));\r\n }\r\n\r\n .bottom-2 {\r\n transform: translate(-30%, calc(-5.5rem - 25%));\r\n }\r\n`;\r\n\r\nconst StyledShortcut = styled(SingleShortcut)`\r\n width: 2.5rem;\r\n height: 2.5rem;\r\n transition: all 0.1s;\r\n\r\n .mana,\r\n .qty {\r\n font-size: 0.5rem;\r\n }\r\n\r\n &:hover,\r\n &:focus,\r\n &:active {\r\n background-color: ${uiColors.lightGray};\r\n }\r\n\r\n &.active {\r\n background-color: ${uiColors.gray};\r\n border-color: ${uiColors.yellow};\r\n }\r\n`;\r\n","import { useEffect } from 'react';\r\n\r\nexport function useOutsideClick(ref: any, id: string) {\r\n useEffect(() => {\r\n /**\r\n * Alert if clicked on outside of element\r\n */\r\n function handleClickOutside(event: any) {\r\n if (ref.current && !ref.current.contains(event.target)) {\r\n const event = new CustomEvent('clickOutside', {\r\n detail: {\r\n id,\r\n },\r\n });\r\n document.dispatchEvent(event);\r\n }\r\n }\r\n // Bind the event listener\r\n document.addEventListener('pointerdown', handleClickOutside);\r\n return () => {\r\n // Unbind the event listener on clean up\r\n document.removeEventListener('pointerdown', handleClickOutside);\r\n };\r\n }, [ref]);\r\n}\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nexport enum RangeSliderType {\r\n Slider = 'rpgui-slider',\r\n GoldSlider = 'rpgui-slider golden',\r\n}\r\n\r\nexport interface IRangeSliderProps {\r\n type: RangeSliderType;\r\n valueMin: number;\r\n valueMax: number;\r\n width: string;\r\n onChange: (value: number) => void;\r\n value: number;\r\n}\r\n\r\nexport const RangeSlider: React.FC<IRangeSliderProps> = ({\r\n type,\r\n valueMin,\r\n valueMax,\r\n width,\r\n onChange,\r\n value,\r\n}) => {\r\n const sliderId = uuidv4();\r\n\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const [left, setLeft] = useState(0);\r\n\r\n useEffect(() => {\r\n const calculatedWidth = containerRef.current?.clientWidth || 0;\r\n setLeft(\r\n Math.max(\r\n ((value - valueMin) / (valueMax - valueMin)) * (calculatedWidth - 35) +\r\n 10\r\n )\r\n );\r\n }, [value, valueMin, valueMax]);\r\n\r\n const typeClass = type === RangeSliderType.GoldSlider ? 'golden' : '';\r\n\r\n return (\r\n <div\r\n style={{ width: width, position: 'relative' }}\r\n className={`rpgui-slider-container ${typeClass}`}\r\n id={`rpgui-slider-${sliderId}`}\r\n ref={containerRef}\r\n >\r\n <div style={{ pointerEvents: 'none' }}>\r\n <div className={`rpgui-slider-track ${typeClass}`} />\r\n <div className={`rpgui-slider-left-edge ${typeClass}`} />\r\n <div className={`rpgui-slider-right-edge ${typeClass}`} />\r\n <div className={`rpgui-slider-thumb ${typeClass}`} style={{ left }} />\r\n </div>\r\n <Input\r\n type=\"range\"\r\n style={{ width: width }}\r\n min={valueMin}\r\n max={valueMax}\r\n onChange={e => onChange(Number(e.target.value))}\r\n value={value}\r\n className=\"rpgui-cursor-point\"\r\n />\r\n </div>\r\n );\r\n};\r\n\r\nconst Input = styled.input`\r\n opacity: 0;\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n top: 0;\r\n left: 0;\r\n margin-top: -5px;\r\n`;\r\n","import React, { useEffect, useRef } from 'react';\r\nimport Draggable from 'react-draggable';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\r\nimport { IPosition } from '../types/eventTypes';\r\nimport { RPGUIContainerTypes } from './RPGUIContainer';\r\n\r\nexport interface IDraggableContainerProps {\r\n children: React.ReactNode;\r\n width?: string;\r\n height?: string;\r\n className?: string;\r\n type?: RPGUIContainerTypes;\r\n title?: string;\r\n imgSrc?: string;\r\n imgWidth?: string;\r\n onCloseButton?: () => void;\r\n cancelDrag?: string;\r\n onPositionChange?: (position: IPosition) => void;\r\n onPositionChangeEnd?: (position: IPosition) => void;\r\n onPositionChangeStart?: (position: IPosition) => void;\r\n onOutsideClick?: () => void;\r\n initialPosition?: IPosition;\r\n scale?: number;\r\n}\r\n\r\nexport const DraggableContainer: React.FC<IDraggableContainerProps> = ({\r\n children,\r\n width = '50%',\r\n height,\r\n className,\r\n type = RPGUIContainerTypes.FramedGold,\r\n onCloseButton,\r\n title,\r\n imgSrc,\r\n imgWidth = '20px',\r\n cancelDrag,\r\n onPositionChange,\r\n onPositionChangeEnd,\r\n onPositionChangeStart,\r\n onOutsideClick,\r\n initialPosition = { x: 0, y: 0 },\r\n scale,\r\n}) => {\r\n const draggableRef = useRef(null);\r\n\r\n useOutsideClick(draggableRef, 'item-container');\r\n\r\n useEffect(() => {\r\n document.addEventListener('clickOutside', event => {\r\n const e = event as CustomEvent;\r\n\r\n if (e.detail.id === 'item-container') {\r\n if (onOutsideClick) {\r\n onOutsideClick();\r\n }\r\n }\r\n });\r\n\r\n return () => {\r\n document.removeEventListener('clickOutside', _e => {});\r\n };\r\n }, []);\r\n\r\n return (\r\n <Draggable\r\n cancel={`.container-close,${cancelDrag}`}\r\n onDrag={(_e, data) => {\r\n if (onPositionChange) {\r\n onPositionChange({\r\n x: data.x,\r\n y: data.y,\r\n });\r\n }\r\n }}\r\n onStop={(_e, data) => {\r\n if (onPositionChangeEnd) {\r\n onPositionChangeEnd({\r\n x: data.x,\r\n y: data.y,\r\n });\r\n }\r\n }}\r\n onStart={(_e, data) => {\r\n if (onPositionChangeStart) {\r\n onPositionChangeStart({\r\n x: data.x,\r\n y: data.y,\r\n });\r\n }\r\n }}\r\n defaultPosition={initialPosition}\r\n scale={scale}\r\n >\r\n <Container\r\n ref={draggableRef}\r\n width={width}\r\n height={height || 'auto'}\r\n className={`rpgui-container ${type} ${className}`}\r\n >\r\n {title && (\r\n <TitleContainer className=\"drag-handler\">\r\n <Title>\r\n {imgSrc && <Icon src={imgSrc} width={imgWidth} />}\r\n {title}\r\n </Title>\r\n </TitleContainer>\r\n )}\r\n {onCloseButton && (\r\n <CloseButton\r\n className=\"container-close\"\r\n onPointerDown={onCloseButton}\r\n >\r\n X\r\n </CloseButton>\r\n )}\r\n\r\n {children}\r\n </Container>\r\n </Draggable>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n width: string;\r\n height: string;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n height: ${props => props.height};\r\n width: ${({ width }) => width};\r\n display: flex;\r\n flex-wrap: wrap;\r\n image-rendering: pixelated;\r\n\r\n &.rpgui-container {\r\n padding-top: 1.5rem;\r\n }\r\n`;\r\n\r\nconst CloseButton = styled.div`\r\n position: absolute;\r\n top: 3px;\r\n right: 0px;\r\n color: white;\r\n z-index: 22;\r\n font-size: 1.1rem;\r\n\r\n @media (max-width: 950px) {\r\n font-size: 1.7rem;\r\n padding: 12px;\r\n }\r\n`;\r\n\r\nconst TitleContainer = styled.div`\r\n width: 100%;\r\n height: 100%;\r\n display: flex;\r\n flex-wrap: wrap;\r\n justify-content: flex-start;\r\n align-items: center;\r\n`;\r\n\r\nconst Title = styled.h1`\r\n color: white;\r\n z-index: 22;\r\n font-size: ${uiFonts.size.large};\r\n`;\r\n\r\ninterface ICustomIconProps {\r\n width: string;\r\n}\r\n\r\nconst Icon = styled.img`\r\n color: white;\r\n z-index: 22;\r\n font-size: ${uiFonts.size.xsmall};\r\n width: ${(props: ICustomIconProps) => props.width};\r\n margin-right: 0.5rem;\r\n`;\r\n","import React from 'react';\r\n\r\ninterface IProps\r\n extends React.DetailedHTMLProps<\r\n React.InputHTMLAttributes<HTMLInputElement>,\r\n HTMLInputElement\r\n > {\r\n label: string;\r\n name: string;\r\n value: string;\r\n isChecked: boolean;\r\n onRadioSelect: (value: string) => void;\r\n}\r\n\r\nexport const InputRadio: React.FC<IProps> = ({\r\n label,\r\n name,\r\n value,\r\n isChecked,\r\n onRadioSelect,\r\n}) => {\r\n const onRadioClick = (): void => {\r\n onRadioSelect(value);\r\n };\r\n\r\n return (\r\n <div onPointerUp={onRadioClick}>\r\n <input\r\n className=\"rpgui-radio\"\r\n name={name}\r\n value={value}\r\n type=\"radio\"\r\n data-rpguitype=\"radio\"\r\n checked={isChecked}\r\n // rpgui breaks onChange on this input (doesn't work). That's why I had to wrap it with a div and a onClick listener.\r\n readOnly\r\n ></input>\r\n <label>{label}</label>\r\n </div>\r\n );\r\n};\r\n","import { IItem, IItemContainer } from \"@rpg-engine/shared\";\r\n\r\nexport const countItemFromInventory = (itemKey: string, inventory: IItemContainer) => {\r\n let itemsFromInventory: (IItem | undefined | null)[] = [];\r\n\r\n if (inventory) {\r\n Object.keys(inventory.slots).forEach(i => {\r\n const index = parseInt(i);\r\n\r\n if (inventory.slots[index]?.key === itemKey) {\r\n itemsFromInventory.push(inventory.slots[index]);\r\n }\r\n });\r\n }\r\n\r\n const totalQty = itemsFromInventory.reduce(\r\n (acc, item) => acc + (item?.stackQty || 1),\r\n 0\r\n );\r\n\r\n return totalQty;\r\n};","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport styled from 'styled-components';\r\n\r\nconst modalRoot = document.getElementById('modal-root')!;\r\n\r\ninterface ModalPortalProps {\r\n children: React.ReactNode;\r\n}\r\n\r\nconst ModalPortal: React.FC<ModalPortalProps> = ({ children }) => {\r\n return ReactDOM.createPortal(\r\n <Container className=\"rpgui-content\">{children}</Container>,\r\n modalRoot\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n position: static !important;\r\n`;\r\n\r\nexport default ModalPortal;\r\n","import React, { useEffect, useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\r\nimport ModalPortal from './Abstractions/ModalPortal';\r\n\r\ninterface IListMenuOption {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nexport interface IRelativeMenuProps {\r\n options: IListMenuOption[];\r\n onSelected: (selectedOptionId: string) => void;\r\n fontSize?: number;\r\n onOutsideClick?: () => void;\r\n pos: { x: number; y: number };\r\n}\r\n\r\nexport const RelativeListMenu: React.FC<IRelativeMenuProps> = ({\r\n options,\r\n onSelected,\r\n onOutsideClick,\r\n fontSize = 0.8,\r\n pos,\r\n}) => {\r\n const ref = useRef(null);\r\n\r\n useOutsideClick(ref, 'relative-context-menu');\r\n\r\n useEffect(() => {\r\n document.addEventListener('clickOutside', event => {\r\n const e = event as CustomEvent;\r\n\r\n if (e.detail.id === 'relative-context-menu') {\r\n if (onOutsideClick) {\r\n onOutsideClick();\r\n }\r\n }\r\n });\r\n\r\n return () => {\r\n document.removeEventListener('clickOutside', _e => {});\r\n };\r\n }, []);\r\n\r\n return (\r\n <ModalPortal>\r\n <Container fontSize={fontSize} ref={ref} {...pos}>\r\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\r\n {options.map((params, index) => (\r\n <ListElement\r\n key={params?.id || index}\r\n onPointerDown={() => {\r\n onSelected(params?.id);\r\n }}\r\n >\r\n {params?.text || 'No text'}\r\n </ListElement>\r\n ))}\r\n </ul>\r\n </Container>\r\n </ModalPortal>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n fontSize?: number;\r\n x: number;\r\n y: number;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n position: absolute;\r\n top: ${props => props.y}px;\r\n left: ${props => props.x}px;\r\n\r\n display: flex;\r\n flex-direction: column;\r\n width: max-content;\r\n justify-content: start;\r\n align-items: flex-start;\r\n\r\n li {\r\n font-size: ${props => props.fontSize}em;\r\n }\r\n`;\r\n\r\nconst ListElement = styled.li`\r\n margin-right: 0.5rem;\r\n`;\r\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\r\nimport React, { useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport ModalPortal from '../../Abstractions/ModalPortal';\r\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\r\n\r\ninterface IListMenuOption {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nexport interface MobileItemTooltipProps {\r\n item: IItem;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n closeTooltip: () => void;\r\n equipmentSet?: IEquipmentSet | null;\r\n scale?: number;\r\n options?: IListMenuOption[];\r\n onSelected?: (selectedOptionId: string) => void;\r\n}\r\n\r\nexport const MobileItemTooltip: React.FC<MobileItemTooltipProps> = ({\r\n item,\r\n atlasIMG,\r\n atlasJSON,\r\n closeTooltip,\r\n equipmentSet,\r\n scale = 1,\r\n options,\r\n onSelected,\r\n}) => {\r\n const ref = useRef<HTMLDivElement>(null);\r\n\r\n const handleFadeOut = () => {\r\n ref.current?.classList.add('fadeOut');\r\n };\r\n\r\n return (\r\n <ModalPortal>\r\n <Container\r\n ref={ref}\r\n onTouchEnd={() => {\r\n handleFadeOut();\r\n setTimeout(() => {\r\n closeTooltip();\r\n }, 100);\r\n }}\r\n scale={scale}\r\n >\r\n <ItemInfoDisplay\r\n item={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n isMobile\r\n />\r\n <OptionsContainer>\r\n {options?.map(option => (\r\n <Option\r\n key={option.id}\r\n onTouchEnd={() => {\r\n handleFadeOut();\r\n setTimeout(() => {\r\n onSelected?.(option.id);\r\n closeTooltip();\r\n }, 100);\r\n }}\r\n >\r\n {option.text}\r\n </Option>\r\n ))}\r\n </OptionsContainer>\r\n </Container>\r\n </ModalPortal>\r\n );\r\n};\r\n\r\nconst Container = styled.div<{ scale: number }>`\r\n position: absolute;\r\n z-index: 100;\r\n left: 0;\r\n top: 0;\r\n width: 100vw;\r\n height: 100vh;\r\n background-color: rgba(0 0 0 / 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.5rem;\r\n transition: opacity 0.08s;\r\n animation: fadeIn 0.1s forwards;\r\n\r\n @keyframes fadeIn {\r\n 0% {\r\n opacity: 0;\r\n }\r\n 100% {\r\n opacity: 0.92;\r\n }\r\n }\r\n\r\n @keyframes fadeOut {\r\n 0% {\r\n opacity: 0.92;\r\n }\r\n 100% {\r\n opacity: 0;\r\n }\r\n }\r\n\r\n &.fadeOut {\r\n animation: fadeOut 0.1s forwards;\r\n }\r\n\r\n @media (max-width: 640px) {\r\n flex-direction: column;\r\n }\r\n`;\r\n\r\nconst OptionsContainer = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n gap: 0.5rem;\r\n flex-wrap: wrap;\r\n\r\n @media (max-width: 640px) {\r\n flex-direction: row;\r\n justify-content: center;\r\n }\r\n`;\r\n\r\nconst Option = styled.button`\r\n padding: 1rem;\r\n background-color: #333;\r\n color: white;\r\n border: none;\r\n border-radius: 3px;\r\n width: 8rem;\r\n transition: background-color 0.1s;\r\n\r\n &:hover {\r\n background-color: #555;\r\n }\r\n\r\n @media (max-width: 640px) {\r\n padding: 1rem 0.5rem;\r\n }\r\n`;\r\n","import {\r\n ActionsForEquipmentSet,\r\n ActionsForInventory,\r\n ActionsForLoot,\r\n ActionsForMapContainer,\r\n DepotSocketEvents,\r\n IItem,\r\n ItemContainerType,\r\n ItemSocketEvents,\r\n ItemSocketEventsDisplayLabels,\r\n ItemType,\r\n} from '@rpg-engine/shared';\r\n\r\nexport interface IContextMenuItem {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nconst generateContextMenuListOptions = (actionsByTypeList: any) => {\r\n const contextMenu: IContextMenuItem[] = actionsByTypeList.map(\r\n (action: string) => {\r\n return { id: action, text: ItemSocketEventsDisplayLabels[action] };\r\n }\r\n );\r\n return contextMenu;\r\n};\r\n\r\nexport const generateContextMenu = (\r\n item: IItem,\r\n itemContainerType: ItemContainerType | null,\r\n isDepotSystem?: boolean\r\n) => {\r\n let contextActionMenu: IContextMenuItem[] = [];\r\n\r\n if (itemContainerType === ItemContainerType.Inventory) {\r\n switch (item.type) {\r\n case ItemType.Weapon:\r\n case ItemType.Armor:\r\n case ItemType.Accessory:\r\n case ItemType.Jewelry:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.Equipment\r\n );\r\n break;\r\n case ItemType.Container:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.Container\r\n );\r\n break;\r\n case ItemType.Consumable:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.Consumable\r\n );\r\n break;\r\n case ItemType.CraftingResource:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.CraftingResource\r\n );\r\n break;\r\n case ItemType.Tool:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.Tool\r\n );\r\n break;\r\n\r\n default:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.Other\r\n );\r\n break;\r\n }\r\n\r\n if (isDepotSystem) {\r\n contextActionMenu.push({\r\n id: DepotSocketEvents.Deposit,\r\n text: 'Deposit',\r\n });\r\n }\r\n }\r\n if (itemContainerType === ItemContainerType.Equipment) {\r\n switch (item.type) {\r\n case ItemType.Container:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForEquipmentSet.Container\r\n );\r\n\r\n break;\r\n default:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForEquipmentSet.Equipment\r\n );\r\n }\r\n }\r\n if (itemContainerType === ItemContainerType.Loot) {\r\n switch (item.type) {\r\n case ItemType.Weapon:\r\n case ItemType.Armor:\r\n case ItemType.Accessory:\r\n case ItemType.Jewelry:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForLoot.Equipment\r\n );\r\n break;\r\n case ItemType.Consumable:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForLoot.Consumable\r\n );\r\n break;\r\n case ItemType.CraftingResource:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForLoot.CraftingResource\r\n );\r\n break;\r\n case ItemType.Tool:\r\n contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Tool);\r\n break;\r\n default:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForLoot.Other\r\n );\r\n break;\r\n }\r\n }\r\n if (itemContainerType === ItemContainerType.MapContainer) {\r\n switch (item.type) {\r\n case ItemType.Weapon:\r\n case ItemType.Armor:\r\n case ItemType.Accessory:\r\n case ItemType.Jewelry:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForMapContainer.Equipment\r\n );\r\n break;\r\n case ItemType.Consumable:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForMapContainer.Consumable\r\n );\r\n break;\r\n case ItemType.CraftingResource:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForMapContainer.CraftingResource\r\n );\r\n break;\r\n case ItemType.Tool:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForMapContainer.Tool\r\n );\r\n break;\r\n default:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForMapContainer.Other\r\n );\r\n break;\r\n }\r\n\r\n const contextActionMenuDontHaveUseWith = !contextActionMenu.find(action =>\r\n action.text.toLowerCase().includes('use with')\r\n );\r\n\r\n if (item.hasUseWith && contextActionMenuDontHaveUseWith) {\r\n contextActionMenu.push({ id: 'use-with', text: 'Use with...' });\r\n }\r\n }\r\n if (itemContainerType === ItemContainerType.Depot) {\r\n contextActionMenu = [\r\n {\r\n id: ItemSocketEvents.GetItemInfo,\r\n text: ItemSocketEventsDisplayLabels.GetItemInfo,\r\n },\r\n { id: DepotSocketEvents.Withdraw, text: 'Withdraw' },\r\n ];\r\n }\r\n\r\n return contextActionMenu;\r\n};\r\n","import {\r\n getItemTextureKeyPath,\r\n IEquipmentSet,\r\n IItem,\r\n IItemContainer,\r\n ItemContainerType,\r\n ItemRarities,\r\n ItemSlotType,\r\n ItemType,\r\n} from '@rpg-engine/shared';\r\n\r\nimport { observer } from 'mobx-react-lite';\r\nimport React, { useEffect, useRef, useState } from 'react';\r\nimport Draggable from 'react-draggable';\r\nimport styled from 'styled-components';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { uiFonts } from '../../../constants/uiFonts';\r\nimport { IPosition } from '../../../types/eventTypes';\r\nimport { RelativeListMenu } from '../../RelativeListMenu';\r\nimport { Ellipsis } from '../../shared/Ellipsis';\r\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\r\nimport { ItemTooltip } from '../Cards/ItemTooltip';\r\nimport { MobileItemTooltip } from '../Cards/MobileItemTooltip';\r\nimport { ErrorBoundary } from './ErrorBoundary';\r\nimport { generateContextMenu, IContextMenuItem } from './itemContainerHelper';\r\n\r\nexport const EquipmentSlotSpriteByType: any = {\r\n Neck: 'accessories/corruption-necklace.png',\r\n LeftHand: 'swords/broad-sword.png',\r\n Ring: 'rings/iron-ring.png',\r\n Head: 'helmets/viking-helmet.png',\r\n Torso: 'armors/iron-armor.png',\r\n Legs: 'legs/studded-legs.png',\r\n Feet: 'boots/iron-boots.png',\r\n Inventory: 'containers/bag.png',\r\n RightHand: 'shields/plate-shield.png',\r\n Accessory: 'ranged-weapons/arrow.png',\r\n};\r\n\r\ninterface IProps {\r\n slotIndex: number;\r\n item: IItem | null;\r\n itemContainer?: IItemContainer | null;\r\n itemContainerType: ItemContainerType | null;\r\n slotSpriteMask?: ItemSlotType | null;\r\n onSelected: (selectedOption: string, item: IItem) => void;\r\n onMouseOver: (\r\n event: any,\r\n slotIndex: number,\r\n item: IItem | null,\r\n x: number,\r\n y: number\r\n ) => void;\r\n onMouseOut?: () => void;\r\n onPointerDown: (\r\n ItemType: ItemType,\r\n itemContainerType: ItemContainerType | null,\r\n item: IItem\r\n ) => void;\r\n onDragStart: (\r\n item: IItem,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onDragEnd: (quantity?: number) => void;\r\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\r\n dragScale?: number;\r\n checkIfItemCanBeMoved: () => boolean;\r\n checkIfItemShouldDragEnd?: () => boolean;\r\n openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;\r\n onPlaceDrop: (\r\n item: IItem | null,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n isContextMenuDisabled?: boolean;\r\n isSelectingShortcut?: boolean;\r\n equipmentSet?: IEquipmentSet | null;\r\n setItemShortcut?: (item: IItem, shortcutIndex: number) => void;\r\n isDepotSystem?: boolean;\r\n}\r\n\r\nexport const ItemSlot: React.FC<IProps> = observer(\r\n ({\r\n slotIndex,\r\n item,\r\n itemContainerType: containerType,\r\n slotSpriteMask,\r\n onMouseOver,\r\n onMouseOut,\r\n onPointerDown,\r\n onSelected,\r\n atlasJSON,\r\n atlasIMG,\r\n isContextMenuDisabled = false,\r\n onDragEnd,\r\n onDragStart,\r\n onPlaceDrop,\r\n onOutsideDrop: onDrop,\r\n checkIfItemCanBeMoved,\r\n openQuantitySelector,\r\n checkIfItemShouldDragEnd,\r\n dragScale,\r\n isSelectingShortcut,\r\n equipmentSet,\r\n setItemShortcut,\r\n isDepotSystem,\r\n }) => {\r\n const [isTooltipVisible, setTooltipVisible] = useState(false);\r\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\r\n\r\n const [isContextMenuVisible, setIsContextMenuVisible] = useState(false);\r\n const [contextMenuPosition, setContextMenuPosition] = useState({\r\n x: 0,\r\n y: 0,\r\n });\r\n\r\n const [isFocused, setIsFocused] = useState(false);\r\n const [wasDragged, setWasDragged] = useState(false);\r\n const [dragPosition, setDragPosition] = useState<IPosition>({ x: 0, y: 0 });\r\n const [dropPosition, setDropPosition] = useState<IPosition | null>(null);\r\n const dragContainer = useRef<HTMLDivElement>(null);\r\n\r\n const [contextActions, setContextActions] = useState<IContextMenuItem[]>(\r\n []\r\n );\r\n\r\n useEffect(() => {\r\n setDragPosition({ x: 0, y: 0 });\r\n setIsFocused(false);\r\n\r\n if (item) {\r\n setContextActions(\r\n generateContextMenu(item, containerType, isDepotSystem)\r\n );\r\n }\r\n }, [item, isDepotSystem]);\r\n\r\n useEffect(() => {\r\n if (onDrop && item && dropPosition) {\r\n onDrop(item, dropPosition);\r\n }\r\n }, [dropPosition]);\r\n\r\n const getStackInfo = (itemId: string, stackQty: number) => {\r\n const isFractionalStackQty = stackQty % 1 !== 0;\r\n const isLargerThan999 = stackQty > 999;\r\n\r\n let qtyClassName = 'regular';\r\n if (isLargerThan999) qtyClassName = 'small';\r\n if (isFractionalStackQty) qtyClassName = 'xsmall';\r\n\r\n if (stackQty > 1) {\r\n return (\r\n <ItemQtyContainer key={`qty-${itemId}`}>\r\n <Ellipsis maxLines={1} maxWidth=\"48px\">\r\n <ItemQty className={qtyClassName}>\r\n {Math.round(stackQty * 100) / 100}{' '}\r\n </ItemQty>\r\n </Ellipsis>\r\n </ItemQtyContainer>\r\n );\r\n }\r\n return undefined;\r\n };\r\n\r\n const renderItem = (itemToRender: IItem | null) => {\r\n const element = [];\r\n\r\n if (itemToRender?.texturePath) {\r\n element.push(\r\n <ErrorBoundary key={itemToRender._id}>\r\n <SpriteFromAtlas\r\n key={itemToRender._id}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: itemToRender.texturePath,\r\n texturePath: itemToRender.texturePath,\r\n stackQty: itemToRender.stackQty || 1,\r\n isStackable: itemToRender.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n imgScale={3}\r\n imgClassname=\"sprite-from-atlas-img--item\"\r\n />\r\n </ErrorBoundary>\r\n );\r\n }\r\n const stackInfo = getStackInfo(\r\n itemToRender?._id ?? '',\r\n itemToRender?.stackQty ?? 0\r\n );\r\n if (stackInfo) {\r\n element.push(stackInfo);\r\n }\r\n\r\n return element;\r\n };\r\n\r\n const renderEquipment = (itemToRender: IItem | null) => {\r\n if (\r\n itemToRender?.texturePath &&\r\n itemToRender.allowedEquipSlotType?.includes(slotSpriteMask!)\r\n ) {\r\n const element = [];\r\n\r\n element.push(\r\n <ErrorBoundary key={itemToRender._id}>\r\n <SpriteFromAtlas\r\n key={itemToRender._id}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: itemToRender.texturePath,\r\n texturePath: itemToRender.texturePath,\r\n stackQty: itemToRender.stackQty || 1,\r\n isStackable: itemToRender.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n imgScale={3}\r\n imgClassname=\"sprite-from-atlas-img--item\"\r\n />\r\n </ErrorBoundary>\r\n );\r\n const stackInfo = getStackInfo(\r\n itemToRender?._id ?? '',\r\n itemToRender?.stackQty ?? 0\r\n );\r\n if (stackInfo) {\r\n element.push(stackInfo);\r\n }\r\n return element;\r\n } else {\r\n return (\r\n <ErrorBoundary key={uuidv4()}>\r\n <SpriteFromAtlas\r\n key={uuidv4()}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={EquipmentSlotSpriteByType[slotSpriteMask!]}\r\n imgScale={3}\r\n grayScale={true}\r\n opacity={0.4}\r\n imgClassname=\"sprite-from-atlas-img--item\"\r\n />\r\n </ErrorBoundary>\r\n );\r\n }\r\n };\r\n\r\n const onRenderSlot = (itemToRender: IItem | null) => {\r\n switch (containerType) {\r\n case ItemContainerType.Equipment:\r\n return renderEquipment(itemToRender);\r\n case ItemContainerType.Inventory:\r\n return renderItem(itemToRender);\r\n default:\r\n return renderItem(itemToRender);\r\n }\r\n };\r\n\r\n const resetItem = () => {\r\n setTooltipVisible(false);\r\n setWasDragged(false);\r\n };\r\n\r\n const onSuccesfulDrag = (quantity?: number) => {\r\n resetItem();\r\n\r\n if (quantity === -1) {\r\n setDragPosition({ x: 0, y: 0 });\r\n setIsFocused(false);\r\n } else if (item) {\r\n onDragEnd(quantity);\r\n }\r\n };\r\n\r\n return (\r\n <Container\r\n item={item}\r\n className=\"rpgui-icon empty-slot\"\r\n onMouseUp={() => {\r\n const data = item ? item : null;\r\n if (onPlaceDrop) onPlaceDrop(data, slotIndex, containerType);\r\n }}\r\n onTouchEnd={e => {\r\n const { clientX, clientY } = e.changedTouches[0];\r\n const simulatedEvent = new MouseEvent('mouseup', {\r\n clientX,\r\n clientY,\r\n bubbles: true,\r\n });\r\n\r\n document\r\n .elementFromPoint(clientX, clientY)\r\n ?.dispatchEvent(simulatedEvent);\r\n }}\r\n isSelectingShortcut={\r\n isSelectingShortcut &&\r\n (item?.type === ItemType.Consumable || item?.type === ItemType.Tool)\r\n }\r\n >\r\n <Draggable\r\n axis={isSelectingShortcut ? 'none' : 'both'}\r\n defaultClassName={item ? 'draggable' : 'empty-slot'}\r\n scale={dragScale}\r\n onStop={(e, data) => {\r\n const target = e.target as HTMLElement;\r\n if (\r\n target?.id.includes('shortcutSetter') &&\r\n setItemShortcut &&\r\n item\r\n ) {\r\n const index = parseInt(target.id.split('_')[1]);\r\n if (!isNaN(index)) {\r\n setItemShortcut(item, index);\r\n }\r\n }\r\n\r\n if (wasDragged && item && !isSelectingShortcut) {\r\n //@ts-ignore\r\n const classes: string[] = Array.from(e.target?.classList);\r\n\r\n const isOutsideDrop =\r\n classes.some(elm => {\r\n return elm.includes('rpgui-content');\r\n }) || classes.length === 0;\r\n\r\n if (isOutsideDrop) {\r\n setDropPosition({\r\n x: data.x,\r\n y: data.y,\r\n });\r\n }\r\n\r\n setWasDragged(false);\r\n\r\n const target = dragContainer.current;\r\n if (!target || !wasDragged) return;\r\n\r\n const style = window.getComputedStyle(target);\r\n const matrix = new DOMMatrixReadOnly(style.transform);\r\n const x = matrix.m41;\r\n const y = matrix.m42;\r\n\r\n setDragPosition({ x, y });\r\n\r\n setTimeout(() => {\r\n if (checkIfItemCanBeMoved()) {\r\n if (checkIfItemShouldDragEnd && !checkIfItemShouldDragEnd())\r\n return;\r\n\r\n if (\r\n item.stackQty &&\r\n item.stackQty !== 1 &&\r\n openQuantitySelector\r\n )\r\n openQuantitySelector(item.stackQty, onSuccesfulDrag);\r\n else onSuccesfulDrag(item.stackQty);\r\n } else {\r\n resetItem();\r\n setIsFocused(false);\r\n setDragPosition({ x: 0, y: 0 });\r\n }\r\n }, 100);\r\n } else if (item) {\r\n let isTouch = false;\r\n if (\r\n !isContextMenuDisabled &&\r\n e.type === 'touchend' &&\r\n !isSelectingShortcut\r\n ) {\r\n isTouch = true;\r\n setIsTooltipMobileVisible(true);\r\n }\r\n\r\n if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch) {\r\n setIsContextMenuVisible(!isContextMenuVisible);\r\n const event = e as MouseEvent;\r\n\r\n if (event.clientX && event.clientY) {\r\n setContextMenuPosition({\r\n x: event.clientX - 10,\r\n y: event.clientY - 5,\r\n });\r\n }\r\n }\r\n\r\n onPointerDown(item.type, containerType, item);\r\n }\r\n }}\r\n onStart={() => {\r\n if (!item || isSelectingShortcut) {\r\n return;\r\n }\r\n\r\n if (onDragStart) {\r\n onDragStart(item, slotIndex, containerType);\r\n }\r\n }}\r\n onDrag={(_e, data) => {\r\n if (\r\n Math.abs(data.x - dragPosition.x) > 5 ||\r\n Math.abs(data.y - dragPosition.y) > 5\r\n ) {\r\n setWasDragged(true);\r\n setIsFocused(true);\r\n }\r\n }}\r\n position={dragPosition}\r\n cancel=\".empty-slot\"\r\n >\r\n <ItemContainer\r\n ref={dragContainer}\r\n isFocused={isFocused}\r\n onMouseOver={event => {\r\n onMouseOver(event, slotIndex, item, event.clientX, event.clientY);\r\n }}\r\n onMouseOut={() => {\r\n if (onMouseOut) onMouseOut();\r\n }}\r\n onMouseEnter={() => {\r\n setTooltipVisible(true);\r\n }}\r\n onMouseLeave={() => {\r\n setTooltipVisible(false);\r\n }}\r\n >\r\n {onRenderSlot(item)}\r\n </ItemContainer>\r\n </Draggable>\r\n\r\n {isTooltipVisible && item && !isFocused && (\r\n <ItemTooltip\r\n item={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n />\r\n )}\r\n\r\n {isTooltipMobileVisible && item && (\r\n <MobileItemTooltip\r\n item={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n closeTooltip={() => {\r\n setIsTooltipMobileVisible(false);\r\n }}\r\n scale={dragScale}\r\n options={contextActions}\r\n onSelected={(optionId: string) => {\r\n setIsContextMenuVisible(false);\r\n if (item) {\r\n onSelected(optionId, item);\r\n }\r\n }}\r\n />\r\n )}\r\n\r\n {!isContextMenuDisabled && isContextMenuVisible && contextActions && (\r\n <RelativeListMenu\r\n options={contextActions}\r\n onSelected={(optionId: string) => {\r\n setIsContextMenuVisible(false);\r\n if (item) {\r\n onSelected(optionId, item);\r\n }\r\n }}\r\n onOutsideClick={() => {\r\n setIsContextMenuVisible(false);\r\n }}\r\n pos={contextMenuPosition}\r\n />\r\n )}\r\n </Container>\r\n );\r\n }\r\n);\r\n\r\nexport const rarityColor = (item: IItem | null) => {\r\n switch (item?.rarity) {\r\n case ItemRarities.Uncommon:\r\n return 'rgba(13, 193, 13, 0.6)';\r\n case ItemRarities.Rare:\r\n return 'rgba(8, 104, 187, 0.6)';\r\n case ItemRarities.Epic:\r\n return 'rgba(191, 0, 255, 0.6)';\r\n case ItemRarities.Legendary:\r\n return 'rgba(255, 191, 0,0.6)';\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\ninterface ContainerTypes {\r\n item: IItem | null;\r\n isSelectingShortcut?: boolean;\r\n}\r\n\r\nconst Container = styled.div<ContainerTypes>`\r\n margin: 0.1rem;\r\n .sprite-from-atlas-img--item {\r\n position: relative;\r\n top: 1.5rem;\r\n left: 1.5rem;\r\n border-color: ${({ item }) => rarityColor(item)};\r\n box-shadow: ${({ item }) => `0 0 5px 2px ${rarityColor(item)}`} inset, ${({\r\n item,\r\n}) => `0 0 4px 3px ${rarityColor(item)}`};\r\n //background-color: ${({ item }) => rarityColor(item)};\r\n }\r\n position: relative;\r\n\r\n &::before {\r\n content: '';\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n z-index: 1;\r\n border-radius: 12px;\r\n pointer-events: none;\r\n animation: ${({ isSelectingShortcut }) =>\r\n isSelectingShortcut ? 'bg-color-change 1s infinite' : 'none'};\r\n\r\n @keyframes bg-color-change {\r\n 0% {\r\n background-color: rgba(255 255 255 / 0.5);\r\n }\r\n 50% {\r\n background-color: transparent;\r\n }\r\n 100% {\r\n background-color: rgba(255 255 255 / 0.5);\r\n }\r\n }\r\n }\r\n`;\r\n\r\nconst ItemContainer = styled.div<{ isFocused?: boolean }>`\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n\r\n ${props => props.isFocused && 'z-index: 100; pointer-events: none;'}\r\n`;\r\n\r\nconst ItemQtyContainer = styled.div`\r\n position: relative;\r\n width: 85%;\r\n height: 16px;\r\n top: 25px;\r\n left: 2px;\r\n pointer-events: none;\r\n\r\n display: flex;\r\n justify-content: flex-end;\r\n`;\r\n\r\nconst ItemQty = styled.span`\r\n &.regular {\r\n font-size: ${uiFonts.size.small};\r\n }\r\n &.small {\r\n font-size: ${uiFonts.size.xsmall};\r\n }\r\n &.xsmall {\r\n font-size: ${uiFonts.size.xxsmall};\r\n }\r\n`;\r\n","import { IItem } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../../constants/uiColors';\r\nimport { uiFonts } from '../../../constants/uiFonts';\r\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\r\nimport { ErrorBoundary } from '../Inventory/ErrorBoundary';\r\nimport { EquipmentSlotSpriteByType, rarityColor } from '../Inventory/ItemSlot';\r\n\r\ninterface IItemInfoProps {\r\n item: IItem;\r\n itemToCompare?: IItem;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n}\r\n\r\ninterface IItemStat {\r\n key: keyof IItem;\r\n label?: string;\r\n higherIsWorse?: boolean;\r\n}\r\n\r\nconst statisticsToDisplay: IItemStat[] = [\r\n { key: 'attack' },\r\n { key: 'defense' },\r\n { key: 'maxRange', label: 'Range' },\r\n { key: 'weight', higherIsWorse: true },\r\n];\r\n\r\nexport const ItemInfo: React.FC<IItemInfoProps> = ({\r\n item,\r\n itemToCompare,\r\n atlasIMG,\r\n atlasJSON,\r\n}) => {\r\n const renderStatistics = () => {\r\n const statistics = [];\r\n\r\n for (const stat of statisticsToDisplay) {\r\n const itemStatistic = item[stat.key];\r\n\r\n if (itemStatistic) {\r\n const label =\r\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\r\n\r\n const isItemToCompare = !!itemToCompare;\r\n\r\n const isOnlyInOneItem = isItemToCompare && !itemToCompare?.[stat.key];\r\n const statDiff =\r\n parseInt(itemStatistic.toString()) -\r\n parseInt(itemToCompare?.[stat.key]?.toString() ?? '0');\r\n\r\n const isDifference = isItemToCompare && statDiff !== 0;\r\n const isBetter =\r\n (statDiff > 0 && !stat.higherIsWorse) ||\r\n (statDiff < 0 && stat.higherIsWorse);\r\n\r\n statistics.push(\r\n <Statistic key={stat.key} className={isOnlyInOneItem ? 'better' : ''}>\r\n <div className=\"label\">{label}:</div>\r\n <div\r\n className={`value ${\r\n isDifference ? (isBetter ? 'better' : 'worse') : ''\r\n }`}\r\n >\r\n {`${itemStatistic.toString()} ${\r\n isDifference ? `(${statDiff > 0 ? '+' : ''}${statDiff})` : ''\r\n }`}\r\n </div>\r\n </Statistic>\r\n );\r\n }\r\n }\r\n\r\n return statistics;\r\n };\r\n\r\n const renderMissingStatistic = () => {\r\n const statistics = [];\r\n\r\n for (const stat of statisticsToDisplay) {\r\n const itemToCompareStatistic = itemToCompare?.[stat.key];\r\n\r\n if (itemToCompareStatistic && !item[stat.key]) {\r\n const label =\r\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\r\n\r\n statistics.push(\r\n <Statistic key={stat.key} className=\"worse\">\r\n <div className=\"label\">{label}:</div>\r\n <div className=\"value worse\">\r\n {itemToCompareStatistic.toString()}\r\n </div>\r\n </Statistic>\r\n );\r\n }\r\n }\r\n\r\n return statistics;\r\n };\r\n\r\n const renderEntityEffects = () => {\r\n if (!item.entityEffects || !item.entityEffectChance) return null;\r\n\r\n return item.entityEffects.map((effect, index) => (\r\n <Statistic key={index} $isSpecial>\r\n {effect[0].toUpperCase() + effect.slice(1)} ({item.entityEffectChance}%)\r\n </Statistic>\r\n ));\r\n };\r\n\r\n const renderAvaibleSlots = () => {\r\n if (!item.allowedEquipSlotType) return null;\r\n\r\n return item.allowedEquipSlotType.map((slotType, index) => (\r\n <ErrorBoundary key={index}>\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={EquipmentSlotSpriteByType[slotType]}\r\n imgScale={2}\r\n grayScale={true}\r\n opacity={0.4}\r\n containerStyle={{ width: '32px', height: '32px' }}\r\n />\r\n </ErrorBoundary>\r\n ));\r\n };\r\n\r\n return (\r\n <Container item={item}>\r\n <Header>\r\n <div>\r\n <Title>{item.name}</Title>\r\n {item.rarity !== 'Common' && (\r\n <Rarity item={item}>{item.rarity}</Rarity>\r\n )}\r\n <Type>{item.subType}</Type>\r\n </div>\r\n <AllowedSlots>{renderAvaibleSlots()}</AllowedSlots>\r\n </Header>\r\n\r\n {item.minRequirements && (\r\n <LevelRequirement>\r\n <div className=\"title\">Requirements:</div>\r\n <div>- Level: {item.minRequirements.level}</div>\r\n <div>\r\n -{' '}\r\n {item.minRequirements.skill.name[0].toUpperCase() +\r\n item.minRequirements.skill.name.slice(1)}\r\n : {item.minRequirements.skill.level}\r\n </div>\r\n </LevelRequirement>\r\n )}\r\n\r\n {renderStatistics()}\r\n {renderEntityEffects()}\r\n {item.usableEffectDescription && (\r\n <Statistic $isSpecial>{item.usableEffectDescription}</Statistic>\r\n )}\r\n {item.equippedBuffDescription && (\r\n <Statistic $isSpecial>{item.equippedBuffDescription}</Statistic>\r\n )}\r\n {item.isTwoHanded && <Statistic $isSpecial>Two handed</Statistic>}\r\n\r\n <Description>{item.description}</Description>\r\n\r\n {item.maxStackSize && item.maxStackSize !== 1 && (\r\n <StackInfo>\r\n x{Math.round((item.stackQty ?? 1) * 100) / 100}({item.maxStackSize})\r\n </StackInfo>\r\n )}\r\n\r\n {renderMissingStatistic().length > 0 && (\r\n <MissingStatistics>\r\n <Statistic>Equipped Diff</Statistic>\r\n {itemToCompare && renderMissingStatistic()}\r\n </MissingStatistics>\r\n )}\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div<{ item: IItem }>`\r\n color: white;\r\n background-color: #222;\r\n border-radius: 5px;\r\n padding: 0.5rem;\r\n font-size: ${uiFonts.size.small};\r\n border: 3px solid ${({ item }) => rarityColor(item) ?? uiColors.lightGray};\r\n height: max-content;\r\n width: 18rem;\r\n\r\n @media (max-width: 640px) {\r\n width: 80vw;\r\n }\r\n`;\r\n\r\nconst Title = styled.div`\r\n font-size: ${uiFonts.size.medium};\r\n font-weight: bold;\r\n margin-bottom: 0.5rem;\r\n display: flex;\r\n align-items: center;\r\n margin: 0;\r\n`;\r\n\r\nconst Rarity = styled.div<{ item: IItem }>`\r\n font-size: ${uiFonts.size.small};\r\n font-weight: normal;\r\n margin-top: 0.2rem;\r\n color: ${({ item }) => rarityColor(item)};\r\n filter: brightness(1.5);\r\n`;\r\n\r\nconst Type = styled.div`\r\n font-size: ${uiFonts.size.small};\r\n margin-top: 0.2rem;\r\n color: ${uiColors.lightGray};\r\n`;\r\n\r\nconst LevelRequirement = styled.div`\r\n font-size: ${uiFonts.size.small};\r\n margin-top: 0.2rem;\r\n margin-bottom: 1rem;\r\n color: ${uiColors.orange};\r\n\r\n .title {\r\n margin-bottom: 4px;\r\n }\r\n\r\n div {\r\n margin-bottom: 2px;\r\n }\r\n`;\r\n\r\nconst Statistic = styled.div<{ $isSpecial?: boolean }>`\r\n margin-bottom: 0.4rem;\r\n width: 100%;\r\n color: ${({ $isSpecial }) => ($isSpecial ? uiColors.darkYellow : 'inherit')};\r\n\r\n .label {\r\n display: inline-block;\r\n margin-right: 0.5rem;\r\n color: inherit;\r\n }\r\n\r\n .value {\r\n display: inline-block;\r\n color: inherit;\r\n }\r\n\r\n &.better,\r\n .better {\r\n color: ${uiColors.lightGreen};\r\n }\r\n\r\n &.worse,\r\n .worse {\r\n color: ${uiColors.cardinal};\r\n }\r\n`;\r\n\r\nconst Description = styled.div`\r\n margin-top: 1.5rem;\r\n font-size: ${uiFonts.size.small};\r\n color: ${uiColors.lightGray};\r\n font-style: italic;\r\n`;\r\n\r\nconst Header = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n margin-bottom: 0.5rem;\r\n`;\r\n\r\nconst AllowedSlots = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 0.5rem;\r\n margin-left: auto;\r\n align-self: flex-start;\r\n`;\r\n\r\nconst StackInfo = styled.div`\r\n width: 100%;\r\n text-align: right;\r\n font-size: ${uiFonts.size.small};\r\n color: ${uiColors.orange};\r\n margin-top: 1rem;\r\n`;\r\n\r\nconst MissingStatistics = styled.div`\r\n margin-top: 1rem;\r\n color: ${uiColors.cardinal};\r\n`;\r\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\r\nimport { camelCase } from 'lodash';\r\nimport React, { useMemo } from 'react';\r\nimport styled from 'styled-components';\r\nimport { ItemInfo } from './ItemInfo';\r\n\r\nexport interface IItemInfoDisplayProps {\r\n item: IItem;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n equipmentSet?: IEquipmentSet | null;\r\n isMobile?: boolean;\r\n}\r\n\r\ntype EquipmentSlotTypes =\r\n | 'head'\r\n | 'neck'\r\n | 'leftHand'\r\n | 'rightHand'\r\n | 'ring'\r\n | 'legs'\r\n | 'boot'\r\n | 'accessory'\r\n | 'armor'\r\n | 'inventory';\r\n\r\nconst itemSlotTypes: EquipmentSlotTypes[] = [\r\n 'head',\r\n 'neck',\r\n 'leftHand',\r\n 'rightHand',\r\n 'ring',\r\n 'legs',\r\n 'boot',\r\n 'accessory',\r\n 'armor',\r\n 'inventory',\r\n];\r\n\r\nconst getSlotType = (\r\n itemSlotTypes: string[],\r\n slotType: string,\r\n subType: string\r\n): keyof IEquipmentSet => {\r\n if (!itemSlotTypes.includes(slotType)) {\r\n return subType as keyof IEquipmentSet;\r\n }\r\n return slotType as keyof IEquipmentSet;\r\n};\r\n\r\nexport const ItemInfoDisplay: React.FC<IItemInfoDisplayProps> = ({\r\n item,\r\n atlasIMG,\r\n atlasJSON,\r\n equipmentSet,\r\n isMobile,\r\n}) => {\r\n const itemToCompare = useMemo(() => {\r\n if (equipmentSet && item.allowedEquipSlotType?.length) {\r\n const allowedSlotTypeCamelCase = camelCase(item.allowedEquipSlotType[0]);\r\n const itemSubTypeCamelCase = camelCase(item.subType);\r\n\r\n const slotType = getSlotType(\r\n itemSlotTypes,\r\n allowedSlotTypeCamelCase,\r\n itemSubTypeCamelCase\r\n );\r\n\r\n const itemSubTypeFromEquipment = Object.values(equipmentSet).find(\r\n item => camelCase(item?.subType ?? '') === itemSubTypeCamelCase\r\n );\r\n\r\n const itemFromEquipment = itemSubTypeFromEquipment\r\n ? itemSubTypeFromEquipment\r\n : (equipmentSet[slotType] as IItem);\r\n\r\n if (\r\n itemFromEquipment &&\r\n (!item._id || itemFromEquipment._id !== item._id)\r\n ) {\r\n return itemFromEquipment;\r\n }\r\n }\r\n\r\n return undefined;\r\n }, [equipmentSet, item]);\r\n\r\n return (\r\n <Flex $isMobile={isMobile}>\r\n <ItemInfo\r\n item={item}\r\n itemToCompare={itemToCompare}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n\r\n {itemToCompare && (\r\n <CompareContainer>\r\n <Equipped>\r\n <span>Equipped</span>\r\n </Equipped>\r\n <ItemInfo\r\n item={itemToCompare}\r\n itemToCompare={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n </CompareContainer>\r\n )}\r\n </Flex>\r\n );\r\n};\r\n\r\nconst Flex = styled.div<{ $isMobile?: boolean }>`\r\n display: flex;\r\n gap: 0.5rem;\r\n flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};\r\n align-items: center;\r\n\r\n @media (max-width: 640px) {\r\n flex-direction: column-reverse;\r\n align-items: center;\r\n }\r\n`;\r\n\r\nconst Equipped = styled.div`\r\n position: absolute;\r\n bottom: 100%;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n`;\r\n\r\nconst CompareContainer = styled.div`\r\n position: relative;\r\n`;\r\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\r\nimport React, { useEffect, useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport ModalPortal from '../../Abstractions/ModalPortal';\r\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\r\n\r\nexport interface IItemTooltipProps {\r\n item: IItem;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n equipmentSet?: IEquipmentSet | null;\r\n}\r\n\r\nconst offset = 20;\r\n\r\nexport const ItemTooltip: React.FC<IItemTooltipProps> = ({\r\n item,\r\n atlasIMG,\r\n atlasJSON,\r\n equipmentSet,\r\n}) => {\r\n const ref = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const { current } = ref;\r\n\r\n if (current) {\r\n const handleMouseMove = (event: MouseEvent) => {\r\n const { clientX, clientY } = event;\r\n\r\n // Adjust the position of the tooltip based on the mouse position\r\n const rect = current.getBoundingClientRect();\r\n\r\n const tooltipWidth = rect.width;\r\n const tooltipHeight = rect.height;\r\n const isOffScreenRight =\r\n clientX + tooltipWidth + offset > window.innerWidth;\r\n const isOffScreenBottom =\r\n clientY + tooltipHeight + offset > window.innerHeight;\r\n const x = isOffScreenRight\r\n ? clientX - tooltipWidth - offset\r\n : clientX + offset;\r\n const y = isOffScreenBottom\r\n ? clientY - tooltipHeight - offset\r\n : clientY + offset;\r\n\r\n current.style.transform = `translate(${x}px, ${y}px)`;\r\n current.style.opacity = '1';\r\n };\r\n\r\n window.addEventListener('mousemove', handleMouseMove);\r\n\r\n return () => {\r\n window.removeEventListener('mousemove', handleMouseMove);\r\n };\r\n }\r\n\r\n return;\r\n }, []);\r\n\r\n return (\r\n <ModalPortal>\r\n <Container ref={ref}>\r\n <ItemInfoDisplay\r\n item={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n />\r\n </Container>\r\n </ModalPortal>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n position: absolute;\r\n z-index: 100;\r\n pointer-events: none;\r\n left: 0;\r\n top: 0;\r\n opacity: 0;\r\n transition: opacity 0.08s;\r\n`;\r\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\r\nimport React, { useState } from 'react';\r\nimport { ItemTooltip } from './ItemTooltip';\r\nimport { MobileItemTooltip } from './MobileItemTooltip';\r\n\r\ninterface IItemInfoWrapperProps {\r\n item: IItem;\r\n children: React.ReactNode;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n equipmentSet?: IEquipmentSet | null;\r\n scale?: number;\r\n}\r\n\r\nexport const ItemInfoWrapper: React.FC<IItemInfoWrapperProps> = ({\r\n children,\r\n atlasIMG,\r\n atlasJSON,\r\n item,\r\n equipmentSet,\r\n scale,\r\n}) => {\r\n const [isTooltipVisible, setIsTooltipVisible] = useState(false);\r\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\r\n\r\n return (\r\n <div\r\n onMouseEnter={() => {\r\n if (!isTooltipMobileVisible) setIsTooltipVisible(true);\r\n }}\r\n onMouseLeave={setIsTooltipVisible.bind(null, false)}\r\n onTouchEnd={() => {\r\n setIsTooltipMobileVisible(true);\r\n setIsTooltipVisible(false);\r\n }}\r\n >\r\n {children}\r\n\r\n {isTooltipVisible && !isTooltipMobileVisible && (\r\n <ItemTooltip\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n item={item}\r\n />\r\n )}\r\n {isTooltipMobileVisible && (\r\n <MobileItemTooltip\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n closeTooltip={() => {\r\n setIsTooltipMobileVisible(false);\r\n console.log('close');\r\n }}\r\n item={item}\r\n scale={scale}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n","import {\r\n ICraftableItem,\r\n IEquipmentSet,\r\n IItemContainer,\r\n ISkill,\r\n} from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { countItemFromInventory } from '../../libs/itemCounter';\r\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\n\r\ninterface ICraftingRecipeProps {\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n equipmentSet?: IEquipmentSet | null;\r\n recipe: ICraftableItem;\r\n scale?: number;\r\n handleRecipeSelect: () => void;\r\n selectedCraftItemKey?: string;\r\n inventory?: IItemContainer | null;\r\n skills?: ISkill | null;\r\n}\r\n\r\nexport const CraftingRecipe: React.FC<ICraftingRecipeProps> = ({\r\n atlasIMG,\r\n atlasJSON,\r\n equipmentSet,\r\n recipe,\r\n scale,\r\n handleRecipeSelect,\r\n selectedCraftItemKey,\r\n inventory,\r\n skills,\r\n}) => {\r\n const modifyString = (str: string) => {\r\n // Split the string by \"/\" and \".\"\r\n let parts = str.split('/');\r\n let fileName = parts[parts.length - 1];\r\n parts = fileName.split('.');\r\n let name = parts[0];\r\n\r\n // Replace all occurrences of \"-\" with \" \"\r\n name = name.replace(/-/g, ' ');\r\n\r\n // Uppercase the first word\r\n let words = name.split(' ');\r\n let firstWord = words[0].slice(0, 1).toUpperCase() + words[0].slice(1);\r\n let modifiedWords = [firstWord].concat(words.slice(1));\r\n name = modifiedWords.join(' ');\r\n\r\n return name;\r\n };\r\n\r\n const levelInSkill =\r\n (skills?.[\r\n (recipe?.minCraftingRequirements?.[0] ?? '') as keyof ISkill\r\n ] as any)?.level ?? 1;\r\n\r\n return (\r\n <RadioOptionsWrapper>\r\n <SpriteAtlasWrapper>\r\n <ItemInfoWrapper\r\n item={recipe}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n scale={scale}\r\n >\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={recipe.texturePath}\r\n imgScale={3}\r\n grayScale={!recipe.canCraft}\r\n />\r\n </ItemInfoWrapper>\r\n </SpriteAtlasWrapper>\r\n <div>\r\n <div onPointerUp={recipe.canCraft ? handleRecipeSelect : undefined}>\r\n <input\r\n className=\"rpgui-radio\"\r\n type=\"radio\"\r\n value={recipe.name}\r\n name=\"test\"\r\n disabled={!recipe.canCraft}\r\n checked={selectedCraftItemKey === recipe.key}\r\n onChange={handleRecipeSelect}\r\n />\r\n <label style={{ display: 'flex', alignItems: 'center' }}>\r\n {modifyString(recipe.name)}\r\n </label>\r\n </div>\r\n\r\n <MinCraftingRequirementsText levelIsOk={recipe?.levelIsOk ?? false}>\r\n {modifyString(`${recipe?.minCraftingRequirements?.[0] ?? ''}`)} lvl{' '}\r\n {recipe?.minCraftingRequirements?.[1] ?? 0} ({levelInSkill})\r\n </MinCraftingRequirementsText>\r\n\r\n {recipe.ingredients.map((ingredient, index) => {\r\n const itemQtyInInventory = !inventory\r\n ? 0\r\n : countItemFromInventory(ingredient.key, inventory);\r\n\r\n return (\r\n <Recipe key={index}>\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={ingredient.texturePath}\r\n imgScale={1.2}\r\n />\r\n <Ingredient isQuantityOk={ingredient.qty <= itemQtyInInventory}>\r\n {modifyString(ingredient.key)} x{ingredient.qty} (\r\n {itemQtyInInventory})\r\n </Ingredient>\r\n </Recipe>\r\n );\r\n })}\r\n </div>\r\n </RadioOptionsWrapper>\r\n );\r\n};\r\n\r\nconst Ingredient = styled.p<{ isQuantityOk: boolean }>`\r\n margin: 0;\r\n margin-left: 14px;\r\n color: ${({ isQuantityOk }) =>\r\n isQuantityOk ? uiColors.lightGreen : uiColors.lightGray} !important;\r\n`;\r\n\r\nconst Recipe = styled.div`\r\n font-size: 0.6rem;\r\n margin-bottom: 3px;\r\n display: flex;\r\n align-items: center;\r\n margin-left: 4px;\r\n\r\n .sprite-from-atlas-img {\r\n top: 0px;\r\n left: 0px;\r\n }\r\n`;\r\n\r\nconst SpriteAtlasWrapper = styled.div`\r\n margin-right: 40px;\r\n`;\r\n\r\nconst RadioOptionsWrapper = styled.div`\r\n display: flex;\r\n align-items: stretch;\r\n margin-bottom: 40px;\r\n`;\r\n\r\nconst MinCraftingRequirementsText = styled.p<{ levelIsOk: boolean }>`\r\n font-size: 0.6rem !important;\r\n margin: 0 5px 0 35px;\r\n color: ${({ levelIsOk }) =>\r\n levelIsOk ? uiColors.lightGreen : uiColors.lightGray} !important;\r\n`;\r\n","import {\r\n ICraftableItem,\r\n IEquipmentSet,\r\n IItemContainer,\r\n ISkill,\r\n ItemSubType,\r\n} from '@rpg-engine/shared';\r\nimport React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { InputRadio } from '../InputRadio';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { CraftingRecipe } from './CraftingRecipe';\r\n\r\nexport interface IItemCraftSelectorProps {\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n onClose: () => void;\r\n onSelect: (value: string) => void;\r\n onCraftItem: (value: string | undefined) => void;\r\n craftablesItems: ICraftableItem[];\r\n equipmentSet?: IEquipmentSet | null;\r\n inventory?: IItemContainer | null;\r\n scale?: number;\r\n skills?: ISkill | null;\r\n savedSelectedType?: string;\r\n}\r\n\r\nexport interface ShowMessage {\r\n show: boolean;\r\n index: number;\r\n}\r\n\r\nconst desktop = {\r\n width: 'min(900px, 80%)',\r\n height: 'min(700px, 80%)',\r\n};\r\n\r\nconst mobileLanscape = {\r\n width: '800px',\r\n height: '500px',\r\n};\r\n\r\nconst mobilePortrait = {\r\n width: '500px',\r\n height: '700px',\r\n};\r\n\r\nexport const CraftBook: React.FC<IItemCraftSelectorProps> = ({\r\n atlasIMG,\r\n atlasJSON,\r\n onClose,\r\n onSelect,\r\n onCraftItem,\r\n craftablesItems,\r\n equipmentSet,\r\n scale,\r\n inventory,\r\n skills,\r\n savedSelectedType,\r\n}) => {\r\n const [craftItemKey, setCraftItemKey] = useState<string>();\r\n const [selectedType, setSelectedType] = useState<string>(\r\n savedSelectedType ?? Object.keys(ItemSubType)[0]\r\n );\r\n const [size, setSize] = useState<{ width: string; height: string }>();\r\n\r\n useEffect(() => {\r\n const handleResize = (): void => {\r\n if (\r\n window.innerWidth < 500 &&\r\n size?.width !== mobilePortrait.width &&\r\n (!scale || scale < 1)\r\n ) {\r\n setSize(mobilePortrait);\r\n } else if (\r\n (!scale || scale < 1) &&\r\n size?.width !== mobileLanscape.width\r\n ) {\r\n setSize(mobileLanscape);\r\n } else if (size?.width !== desktop.width) {\r\n setSize(desktop);\r\n }\r\n };\r\n handleResize();\r\n\r\n window.addEventListener('resize', handleResize);\r\n\r\n return () => window.removeEventListener('resize', handleResize);\r\n }, [scale]);\r\n\r\n const renderItemTypes = () => {\r\n const itemTypes = ['Suggested', ...Object.keys(ItemSubType)]\r\n .filter(type => type !== 'DeadBody')\r\n .sort((a, b) => {\r\n if (a === 'Suggested') return -1;\r\n if (b === 'Suggested') return 1;\r\n return a.localeCompare(b);\r\n });\r\n\r\n if (window.innerWidth > parseInt(mobilePortrait.width)) {\r\n return itemTypes.map(type => {\r\n return (\r\n <InputRadio\r\n key={type}\r\n value={type}\r\n label={type}\r\n name={type}\r\n isChecked={selectedType === type}\r\n onRadioSelect={value => {\r\n setSelectedType(value);\r\n onSelect(value);\r\n }}\r\n />\r\n );\r\n });\r\n }\r\n\r\n const rows: JSX.Element[][] = [[], []];\r\n\r\n itemTypes.forEach((type, index) => {\r\n let row = 0;\r\n\r\n if (index % 2 === 1) row = 1;\r\n\r\n rows[row].push(\r\n <InputRadio\r\n key={type}\r\n value={type}\r\n label={type}\r\n name={type}\r\n isChecked={selectedType === type}\r\n onRadioSelect={value => {\r\n setSelectedType(value);\r\n onSelect(value);\r\n }}\r\n />\r\n );\r\n });\r\n\r\n return rows.map((row, index) => (\r\n <div key={index} style={{ display: 'flex', gap: '10px' }}>\r\n {row}\r\n </div>\r\n ));\r\n };\r\n\r\n if (!size) return null;\r\n\r\n return (\r\n <DraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n width={size.width}\r\n height={size.height}\r\n cancelDrag=\".inputRadioCraftBook\"\r\n onCloseButton={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n scale={scale}\r\n >\r\n <Wrapper>\r\n <div style={{ width: '100%' }}>\r\n <Title>Craftbook</Title>\r\n <Subtitle>Select an item to craft</Subtitle>\r\n <hr className=\"golden\" />\r\n </div>\r\n\r\n <ContentContainer>\r\n <ItemTypes className=\"inputRadioCraftBook\">\r\n {renderItemTypes()}\r\n </ItemTypes>\r\n\r\n <RadioInputScroller className=\"inputRadioCraftBook\">\r\n {craftablesItems?.map(item => (\r\n <CraftingRecipe\r\n key={item.key}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n recipe={item}\r\n scale={scale}\r\n handleRecipeSelect={setCraftItemKey.bind(null, item.key)}\r\n selectedCraftItemKey={craftItemKey}\r\n inventory={inventory}\r\n skills={skills}\r\n />\r\n ))}\r\n </RadioInputScroller>\r\n </ContentContainer>\r\n <ButtonWrapper>\r\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\r\n Cancel\r\n </Button>\r\n <Button\r\n disabled={!craftItemKey}\r\n buttonType={ButtonTypes.RPGUIButton}\r\n onPointerDown={() => onCraftItem(craftItemKey)}\r\n >\r\n Craft\r\n </Button>\r\n </ButtonWrapper>\r\n </Wrapper>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst Wrapper = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n width: 100%;\r\n height: 100%;\r\n`;\r\n\r\nconst Title = styled.h1`\r\n font-size: 0.6rem;\r\n color: ${uiColors.yellow} !important;\r\n`;\r\n\r\nconst Subtitle = styled.h1`\r\n font-size: 0.4rem;\r\n color: ${uiColors.yellow} !important;\r\n`;\r\n\r\nconst RadioInputScroller = styled.div`\r\n padding-left: 15px;\r\n padding-top: 10px;\r\n margin-top: 1rem;\r\n align-items: center;\r\n align-items: flex-start;\r\n overflow-y: scroll;\r\n min-height: 0;\r\n flex: 1;\r\n margin-left: 10px;\r\n -webkit-overflow-scrolling: touch;\r\n\r\n @media (max-width: ${mobilePortrait.width}) {\r\n margin-left: 0;\r\n }\r\n`;\r\n\r\nconst ButtonWrapper = styled.div`\r\n display: flex;\r\n justify-content: flex-end;\r\n margin-top: 10px;\r\n width: 100%;\r\n\r\n button {\r\n padding: 0px 50px;\r\n margin: 5px;\r\n }\r\n\r\n @media (max-width: ${mobilePortrait.width}) {\r\n justify-content: center;\r\n }\r\n`;\r\n\r\nconst ContentContainer = styled.div`\r\n display: flex;\r\n width: 100%;\r\n min-height: 0;\r\n flex: 1;\r\n\r\n @media (max-width: ${mobilePortrait.width}) {\r\n flex-direction: column;\r\n }\r\n`;\r\n\r\nconst ItemTypes = styled.div`\r\n display: flex;\r\n overflow-y: scroll;\r\n overflow-x: hidden;\r\n width: max-content;\r\n flex-direction: column;\r\n padding-right: 5px;\r\n\r\n @media (max-width: ${mobilePortrait.width}) {\r\n overflow-x: scroll;\r\n overflow-y: hidden;\r\n padding-right: 0;\r\n width: 100%;\r\n }\r\n`;\r\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport interface IOptionsProps {\n id: number;\n value: string;\n option: string | JSX.Element;\n}\n\nexport interface IDropdownProps {\n options: IOptionsProps[];\n width?: string;\n onChange: (value: string) => void;\n}\n\nexport const Dropdown: React.FC<IDropdownProps> = ({\n options,\n width,\n onChange,\n}) => {\n const dropdownId = uuidv4();\n\n const [selectedValue, setSelectedValue] = useState<string>('');\n const [selectedOption, setSelectedOption] = useState<string | JSX.Element>(\n ''\n );\n const [opened, setOpened] = useState<boolean>(false);\n\n useEffect(() => {\n const firstOption = options[0];\n\n if (firstOption) {\n let change = !selectedValue;\n if (!change) {\n change = options.filter((o) => o.value === selectedValue).length < 1;\n }\n\n /**\n * make a selection if there is no selected value already present\n * or if there is a selected value but its not in new options\n */\n if (change) {\n setSelectedValue(firstOption.value);\n setSelectedOption(firstOption.option);\n }\n }\n }, [options]);\n\n useEffect(() => {\n if (selectedValue) {\n onChange(selectedValue);\n }\n }, [selectedValue]);\n\n return (\n <Container onMouseLeave={() => setOpened(false)} width={width}>\n <DropdownSelect\n id={`dropdown-${dropdownId}`}\n className=\"rpgui-dropdown-imp rpgui-dropdown-imp-header\"\n onPointerDown={() => setOpened((prev) => !prev)}\n >\n <label>▼</label> {selectedOption}\n </DropdownSelect>\n\n <DropdownOptions className=\"rpgui-dropdown-imp\" opened={opened}>\n {options.map((option) => {\n return (\n <li\n key={option.id}\n onPointerDown={() => {\n setSelectedValue(option.value);\n setSelectedOption(option.option);\n setOpened(false);\n }}\n >\n {option.option}\n </li>\n );\n })}\n </DropdownOptions>\n </Container>\n );\n};\n\nconst Container = styled.div<{ width: string | undefined }>`\n position: relative;\n width: ${(props) => props.width || '100%'};\n`;\n\nconst DropdownSelect = styled.p`\n width: 100%;\n box-sizing: border-box;\n`;\n\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n}>`\n position: absolute;\n width: 100%;\n display: ${(props) => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n @media (max-width: 768px) {\n padding: 8px 0;\n }\n`;\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\nimport { Dropdown } from './Dropdown';\r\n\r\ninterface IDropdownSelectorOption {\r\n id: string;\r\n name: string;\r\n}\r\n\r\nexport interface IDropdownSelectorContainer {\r\n onChange: (id: string) => void;\r\n options: IDropdownSelectorOption[];\r\n details?: string;\r\n title: string;\r\n}\r\n\r\nexport const DropdownSelectorContainer: React.FC<IDropdownSelectorContainer> = ({\r\n title,\r\n onChange,\r\n options,\r\n details,\r\n}) => {\r\n return (\r\n <div>\r\n <p>{title}</p>\r\n <Dropdown\r\n options={options.map((option, index) => ({\r\n option: option.name,\r\n value: option.id,\r\n id: index,\r\n }))}\r\n onChange={onChange}\r\n />\r\n <Details>{details}</Details>\r\n </div>\r\n );\r\n};\r\n\r\nconst Details = styled.p`\r\n font-size: ${uiFonts.size.xsmall} !important;\r\n`;\r\n","import {\r\n IEquipmentSet,\r\n IItem,\r\n IItemContainer,\r\n ItemContainerType,\r\n ItemSlotType,\r\n ItemType,\r\n} from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { IPosition } from '../../types/eventTypes';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { ItemSlot } from '../Item/Inventory/ItemSlot';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\n\r\nexport interface IEquipmentSetProps {\r\n equipmentSet: IEquipmentSet;\r\n onClose?: () => void;\r\n onItemClick?: (\r\n ItemType: ItemType,\r\n item: IItem,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onItemDragStart?: (\r\n item: IItem,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onItemDragEnd?: (quantity?: number) => void;\r\n onItemPlaceDrop?: (\r\n item: IItem | null,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onItemOutsideDrop?: (item: IItem, position: IPosition) => void;\r\n scale?: number;\r\n checkIfItemCanBeMoved: () => boolean;\r\n checkIfItemShouldDragEnd?: () => boolean;\r\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\r\n onSelected?: (optionId: string) => void;\r\n initialPosition?: { x: number; y: number };\r\n type: ItemContainerType | null;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n onPositionChangeEnd?: (position: IPosition) => void;\r\n onPositionChangeStart?: (position: IPosition) => void;\r\n}\r\n\r\nexport const EquipmentSet: React.FC<IEquipmentSetProps> = ({\r\n equipmentSet,\r\n onClose,\r\n onMouseOver,\r\n onSelected,\r\n onItemClick,\r\n atlasIMG,\r\n atlasJSON,\r\n onItemDragEnd,\r\n onItemDragStart,\r\n onItemPlaceDrop,\r\n onItemOutsideDrop,\r\n checkIfItemCanBeMoved,\r\n checkIfItemShouldDragEnd,\r\n scale,\r\n initialPosition,\r\n onPositionChangeEnd,\r\n onPositionChangeStart,\r\n}) => {\r\n const {\r\n neck,\r\n leftHand,\r\n ring,\r\n head,\r\n armor,\r\n legs,\r\n boot,\r\n inventory,\r\n rightHand,\r\n accessory,\r\n } = equipmentSet;\r\n\r\n const equipmentData = [\r\n neck,\r\n leftHand,\r\n ring,\r\n head,\r\n armor,\r\n legs,\r\n boot,\r\n inventory,\r\n rightHand,\r\n accessory,\r\n ];\r\n\r\n const equipmentMaskSlots = [\r\n ItemSlotType.Neck,\r\n ItemSlotType.LeftHand,\r\n ItemSlotType.Ring,\r\n ItemSlotType.Head,\r\n ItemSlotType.Torso,\r\n ItemSlotType.Legs,\r\n ItemSlotType.Feet,\r\n ItemSlotType.Inventory,\r\n ItemSlotType.RightHand,\r\n ItemSlotType.Accessory,\r\n ];\r\n\r\n const onRenderEquipmentSlotRange = (start: number, end: number) => {\r\n const equipmentRange = equipmentData.slice(start, end);\r\n const slotMaksRange = equipmentMaskSlots.slice(start, end);\r\n\r\n return equipmentRange.map((data, i) => {\r\n const item = data as IItem;\r\n const itemContainer =\r\n (item && (item.itemContainer as IItemContainer)) ?? null;\r\n\r\n return (\r\n <ItemSlot\r\n key={i}\r\n slotIndex={i}\r\n item={item}\r\n itemContainer={itemContainer}\r\n itemContainerType={ItemContainerType.Equipment}\r\n slotSpriteMask={slotMaksRange[i]}\r\n onMouseOver={(event, slotIndex, item) => {\r\n if (onMouseOver) onMouseOver(event, slotIndex, item);\r\n }}\r\n onPointerDown={(itemType, ContainerType) => {\r\n if (onItemClick) onItemClick(itemType, item, ContainerType);\r\n }}\r\n onSelected={(optionId: string) => {\r\n if (onSelected) onSelected(optionId);\r\n }}\r\n onDragStart={(item, slotIndex, itemContainerType) => {\r\n if (!item) {\r\n return;\r\n }\r\n\r\n if (onItemDragStart)\r\n onItemDragStart(item, slotIndex, itemContainerType);\r\n }}\r\n onDragEnd={quantity => {\r\n if (onItemDragEnd) onItemDragEnd(quantity);\r\n }}\r\n dragScale={scale}\r\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\r\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\r\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\r\n if (onItemPlaceDrop)\r\n onItemPlaceDrop(item, slotIndex, itemContainerType);\r\n }}\r\n onOutsideDrop={(item, position) => {\r\n if (onItemOutsideDrop) onItemOutsideDrop(item, position);\r\n }}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n );\r\n });\r\n };\r\n\r\n return (\r\n <DraggableContainer\r\n title={'Equipments'}\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) onClose();\r\n }}\r\n width=\"330px\"\r\n cancelDrag=\".equipment-container-body\"\r\n scale={scale}\r\n initialPosition={initialPosition}\r\n onPositionChangeEnd={onPositionChangeEnd}\r\n onPositionChangeStart={onPositionChangeStart}\r\n >\r\n <EquipmentSetContainer className=\"equipment-container-body\">\r\n <EquipmentColumn>{onRenderEquipmentSlotRange(0, 3)}</EquipmentColumn>\r\n <EquipmentColumn>{onRenderEquipmentSlotRange(3, 7)}</EquipmentColumn>\r\n <EquipmentColumn>{onRenderEquipmentSlotRange(7, 10)}</EquipmentColumn>\r\n </EquipmentSetContainer>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst EquipmentSetContainer = styled.div`\r\n width: inherit;\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n touch-action: none;\r\n`;\r\n\r\nconst EquipmentColumn = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\r\n flex-direction: column;\r\n touch-action: none;\r\n`;\r\n","import React from 'react';\r\nimport { IPosition } from '../../types/eventTypes';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\n\r\ninterface IProps {\r\n children: React.ReactNode;\r\n title: string;\r\n onClose?: () => void;\r\n onPositionChange?: (position: IPosition) => void;\r\n onPositionChangeEnd?: (position: IPosition) => void;\r\n onPositionChangeStart?: (position: IPosition) => void;\r\n onOutsideClick?: () => void;\r\n initialPosition?: IPosition;\r\n scale?: number;\r\n}\r\n\r\nexport const SlotsContainer: React.FC<IProps> = ({\r\n children,\r\n title,\r\n onClose,\r\n onPositionChange,\r\n onPositionChangeEnd,\r\n onPositionChangeStart,\r\n onOutsideClick,\r\n initialPosition,\r\n scale,\r\n}) => {\r\n return (\r\n <DraggableContainer\r\n title={title}\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n width=\"400px\"\r\n cancelDrag=\".item-container-body, #shortcuts_list\"\r\n onPositionChange={({ x, y }) => {\r\n if (onPositionChange) {\r\n onPositionChange({ x, y });\r\n }\r\n }}\r\n onPositionChangeEnd={({ x, y }) => {\r\n if (onPositionChangeEnd) {\r\n onPositionChangeEnd({ x, y });\r\n }\r\n }}\r\n onPositionChangeStart={({ x, y }) => {\r\n if (onPositionChangeStart) {\r\n onPositionChangeStart({ x, y });\r\n }\r\n }}\r\n onOutsideClick={onOutsideClick}\r\n initialPosition={initialPosition}\r\n scale={scale}\r\n >\r\n {children}\r\n </DraggableContainer>\r\n );\r\n};\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\r\nimport pressSpaceGif from './img/space.gif';\r\nimport { NPCDialogText } from './NPCDialogText';\r\n\r\nexport enum ImgSide {\r\n right = 'right',\r\n left = 'left',\r\n}\r\n\r\nexport interface NPCMultiDialogType {\r\n text: string;\r\n imagePath?: string;\r\n imageSide: ImgSide;\r\n}\r\n\r\nexport interface INPCMultiDialogProps {\r\n onClose: () => void;\r\n textAndTypeArray: NPCMultiDialogType[];\r\n}\r\n\r\nexport const NPCMultiDialog: React.FC<INPCMultiDialogProps> = ({\r\n onClose,\r\n textAndTypeArray,\r\n}) => {\r\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\r\n false\r\n );\r\n const [slide, setSlide] = useState<number>(0);\r\n\r\n const onHandleSpacePress = (event: KeyboardEvent) => {\r\n if (event.code === 'Space') {\r\n if (slide < textAndTypeArray?.length - 1) {\r\n setSlide(prev => prev + 1);\r\n } else {\r\n // if there's no more text chunks, close the dialog\r\n onClose();\r\n }\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n document.addEventListener('keydown', onHandleSpacePress);\r\n\r\n return () => document.removeEventListener('keydown', onHandleSpacePress);\r\n }, [slide]);\r\n\r\n return (\r\n <RPGUIContainer\r\n type={RPGUIContainerTypes.FramedGold}\r\n width={'50%'}\r\n height={'180px'}\r\n >\r\n <>\r\n <Container>\r\n {textAndTypeArray[slide]?.imageSide === 'right' && (\r\n <>\r\n <TextContainer flex={'70%'}>\r\n <NPCDialogText\r\n onStartStep={() => setShowGoNextIndicator(false)}\r\n onEndStep={() => setShowGoNextIndicator(true)}\r\n text={textAndTypeArray[slide].text || 'No text provided.'}\r\n onClose={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n />\r\n </TextContainer>\r\n <ThumbnailContainer>\r\n <NPCThumbnail\r\n src={\r\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\r\n }\r\n />\r\n </ThumbnailContainer>\r\n {showGoNextIndicator && (\r\n <PressSpaceIndicator right={'10.5rem'} src={pressSpaceGif} />\r\n )}\r\n </>\r\n )}\r\n {textAndTypeArray[slide].imageSide === 'left' && (\r\n <>\r\n <ThumbnailContainer>\r\n <NPCThumbnail\r\n src={\r\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\r\n }\r\n />\r\n </ThumbnailContainer>\r\n <TextContainer flex={'70%'}>\r\n <NPCDialogText\r\n onStartStep={() => setShowGoNextIndicator(false)}\r\n onEndStep={() => setShowGoNextIndicator(true)}\r\n text={textAndTypeArray[slide].text || 'No text provided.'}\r\n onClose={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n />\r\n </TextContainer>\r\n {showGoNextIndicator && (\r\n <PressSpaceIndicator right={'1rem'} src={pressSpaceGif} />\r\n )}\r\n </>\r\n )}\r\n </Container>\r\n )\r\n </>\r\n </RPGUIContainer>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n display: flex;\r\n width: 100%;\r\n height: 100%;\r\n\r\n box-sizing: border-box;\r\n justify-content: center;\r\n align-items: flex-start;\r\n position: relative;\r\n`;\r\n\r\ninterface ITextContainerProps {\r\n flex: string;\r\n}\r\n\r\nconst TextContainer = styled.div<ITextContainerProps>`\r\n flex: ${({ flex }) => flex} 0 0;\r\n width: 355px;\r\n`;\r\n\r\nconst ThumbnailContainer = styled.div`\r\n flex: 30% 0 0;\r\n display: flex;\r\n justify-content: flex-end;\r\n`;\r\n\r\nconst NPCThumbnail = styled.img`\r\n image-rendering: pixelated;\r\n height: 128px;\r\n width: 128px;\r\n`;\r\n\r\ninterface IPressSpaceIndicatorProps {\r\n right: string;\r\n}\r\n\r\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\r\n position: absolute;\r\n right: ${({ right }) => right};\r\n bottom: 1rem;\r\n height: 20.7px;\r\n image-rendering: -webkit-optimize-contrast;\r\n`;\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { Button, ButtonTypes } from '../../Button';\r\nimport { Input } from '../../Input';\r\nimport { RPGUIContainer, RPGUIContainerTypes } from '../../RPGUIContainer';\r\nimport { RangeSlider, RangeSliderType } from '../../RangeSlider';\r\n\r\nexport interface IItemQuantitySelectorProps {\r\n quantity: number;\r\n onConfirm: (quantity: number) => void;\r\n onClose: () => void;\r\n}\r\n\r\nexport const ItemQuantitySelector: React.FC<IItemQuantitySelectorProps> = ({\r\n quantity,\r\n onConfirm,\r\n onClose,\r\n}) => {\r\n const [value, setValue] = useState(quantity);\r\n\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n\r\n useEffect(() => {\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n inputRef.current.select();\r\n\r\n const closeSelector = (e: KeyboardEvent) => {\r\n if (e.key === 'Escape') {\r\n onClose();\r\n }\r\n };\r\n\r\n document.addEventListener('keydown', closeSelector);\r\n\r\n return () => {\r\n document.removeEventListener('keydown', closeSelector);\r\n };\r\n }\r\n\r\n return () => {};\r\n }, []);\r\n\r\n return (\r\n <StyledContainer type={RPGUIContainerTypes.Framed} width=\"25rem\">\r\n <CloseButton className=\"container-close\" onPointerDown={onClose}>\r\n X\r\n </CloseButton>\r\n <h2>Select quantity to move</h2>\r\n <StyledForm\r\n style={{ width: '100%' }}\r\n onSubmit={e => {\r\n e.preventDefault();\r\n\r\n const numberValue = Number(value);\r\n\r\n if (Number.isNaN(numberValue)) {\r\n return;\r\n }\r\n\r\n onConfirm(Math.max(1, Math.min(quantity, numberValue)));\r\n }}\r\n noValidate\r\n >\r\n <StyledInput\r\n innerRef={inputRef}\r\n placeholder=\"Enter quantity\"\r\n type=\"number\"\r\n min={1}\r\n max={quantity}\r\n value={value}\r\n onChange={e => {\r\n if (Number(e.target.value) >= quantity) {\r\n setValue(quantity);\r\n return;\r\n }\r\n\r\n setValue((e.target.value as unknown) as number);\r\n }}\r\n onBlur={e => {\r\n const newValue = Math.max(\r\n 1,\r\n Math.min(quantity, Number(e.target.value))\r\n );\r\n\r\n setValue(newValue);\r\n }}\r\n />\r\n <RangeSlider\r\n type={RangeSliderType.Slider}\r\n valueMin={1}\r\n valueMax={quantity}\r\n width=\"100%\"\r\n onChange={setValue}\r\n value={value}\r\n />\r\n <Button buttonType={ButtonTypes.RPGUIButton} type=\"submit\">\r\n Confirm\r\n </Button>\r\n </StyledForm>\r\n </StyledContainer>\r\n );\r\n};\r\n\r\nconst StyledContainer = styled(RPGUIContainer)`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n`;\r\n\r\nconst StyledForm = styled.form`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n width: 100%;\r\n`;\r\nconst StyledInput = styled(Input)`\r\n text-align: center;\r\n\r\n &::-webkit-outer-spin-button,\r\n &::-webkit-inner-spin-button {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n }\r\n\r\n &[type='number'] {\r\n -moz-appearance: textfield;\r\n }\r\n`;\r\n\r\nconst CloseButton = styled.div`\r\n position: absolute;\r\n top: 3px;\r\n right: 0px;\r\n color: white;\r\n z-index: 22;\r\n font-size: 0.8rem;\r\n`;\r\n","import {\r\n getItemTextureKeyPath,\r\n IItem,\r\n IRawSpell,\r\n IShortcut,\r\n ShortcutType,\r\n} from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\n\r\ntype ShortcutsSetterProps = {\r\n setSettingShortcutIndex: (index: number) => void;\r\n settingShortcutIndex: number;\r\n shortcuts: IShortcut[];\r\n removeShortcut: (index: number) => void;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n};\r\n\r\nexport const ShortcutsSetter: React.FC<ShortcutsSetterProps> = ({\r\n setSettingShortcutIndex,\r\n settingShortcutIndex,\r\n shortcuts,\r\n removeShortcut,\r\n atlasJSON,\r\n atlasIMG,\r\n}) => {\r\n const getContent = (index: number) => {\r\n if (shortcuts[index]?.type === ShortcutType.Item) {\r\n const payload = shortcuts[index]?.payload as IItem | undefined;\r\n\r\n if (!payload) return null;\r\n\r\n return (\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: payload.texturePath,\r\n texturePath: payload.texturePath,\r\n stackQty: payload.stackQty || 1,\r\n isStackable: payload.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n width={32}\r\n height={32}\r\n imgScale={1.6}\r\n imgStyle={{ left: '5px' }}\r\n />\r\n );\r\n }\r\n\r\n const payload = shortcuts[index]?.payload as IRawSpell | undefined;\r\n\r\n return <span>{payload?.magicWords.split(' ').map(word => word[0])}</span>;\r\n };\r\n\r\n return (\r\n <Container>\r\n <p>Shortcuts:</p>\r\n <List id=\"shortcuts_list\">\r\n {Array.from({ length: 6 }).map((_, i) => (\r\n <Shortcut\r\n key={i}\r\n onPointerDown={() => {\r\n if (settingShortcutIndex !== -1) setSettingShortcutIndex(-1);\r\n\r\n removeShortcut(i);\r\n if (\r\n settingShortcutIndex === -1 &&\r\n (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)\r\n )\r\n setSettingShortcutIndex(i);\r\n }}\r\n disabled={settingShortcutIndex !== -1 && settingShortcutIndex !== i}\r\n isBeingSet={settingShortcutIndex === i}\r\n id={`shortcutSetter_${i}`}\r\n >\r\n {getContent(i)}\r\n </Shortcut>\r\n ))}\r\n </List>\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n p {\r\n margin: 0;\r\n margin-left: 0.5rem;\r\n }\r\n`;\r\n\r\nconst Shortcut = styled.button<{ isBeingSet?: boolean }>`\r\n width: 2.6rem;\r\n height: 2.6rem;\r\n background-color: ${uiColors.lightGray};\r\n border: 2px solid\r\n ${({ isBeingSet }) => (isBeingSet ? uiColors.yellow : uiColors.darkGray)};\r\n border-radius: 50%;\r\n text-transform: uppercase;\r\n font-size: 0.7rem;\r\n font-weight: bold;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n\r\n span {\r\n margin-top: 4px;\r\n }\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: ${uiColors.darkGray};\r\n }\r\n\r\n &:active {\r\n background-color: ${uiColors.gray};\r\n }\r\n\r\n &:disabled {\r\n opacity: 0.5;\r\n }\r\n`;\r\n\r\nconst List = styled.div`\r\n width: 100%;\r\n display: flex;\r\n align-items: center;\r\n gap: 0.5rem;\r\n padding-bottom: 0.5rem;\r\n padding-left: 0.5rem;\r\n box-sizing: border-box;\r\n margin: 0 !important;\r\n`;\r\n","import {\r\n IEquipmentSet,\r\n IItem,\r\n IItemContainer,\r\n IShortcut,\r\n ItemContainerType,\r\n ItemType,\r\n} from '@rpg-engine/shared';\r\nimport React, { useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { SlotsContainer } from '../../Abstractions/SlotsContainer';\r\nimport { ItemQuantitySelector } from './ItemQuantitySelector';\r\n\r\nimport { IPosition } from '../../../types/eventTypes';\r\nimport ModalPortal from '../../Abstractions/ModalPortal';\r\nimport { ShortcutsSetter } from '../../Shortcuts/ShortcutsSetter';\r\nimport { ItemSlot } from './ItemSlot';\r\n\r\nexport interface IItemContainerProps {\r\n itemContainer: IItemContainer;\r\n onClose?: () => void;\r\n onItemClick?: (\r\n item: IItem,\r\n ItemType: IItem['type'],\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onItemDragStart?: (\r\n item: IItem,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onItemDragEnd?: (quantity?: number) => void;\r\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\r\n onItemPlaceDrop?: (\r\n item: IItem | null,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n scale?: number;\r\n checkIfItemCanBeMoved: () => boolean;\r\n checkIfItemShouldDragEnd?: () => boolean;\r\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\r\n onSelected?: (optionId: string, item: IItem) => void;\r\n type: ItemContainerType;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n disableContextMenu?: boolean;\r\n initialPosition?: { x: number; y: number };\r\n shortcuts?: IShortcut[];\r\n setItemShortcut?: (key: string, index: number) => void;\r\n removeShortcut?: (index: number) => void;\r\n equipmentSet?: IEquipmentSet | null;\r\n isDepotSystem?: boolean;\r\n onPositionChangeEnd?: (position: IPosition) => void;\r\n onPositionChangeStart?: (position: IPosition) => void;\r\n}\r\n\r\nexport const ItemContainer: React.FC<IItemContainerProps> = ({\r\n itemContainer,\r\n onClose,\r\n onMouseOver,\r\n onSelected,\r\n onItemClick,\r\n type,\r\n atlasJSON,\r\n atlasIMG,\r\n disableContextMenu = false,\r\n onItemDragEnd,\r\n onItemDragStart,\r\n onItemPlaceDrop,\r\n onOutsideDrop,\r\n checkIfItemCanBeMoved,\r\n initialPosition,\r\n checkIfItemShouldDragEnd,\r\n scale,\r\n shortcuts,\r\n setItemShortcut,\r\n removeShortcut,\r\n equipmentSet,\r\n isDepotSystem,\r\n onPositionChangeEnd,\r\n onPositionChangeStart,\r\n}) => {\r\n const [quantitySelect, setQuantitySelect] = useState({\r\n isOpen: false,\r\n maxQuantity: 1,\r\n callback: (_quantity: number) => {},\r\n });\r\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\r\n\r\n const handleSetShortcut = (item: IItem, index: number) => {\r\n if (item.type === ItemType.Consumable || item.type === ItemType.Tool) {\r\n setItemShortcut?.(item.key, index);\r\n }\r\n };\r\n\r\n const onRenderSlots = () => {\r\n const slots = [];\r\n\r\n for (let i = 0; i < itemContainer.slotQty; i++) {\r\n slots.push(\r\n <ItemSlot\r\n isContextMenuDisabled={disableContextMenu}\r\n key={i}\r\n slotIndex={i}\r\n item={itemContainer.slots?.[i] || null}\r\n itemContainerType={type}\r\n onMouseOver={(event, slotIndex, item) => {\r\n if (onMouseOver) onMouseOver(event, slotIndex, item);\r\n }}\r\n onPointerDown={(itemType, containerType, item) => {\r\n if (settingShortcutIndex !== -1) {\r\n setSettingShortcutIndex(-1);\r\n\r\n handleSetShortcut(item, settingShortcutIndex);\r\n } else if (onItemClick) onItemClick(item, itemType, containerType);\r\n }}\r\n onSelected={(optionId: string, item: IItem) => {\r\n if (onSelected) onSelected(optionId, item);\r\n }}\r\n onDragStart={(item, slotIndex, itemContainerType) => {\r\n if (onItemDragStart)\r\n onItemDragStart(item, slotIndex, itemContainerType);\r\n }}\r\n onDragEnd={quantity => {\r\n if (onItemDragEnd) onItemDragEnd(quantity);\r\n }}\r\n dragScale={scale}\r\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\r\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\r\n openQuantitySelector={(maxQuantity, callback) => {\r\n setQuantitySelect({\r\n isOpen: true,\r\n maxQuantity,\r\n callback,\r\n });\r\n }}\r\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\r\n if (onItemPlaceDrop)\r\n onItemPlaceDrop(item, slotIndex, itemContainerType);\r\n }}\r\n onOutsideDrop={(item, position) => {\r\n if (onOutsideDrop) onOutsideDrop(item, position);\r\n }}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n isSelectingShortcut={settingShortcutIndex !== -1}\r\n equipmentSet={equipmentSet}\r\n setItemShortcut={\r\n type === ItemContainerType.Inventory ? handleSetShortcut : undefined\r\n }\r\n isDepotSystem={isDepotSystem}\r\n />\r\n );\r\n }\r\n return slots;\r\n };\r\n\r\n return (\r\n <>\r\n <SlotsContainer\r\n title={itemContainer.name || 'Container'}\r\n onClose={onClose}\r\n initialPosition={initialPosition}\r\n scale={scale}\r\n onPositionChangeEnd={onPositionChangeEnd}\r\n onPositionChangeStart={onPositionChangeStart}\r\n >\r\n {type === ItemContainerType.Inventory &&\r\n shortcuts &&\r\n removeShortcut && (\r\n <ShortcutsSetter\r\n setSettingShortcutIndex={setSettingShortcutIndex}\r\n settingShortcutIndex={settingShortcutIndex}\r\n shortcuts={shortcuts}\r\n removeShortcut={removeShortcut}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n )}\r\n <ItemsContainer className=\"item-container-body\">\r\n {onRenderSlots()}\r\n </ItemsContainer>\r\n </SlotsContainer>\r\n {quantitySelect.isOpen && (\r\n <ModalPortal>\r\n <QuantitySelectorContainer>\r\n <ItemQuantitySelector\r\n quantity={quantitySelect.maxQuantity}\r\n onConfirm={quantity => {\r\n quantitySelect.callback(quantity);\r\n setQuantitySelect({\r\n isOpen: false,\r\n maxQuantity: 1,\r\n callback: () => {},\r\n });\r\n }}\r\n onClose={() => {\r\n quantitySelect.callback(-1);\r\n setQuantitySelect({\r\n isOpen: false,\r\n maxQuantity: 1,\r\n callback: () => {},\r\n });\r\n }}\r\n />\r\n </QuantitySelectorContainer>\r\n </ModalPortal>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nconst ItemsContainer = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nconst QuantitySelectorContainer = styled.div`\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100vw;\r\n height: 100vh;\r\n z-index: 100;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n`;\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\n\r\nexport interface IOptionsItemSelectorProps {\r\n name: string;\r\n description?: string;\r\n imageKey: string;\r\n}\r\n\r\nexport interface IItemSelectorProps {\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n options: IOptionsItemSelectorProps[];\r\n onClose: () => void;\r\n onSelect: (value: string) => void;\r\n}\r\n\r\nexport const ItemSelector: React.FC<IItemSelectorProps> = ({\r\n atlasIMG,\r\n atlasJSON,\r\n options,\r\n onClose,\r\n onSelect,\r\n}) => {\r\n const [selectedValue, setSelectedValue] = useState<string>();\r\n\r\n const handleClick = () => {\r\n let element = document.querySelector(\r\n `input[name='test']:checked`\r\n ) as HTMLInputElement;\r\n const elementValue = element.value;\r\n setSelectedValue(elementValue);\r\n };\r\n\r\n useEffect(() => {\r\n if (selectedValue) {\r\n onSelect(selectedValue);\r\n }\r\n }, [selectedValue]);\r\n return (\r\n <DraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n width=\"500px\"\r\n cancelDrag=\".equipment-container-body .arrow-selector\"\r\n onCloseButton={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n >\r\n <div style={{ width: '100%' }}>\r\n <Title>{'Harvesting instruments'}</Title>\r\n <Subtitle>{'Use the tool, you need it'}</Subtitle>\r\n <hr className=\"golden\" />\r\n </div>\r\n\r\n <RadioInputScroller>\r\n {options?.map((option, index) => (\r\n <RadioOptionsWrapper key={index}>\r\n <SpriteAtlasWrapper>\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={option.imageKey}\r\n imgScale={3}\r\n />\r\n </SpriteAtlasWrapper>\r\n <div>\r\n <input\r\n className=\"rpgui-radio\"\r\n type=\"radio\"\r\n value={option.name}\r\n name=\"test\"\r\n />\r\n <label\r\n onPointerDown={handleClick}\r\n style={{ display: 'flex', alignItems: 'center' }}\r\n >\r\n {option.name} <br />\r\n {option.description}\r\n </label>\r\n </div>\r\n </RadioOptionsWrapper>\r\n ))}\r\n </RadioInputScroller>\r\n <ButtonWrapper>\r\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\r\n Cancel\r\n </Button>\r\n <Button buttonType={ButtonTypes.RPGUIButton}>Select</Button>\r\n </ButtonWrapper>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst Title = styled.h1`\r\n font-size: 0.6rem;\r\n color: yellow !important;\r\n`;\r\nconst Subtitle = styled.h1`\r\n font-size: 0.4rem;\r\n color: yellow !important;\r\n`;\r\n\r\nconst RadioInputScroller = styled.div`\r\n padding-left: 15px;\r\n padding-top: 10px;\r\n width: 100%;\r\n margin-top: 1rem;\r\n align-items: center;\r\n margin-left: 20px;\r\n align-items: flex-start;\r\n overflow-y: scroll;\r\n height: 360px;\r\n`;\r\n\r\nconst SpriteAtlasWrapper = styled.div`\r\n margin-right: 40px;\r\n`;\r\n\r\nconst RadioOptionsWrapper = styled.div`\r\n display: flex;\r\n align-items: stretch;\r\n margin-bottom: 40px;\r\n`;\r\n\r\nconst ButtonWrapper = styled.div`\r\n display: flex;\r\n justify-content: space-around;\r\n padding-top: 20px;\r\n width: 100%;\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\n\r\ninterface IListMenuOption {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nexport interface IListMenuProps {\r\n x: number;\r\n y: number;\r\n options: IListMenuOption[];\r\n onSelected: (selectedOptionId: string) => void;\r\n}\r\n\r\nexport const ListMenu: React.FC<IListMenuProps> = ({\r\n options,\r\n onSelected,\r\n x,\r\n y,\r\n}) => {\r\n return (\r\n <Container x={x} y={y}>\r\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\r\n {options.map((params, index) => (\r\n <ListElement\r\n key={params?.id || index}\r\n onPointerDown={() => {\r\n onSelected(params?.id);\r\n }}\r\n >\r\n {params?.text || 'No text'}\r\n </ListElement>\r\n ))}\r\n </ul>\r\n </Container>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n x?: number;\r\n y?: number;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n display: flex;\r\n flex-direction: column;\r\n width: 100%;\r\n justify-content: start;\r\n align-items: flex-start;\r\n position: absolute;\r\n top: ${props => props.y || 0}px;\r\n left: ${props => props.x || 0}px;\r\n\r\n li {\r\n font-size: ${uiFonts.size.xsmall};\r\n }\r\n`;\r\n\r\nconst ListElement = styled.li`\r\n margin-right: 0.5rem;\r\n`;\r\n","import {\r\n getItemTextureKeyPath,\r\n IEquipmentSet,\r\n IItem,\r\n} from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\r\nimport { Ellipsis } from '../shared/Ellipsis';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\n\r\nexport interface IMarketPlaceRowsPropos {\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n item: IItem;\r\n itemPrice: number;\r\n equipmentSet?: IEquipmentSet | null;\r\n scale?: number;\r\n onHandleClick: (value: string) => void;\r\n}\r\n\r\nexport const MarketplaceRows: React.FC<IMarketPlaceRowsPropos> = ({\r\n atlasJSON,\r\n atlasIMG,\r\n item,\r\n itemPrice,\r\n equipmentSet,\r\n scale,\r\n onHandleClick,\r\n}) => {\r\n return (\r\n <MarketPlaceWrapper>\r\n <ItemIconContainer>\r\n <SpriteContainer>\r\n <ItemInfoWrapper\r\n item={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n scale={scale}\r\n >\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: item.key,\r\n stackQty: item.stackQty || 1,\r\n texturePath: item.texturePath,\r\n isStackable: item.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n imgScale={2}\r\n />\r\n </ItemInfoWrapper>\r\n </SpriteContainer>\r\n <PriceValue>\r\n <p>\r\n <Ellipsis maxLines={1} maxWidth=\"150px\" fontSize=\"10px\">\r\n {item.name}\r\n </Ellipsis>\r\n </p>\r\n </PriceValue>\r\n </ItemIconContainer>\r\n <QuantityContainer>\r\n <QuantityDisplay>\r\n <TextOverlay>\r\n <Item>\r\n <Ellipsis maxLines={1} maxWidth=\"150px\" fontSize=\"10px\">\r\n {item.rarity}\r\n </Ellipsis>\r\n </Item>\r\n </TextOverlay>\r\n </QuantityDisplay>\r\n </QuantityContainer>\r\n <ItemIconContainer>\r\n <SpriteContainer>\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={'others/gold-coin-qty-4.png'}\r\n imgScale={2}\r\n />\r\n </SpriteContainer>\r\n <PriceValue>\r\n <p>\r\n <Ellipsis maxLines={1} maxWidth=\"150px\" fontSize=\"10px\">\r\n ${itemPrice}\r\n </Ellipsis>\r\n </p>\r\n </PriceValue>\r\n </ItemIconContainer>\r\n <ButtonContainer>\r\n <Button\r\n buttonType={ButtonTypes.RPGUIButton}\r\n onClick={() => onHandleClick(item.name)}\r\n >\r\n Buy\r\n </Button>\r\n </ButtonContainer>\r\n </MarketPlaceWrapper>\r\n );\r\n};\r\n\r\nconst MarketPlaceWrapper = styled.div`\r\n margin: auto;\r\n display: grid;\r\n grid-template-columns: 35% 20% 20% 25%;\r\n\r\n &:hover {\r\n background-color: ${uiColors.darkGray};\r\n }\r\n padding: 0.5rem;\r\n p {\r\n font-size: 0.8rem;\r\n }\r\n`;\r\n\r\nconst ItemIconContainer = styled.div`\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n`;\r\n\r\nconst SpriteContainer = styled.div`\r\n position: relative;\r\n top: -0.5rem;\r\n left: 0.5rem;\r\n`;\r\n\r\nconst Item = styled.span`\r\n color: white;\r\n text-align: center;\r\n z-index: 1;\r\n width: 100%;\r\n`;\r\n\r\nconst TextOverlay = styled.div`\r\n width: 100%;\r\n position: relative;\r\n`;\r\n\r\ninterface IContainerProps {\r\n percentageWidth?: number;\r\n minWidth?: number;\r\n style?: Record<string, any>;\r\n}\r\n\r\nconst QuantityContainer = styled.div<IContainerProps>`\r\n position: relative;\r\n display: flex;\r\n min-width: 100px;\r\n justify-content: center;\r\n align-items: center;\r\n`;\r\n\r\nconst QuantityDisplay = styled.div`\r\n font-size: ${uiFonts.size.small};\r\n`;\r\n\r\nconst PriceValue = styled.div`\r\n margin-left: 40px;\r\n`;\r\n\r\nconst ButtonContainer = styled.div`\r\n margin: auto;\r\n`;\r\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\r\nimport React, { ChangeEvent } from 'react';\r\nimport styled from 'styled-components';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { Dropdown, IOptionsProps } from '../Dropdown';\r\nimport { Input } from '../Input';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { MarketplaceRows } from './MarketplaceRows';\r\n\r\nexport interface IMarketPlaceProps {\r\n items: IItem[] | null;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n optionsType: IOptionsProps[];\r\n optionsRarity: IOptionsProps[];\r\n optionsPrice: IOptionsProps[];\r\n onClose: () => void;\r\n onChangeType: (value: string) => void;\r\n onChangeRarity: (value: string) => void;\r\n onChangeOrder: (value: string) => void;\r\n onChangeNameInput: (event: ChangeEvent<HTMLInputElement>) => void;\r\n scale?: number;\r\n equipmentSet?: IEquipmentSet | null;\r\n onHandleClick: (value: string) => void;\r\n}\r\n\r\nexport const Marketplace: React.FC<IMarketPlaceProps> = ({\r\n items,\r\n atlasIMG,\r\n atlasJSON,\r\n onClose,\r\n optionsType,\r\n optionsRarity,\r\n optionsPrice,\r\n onChangeType,\r\n onChangeRarity,\r\n onChangeOrder,\r\n onChangeNameInput,\r\n scale,\r\n equipmentSet,\r\n onHandleClick,\r\n}) => {\r\n return (\r\n <DraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) onClose();\r\n }}\r\n width=\"800px\"\r\n cancelDrag=\"#MarketContainer\"\r\n scale={scale}\r\n >\r\n <>\r\n <InputWrapper>\r\n <p> Search By Name</p>\r\n <Input onChange={onChangeNameInput} placeholder={'Search...'} />\r\n </InputWrapper>\r\n\r\n <WrapperContainer>\r\n <StyledDropdown\r\n options={optionsType}\r\n onChange={onChangeType}\r\n width={'220px'}\r\n />\r\n <StyledDropdown\r\n options={optionsRarity}\r\n onChange={onChangeRarity}\r\n width={'220px'}\r\n />\r\n <StyledDropdown\r\n options={optionsPrice}\r\n onChange={onChangeOrder}\r\n width={'220px'}\r\n />\r\n </WrapperContainer>\r\n <ItemComponentScrollWrapper id=\"MarketContainer\">\r\n {items?.map((item, index) => (\r\n <MarketplaceRows\r\n key={`${item.key}_${index}`}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n item={item}\r\n itemPrice={10}\r\n equipmentSet={equipmentSet}\r\n onHandleClick={onHandleClick}\r\n />\r\n ))}\r\n </ItemComponentScrollWrapper>\r\n </>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst InputWrapper = styled.div`\r\n width: 95%;\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n margin: auto;\r\n margin-bottom: 10px;\r\n p {\r\n width: auto;\r\n margin-right: 20px;\r\n }\r\n input {\r\n width: 68%;\r\n height: 10px;\r\n }\r\n`;\r\n\r\nconst WrapperContainer = styled.div`\r\n display: grid;\r\n grid-template-columns: 30% 30% 30%;\r\n justify-content: space-between;\r\n width: 90%;\r\n margin-left: 10px;\r\n .rpgui-content .rpgui-dropdown-imp-header {\r\n padding: 0px 10px 0 !important;\r\n }\r\n`;\r\n\r\nconst ItemComponentScrollWrapper = styled.div`\r\n overflow-y: scroll;\r\n height: 390px;\r\n width: 100%;\r\n margin-top: 1rem;\r\n`;\r\n\r\nconst StyledDropdown = styled(Dropdown)`\r\n margin: 3px !important;\r\n width: 170px !important;\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { NPCDialogText } from './NPCDialogText';\r\nimport {\r\n IQuestionDialog,\r\n IQuestionDialogAnswer,\r\n QuestionDialog,\r\n} from './QuestionDialog/QuestionDialog';\r\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\r\n\r\nexport enum NPCDialogType {\r\n TextOnly = 'TextOnly',\r\n TextAndThumbnail = 'TextAndThumbnail',\r\n}\r\n\r\nexport interface INPCDialogProps {\r\n text?: string;\r\n type: NPCDialogType;\r\n imagePath?: string;\r\n onClose?: () => void;\r\n isQuestionDialog?: boolean;\r\n answers?: IQuestionDialogAnswer[];\r\n questions?: IQuestionDialog[];\r\n}\r\n\r\nexport const NPCDialog: React.FC<INPCDialogProps> = ({\r\n text,\r\n type,\r\n onClose,\r\n imagePath,\r\n isQuestionDialog = false,\r\n questions,\r\n answers,\r\n}) => {\r\n return (\r\n <RPGUIContainer\r\n type={RPGUIContainerTypes.FramedGold}\r\n width={isQuestionDialog ? '600px' : '80%'}\r\n height={'180px'}\r\n >\r\n {isQuestionDialog && questions && answers ? (\r\n <>\r\n <TextContainer\r\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\r\n >\r\n <QuestionDialog\r\n questions={questions}\r\n answers={answers}\r\n onClose={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n />\r\n </TextContainer>\r\n {type === NPCDialogType.TextAndThumbnail && (\r\n <ThumbnailContainer>\r\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\r\n </ThumbnailContainer>\r\n )}\r\n </>\r\n ) : (\r\n <>\r\n <Container>\r\n <TextContainer\r\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\r\n >\r\n <NPCDialogText\r\n type={type}\r\n text={text || 'No text provided.'}\r\n onClose={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n />\r\n </TextContainer>\r\n {type === NPCDialogType.TextAndThumbnail && (\r\n <ThumbnailContainer>\r\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\r\n </ThumbnailContainer>\r\n )}\r\n </Container>\r\n </>\r\n )}\r\n </RPGUIContainer>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n display: flex;\r\n width: 100%;\r\n height: 100%;\r\n\r\n box-sizing: border-box;\r\n justify-content: center;\r\n align-items: flex-start;\r\n position: relative;\r\n`;\r\n\r\ninterface ITextContainerProps {\r\n flex: string;\r\n}\r\n\r\nconst TextContainer = styled.div<ITextContainerProps>`\r\n flex: ${({ flex }) => flex} 0 0;\r\n width: 355px;\r\n`;\r\n\r\nconst ThumbnailContainer = styled.div`\r\n flex: 30% 0 0;\r\n display: flex;\r\n justify-content: flex-end;\r\n`;\r\n\r\nconst NPCThumbnail = styled.img`\r\n image-rendering: pixelated;\r\n height: 128px;\r\n width: 128px;\r\n`;\r\n","import React from 'react';\r\n\r\n//@ts-ignore\r\nexport const useEventListener = (type, handler, el = window) => {\r\n const savedHandler = React.useRef();\r\n\r\n React.useEffect(() => {\r\n savedHandler.current = handler;\r\n }, [handler]);\r\n\r\n React.useEffect(() => {\r\n //@ts-ignore\r\n const listener = e => savedHandler.current(e);\r\n\r\n el.addEventListener(type, listener);\r\n\r\n return () => {\r\n el.removeEventListener(type, listener);\r\n };\r\n }, [type, el]);\r\n};\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\n\r\ninterface IProps {\r\n text: string;\r\n onFinish?: () => void;\r\n onStart?: () => void;\r\n}\r\n\r\nexport const DynamicText: React.FC<IProps> = ({ text, onFinish, onStart }) => {\r\n const [textState, setTextState] = useState<string>('');\r\n\r\n useEffect(() => {\r\n let i = 0;\r\n const interval = setInterval(() => {\r\n // on every interval, show one more character\r\n\r\n if (i === 0) {\r\n if (onStart) {\r\n onStart();\r\n }\r\n }\r\n\r\n if (i < text.length) {\r\n setTextState(text.substring(0, i + 1));\r\n i++;\r\n } else {\r\n clearInterval(interval);\r\n if (onFinish) {\r\n onFinish();\r\n }\r\n }\r\n }, 50);\r\n\r\n return () => {\r\n clearInterval(interval);\r\n };\r\n }, [text]);\r\n\r\n return <TextContainer>{textState}</TextContainer>;\r\n};\r\n\r\nconst TextContainer = styled.p`\r\n font-size: 0.7rem !important;\r\n color: white;\r\n text-shadow: 1px 1px 0px #000000;\r\n letter-spacing: 1.2px;\r\n word-break: normal;\r\n`;\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { useEventListener } from '../../../hooks/useEventListener';\r\nimport { DynamicText } from '../../typography/DynamicText';\r\n\r\nexport interface IQuestionDialogAnswer {\r\n id: number;\r\n text: string;\r\n nextQuestionId?: number;\r\n}\r\n\r\nexport interface IQuestionDialog {\r\n id: number;\r\n text: string;\r\n answerIds?: number[];\r\n}\r\n\r\nexport interface IProps {\r\n questions: IQuestionDialog[];\r\n answers: IQuestionDialogAnswer[];\r\n onClose: () => void;\r\n}\r\n\r\nexport const QuestionDialog: React.FC<IProps> = ({\r\n questions,\r\n answers,\r\n onClose,\r\n}) => {\r\n const [currentQuestion, setCurrentQuestion] = useState(questions[0]);\r\n\r\n const [canShowAnswers, setCanShowAnswers] = useState<boolean>(false);\r\n\r\n const onGetFirstAnswer = () => {\r\n if (!currentQuestion.answerIds || currentQuestion.answerIds.length === 0) {\r\n return null;\r\n }\r\n\r\n const firstAnswerId = currentQuestion.answerIds![0];\r\n\r\n return answers.find(answer => answer.id === firstAnswerId);\r\n };\r\n\r\n const [\r\n currentAnswer,\r\n setCurrentAnswer,\r\n ] = useState<IQuestionDialogAnswer | null>(onGetFirstAnswer()!);\r\n\r\n useEffect(() => {\r\n setCurrentAnswer(onGetFirstAnswer()!);\r\n }, [currentQuestion]);\r\n\r\n const onGetAnswers = (answerIds: number[]) => {\r\n return answerIds.map((answerId: number) =>\r\n answers.find(answer => answer.id === answerId)\r\n );\r\n };\r\n\r\n const onKeyPress = (e: KeyboardEvent) => {\r\n switch (e.key) {\r\n case 'ArrowDown':\r\n // select next answer, if any.\r\n // if no next answer, select first answer\r\n // const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\r\n // (answer) => answer?.id === currentAnswer!.id + 1\r\n // );\r\n\r\n const nextAnswerIndex = onGetAnswers(\r\n currentQuestion.answerIds!\r\n ).findIndex(answer => answer?.id === currentAnswer!.id + 1);\r\n\r\n const nextAnswerID = currentQuestion.answerIds![nextAnswerIndex];\r\n\r\n const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\r\n answer => answer?.id === nextAnswerID\r\n );\r\n\r\n setCurrentAnswer(nextAnswer || onGetFirstAnswer()!);\r\n\r\n break;\r\n case 'ArrowUp':\r\n // select previous answer, if any.\r\n // if no previous answer, select last answer\r\n\r\n const previousAnswerIndex = onGetAnswers(\r\n currentQuestion.answerIds!\r\n ).findIndex(answer => answer?.id === currentAnswer!.id - 1);\r\n\r\n const previousAnswerID =\r\n currentQuestion.answerIds &&\r\n currentQuestion.answerIds[previousAnswerIndex];\r\n\r\n const previousAnswer = onGetAnswers(currentQuestion.answerIds!).find(\r\n answer => answer?.id === previousAnswerID\r\n );\r\n\r\n if (previousAnswer) {\r\n setCurrentAnswer(previousAnswer);\r\n } else {\r\n setCurrentAnswer(onGetAnswers(currentQuestion.answerIds!).pop()!);\r\n }\r\n\r\n break;\r\n case 'Enter':\r\n setCanShowAnswers(false);\r\n\r\n if (!currentAnswer?.nextQuestionId) {\r\n onClose();\r\n return;\r\n } else {\r\n setCurrentQuestion(\r\n questions.find(\r\n question => question.id === currentAnswer!.nextQuestionId\r\n )!\r\n );\r\n }\r\n\r\n break;\r\n }\r\n };\r\n useEventListener('keydown', onKeyPress);\r\n\r\n const onAnswerClick = (answer: IQuestionDialogAnswer) => {\r\n setCanShowAnswers(false);\r\n if (answer.nextQuestionId) {\r\n // if there is a next question, go to it\r\n setCurrentQuestion(\r\n questions.find(question => question.id === answer.nextQuestionId)!\r\n );\r\n } else {\r\n // else, finish dialog!\r\n onClose();\r\n }\r\n };\r\n\r\n const onRenderCurrentAnswers = () => {\r\n const answerIds = currentQuestion.answerIds;\r\n if (!answerIds) {\r\n return null;\r\n }\r\n\r\n const answers = onGetAnswers(answerIds);\r\n\r\n if (!answers) {\r\n return null;\r\n }\r\n\r\n return answers.map(answer => {\r\n const isSelected = currentAnswer?.id === answer?.id;\r\n const selectedColor = isSelected ? 'yellow' : 'white';\r\n\r\n if (answer) {\r\n return (\r\n <AnswerRow key={`answer_${answer.id}`}>\r\n <AnswerSelectedIcon color={selectedColor}>\r\n {isSelected ? 'X' : null}\r\n </AnswerSelectedIcon>\r\n\r\n <Answer\r\n key={answer.id}\r\n onPointerDown={() => onAnswerClick(answer)}\r\n color={selectedColor}\r\n >\r\n {answer.text}\r\n </Answer>\r\n </AnswerRow>\r\n );\r\n }\r\n\r\n return null;\r\n });\r\n };\r\n\r\n return (\r\n <Container>\r\n <QuestionContainer>\r\n <DynamicText\r\n text={currentQuestion.text}\r\n onStart={() => setCanShowAnswers(false)}\r\n onFinish={() => setCanShowAnswers(true)}\r\n />\r\n </QuestionContainer>\r\n\r\n {canShowAnswers && (\r\n <AnswersContainer>{onRenderCurrentAnswers()}</AnswersContainer>\r\n )}\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n display: flex;\r\n word-break: break-all;\r\n box-sizing: border-box;\r\n justify-content: flex-start;\r\n align-items: flex-start;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nconst QuestionContainer = styled.div`\r\n flex: 100%;\r\n width: 100%;\r\n`;\r\n\r\nconst AnswersContainer = styled.div`\r\n flex: 100%;\r\n`;\r\n\r\ninterface IAnswerProps {\r\n color: string;\r\n}\r\n\r\nconst Answer = styled.p<IAnswerProps>`\r\n flex: auto;\r\n color: ${props => props.color} !important;\r\n font-size: 0.65rem !important;\r\n background: inherit;\r\n border: none;\r\n`;\r\n\r\nconst AnswerSelectedIcon = styled.span<IAnswerProps>`\r\n flex: 5% 0 0;\r\n color: ${props => props.color} !important;\r\n`;\r\n\r\nconst AnswerRow = styled.div`\r\n display: flex;\r\n flex-wrap: wrap;\r\n justify-content: center;\r\n align-items: center;\r\n margin-bottom: 0.5rem;\r\n height: 22px;\r\n p {\r\n line-height: unset;\r\n margin-top: 0;\r\n margin-bottom: 0rem;\r\n }\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\n\r\nexport interface IBarProps {\r\n max: number;\r\n value: number;\r\n color: 'red' | 'blue' | 'green';\r\n style?: Record<string, any>;\r\n displayText?: boolean;\r\n percentageWidth?: number;\r\n minWidth?: number;\r\n}\r\n\r\nexport const ProgressBar: React.FC<IBarProps> = ({\r\n max,\r\n value,\r\n color,\r\n displayText = true,\r\n percentageWidth = 40,\r\n minWidth = 100,\r\n style,\r\n}) => {\r\n value = Math.round(value);\r\n max = Math.round(max);\r\n\r\n const calculatePercentageValue = function(max: number, value: number) {\r\n if (value > max) {\r\n value = max;\r\n }\r\n return (value * 100) / max;\r\n };\r\n\r\n return (\r\n <Container\r\n className=\"rpgui-progress\"\r\n data-value={calculatePercentageValue(max, value) / 100}\r\n data-rpguitype=\"progress\"\r\n percentageWidth={percentageWidth}\r\n minWidth={minWidth}\r\n style={style}\r\n >\r\n {displayText && (\r\n <TextOverlay>\r\n <ProgressBarText>\r\n {value}/{max}\r\n </ProgressBarText>\r\n </TextOverlay>\r\n )}\r\n <div className=\" rpgui-progress-track\">\r\n <div\r\n className={`rpgui-progress-fill ${color} `}\r\n style={{\r\n left: '0px',\r\n width: calculatePercentageValue(max, value) + '%',\r\n }}\r\n ></div>\r\n </div>\r\n <div className=\" rpgui-progress-left-edge\"></div>\r\n <div className=\" rpgui-progress-right-edge\"></div>\r\n </Container>\r\n );\r\n};\r\n\r\nconst ProgressBarText = styled.span`\r\n font-size: ${uiFonts.size.small} !important;\r\n color: white;\r\n text-align: center;\r\n z-index: 1;\r\n position: absolute;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n top: 12px;\r\n`;\r\n\r\nconst TextOverlay = styled.div`\r\n width: 100%;\r\n position: relative;\r\n`;\r\n\r\ninterface IContainerProps {\r\n percentageWidth?: number;\r\n minWidth?: number;\r\n style?: Record<string, any>;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n display: flex;\r\n flex-direction: column;\r\n min-width: ${props => props.minWidth}px;\r\n width: ${props => props.percentageWidth}%;\r\n justify-content: start;\r\n align-items: flex-start;\r\n ${props => props.style}\r\n`;\r\n","import { IQuest } from '@rpg-engine/shared';\r\nimport React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport SelectArrow from '../Arrow/SelectArrow';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\n\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { Column } from '../shared/Column';\r\nimport thumbnailDefault from './img/default.png';\r\n\r\nexport interface IQuestsButtonProps {\r\n disabled: boolean;\r\n title: string;\r\n onClick: (questId: string, npcId: string) => void;\r\n}\r\n\r\nexport interface IQuestInfoProps {\r\n onClose?: () => void;\r\n buttons?: IQuestsButtonProps[];\r\n quests: IQuest[];\r\n onChangeQuest: (currentQuestIndex: number, currentQuestId: string) => void;\r\n scale?: number;\r\n}\r\n\r\nexport const QuestInfo: React.FC<IQuestInfoProps> = ({\r\n quests,\r\n onClose,\r\n buttons,\r\n onChangeQuest,\r\n scale,\r\n}) => {\r\n const [currentIndex, setCurrentIndex] = useState(0);\r\n const questsLength = quests.length - 1;\r\n\r\n useEffect(() => {\r\n if (onChangeQuest) {\r\n onChangeQuest(currentIndex, quests[currentIndex]._id);\r\n }\r\n }, [currentIndex]);\r\n\r\n const onLeftClick = () => {\r\n if (currentIndex === 0) setCurrentIndex(questsLength);\r\n else setCurrentIndex(index => index - 1);\r\n };\r\n const onRightClick = () => {\r\n if (currentIndex === questsLength) setCurrentIndex(0);\r\n else setCurrentIndex(index => index + 1);\r\n };\r\n\r\n return (\r\n <QuestDraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) onClose();\r\n }}\r\n width=\"730px\"\r\n cancelDrag=\".equipment-container-body .arrow-selector\"\r\n scale={scale}\r\n >\r\n {quests.length >= 2 ? (\r\n <QuestsContainer>\r\n {currentIndex !== 0 && (\r\n <SelectArrow\r\n direction=\"left\"\r\n onPointerDown={onLeftClick}\r\n ></SelectArrow>\r\n )}\r\n {currentIndex !== quests.length - 1 && (\r\n <SelectArrow\r\n direction=\"right\"\r\n onPointerDown={onRightClick}\r\n ></SelectArrow>\r\n )}\r\n\r\n <QuestContainer>\r\n <TitleContainer className=\"drag-handler\">\r\n <Title>\r\n <Thumbnail\r\n src={quests[currentIndex].thumbnail || thumbnailDefault}\r\n />\r\n {quests[currentIndex].title}\r\n </Title>\r\n <QuestSplitDiv>\r\n <hr className=\"golden\" />\r\n </QuestSplitDiv>\r\n </TitleContainer>\r\n <Content>\r\n <p>{quests[currentIndex].description}</p>\r\n </Content>\r\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\r\n {buttons &&\r\n buttons.map((button, index) => (\r\n <Button\r\n key={index}\r\n onPointerDown={() =>\r\n button.onClick(\r\n quests[currentIndex]._id,\r\n quests[currentIndex].npcId\r\n )\r\n }\r\n disabled={button.disabled}\r\n buttonType={ButtonTypes.RPGUIButton}\r\n id={`button-${index}`}\r\n >\r\n {button.title}\r\n </Button>\r\n ))}\r\n </QuestColumn>\r\n </QuestContainer>\r\n </QuestsContainer>\r\n ) : (\r\n <QuestsContainer>\r\n <QuestContainer>\r\n <TitleContainer className=\"drag-handler\">\r\n <Title>\r\n <Thumbnail src={quests[0].thumbnail || thumbnailDefault} />\r\n {quests[0].title}\r\n </Title>\r\n <QuestSplitDiv>\r\n <hr className=\"golden\" />\r\n </QuestSplitDiv>\r\n </TitleContainer>\r\n <Content>\r\n <p>{quests[0].description}</p>\r\n </Content>\r\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\r\n {buttons &&\r\n buttons.map((button, index) => (\r\n <Button\r\n key={index}\r\n onPointerDown={() =>\r\n button.onClick(quests[0]._id, quests[0].npcId)\r\n }\r\n disabled={button.disabled}\r\n buttonType={ButtonTypes.RPGUIButton}\r\n id={`button-${index}`}\r\n >\r\n {button.title}\r\n </Button>\r\n ))}\r\n </QuestColumn>\r\n </QuestContainer>\r\n </QuestsContainer>\r\n )}\r\n </QuestDraggableContainer>\r\n );\r\n};\r\n\r\nconst QuestDraggableContainer = styled(DraggableContainer)`\r\n border: 1px solid black;\r\n width: 600px;\r\n padding: 0 0 0 0 !important;\r\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\r\n height: auto;\r\n }\r\n .container-close {\r\n position: absolute;\r\n margin-left: auto;\r\n top: 20px;\r\n padding-right: 5px;\r\n }\r\n img {\r\n display: inline-block;\r\n vertical-align: middle;\r\n line-height: normal;\r\n }\r\n`;\r\n\r\nconst QuestContainer = styled.div`\r\n margin-right: 40px;\r\n margin-left: 40px;\r\n`;\r\n\r\nconst QuestsContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n`;\r\n\r\nconst Content = styled.div`\r\n padding: 18px;\r\n h1 {\r\n text-align: left;\r\n margin: 14px 0px;\r\n }\r\n`;\r\n\r\nconst QuestSplitDiv = styled.div`\r\n width: 100%;\r\n font-size: 11px;\r\n margin-bottom: 10px;\r\n hr {\r\n margin: 0px;\r\n padding: 0px;\r\n }\r\n p {\r\n margin-bottom: 0px;\r\n }\r\n`;\r\n\r\nconst QuestColumn = styled(Column)`\r\n padding-top: 5px;\r\n margin-bottom: 20px;\r\n display: flex;\r\n justify-content: space-evenly;\r\n`;\r\n\r\nconst TitleContainer = styled.div`\r\n width: 100%;\r\n display: flex;\r\n flex-wrap: wrap;\r\n justify-content: flex-start;\r\n align-items: center;\r\n margin-top: 1rem;\r\n`;\r\n\r\nconst Title = styled.h1`\r\n color: white;\r\n z-index: 22;\r\n font-size: ${uiFonts.size.medium} !important;\r\n color: ${uiColors.yellow} !important;\r\n`;\r\n\r\nconst Thumbnail = styled.img`\r\n color: white;\r\n z-index: 22;\r\n width: 32px * 1.5;\r\n margin-right: 0.5rem;\r\n position: relative;\r\n top: -4px;\r\n`;\r\n","import { IQuest } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\nimport { DraggableContainer } from './DraggableContainer';\r\nimport { RPGUIContainerTypes } from './RPGUIContainer';\r\n\r\nexport interface IQuestListProps {\r\n quests?: IQuest[];\r\n onClose: () => void;\r\n scale?: number;\r\n}\r\n\r\nexport const QuestList: React.FC<IQuestListProps> = ({\r\n quests,\r\n onClose,\r\n scale,\r\n}) => {\r\n return (\r\n <QuestDraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) onClose();\r\n }}\r\n width=\"520px\"\r\n scale={scale}\r\n >\r\n <div style={{ width: '100%' }}>\r\n <Title>Quests</Title>\r\n <hr className=\"golden\" />\r\n\r\n <QuestListContainer>\r\n {quests ? (\r\n quests.map((quest, i) => (\r\n <div className=\"quest-item\" key={i}>\r\n <span className=\"quest-number\">{i + 1}</span>\r\n <div className=\"quest-detail\">\r\n <p className=\"quest-detail__title\">{quest.title}</p>\r\n <p className=\"quest-detail__description\">\r\n {quest.description}\r\n </p>\r\n </div>\r\n </div>\r\n ))\r\n ) : (\r\n <NoQuestContainer>\r\n <p>There are no ongoing quests</p>\r\n </NoQuestContainer>\r\n )}\r\n </QuestListContainer>\r\n </div>\r\n </QuestDraggableContainer>\r\n );\r\n};\r\n\r\nconst QuestDraggableContainer = styled(DraggableContainer)`\r\n .container-close {\r\n top: 10px;\r\n right: 10px;\r\n }\r\n\r\n .quest-title {\r\n text-align: left;\r\n margin-left: 44px;\r\n margin-top: 20px;\r\n color: yellow;\r\n }\r\n\r\n .quest-desc {\r\n margin-top: 12px;\r\n margin-left: 44px;\r\n }\r\n\r\n .rpgui-progress {\r\n min-width: 80%;\r\n margin: 0 auto;\r\n }\r\n`;\r\n\r\nconst Title = styled.h1`\r\n z-index: 22;\r\n font-size: ${uiFonts.size.medium} !important;\r\n color: yellow !important;\r\n`;\r\n\r\nconst QuestListContainer = styled.div`\r\n margin-top: 20px;\r\n margin-bottom: 40px;\r\n overflow-y: auto;\r\n max-height: 400px;\r\n\r\n .quest-item {\r\n display: flex;\r\n align-items: flex-start;\r\n margin-bottom: 12px;\r\n }\r\n\r\n .quest-number {\r\n border-radius: 50%;\r\n width: 28px;\r\n height: 28px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n margin-right: 16px;\r\n background-color: brown;\r\n flex-shrink: 0;\r\n }\r\n\r\n .quest-number.completed {\r\n background-color: yellow;\r\n }\r\n\r\n p {\r\n margin: 0;\r\n }\r\n\r\n .quest-detail__title {\r\n color: yellow;\r\n }\r\n\r\n .quest-detail__description {\r\n margin-top: 5px;\r\n }\r\n .Noquest-detail__description {\r\n margin-top: 5px;\r\n margin: auto;\r\n }\r\n`;\r\nconst NoQuestContainer = styled.div`\r\n text-align: center;\r\n p {\r\n margin-top: 5px;\r\n }\r\n`;\r\n","import React from 'react';\r\nimport 'rpgui/rpgui.min.css';\r\nimport 'rpgui/rpgui.min.js';\r\n\r\ninterface IProps {\r\n children: React.ReactNode;\r\n}\r\n\r\n//@ts-ignore\r\nexport const _RPGUI = RPGUI;\r\n\r\nexport const RPGUIRoot: React.FC<IProps> = ({ children }) => {\r\n return <div className=\"rpgui-content\">{children}</div>;\r\n};\r\n","import {\r\n getItemTextureKeyPath,\r\n IItem,\r\n IItemContainer,\r\n IRawSpell,\r\n IShortcut,\r\n ShortcutType,\r\n} from '@rpg-engine/shared';\r\nimport React, { useEffect, useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { countItemFromInventory } from '../../libs/itemCounter';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\nimport { SingleShortcut } from './SingleShortcut';\r\nimport { useShortcutCooldown } from './useShortcutCooldown';\r\n\r\nexport type ShortcutsProps = {\r\n shortcuts: IShortcut[];\r\n onShortcutCast: (index: number) => void;\r\n mana: number;\r\n isBlockedCastingByKeyboard?: boolean;\r\n inventory?: IItemContainer | null;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n spellCooldowns?: Record<string, number>;\r\n};\r\n\r\nexport const Shortcuts: React.FC<ShortcutsProps> = ({\r\n shortcuts,\r\n onShortcutCast,\r\n mana,\r\n isBlockedCastingByKeyboard = false,\r\n atlasJSON,\r\n atlasIMG,\r\n inventory,\r\n spellCooldowns,\r\n}) => {\r\n const shortcutsRefs = useRef<HTMLButtonElement[]>([]);\r\n\r\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\r\n onShortcutCast\r\n );\r\n\r\n useEffect(() => {\r\n const handleKeyDown = (e: KeyboardEvent) => {\r\n if (isBlockedCastingByKeyboard) return;\r\n\r\n const shortcutIndex = Number(e.key) - 1;\r\n if (shortcutIndex >= 0 && shortcutIndex <= 5) {\r\n handleShortcutCast(shortcutIndex);\r\n shortcutsRefs.current[shortcutIndex]?.classList.add('active');\r\n setTimeout(() => {\r\n shortcutsRefs.current[shortcutIndex]?.classList.remove('active');\r\n }, 150);\r\n }\r\n };\r\n\r\n window.addEventListener('keydown', handleKeyDown);\r\n\r\n return () => {\r\n window.removeEventListener('keydown', handleKeyDown);\r\n };\r\n }, [shortcuts, isBlockedCastingByKeyboard, shortcutCooldown]);\r\n\r\n return (\r\n <List>\r\n {Array.from({ length: 6 }).map((_, i) => {\r\n const buildClassName = (classBase: string, isOnCooldown: boolean) => {\r\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\r\n };\r\n\r\n const isOnShortcutCooldown = shortcutCooldown > 0;\r\n\r\n if (shortcuts && shortcuts[i]?.type === ShortcutType.Item) {\r\n const payload = shortcuts[i]?.payload as IItem | undefined;\r\n\r\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\r\n\r\n if (inventory) {\r\n Object.keys(inventory.slots).forEach(i => {\r\n const index = parseInt(i);\r\n\r\n if (inventory.slots[index]?.key === payload?.key) {\r\n itemsFromEquipment.push(inventory.slots[index]);\r\n }\r\n });\r\n }\r\n\r\n const totalQty =\r\n payload && inventory\r\n ? countItemFromInventory(payload.key, inventory)\r\n : 0;\r\n\r\n return (\r\n <StyledShortcut\r\n key={i}\r\n onPointerDown={handleShortcutCast.bind(null, i)}\r\n disabled={false}\r\n ref={el => {\r\n if (el) shortcutsRefs.current[i] = el;\r\n }}\r\n >\r\n {isOnShortcutCooldown && (\r\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\r\n )}\r\n {payload && (\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: payload.texturePath,\r\n texturePath: payload.texturePath,\r\n stackQty: payload.stackQty || 1,\r\n isStackable: payload.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n width={32}\r\n height={32}\r\n />\r\n )}\r\n <span className={buildClassName('qty', isOnShortcutCooldown)}>\r\n {totalQty}\r\n </span>\r\n <span\r\n className={buildClassName('keyboard', isOnShortcutCooldown)}\r\n >\r\n {i + 1}\r\n </span>\r\n </StyledShortcut>\r\n );\r\n }\r\n\r\n const payload =\r\n shortcuts && (shortcuts[i]?.payload as IRawSpell | undefined); //check if shortcuts exists before using the ? operator.\r\n\r\n const spellCooldown = !payload\r\n ? 0\r\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\r\n shortcutCooldown;\r\n const cooldown =\r\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\r\n const isOnCooldown = cooldown > 0 && !!payload;\r\n\r\n return (\r\n <StyledShortcut\r\n key={i}\r\n onPointerDown={handleShortcutCast.bind(null, i)}\r\n disabled={mana < (payload?.manaCost ?? 0)}\r\n ref={el => {\r\n if (el) shortcutsRefs.current[i] = el;\r\n }}\r\n >\r\n {isOnCooldown && (\r\n <span className=\"cooldown\">\r\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\r\n </span>\r\n )}\r\n <span className={buildClassName('mana', isOnCooldown)}>\r\n {payload && payload.manaCost}\r\n </span>\r\n <span className=\"magicWords\">\r\n {payload?.magicWords.split(' ').map(word => word[0])}\r\n </span>\r\n <span className={buildClassName('keyboard', isOnCooldown)}>\r\n {i + 1}\r\n </span>\r\n </StyledShortcut>\r\n );\r\n })}\r\n </List>\r\n );\r\n};\r\n\r\nconst StyledShortcut = styled(SingleShortcut)`\r\n transition: all 0.15s;\r\n\r\n &.active {\r\n background-color: ${uiColors.gray};\r\n border-color: ${uiColors.yellow};\r\n }\r\n`;\r\n\r\nconst List = styled.p`\r\n width: 100%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 0.5rem;\r\n box-sizing: border-box;\r\n margin: 0 !important;\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nexport interface ISimpleProgressBarProps {\r\n value: number;\r\n bgColor?: string;\r\n margin?: number;\r\n}\r\n\r\nexport const SimpleProgressBar: React.FC<ISimpleProgressBarProps> = ({\r\n value,\r\n bgColor = 'red',\r\n margin = 20,\r\n}) => {\r\n return (\r\n <Container className=\"simple-progress-bar\">\r\n <ProgressBarContainer margin={margin}>\r\n <BackgroundBar>\r\n <Progress value={value} bgColor={bgColor} />\r\n </BackgroundBar>\r\n </ProgressBarContainer>\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n width: 100%;\r\n`;\r\n\r\nconst BackgroundBar = styled.span`\r\n background-color: rgba(0, 0, 0, 0.075);\r\n`;\r\n\r\ninterface ISimpleProgressBarThemeProps {\r\n value: number;\r\n bgColor: string;\r\n}\r\n\r\nconst Progress = styled.span`\r\n background-color: ${(props: ISimpleProgressBarThemeProps) => props.bgColor};\r\n width: ${(props: ISimpleProgressBarThemeProps) => props.value}%;\r\n`;\r\n\r\ninterface ISimpleProgressBarTheme2Props {\r\n margin: number;\r\n}\r\n\r\nconst ProgressBarContainer = styled.div`\r\n border-radius: 60px;\r\n border: 1px solid #282424;\r\n overflow: hidden;\r\n width: 100%;\r\n span {\r\n display: block;\r\n height: 100%;\r\n }\r\n height: 8px;\r\n margin-left: ${(props: ISimpleProgressBarTheme2Props) => props.margin}px;\r\n`;\r\n","import { getSPForLevel } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { ErrorBoundary } from './Item/Inventory/ErrorBoundary';\r\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\r\nimport { SimpleProgressBar } from './SimpleProgressBar';\r\n\r\nexport interface ISkillProgressBarProps {\r\n skillName: string;\r\n bgColor: string;\r\n level: number;\r\n skillPoints: number;\r\n skillPointsToNextLevel?: number;\r\n texturePath: string;\r\n showSkillPoints?: boolean;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n}\r\n\r\nexport const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({\r\n bgColor,\r\n skillName,\r\n level,\r\n skillPoints,\r\n skillPointsToNextLevel,\r\n texturePath,\r\n showSkillPoints = true,\r\n atlasIMG,\r\n atlasJSON,\r\n}) => {\r\n if (!skillPointsToNextLevel) {\r\n skillPointsToNextLevel = getSPForLevel(level + 1);\r\n }\r\n\r\n const nextLevelSPWillbe = skillPoints + skillPointsToNextLevel;\r\n\r\n const ratio = (skillPoints / nextLevelSPWillbe) * 100;\r\n\r\n return (\r\n <>\r\n <ProgressTitle>\r\n <TitleName>{skillName}</TitleName>\r\n <ValueDisplay>lv {level}</ValueDisplay>\r\n </ProgressTitle>\r\n <ProgressBody>\r\n <ProgressIconContainer>\r\n {atlasIMG && atlasJSON ? (\r\n <SpriteContainer>\r\n <ErrorBoundary>\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={texturePath}\r\n imgScale={1}\r\n grayScale\r\n opacity={0.5}\r\n />\r\n </ErrorBoundary>\r\n </SpriteContainer>\r\n ) : (\r\n <></>\r\n )}\r\n </ProgressIconContainer>\r\n\r\n <ProgressBarContainer>\r\n <SimpleProgressBar value={ratio} bgColor={bgColor} />\r\n </ProgressBarContainer>\r\n </ProgressBody>\r\n {showSkillPoints && (\r\n <SkillDisplayContainer>\r\n <SkillPointsDisplay>\r\n {skillPoints}/{nextLevelSPWillbe}\r\n </SkillPointsDisplay>\r\n </SkillDisplayContainer>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nconst ProgressBarContainer = styled.div`\r\n position: relative;\r\n top: 8px;\r\n width: 100%;\r\n height: auto;\r\n`;\r\n\r\nconst SpriteContainer = styled.div`\r\n position: relative;\r\n top: -3px;\r\n left: 0;\r\n`;\r\n\r\nconst SkillDisplayContainer = styled.div`\r\n margin: 0 auto;\r\n\r\n p {\r\n margin: 0;\r\n }\r\n`;\r\n\r\nconst SkillPointsDisplay = styled.p`\r\n font-size: 0.6rem !important;\r\n font-weight: bold;\r\n text-align: center;\r\n`;\r\n\r\nconst TitleName = styled.span`\r\n margin-left: 5px;\r\n`;\r\n\r\nconst ValueDisplay = styled.span``;\r\n\r\nconst ProgressIconContainer = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n`;\r\n\r\nconst ProgressBody = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n width: 100%;\r\n`;\r\n\r\nconst ProgressTitle = styled.div`\r\n width: 100%;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n span {\r\n font-size: 0.6rem;\r\n }\r\n`;\r\n","import { ISkill, ISkillDetails } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../constants/uiColors';\r\nimport { DraggableContainer } from './DraggableContainer';\r\nimport { SkillProgressBar } from './SkillProgressBar';\r\n\r\nexport interface ISkillContainerProps {\r\n skill: ISkill;\r\n onCloseButton: () => void;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n scale?: number;\r\n}\r\n\r\nconst skillProps = {\r\n attributes: {\r\n color: uiColors.purple,\r\n values: {\r\n stamina: 'spell-icons/regenerate.png',\r\n magic: 'spell-icons/fireball.png',\r\n magicResistance: 'spell-icons/freeze.png',\r\n strength: 'spell-icons/enchanted-blow.png',\r\n resistance: 'spell-icons/magic-shield.png',\r\n dexterity: 'spell-icons/haste.png',\r\n },\r\n },\r\n combat: {\r\n color: uiColors.cardinal,\r\n values: {\r\n first: 'gloves/leather-gloves.png',\r\n club: 'maces/club.png',\r\n sword: 'swords/double-edged-sword.png',\r\n axe: 'axes/double-axe.png',\r\n distance: 'ranged-weapons/horse-bow.png',\r\n shielding: 'shields/studded-shield.png',\r\n dagger: 'daggers/dagger.png',\r\n },\r\n },\r\n crafting: {\r\n color: uiColors.blue,\r\n values: {\r\n fishing: 'foods/fish.png',\r\n mining: 'crafting-resources/iron-ingot.png',\r\n lumberjacking: 'crafting-resources/greater-wooden-log.png',\r\n blacksmithing: 'hammers/hammer.png',\r\n cooking: 'foods/chickens-meat.png',\r\n alchemy: 'potions/greater-mana-potion.png',\r\n },\r\n },\r\n};\r\n\r\ninterface SkillMap {\r\n [key: string]: string;\r\n}\r\n\r\nconst skillNameMap: SkillMap = {\r\n stamina: 'Stamina',\r\n magic: 'Magic',\r\n magicResistance: 'Magic Resistance',\r\n strength: 'Strength',\r\n resistance: 'Resistance',\r\n dexterity: 'Dexterity',\r\n first: 'Fist',\r\n club: 'Club',\r\n sword: 'Sword',\r\n axe: 'Axe',\r\n distance: 'Distance',\r\n shielding: 'Shielding',\r\n dagger: 'Dagger',\r\n fishing: 'Fishing',\r\n mining: 'Mining',\r\n lumberjacking: 'Lumberjacking',\r\n blacksmithing: 'Blacksmithing',\r\n cooking: 'Cooking',\r\n alchemy: 'Alchemy',\r\n};\r\n\r\nexport const SkillsContainer: React.FC<ISkillContainerProps> = ({\r\n onCloseButton,\r\n skill,\r\n atlasIMG,\r\n atlasJSON,\r\n scale,\r\n}) => {\r\n const onRenderSkillCategory = (\r\n category: 'attributes' | 'combat' | 'crafting'\r\n ) => {\r\n const skillCategory = skillProps[category];\r\n\r\n const skillCategoryColor = skillCategory.color;\r\n\r\n const output = [];\r\n\r\n for (const [key, value] of Object.entries(skillCategory.values)) {\r\n if (key === 'stamina') {\r\n continue;\r\n }\r\n //@ts-ignore\r\n const skillDetails = (skill[key] as unknown) as ISkillDetails;\r\n\r\n output.push(\r\n <SkillProgressBar\r\n key={key}\r\n skillName={skillNameMap[key]}\r\n bgColor={skillCategoryColor}\r\n level={skillDetails.level || 0}\r\n skillPoints={Math.round(skillDetails.skillPoints) || 0}\r\n skillPointsToNextLevel={\r\n Math.round(skillDetails.skillPointsToNextLevel) || 0\r\n }\r\n texturePath={value}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n );\r\n }\r\n\r\n return output;\r\n };\r\n\r\n return (\r\n <SkillsDraggableContainer\r\n title=\"Skills\"\r\n cancelDrag=\"#skillsDiv\"\r\n scale={scale}\r\n >\r\n {onCloseButton && (\r\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\r\n )}\r\n <SkillsContainerDiv id=\"skillsDiv\">\r\n <SkillSplitDiv>\r\n <p>General</p>\r\n <hr className=\"golden\" />\r\n\r\n <SkillProgressBar\r\n skillName={'Level'}\r\n bgColor={uiColors.navyBlue}\r\n level={Math.round(skill.level) || 0}\r\n skillPoints={Math.round(skill.experience) || 0}\r\n skillPointsToNextLevel={Math.round(skill.xpToNextLevel) || 0}\r\n texturePath={'swords/broad-sword.png'}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n\r\n <p>Combat Skills</p>\r\n <hr className=\"golden\" />\r\n </SkillSplitDiv>\r\n\r\n {onRenderSkillCategory('combat')}\r\n\r\n <SkillSplitDiv>\r\n <p>Crafting Skills</p>\r\n <hr className=\"golden\" />\r\n </SkillSplitDiv>\r\n\r\n {onRenderSkillCategory('crafting')}\r\n\r\n <SkillSplitDiv>\r\n <p>Basic Attributes</p>\r\n <hr className=\"golden\" />\r\n </SkillSplitDiv>\r\n\r\n {onRenderSkillCategory('attributes')}\r\n </SkillsContainerDiv>\r\n </SkillsDraggableContainer>\r\n );\r\n};\r\n\r\nconst SkillsDraggableContainer = styled(DraggableContainer)`\r\n border: 1px solid black;\r\n\r\n max-width: 380px;\r\n\r\n height: 90%;\r\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\r\n width: auto;\r\n height: auto;\r\n }\r\n`;\r\n\r\nconst SkillsContainerDiv = styled.div`\r\n width: 100%;\r\n -webkit-overflow-y: scroll;\r\n overflow-y: scroll;\r\n height: 90%;\r\n padding-right: 10px;\r\n`;\r\n\r\nconst SkillSplitDiv = styled.div`\r\n width: 100%;\r\n font-size: 11px;\r\n hr {\r\n margin: 0;\r\n margin-bottom: 1rem;\r\n padding: 0px;\r\n }\r\n p {\r\n margin-bottom: 0px;\r\n }\r\n`;\r\n\r\nconst CloseButton = styled.div`\r\n position: absolute;\r\n top: 2px;\r\n right: 2px;\r\n color: white;\r\n z-index: 22;\r\n font-size: 1.1rem;\r\n`;\r\n","import { ISpell } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../../constants/uiColors';\r\nimport { uiFonts } from '../../../constants/uiFonts';\r\nimport { formatSpellCastingType } from '../../../libs/CastingTypeHelper';\r\n\r\ninterface ISpellInfoProps {\r\n spell: ISpell;\r\n}\r\n\r\nexport const SpellInfo: React.FC<ISpellInfoProps> = ({ spell }) => {\r\n const {\r\n magicWords,\r\n name,\r\n manaCost,\r\n requiredItem,\r\n description,\r\n castingType,\r\n cooldown,\r\n maxDistanceGrid,\r\n } = spell;\r\n return (\r\n <Container>\r\n <Header>\r\n <div>\r\n <Title>{name}</Title>\r\n <Type>{magicWords}</Type>\r\n </div>\r\n </Header>\r\n <Statistic>\r\n <div className=\"label\">Casting Type:</div>\r\n <div className=\"value\">{formatSpellCastingType(castingType)}</div>\r\n </Statistic>\r\n <Statistic>\r\n <div className=\"label\">Magic words:</div>\r\n <div className=\"value\">{magicWords}</div>\r\n </Statistic>\r\n <Statistic>\r\n <div className=\"label\">Mana cost:</div>\r\n <div className=\"value\">{manaCost}</div>\r\n </Statistic>\r\n <Statistic>\r\n <div className=\"label\">Cooldown:</div>\r\n <div className=\"value\">{cooldown}</div>\r\n </Statistic>\r\n {maxDistanceGrid && (\r\n <Statistic>\r\n <div className=\"label\">Max Distance Grid:</div>\r\n <div className=\"value\">{maxDistanceGrid}</div>\r\n </Statistic>\r\n )}\r\n <Statistic>\r\n {requiredItem && (\r\n <>\r\n <div className=\"label\">Required Item:</div>\r\n <div className=\"value\">{requiredItem}</div>\r\n </>\r\n )}\r\n </Statistic>\r\n <Description>{description}</Description>\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n color: white;\r\n background-color: #222;\r\n border-radius: 5px;\r\n padding: 0.5rem;\r\n font-size: ${uiFonts.size.small};\r\n border: 3px solid ${uiColors.lightGray};\r\n height: max-content;\r\n width: 30rem;\r\n\r\n @media (max-width: 580px) {\r\n width: 80vw;\r\n }\r\n`;\r\n\r\nconst Title = styled.div`\r\n font-size: ${uiFonts.size.medium};\r\n font-weight: bold;\r\n margin-bottom: 0.5rem;\r\n display: flex;\r\n align-items: center;\r\n margin: 0;\r\n`;\r\n\r\nconst Type = styled.div`\r\n font-size: ${uiFonts.size.small};\r\n margin-top: 0.2rem;\r\n color: ${uiColors.lightGray};\r\n`;\r\n\r\nconst Description = styled.div`\r\n margin-top: 1.5rem;\r\n font-size: ${uiFonts.size.small};\r\n color: ${uiColors.lightGray};\r\n font-style: italic;\r\n`;\r\n\r\nconst Header = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n margin-bottom: 0.5rem;\r\n`;\r\n\r\nconst Statistic = styled.div`\r\n margin-bottom: 0.4rem;\r\n width: max-content;\r\n\r\n .label {\r\n display: inline-block;\r\n margin-right: 0.5rem;\r\n color: inherit;\r\n }\r\n\r\n .value {\r\n display: inline-block;\r\n color: inherit;\r\n }\r\n\r\n &.better,\r\n .better {\r\n color: ${uiColors.lightGreen};\r\n }\r\n\r\n &.worse,\r\n .worse {\r\n color: ${uiColors.cardinal};\r\n }\r\n`;\r\n","export const formatSpellCastingType = (castingType: string): string => {\r\n const formattedCastingType = castingType\r\n .split(\"-\")\r\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\r\n .join(\" \");\r\n \r\n return formattedCastingType;\r\n };","import { ISpell } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { SpellInfo } from './SpellInfo';\r\n\r\nexport interface ISpellInfoDisplayProps {\r\n spell: ISpell;\r\n isMobile?: boolean;\r\n}\r\n\r\nexport const SpellInfoDisplay: React.FC<ISpellInfoDisplayProps> = ({\r\n spell,\r\n isMobile,\r\n}) => {\r\n return (\r\n <Flex $isMobile={isMobile}>\r\n <SpellInfo spell={spell} />\r\n </Flex>\r\n );\r\n};\r\n\r\nconst Flex = styled.div<{ $isMobile?: boolean }>`\r\n display: flex;\r\n gap: 0.5rem;\r\n flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};\r\n\r\n @media (max-width: 580px) {\r\n flex-direction: column-reverse;\r\n align-items: center;\r\n }\r\n`;\r\n","import { ISpell } from '@rpg-engine/shared';\r\nimport React, { useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport ModalPortal from '../../Abstractions/ModalPortal';\r\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\r\n\r\ninterface IListMenuOption {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nexport interface MobileSpellTooltipProps {\r\n spell: ISpell;\r\n closeTooltip: () => void;\r\n scale?: number;\r\n options?: IListMenuOption[];\r\n onSelected?: (selectedOptionId: string) => void;\r\n}\r\n\r\nexport const MobileSpellTooltip: React.FC<MobileSpellTooltipProps> = ({\r\n spell,\r\n closeTooltip,\r\n scale = 1,\r\n options,\r\n onSelected,\r\n}) => {\r\n const ref = useRef<HTMLDivElement>(null);\r\n\r\n const handleFadeOut = () => {\r\n ref.current?.classList.add('fadeOut');\r\n };\r\n\r\n return (\r\n <ModalPortal>\r\n <Container\r\n ref={ref}\r\n onTouchEnd={() => {\r\n handleFadeOut();\r\n setTimeout(() => {\r\n closeTooltip();\r\n }, 100);\r\n }}\r\n scale={scale}\r\n >\r\n <SpellInfoDisplay spell={spell} isMobile />\r\n <OptionsContainer>\r\n {options?.map(option => (\r\n <Option\r\n key={option.id}\r\n onTouchEnd={() => {\r\n handleFadeOut();\r\n setTimeout(() => {\r\n onSelected?.(option.id);\r\n closeTooltip();\r\n }, 100);\r\n }}\r\n >\r\n {option.text}\r\n </Option>\r\n ))}\r\n </OptionsContainer>\r\n </Container>\r\n </ModalPortal>\r\n );\r\n};\r\n\r\nconst Container = styled.div<{ scale: number }>`\r\n position: absolute;\r\n z-index: 100;\r\n left: 0;\r\n top: 0;\r\n width: 100vw;\r\n height: 100vh;\r\n background-color: rgba(0 0 0 / 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.5rem;\r\n transition: opacity 0.08s;\r\n animation: fadeIn 0.1s forwards;\r\n\r\n @keyframes fadeIn {\r\n 0% {\r\n opacity: 0;\r\n }\r\n 100% {\r\n opacity: 0.92;\r\n }\r\n }\r\n\r\n @keyframes fadeOut {\r\n 0% {\r\n opacity: 0.92;\r\n }\r\n 100% {\r\n opacity: 0;\r\n }\r\n }\r\n\r\n &.fadeOut {\r\n animation: fadeOut 0.1s forwards;\r\n }\r\n\r\n @media (max-width: 580px) {\r\n flex-direction: column;\r\n }\r\n`;\r\n\r\nconst OptionsContainer = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n gap: 0.5rem;\r\n flex-wrap: wrap;\r\n\r\n @media (max-width: 580px) {\r\n flex-direction: row;\r\n justify-content: center;\r\n }\r\n`;\r\n\r\nconst Option = styled.button`\r\n padding: 1rem;\r\n background-color: #333;\r\n color: white;\r\n border: none;\r\n border-radius: 3px;\r\n width: 8rem;\r\n transition: background-color 0.1s;\r\n\r\n &:hover {\r\n background-color: #555;\r\n }\r\n\r\n @media (max-width: 580px) {\r\n padding: 1rem 0.5rem;\r\n }\r\n`;\r\n","import { ISpell } from '@rpg-engine/shared';\r\nimport React, { useEffect, useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport ModalPortal from '../../Abstractions/ModalPortal';\r\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\r\n\r\nexport interface IMagicTooltipProps {\r\n spell: ISpell;\r\n}\r\n\r\nconst offset = 20;\r\n\r\nexport const MagicTooltip: React.FC<IMagicTooltipProps> = ({ spell }) => {\r\n const ref = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const { current } = ref;\r\n\r\n if (current) {\r\n const handleMouseMove = (event: MouseEvent) => {\r\n const { clientX, clientY } = event;\r\n\r\n // Adjust the position of the tooltip based on the mouse position\r\n const rect = current.getBoundingClientRect();\r\n\r\n const tooltipWidth = rect.width;\r\n const tooltipHeight = rect.height;\r\n const isOffScreenRight =\r\n clientX + tooltipWidth + offset > window.innerWidth;\r\n const isOffScreenBottom =\r\n clientY + tooltipHeight + offset > window.innerHeight;\r\n const x = isOffScreenRight\r\n ? clientX - tooltipWidth - offset\r\n : clientX + offset;\r\n const y = isOffScreenBottom\r\n ? clientY - tooltipHeight - offset\r\n : clientY + offset;\r\n\r\n current.style.transform = `translate(${x}px, ${y}px)`;\r\n current.style.opacity = '1';\r\n };\r\n\r\n window.addEventListener('mousemove', handleMouseMove);\r\n\r\n return () => {\r\n window.removeEventListener('mousemove', handleMouseMove);\r\n };\r\n }\r\n\r\n return;\r\n }, []);\r\n\r\n return (\r\n <ModalPortal>\r\n <Container ref={ref}>\r\n <SpellInfoDisplay spell={spell} />\r\n </Container>\r\n </ModalPortal>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n position: absolute;\r\n z-index: 100;\r\n pointer-events: none;\r\n left: 0;\r\n top: 0;\r\n opacity: 0;\r\n transition: opacity 0.08s;\r\n`;\r\n","import { ISpell } from '@rpg-engine/shared';\r\nimport React, { useState } from 'react';\r\nimport { MobileSpellTooltip } from './MobileSpellTooltip';\r\nimport { MagicTooltip } from './SpellTooltip';\r\n\r\ninterface ISpellInfoWrapperProps {\r\n spell: ISpell;\r\n children: React.ReactNode;\r\n scale?: number;\r\n}\r\n\r\nexport const SpellInfoWrapper: React.FC<ISpellInfoWrapperProps> = ({\r\n children,\r\n spell,\r\n scale,\r\n}) => {\r\n const [isTooltipVisible, setIsTooltipVisible] = useState(false);\r\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\r\n\r\n return (\r\n <div\r\n onMouseEnter={() => {\r\n if (!isTooltipMobileVisible) setIsTooltipVisible(true);\r\n }}\r\n onMouseLeave={setIsTooltipVisible.bind(null, false)}\r\n onTouchEnd={() => {\r\n setIsTooltipMobileVisible(true);\r\n setIsTooltipVisible(false);\r\n }}\r\n >\r\n {children}\r\n\r\n {isTooltipVisible && !isTooltipMobileVisible && (\r\n <MagicTooltip spell={spell} />\r\n )}\r\n {isTooltipMobileVisible && (\r\n <MobileSpellTooltip\r\n closeTooltip={() => {\r\n setIsTooltipMobileVisible(false);\r\n console.log('close');\r\n }}\r\n spell={spell}\r\n scale={scale}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n","import { ISpell } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport { SpellInfoWrapper } from './cards/SpellInfoWrapper';\r\n\r\nexport interface ISpellProps {\r\n charMana: number;\r\n charMagicLevel: number;\r\n onPointerUp?: (spellKey: string) => void;\r\n isSettingShortcut?: boolean;\r\n spellKey: string;\r\n spell: ISpell;\r\n activeCooldown?: number;\r\n}\r\n\r\nexport const Spell: React.FC<ISpellProps> = ({\r\n spellKey,\r\n charMana,\r\n charMagicLevel,\r\n onPointerUp,\r\n isSettingShortcut,\r\n spell,\r\n activeCooldown,\r\n}) => {\r\n const {\r\n manaCost,\r\n minMagicLevelRequired,\r\n magicWords,\r\n name,\r\n description,\r\n } = spell;\r\n const disabled = isSettingShortcut\r\n ? charMagicLevel < minMagicLevelRequired\r\n : manaCost > charMana || charMagicLevel < minMagicLevelRequired;\r\n\r\n return (\r\n <SpellInfoWrapper spell={spell}>\r\n <Container\r\n disabled={disabled || (activeCooldown ?? 0) > 0}\r\n onPointerUp={onPointerUp?.bind(null, spellKey)}\r\n isSettingShortcut={isSettingShortcut && !disabled}\r\n className=\"spell\"\r\n >\r\n {disabled && (\r\n <Overlay>\r\n {charMagicLevel < minMagicLevelRequired\r\n ? 'Low magic level'\r\n : manaCost > charMana && 'No mana'}\r\n </Overlay>\r\n )}\r\n <SpellImage>\r\n {activeCooldown && activeCooldown > 0 ? (\r\n <span className=\"cooldown\">\r\n {activeCooldown.toFixed(activeCooldown > 10 ? 0 : 1)}\r\n </span>\r\n ) : null}\r\n {magicWords.split(' ').map(word => word[0])}\r\n </SpellImage>\r\n <Info>\r\n <Title>\r\n <span>{name}</span>\r\n <span className=\"spell\">({magicWords})</span>\r\n </Title>\r\n <Description>{description}</Description>\r\n </Info>\r\n\r\n <Divider />\r\n <Cost>\r\n <span>Mana cost:</span>\r\n <span className=\"mana\">{manaCost}</span>\r\n </Cost>\r\n </Container>\r\n </SpellInfoWrapper>\r\n );\r\n};\r\n\r\nconst Container = styled.button<{ isSettingShortcut?: boolean }>`\r\n display: block;\r\n background: none;\r\n border: 2px solid transparent;\r\n border-radius: 1rem;\r\n width: 100%;\r\n display: flex;\r\n\r\n gap: 1rem;\r\n align-items: center;\r\n padding: 0 1rem;\r\n text-align: left;\r\n position: relative;\r\n\r\n animation: ${({ isSettingShortcut }) =>\r\n isSettingShortcut ? 'border-color-change 1s infinite' : 'none'};\r\n\r\n @keyframes border-color-change {\r\n 0% {\r\n border-color: ${uiColors.yellow};\r\n }\r\n 50% {\r\n border-color: transparent;\r\n }\r\n 100% {\r\n border-color: ${uiColors.yellow};\r\n }\r\n }\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: ${uiColors.darkGray};\r\n }\r\n\r\n &:active {\r\n background: none;\r\n }\r\n`;\r\n\r\nconst SpellImage = styled.div`\r\n width: 4rem;\r\n height: 4rem;\r\n font-size: ${uiFonts.size.xLarge};\r\n font-weight: bold;\r\n background-color: ${uiColors.darkGray};\r\n color: ${uiColors.lightGray};\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n text-transform: uppercase;\r\n position: relative;\r\n overflow: hidden;\r\n\r\n .cooldown {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0 0 0 / 20%);\r\n color: ${uiColors.darkYellow};\r\n font-weight: bold;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n }\r\n`;\r\n\r\nconst Info = styled.span`\r\n width: 0;\r\n flex: 1;\r\n\r\n @media (orientation: portrait) {\r\n display: none;\r\n }\r\n`;\r\nconst Title = styled.p`\r\n display: flex;\r\n flex-wrap: wrap;\r\n align-items: center;\r\n margin-bottom: 5px;\r\n margin: 0;\r\n\r\n span {\r\n font-size: ${uiFonts.size.medium} !important;\r\n font-weight: bold !important;\r\n color: ${uiColors.yellow} !important;\r\n margin-right: 0.5rem;\r\n }\r\n\r\n .spell {\r\n font-size: ${uiFonts.size.small} !important;\r\n font-weight: normal !important;\r\n color: ${uiColors.lightGray} !important;\r\n }\r\n`;\r\n\r\nconst Description = styled.div`\r\n font-size: ${uiFonts.size.small} !important;\r\n line-height: 1.1 !important;\r\n`;\r\n\r\nconst Divider = styled.div`\r\n width: 1px;\r\n height: 100%;\r\n margin: 0 1rem;\r\n background-color: ${uiColors.lightGray};\r\n`;\r\n\r\nconst Cost = styled.p`\r\n display: flex;\r\n align-items: center;\r\n flex-direction: column;\r\n gap: 0.5rem;\r\n\r\n div {\r\n z-index: 1;\r\n }\r\n\r\n .mana {\r\n position: relative;\r\n font-size: ${uiFonts.size.medium};\r\n font-weight: bold;\r\n z-index: 1;\r\n\r\n &::after {\r\n position: absolute;\r\n content: '';\r\n top: 0;\r\n left: 0;\r\n background-color: ${uiColors.blue};\r\n width: 100%;\r\n height: 100%;\r\n border-radius: 50%;\r\n transform: scale(1.8);\r\n filter: blur(10px);\r\n z-index: -1;\r\n }\r\n }\r\n`;\r\n\r\nconst Overlay = styled.p`\r\n margin: 0 !important;\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n border-radius: 1rem;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n color: ${uiColors.yellow};\r\n font-size: ${uiFonts.size.large} !important;\r\n font-weight: bold;\r\n z-index: 10;\r\n background-color: rgba(0 0 0 / 0.2);\r\n`;\r\n","import { IShortcut, ISpell } from '@rpg-engine/shared';\r\nimport React, { Fragment, useEffect, useMemo, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { Input } from '../Input';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { ShortcutsSetter } from '../Shortcuts/ShortcutsSetter';\r\nimport { Spell } from './Spell';\r\n\r\nexport interface ISpellbookProps {\r\n onClose?: () => void;\r\n onInputFocus?: () => void;\r\n onInputBlur?: () => void;\r\n spells: ISpell[];\r\n magicLevel: number;\r\n mana: number;\r\n onSpellClick: (spellKey: string) => void;\r\n setSpellShortcut: (key: string, index: number) => void;\r\n shortcuts: IShortcut[];\r\n removeShortcut: (index: number) => void;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n scale?: number;\r\n spellCooldowns?: Record<string, number>;\r\n}\r\n\r\nexport const Spellbook: React.FC<ISpellbookProps> = ({\r\n onClose,\r\n onInputFocus,\r\n onInputBlur,\r\n spells,\r\n magicLevel,\r\n mana,\r\n onSpellClick,\r\n setSpellShortcut,\r\n shortcuts,\r\n removeShortcut,\r\n atlasIMG,\r\n atlasJSON,\r\n scale,\r\n spellCooldowns,\r\n}) => {\r\n const [search, setSearch] = useState('');\r\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\r\n\r\n useEffect(() => {\r\n const handleEscapeClose = (e: KeyboardEvent) => {\r\n if (e.key === 'Escape') {\r\n onClose?.();\r\n }\r\n };\r\n\r\n document.addEventListener('keydown', handleEscapeClose);\r\n\r\n return () => {\r\n document.removeEventListener('keydown', handleEscapeClose);\r\n };\r\n }, [onClose]);\r\n\r\n const spellsToDisplay = useMemo(() => {\r\n return spells\r\n .sort((a, b) => {\r\n if (a.minMagicLevelRequired > b.minMagicLevelRequired) return 1;\r\n if (a.minMagicLevelRequired < b.minMagicLevelRequired) return -1;\r\n return 0;\r\n })\r\n .filter(\r\n spell =>\r\n spell.name.toLocaleLowerCase().includes(search.toLocaleLowerCase()) ||\r\n spell.magicWords\r\n .toLocaleLowerCase()\r\n .includes(search.toLocaleLowerCase())\r\n );\r\n }, [search, spells]);\r\n\r\n const setShortcut = (spellKey: string) => {\r\n setSpellShortcut?.(spellKey, settingShortcutIndex);\r\n setSettingShortcutIndex(-1);\r\n };\r\n\r\n return (\r\n <DraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={onClose}\r\n width=\"inherit\"\r\n height=\"inherit\"\r\n cancelDrag=\"#spellbook-search, #shortcuts_list, .spell\"\r\n scale={scale}\r\n >\r\n <Container>\r\n <Title>Learned Spells</Title>\r\n\r\n <ShortcutsSetter\r\n setSettingShortcutIndex={setSettingShortcutIndex}\r\n settingShortcutIndex={settingShortcutIndex}\r\n shortcuts={shortcuts}\r\n removeShortcut={removeShortcut}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n\r\n <Input\r\n placeholder=\"Search for spell\"\r\n value={search}\r\n onChange={e => setSearch(e.target.value)}\r\n onFocus={onInputFocus}\r\n onBlur={onInputBlur}\r\n id=\"spellbook-search\"\r\n />\r\n\r\n <SpellList>\r\n {spellsToDisplay.map(spell => (\r\n <Fragment key={spell.key}>\r\n <Spell\r\n charMana={mana}\r\n charMagicLevel={magicLevel}\r\n onPointerUp={\r\n settingShortcutIndex !== -1 ? setShortcut : onSpellClick\r\n }\r\n spellKey={spell.key}\r\n isSettingShortcut={settingShortcutIndex !== -1}\r\n spell={spell}\r\n activeCooldown={\r\n spellCooldowns?.[spell.magicWords.replaceAll(' ', '_')]\r\n }\r\n {...spell}\r\n />\r\n </Fragment>\r\n ))}\r\n </SpellList>\r\n </Container>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst Title = styled.h1`\r\n font-size: ${uiFonts.size.large} !important;\r\n margin-bottom: 0 !important;\r\n \r\n`;\r\n\r\nconst Container = styled.div`\r\n width: 100%;\r\n height: 100%;\r\n color: white;\r\n display: flex;\r\n flex-direction: column;\r\n \r\n`;\r\n\r\nconst SpellList = styled.div`\r\n width: 100%;\r\n min-height: 0;\r\n flex: 1;\r\n overflow-y: auto;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 1.5rem;\r\n margin-top: 1rem;\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nimport { PeriodOfDay } from '@rpg-engine/shared';\r\nimport AfternoonGif from './gif/afternoon.gif';\r\nimport MorningGif from './gif/morning.gif';\r\nimport NightGif from './gif/night.gif';\r\n\r\nexport interface IPeriodOfDayDisplayProps {\r\n periodOfDay: PeriodOfDay;\r\n}\r\n\r\nexport const DayNightPeriod: React.FC<IPeriodOfDayDisplayProps> = ({\r\n periodOfDay,\r\n}) => {\r\n const periodOfDaySrcFiles = {\r\n [PeriodOfDay.Morning]: MorningGif,\r\n [PeriodOfDay.Afternoon]: AfternoonGif,\r\n [PeriodOfDay.Night]: NightGif,\r\n };\r\n\r\n return (\r\n <GifContainer>\r\n <img src={periodOfDaySrcFiles[periodOfDay]} />\r\n </GifContainer>\r\n );\r\n};\r\n\r\nconst GifContainer = styled.div`\r\n width: 100%;\r\n\r\n img {\r\n width: 67%;\r\n }\r\n`;\r\n","import { PeriodOfDay } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport Draggable from 'react-draggable';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport { DayNightPeriod } from './DayNightPeriod/DayNightPeriod';\r\n\r\nimport ClockWidgetImg from './img/clockwidget.png';\r\n\r\nexport interface IClockWidgetProps {\r\n onClose?: () => void;\r\n TimeClock: string;\r\n periodOfDay: PeriodOfDay;\r\n scale?: number;\r\n}\r\n\r\nexport const TimeWidget: React.FC<IClockWidgetProps> = ({\r\n onClose,\r\n TimeClock,\r\n periodOfDay,\r\n scale,\r\n}) => {\r\n return (\r\n <Draggable scale={scale}>\r\n <WidgetContainer>\r\n <CloseButton onPointerDown={onClose}>X</CloseButton>\r\n <DayNightContainer>\r\n <DayNightPeriod periodOfDay={periodOfDay} />\r\n </DayNightContainer>\r\n <Time>{TimeClock}</Time>\r\n </WidgetContainer>\r\n </Draggable>\r\n );\r\n};\r\n\r\nconst WidgetContainer = styled.div`\r\n background-image: url(${ClockWidgetImg});\r\n background-size: 10rem;\r\n background-repeat: no-repeat;\r\n width: 10rem;\r\n position: absolute;\r\n height: 100px;\r\n`;\r\n\r\nconst Time = styled.div`\r\n top: 0.75rem;\r\n right: 0.5rem;\r\n position: absolute;\r\n font-size: ${uiFonts.size.small};\r\n color: white;\r\n`;\r\n\r\nconst CloseButton = styled.p`\r\n position: absolute;\r\n top: -0.5rem;\r\n margin: 0;\r\n right: -0.2rem;\r\n font-size: ${uiFonts.size.small} !important;\r\n z-index: 1;\r\n`;\r\n\r\nconst DayNightContainer = styled.div`\r\n margin-top: -0.3rem;\r\n margin-left: -0.3rem;\r\n`;\r\n","import {\r\n getItemTextureKeyPath,\r\n IEquipmentSet,\r\n ITradeResponseItem,\r\n} from '@rpg-engine/shared';\r\nimport capitalize from 'lodash/capitalize';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport SelectArrow from '../Arrow/SelectArrow';\r\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\r\nimport { Ellipsis } from '../shared/Ellipsis';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\nexport interface ITradeComponentProps {\r\n traderItem: ITradeResponseItem;\r\n onQuantityChange: (\r\n traderItem: ITradeResponseItem,\r\n selectedQty: number\r\n ) => void;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n selectedQty: number;\r\n equipmentSet?: IEquipmentSet | null;\r\n scale?: number;\r\n}\r\n\r\nconst outerQty = 10;\r\n\r\nexport const TradingItemRow: React.FC<ITradeComponentProps> = ({\r\n atlasIMG,\r\n atlasJSON,\r\n onQuantityChange,\r\n traderItem,\r\n selectedQty,\r\n equipmentSet,\r\n scale,\r\n}) => {\r\n const onLeftClick = (qty = 1) => {\r\n onQuantityChange(traderItem, Math.max(0, selectedQty - qty));\r\n };\r\n\r\n const onRightClick = (qty = 1) => {\r\n onQuantityChange(\r\n traderItem,\r\n Math.min(traderItem.stackQty ?? 999, selectedQty + qty)\r\n );\r\n };\r\n\r\n return (\r\n <ItemWrapper>\r\n <ItemIconContainer>\r\n <SpriteContainer>\r\n <ItemInfoWrapper\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n item={traderItem}\r\n scale={scale}\r\n >\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: traderItem.key,\r\n stackQty: traderItem.stackQty || 1,\r\n texturePath: traderItem.texturePath,\r\n isStackable: traderItem.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n imgScale={2.5}\r\n />\r\n </ItemInfoWrapper>\r\n </SpriteContainer>\r\n </ItemIconContainer>\r\n\r\n <ItemNameContainer>\r\n <NameValue>\r\n <p>\r\n <Ellipsis maxLines={1} maxWidth=\"250px\">\r\n {capitalize(traderItem.name)}\r\n </Ellipsis>\r\n </p>\r\n <p>${traderItem.price}</p>\r\n </NameValue>\r\n </ItemNameContainer>\r\n <QuantityContainer>\r\n <SelectArrow\r\n size={32}\r\n className=\"arrow-selector\"\r\n direction=\"left\"\r\n onPointerDown={onLeftClick.bind(null, outerQty)}\r\n />\r\n <StyledArrow\r\n size={32}\r\n className=\"arrow-selector\"\r\n direction=\"left\"\r\n onPointerDown={onLeftClick}\r\n />\r\n <QuantityDisplay>\r\n <TextOverlay>\r\n <Item>{selectedQty}</Item>\r\n </TextOverlay>\r\n </QuantityDisplay>\r\n <StyledArrow\r\n size={32}\r\n className=\"arrow-selector\"\r\n direction=\"right\"\r\n onPointerDown={onRightClick}\r\n />\r\n <SelectArrow\r\n size={32}\r\n className=\"arrow-selector\"\r\n direction=\"right\"\r\n onPointerDown={onRightClick.bind(null, outerQty)}\r\n />\r\n </QuantityContainer>\r\n </ItemWrapper>\r\n );\r\n};\r\n\r\nconst StyledArrow = styled(SelectArrow)`\r\n margin: 40px;\r\n`;\r\n\r\nconst ItemWrapper = styled.div`\r\n width: 100%;\r\n margin: auto;\r\n display: flex;\r\n justify-content: space-between;\r\n margin-bottom: 1rem;\r\n\r\n &:hover {\r\n background-color: ${uiColors.darkGray};\r\n }\r\n padding: 0.5rem;\r\n`;\r\n\r\nconst ItemNameContainer = styled.div`\r\n flex: 60%;\r\n`;\r\n\r\nconst ItemIconContainer = styled.div`\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n\r\n flex: 0 0 58px;\r\n`;\r\n\r\nconst SpriteContainer = styled.div`\r\n position: relative;\r\n top: -0.5rem;\r\n left: 0.5rem;\r\n`;\r\n\r\nconst NameValue = styled.div`\r\n p {\r\n font-size: 0.75rem;\r\n margin: 0;\r\n }\r\n`;\r\n\r\nconst Item = styled.span`\r\n color: white;\r\n text-align: center;\r\n z-index: 1;\r\n\r\n width: 100%;\r\n`;\r\n\r\nconst TextOverlay = styled.div`\r\n width: 100%;\r\n position: relative;\r\n`;\r\n\r\ninterface IContainerProps {\r\n percentageWidth?: number;\r\n minWidth?: number;\r\n style?: Record<string, any>;\r\n}\r\n\r\nconst QuantityContainer = styled.div<IContainerProps>`\r\n position: relative;\r\n display: flex;\r\n\r\n min-width: 100px;\r\n width: 40%;\r\n justify-content: center;\r\n align-items: center;\r\n\r\n flex: 40%;\r\n`;\r\n\r\nconst QuantityDisplay = styled.div`\r\n font-size: ${uiFonts.size.small};\r\n`;\r\n","import {\r\n IEquipmentSet,\r\n ITradeRequestItem,\r\n ITradeResponseItem,\r\n TradeTransactionType,\r\n} from '@rpg-engine/shared';\r\nimport React, { useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { TradingItemRow } from './TradingItemRow';\r\n\r\nexport interface ITradingMenu {\r\n traderItems: ITradeResponseItem[];\r\n onClose: () => void;\r\n onConfirm: (items: ITradeRequestItem[]) => void;\r\n type: TradeTransactionType;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n characterAvailableGold: number;\r\n equipmentSet?: IEquipmentSet | null;\r\n scale?: number;\r\n}\r\n\r\nexport const TradingMenu: React.FC<ITradingMenu> = ({\r\n traderItems,\r\n onClose,\r\n type,\r\n atlasJSON,\r\n atlasIMG,\r\n characterAvailableGold,\r\n onConfirm,\r\n equipmentSet,\r\n scale,\r\n}) => {\r\n const [sum, setSum] = useState(0);\r\n const [qtyMap, setQtyMap] = useState(new Map());\r\n\r\n const onQuantityChange = (item: ITradeResponseItem, selectedQty: number) => {\r\n setQtyMap(new Map(qtyMap.set(item.key, selectedQty)));\r\n\r\n let newSum = 0;\r\n traderItems.forEach(item => {\r\n const qty = qtyMap.get(item.key);\r\n if (qty) newSum += qty * item.price;\r\n setSum(newSum);\r\n });\r\n };\r\n\r\n const isBuy = () => {\r\n return type == 'buy';\r\n };\r\n\r\n const hasGoldForSale = () => {\r\n if (isBuy()) {\r\n return !(sum > characterAvailableGold);\r\n }\r\n return true;\r\n };\r\n\r\n const getFinalGold = () => {\r\n if (isBuy()) {\r\n return characterAvailableGold - sum;\r\n } else {\r\n return characterAvailableGold + sum;\r\n }\r\n };\r\n\r\n const Capitalize = (word: string) => {\r\n return word[0].toUpperCase() + word.substring(1);\r\n };\r\n\r\n const onConfirmClick = () => {\r\n const items: ITradeRequestItem[] = [];\r\n\r\n traderItems.forEach(item => {\r\n const qty = qtyMap.get(item.key);\r\n if (qty) {\r\n items.push(Object.assign({}, item, { qty: qty }));\r\n }\r\n });\r\n\r\n onConfirm(items);\r\n };\r\n\r\n return (\r\n <DraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) onClose();\r\n }}\r\n width=\"600px\"\r\n cancelDrag=\"#TraderContainer\"\r\n scale={scale}\r\n >\r\n <>\r\n <div style={{ width: '100%' }}>\r\n <Title>{Capitalize(type)} Menu</Title>\r\n <hr className=\"golden\" />\r\n </div>\r\n <TradingComponentScrollWrapper id=\"TraderContainer\">\r\n {traderItems.map((tradeItem, index) => (\r\n <ItemWrapper key={`${tradeItem.key}_${index}`}>\r\n <TradingItemRow\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n onQuantityChange={onQuantityChange}\r\n traderItem={tradeItem}\r\n selectedQty={qtyMap.get(tradeItem.key) ?? 0}\r\n equipmentSet={equipmentSet}\r\n scale={scale}\r\n />\r\n </ItemWrapper>\r\n ))}\r\n </TradingComponentScrollWrapper>\r\n <GoldWrapper>\r\n <p>Available Gold:</p>\r\n <p>${characterAvailableGold}</p>\r\n </GoldWrapper>\r\n <TotalWrapper>\r\n <p>Total:</p>\r\n <p>${sum}</p>\r\n </TotalWrapper>\r\n {!hasGoldForSale() ? (\r\n <AlertWrapper>\r\n <p> Sorry, not enough money.</p>\r\n </AlertWrapper>\r\n ) : (\r\n <GoldWrapper>\r\n <p>Final Gold:</p>\r\n <p>${getFinalGold()}</p>\r\n </GoldWrapper>\r\n )}\r\n\r\n <ButtonWrapper>\r\n <Button\r\n buttonType={ButtonTypes.RPGUIButton}\r\n disabled={!hasGoldForSale()}\r\n onPointerDown={() => onConfirmClick()}\r\n >\r\n Confirm\r\n </Button>\r\n <Button\r\n buttonType={ButtonTypes.RPGUIButton}\r\n onPointerDown={() => onClose()}\r\n >\r\n Cancel\r\n </Button>\r\n </ButtonWrapper>\r\n </>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst Title = styled.h1`\r\n z-index: 22;\r\n font-size: 0.6rem;\r\n color: yellow !important;\r\n`;\r\n\r\nconst TradingComponentScrollWrapper = styled.div`\r\n overflow-y: scroll;\r\n height: 390px;\r\n width: 100%;\r\n margin-top: 1rem;\r\n`;\r\n\r\nconst ItemWrapper = styled.div`\r\n margin: auto;\r\n display: flex;\r\n justify-content: space-between;\r\n`;\r\n\r\nconst TotalWrapper = styled.div`\r\n margin-top: 1rem;\r\n display: flex;\r\n justify-content: space-between;\r\n height: 20px;\r\n p {\r\n color: white !important;\r\n }\r\n width: 100%;\r\n margin-left: 0.8rem;\r\n`;\r\n\r\nconst GoldWrapper = styled.div`\r\n margin-top: 1rem;\r\n display: flex;\r\n justify-content: space-between;\r\n height: 20px;\r\n p {\r\n color: yellow !important;\r\n }\r\n width: 100%;\r\n margin-left: 0.8rem;\r\n`;\r\n\r\nconst AlertWrapper = styled.div`\r\n margin-top: 1rem;\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n height: 20px;\r\n p {\r\n color: red !important;\r\n }\r\n`;\r\n\r\nconst ButtonWrapper = styled.div`\r\n display: flex;\r\n justify-content: space-around;\r\n padding-top: 20px;\r\n width: 100%;\r\n margin-top: 1rem;\r\n button {\r\n padding: 0px 50px;\r\n }\r\n`;\r\n","/* eslint-disable react/require-default-props */\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\n\r\ninterface IProps {\r\n maxLines?: number;\r\n children: React.ReactNode;\r\n}\r\n\r\nexport const Truncate: React.FC<IProps> = ({ maxLines = 1, children }) => {\r\n return <Container maxLines={maxLines}>{children}</Container>;\r\n};\r\n\r\ninterface IContainerProps {\r\n maxLines: number;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n display: -webkit-box;\r\n max-width: 100%;\r\n max-height: 100%;\r\n -webkit-line-clamp: ${props => props.maxLines};\r\n -webkit-box-orient: vertical;\r\n overflow: hidden;\r\n`;\r\n","import { isMobileOrTablet } from '@rpg-engine/shared';\r\n\r\nexport const IS_MOBILE_OR_TABLET = isMobileOrTablet();\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { NPCDialogType } from '../..';\r\nimport { IS_MOBILE_OR_TABLET } from '../../constants/uiDevices';\r\nimport { chunkString } from '../../libs/StringHelpers';\r\nimport { DynamicText } from '../typography/DynamicText';\r\nimport pressButtonGif from './img/press-button.gif';\r\nimport pressSpaceGif from './img/space.gif';\r\n\r\ninterface IProps {\r\n text: string;\r\n onClose: () => void;\r\n onEndStep?: () => void;\r\n onStartStep?: () => void;\r\n type?: NPCDialogType;\r\n}\r\n\r\nexport const NPCDialogText: React.FC<IProps> = ({\r\n text,\r\n onClose,\r\n onEndStep,\r\n onStartStep,\r\n type,\r\n}) => {\r\n const windowSize = useRef([window.innerWidth, window.innerHeight]);\r\n function maxCharacters(width: number) {\r\n // Set the font size to 16 pixels\r\n var fontSize = 11.2;\r\n\r\n // Calculate the number of characters that can fit in one line\r\n var charactersPerLine = Math.floor(width / 2 / fontSize);\r\n\r\n // Calculate the number of lines that can fit in the div\r\n var linesPerDiv = Math.floor(180 / fontSize);\r\n\r\n // Calculate the maximum number of characters that can fit in the div\r\n var maxCharacters = charactersPerLine * linesPerDiv;\r\n\r\n // Return the maximum number of characters\r\n return Math.round(maxCharacters / 5);\r\n }\r\n\r\n const textChunks = chunkString(text, maxCharacters(windowSize.current[0]));\r\n\r\n const [chunkIndex, setChunkIndex] = useState<number>(0);\r\n const onHandleSpacePress = (event: KeyboardEvent) => {\r\n if (event.code === 'Space') {\r\n goToNextStep();\r\n }\r\n };\r\n\r\n const goToNextStep = () => {\r\n const hasNextChunk = textChunks?.[chunkIndex + 1] || false;\r\n\r\n if (hasNextChunk) {\r\n setChunkIndex(prev => prev + 1);\r\n } else {\r\n // if there's no more text chunks, close the dialog\r\n onClose();\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n document.addEventListener('keydown', onHandleSpacePress);\r\n\r\n return () => document.removeEventListener('keydown', onHandleSpacePress);\r\n }, [chunkIndex]);\r\n\r\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\r\n false\r\n );\r\n\r\n return (\r\n <Container>\r\n <DynamicText\r\n text={textChunks?.[chunkIndex] || ''}\r\n onFinish={() => {\r\n setShowGoNextIndicator(true);\r\n\r\n onEndStep && onEndStep();\r\n }}\r\n onStart={() => {\r\n setShowGoNextIndicator(false);\r\n\r\n onStartStep && onStartStep();\r\n }}\r\n />\r\n {showGoNextIndicator && (\r\n <PressSpaceIndicator\r\n right={type === NPCDialogType.TextOnly ? '1rem' : '10.5rem'}\r\n src={IS_MOBILE_OR_TABLET ? pressButtonGif : pressSpaceGif}\r\n onPointerDown={() => {\r\n goToNextStep();\r\n }}\r\n />\r\n )}\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div``;\r\n\r\ninterface IPressSpaceIndicatorProps {\r\n right: string;\r\n}\r\n\r\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\r\n position: absolute;\r\n right: ${({ right }) => right};\r\n bottom: 1rem;\r\n height: 20.7px;\r\n image-rendering: -webkit-optimize-contrast;\r\n`;\r\n","export const chunkString = (str: string, length: number) => {\r\n return str.match(new RegExp('.{1,' + length + '}', 'g'));\r\n};\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { NPCDialog, NPCDialogType } from './NPCDialog/NPCDialog';\r\nimport { NPCMultiDialog, NPCMultiDialogType } from './NPCDialog/NPCMultiDialog';\r\nimport {\r\n IQuestionDialog,\r\n IQuestionDialogAnswer,\r\n QuestionDialog,\r\n} from './NPCDialog/QuestionDialog/QuestionDialog';\r\n\r\nexport interface IHistoryDialogProps {\r\n backgroundImgPath: string[];\r\n fullCoverBackground: boolean;\r\n questions?: IQuestionDialog[];\r\n answers?: IQuestionDialogAnswer[];\r\n text?: string;\r\n imagePath?: string;\r\n textAndTypeArray?: NPCMultiDialogType[];\r\n onClose: () => void;\r\n}\r\n\r\nexport const HistoryDialog: React.FC<IHistoryDialogProps> = ({\r\n backgroundImgPath,\r\n fullCoverBackground,\r\n questions,\r\n answers,\r\n text,\r\n imagePath,\r\n textAndTypeArray,\r\n onClose,\r\n}) => {\r\n const [img, setImage] = useState<number>(0);\r\n const onHandleSpacePress = (event: KeyboardEvent) => {\r\n if (event.code === 'Space') {\r\n if (img < backgroundImgPath?.length - 1) {\r\n setImage(prev => prev + 1);\r\n } else {\r\n // if there's no more text chunks, close the dialog\r\n onClose();\r\n }\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n document.addEventListener('keydown', onHandleSpacePress);\r\n\r\n return () => document.removeEventListener('keydown', onHandleSpacePress);\r\n }, [backgroundImgPath]);\r\n return (\r\n <BackgroundContainer\r\n imgPath={backgroundImgPath[img]}\r\n fullImg={fullCoverBackground}\r\n >\r\n <DialogContainer>\r\n {textAndTypeArray ? (\r\n <NPCMultiDialog\r\n textAndTypeArray={textAndTypeArray}\r\n onClose={onClose}\r\n />\r\n ) : questions && answers ? (\r\n <QuestionDialog\r\n questions={questions}\r\n answers={answers}\r\n onClose={onClose}\r\n />\r\n ) : text && imagePath ? (\r\n <NPCDialog\r\n text={text}\r\n imagePath={imagePath}\r\n onClose={onClose}\r\n type={NPCDialogType.TextAndThumbnail}\r\n />\r\n ) : (\r\n <NPCDialog\r\n text={text}\r\n onClose={onClose}\r\n type={NPCDialogType.TextOnly}\r\n />\r\n )}\r\n </DialogContainer>\r\n </BackgroundContainer>\r\n );\r\n};\r\n\r\ninterface IImgContainerProps {\r\n imgPath: string;\r\n fullImg: boolean;\r\n}\r\n\r\nconst BackgroundContainer = styled.div<IImgContainerProps>`\r\n width: 100%;\r\n height: 100%;\r\n background-image: url(${props => props.imgPath});\r\n background-size: ${props => (props.imgPath ? 'cover' : 'auto')};\r\n display: flex;\r\n justify-content: space-evenly;\r\n align-items: center;\r\n`;\r\n\r\nconst DialogContainer = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n padding-top: 200px;\r\n`;\r\n","import React, { useEffect, useState } from 'react';\r\n\r\nexport interface ICheckItems {\r\n label: string;\r\n value: string;\r\n}\r\n\r\nexport interface ICheckProps {\r\n items: ICheckItems[];\r\n onChange: (selectedValues: IChecklistSelectedValues) => void;\r\n}\r\n\r\nexport interface IChecklistSelectedValues {\r\n [label: string]: boolean;\r\n}\r\n\r\nexport const CheckButton: React.FC<ICheckProps> = ({ items, onChange }) => {\r\n const generateSelectedValuesList = () => {\r\n const selectedValues: IChecklistSelectedValues = {};\r\n\r\n items.forEach(item => {\r\n selectedValues[item.label] = false;\r\n });\r\n\r\n return selectedValues;\r\n };\r\n\r\n const [selectedValues, setSelectedValues] = useState<\r\n IChecklistSelectedValues\r\n >(generateSelectedValuesList());\r\n\r\n const handleClick = (label: string) => {\r\n setSelectedValues({\r\n ...selectedValues,\r\n [label]: !selectedValues[label],\r\n });\r\n };\r\n\r\n useEffect(() => {\r\n if (selectedValues) {\r\n onChange(selectedValues);\r\n }\r\n }, [selectedValues]);\r\n\r\n return (\r\n <div id=\"elemento-checkbox\">\r\n {items?.map((element, index) => {\r\n return (\r\n <div key={`${element.label}_${index}`}>\r\n <input\r\n className=\"rpgui-checkbox\"\r\n type=\"checkbox\"\r\n checked={selectedValues[element.label]}\r\n onChange={() => {}}\r\n />\r\n <label onPointerDown={() => handleClick(element.label)}>\r\n {element.label}\r\n </label>\r\n <br />\r\n </div>\r\n );\r\n })}\r\n </div>\r\n );\r\n};\r\n","import React, { useEffect, useState } from 'react';\r\n\r\nexport interface IRadioItems {\r\n label: string;\r\n value: string;\r\n}\r\n\r\nexport interface IRadioProps {\r\n name: string;\r\n items: IRadioItems[];\r\n onChange: (value: string) => void;\r\n}\r\n\r\nexport const InputRadio: React.FC<IRadioProps> = ({\r\n name,\r\n items,\r\n onChange,\r\n}) => {\r\n const [selectedValue, setSelectedValue] = useState<string>();\r\n const handleClick = () => {\r\n let element = document.querySelector(\r\n `input[name=${name}]:checked`\r\n ) as HTMLInputElement;\r\n const elementValue = element.value;\r\n setSelectedValue(elementValue);\r\n };\r\n\r\n useEffect(() => {\r\n if (selectedValue) {\r\n onChange(selectedValue);\r\n }\r\n }, [selectedValue]);\r\n\r\n return (\r\n <div id=\"elemento-radio\">\r\n {items.map(element => {\r\n return (\r\n <>\r\n <input\r\n key={element.value}\r\n className=\"rpgui-radio\"\r\n value={element.value}\r\n name={name}\r\n type=\"radio\"\r\n />\r\n <label onPointerDown={handleClick}>{element.label}</label>\r\n <br />\r\n </>\r\n );\r\n })}\r\n </div>\r\n );\r\n};\r\n","import React from 'react';\r\n\r\nexport interface ITextArea\r\n extends React.DetailedHTMLProps<\r\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\r\n HTMLTextAreaElement\r\n > {}\r\n\r\nexport const TextArea: React.FC<ITextArea> = ({ ...props }) => {\r\n return <textarea {...props} />;\r\n};\r\n"],"names":["ButtonTypes","RPGUIContainerTypes","Button","disabled","children","buttonType","onPointerDown","props","React","ButtonContainer","className","styled","button","displayName","componentId","SpriteFromAtlas","atlasJSON","atlasIMG","spriteKey","_ref$width","width","GRID_WIDTH","_ref$height","height","GRID_HEIGHT","_ref$imgScale","imgScale","imgStyle","containerStyle","_ref$grayScale","grayScale","_ref$opacity","opacity","imgClassname","spriteData","frames","Error","Container","hasHover","style","ImgSprite","frame","scale","div","w","h","x","y","ErrorBoundary","args","_this","state","hasError","getDerivedStateFromError","_","_proto","componentDidCatch","error","errorInfo","console","render","this","Component","SelectArrow","direction","size","LeftArrow","RightArrow","span","Ellipsis","maxWidth","fontSize","center","maxLines","PropertySelect","item","availableProperties","onChange","useState","currentIndex","setCurrentIndex","propertiesLength","length","useEffect","JSON","stringify","TextOverlay","Item","name","index","Column","flex","flexWrap","alignItems","justifyContent","ChatContainer","TextField","input","MessagesContainer","Message","color","Form","form","buttonColor","buttonBackgroundColor","Input","rest","ref","innerRef","RPGUIContainer","type","CloseButton","CustomInput","CustomContainer","MessageText","p","SingleShortcut","useShortcutCooldown","onShortcutCast","shortcutCooldown","setShortcutCooldown","cooldownTimeout","useRef","current","clearTimeout","setTimeout","handleShortcutCast","log","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","id","handleClickOutside","event","contains","target","CustomEvent","detail","document","dispatchEvent","addEventListener","removeEventListener","RangeSliderType","DraggableContainer","_ref$type","FramedGold","onCloseButton","title","imgSrc","_ref$imgWidth","imgWidth","cancelDrag","onPositionChange","onPositionChangeEnd","onPositionChangeStart","onOutsideClick","_ref$initialPosition","initialPosition","draggableRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","h1","img","InputRadio","label","value","onRadioSelect","onPointerUp","checked","isChecked","readOnly","countItemFromInventory","itemKey","inventory","itemsFromInventory","Object","keys","slots","forEach","i","parseInt","_inventory$slots$inde","key","push","reduce","acc","stackQty","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","RelativeListMenu","options","onSelected","_ref$fontSize","pos","overflow","map","params","ListElement","text","li","MobileItemTooltip","closeTooltip","equipmentSet","_ref$scale","handleFadeOut","_ref$current","classList","add","onTouchEnd","ItemInfoDisplay","isMobile","OptionsContainer","option","Option","generateContextMenuListOptions","actionsByTypeList","action","ItemSocketEventsDisplayLabels","EquipmentSlotSpriteByType","Neck","LeftHand","Ring","Head","Torso","Legs","Feet","Inventory","RightHand","Accessory","ItemSlot","observer","slotIndex","containerType","itemContainerType","slotSpriteMask","onMouseOver","onMouseOut","_ref$isContextMenuDis","isContextMenuDisabled","onDragEnd","onDragStart","onPlaceDrop","onDrop","onOutsideDrop","checkIfItemCanBeMoved","openQuantitySelector","checkIfItemShouldDragEnd","dragScale","isSelectingShortcut","setItemShortcut","isDepotSystem","isTooltipVisible","setTooltipVisible","isTooltipMobileVisible","setIsTooltipMobileVisible","isContextMenuVisible","setIsContextMenuVisible","contextMenuPosition","setContextMenuPosition","isFocused","setIsFocused","wasDragged","setWasDragged","dragPosition","setDragPosition","dropPosition","setDropPosition","dragContainer","contextActions","setContextActions","contextActionMenu","ItemContainerType","ItemType","Weapon","Armor","Jewelry","ActionsForInventory","Equipment","Consumable","CraftingResource","Tool","Other","DepotSocketEvents","Deposit","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","contextActionMenuDontHaveUseWith","find","toLowerCase","includes","hasUseWith","Depot","ItemSocketEvents","GetItemInfo","Withdraw","generateContextMenu","getStackInfo","itemId","qtyClassName","ItemQtyContainer","ItemQty","Math","round","resetItem","onSuccesfulDrag","quantity","onMouseUp","e","changedTouches","clientX","clientY","simulatedEvent","MouseEvent","bubbles","elementFromPoint","_document$elementFrom","axis","defaultClassName","split","isNaN","classes","Array","from","_e$target","some","elm","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isTouch","abs","position","ItemContainer","onMouseEnter","onMouseLeave","itemToRender","texturePath","allowedEquipSlotType","_itemToRender$allowed","element","_id","getItemTextureKeyPath","isStackable","stackInfo","uuidv4","renderEquipment","renderItem","onRenderSlot","ItemTooltip","optionId","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","statisticsToDisplay","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","stat","itemToCompareStatistic","toUpperCase","slice","Statistic","toString","Header","Rarity","Type","subType","AllowedSlots","slotType","minRequirements","LevelRequirement","level","skill","itemStatistic","isItemToCompare","isOnlyInOneItem","statDiff","_itemToCompare$stat$k2","isDifference","isBetter","renderStatistics","entityEffects","entityEffectChance","effect","usableEffectDescription","equippedBuffDescription","isTwoHanded","Description","description","maxStackSize","StackInfo","MissingStatistics","$isSpecial","itemSlotTypes","useMemo","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","values","Flex","CompareContainer","Equipped","$isMobile","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","ItemInfoWrapper","setIsTooltipVisible","bind","CraftingRecipe","recipe","handleRecipeSelect","selectedCraftItemKey","skills","modifyString","str","parts","words","replace","concat","join","levelInSkill","minCraftingRequirements","_recipe$minCraftingRe2","_skills","RadioOptionsWrapper","SpriteAtlasWrapper","canCraft","undefined","display","MinCraftingRequirementsText","levelIsOk","_recipe$minCraftingRe4","_recipe$minCraftingRe6","ingredients","ingredient","itemQtyInInventory","Recipe","Ingredient","isQuantityOk","qty","desktop","mobileLanscape","mobilePortrait","Wrapper","Subtitle","RadioInputScroller","ButtonWrapper","ContentContainer","ItemTypes","Dropdown","dropdownId","selectedValue","setSelectedValue","selectedOption","setSelectedOption","opened","setOpened","firstOption","change","filter","o","DropdownSelect","prev","DropdownOptions","ul","Details","EquipmentSetContainer","EquipmentColumn","SlotsContainer","onClose","Framed","ImgSide","RangeSlider","valueMin","valueMax","sliderId","containerRef","left","setLeft","calculatedWidth","_containerRef$current","clientWidth","max","typeClass","GoldSlider","pointerEvents","min","Number","ItemQuantitySelector","onConfirm","setValue","inputRef","focus","select","closeSelector","StyledContainer","StyledForm","onSubmit","preventDefault","numberValue","noValidate","StyledInput","placeholder","onBlur","newValue","Slider","RPGUIButton","ShortcutsSetter","setSettingShortcutIndex","settingShortcutIndex","shortcuts","removeShortcut","List","Shortcut","ShortcutType","None","isBeingSet","_shortcuts$index","payload","_shortcuts$index2","_shortcuts$index3","magicWords","word","getContent","ItemsContainer","QuantitySelectorContainer","MarketplaceRows","itemPrice","onHandleClick","MarketPlaceWrapper","ItemIconContainer","SpriteContainer","PriceValue","QuantityContainer","QuantityDisplay","onClick","InputWrapper","WrapperContainer","ItemComponentScrollWrapper","StyledDropdown","NPCDialogType","NPCMultiDialog","textAndTypeArray","showGoNextIndicator","setShowGoNextIndicator","slide","setSlide","onHandleSpacePress","code","_textAndTypeArray$sli","imageSide","TextContainer","NPCDialogText","onStartStep","onEndStep","ThumbnailContainer","NPCThumbnail","imagePath","aliceDefaultThumbnail","PressSpaceIndicator","right","pressSpaceGif","useEventListener","handler","el","savedHandler","listener","DynamicText","onFinish","textState","setTextState","interval","setInterval","substring","clearInterval","QuestionDialog","questions","answers","currentQuestion","setCurrentQuestion","canShowAnswers","setCanShowAnswers","onGetFirstAnswer","answerIds","firstAnswerId","answer","currentAnswer","setCurrentAnswer","onGetAnswers","answerId","nextAnswerIndex","findIndex","nextAnswerID","nextAnswer","previousAnswerIndex","previousAnswerID","previousAnswer","pop","nextQuestionId","question","QuestionContainer","AnswersContainer","isSelected","selectedColor","AnswerRow","AnswerSelectedIcon","Answer","onAnswerClick","onRenderCurrentAnswers","ProgressBarText","minWidth","percentageWidth","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","NoQuestContainer","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","SkillProgressBar","skillName","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","getSPForLevel","nextLevelSPWillbe","ratio","ProgressTitle","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","stamina","magic","magicResistance","strength","resistance","dexterity","combat","first","club","sword","axe","distance","shielding","dagger","crafting","fishing","mining","lumberjacking","blacksmithing","cooking","alchemy","skillNameMap","SkillsDraggableContainer","SkillsContainerDiv","SkillSplitDiv","SpellInfo","spell","manaCost","requiredItem","castingType","cooldown","maxDistanceGrid","charAt","formatSpellCastingType","SpellInfoDisplay","MobileSpellTooltip","MagicTooltip","SpellInfoWrapper","Spell","charMana","charMagicLevel","isSettingShortcut","activeCooldown","minMagicLevelRequired","spellKey","Overlay","SpellImage","toFixed","Info","Divider","Cost","SpellList","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","TradingItemRow","onQuantityChange","traderItem","selectedQty","onLeftClick","onRightClick","ItemWrapper","ItemNameContainer","NameValue","capitalize","price","StyledArrow","TradingComponentScrollWrapper","TotalWrapper","GoldWrapper","AlertWrapper","IS_MOBILE_OR_TABLET","isMobileOrTablet","charactersPerLine","linesPerDiv","windowSize","textChunks","floor","match","RegExp","chunkIndex","setChunkIndex","goToNextStep","TextOnly","NPCDialog","_ref$isQuestionDialog","isQuestionDialog","TextAndThumbnail","BackgroundContainer","imgPath","DialogContainer","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","paddingBottom","chatMessages","onSendChatMessage","onFocus","_ref$styles","styles","textColor","message","setMessage","scrollChatToBottom","scrollingElement","querySelector","scrollTop","scrollHeight","fallback","emitter","createdAt","dayjs","Date","format","onRenderMessageLines","onRenderChatMessages","trim","autoComplete","autoFocus","borderRadius","RxPaperPlane","FramedGrey","items","selectedValues","generateSelectedValuesList","setSelectedValues","onActionClick","onCancelClick","mana","spellCooldowns","onShortcutClick","onTouchStart","remove","buildClassName","classBase","isOnCooldown","variant","onShortcutClickBinded","_shortcuts$i","isOnShortcutCooldown","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","totalQty","_shortcuts$i4","spellCooldown","replaceAll","renderShortcut","onSelect","onCraftItem","craftablesItems","savedSelectedType","craftItemKey","setCraftItemKey","ItemSubType","selectedType","setSelectedType","setSize","handleResize","itemTypes","sort","a","b","localeCompare","rows","row","gap","renderItemTypes","details","onItemClick","onItemDragEnd","onItemDragStart","onItemPlaceDrop","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","itemContainer","itemType","ContainerType","backgroundImgPath","fullCoverBackground","setImage","fullImg","handleClick","_ref$disableContextMe","disableContextMenu","isOpen","maxQuantity","callback","_quantity","quantitySelect","setQuantitySelect","handleSetShortcut","slotQty","_itemContainer$slots","onRenderSlots","imageKey","optionsType","optionsRarity","optionsPrice","onChangeType","onChangeRarity","onChangeOrder","onChangeNameInput","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","npcId","quest","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","_shortcutsRefs$curren2","onRenderSkillCategory","category","skillCategory","skillCategoryColor","output","entries","skillDetails","experience","xpToNextLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","search","setSearch","handleEscapeClose","spellsToDisplay","toLocaleLowerCase","setShortcut","Fragment","TimeClock","traderItems","characterAvailableGold","sum","setSum","Map","qtyMap","setQtyMap","set","newSum","get","isBuy","hasGoldForSale","tradeItem","assign"],"mappings":"mkCAAO,ICIKA,0DAAAA,EAAAA,sBAAAA,oDAEVA,4CCHUC,EDcCC,EAAS,oBACpBC,SAAAA,gBACAC,IAAAA,SACAC,IAAAA,WACAC,IAAAA,cACGC,SAEH,OACEC,gBAACC,iBACCC,aAAcL,EACdF,SAAUA,GACNI,GACJD,cAAeA,IAEfE,yBAAIJ,KAKJK,EA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I,EAAYjwB,SAAQ,SAAAnH,GAClB,IAAMkZ,EAAMue,EAAOI,IAAI73B,EAAKuH,KACxB2R,GACFsV,EAAMhnB,KAAKR,OAAOixB,OAAO,GAAIj4B,EAAM,CAAEkZ,IAAKA,aAI9CkD,EAAUoS,GAVW,IACfA,eAqEA3yB,gBAACN,GACCG,WAAYL,oBAAYgiB,YACxB1hB,cAAe,WAAA,OAAMqf,qCCxIS,oBAAGlb,SAC3C,OAAOjE,gBAAC6B,IAAUoC,oBADoC,OAAGrE"}
|
|
1
|
+
{"version":3,"file":"long-bow.cjs.production.min.js","sources":["../src/constants/uiFonts.ts","../src/components/Button.tsx","../src/components/RPGUIContainer.tsx","../src/components/shared/SpriteFromAtlas.tsx","../src/components/Item/Inventory/ErrorBoundary.tsx","../src/components/Arrow/SelectArrow.tsx","../src/components/shared/Ellipsis.tsx","../src/components/PropertySelect/PropertySelect.tsx","../src/components/Character/CharacterSelection.tsx","../src/components/shared/Column.tsx","../src/components/Chat/Chat.tsx","../src/components/Input.tsx","../src/components/Chatdeprecated/ChatDeprecated.tsx","../src/constants/uiColors.ts","../src/components/Shortcuts/SingleShortcut.ts","../src/components/Shortcuts/useShortcutCooldown.ts","../src/components/CircularController/CircularController.tsx","../src/hooks/useOutsideAlerter.ts","../src/components/RangeSlider.tsx","../src/components/DraggableContainer.tsx","../src/components/InputRadio.tsx","../src/libs/itemCounter.ts","../src/components/Abstractions/ModalPortal.tsx","../src/components/RelativeListMenu.tsx","../src/components/Item/Cards/MobileItemTooltip.tsx","../src/components/Item/Inventory/itemContainerHelper.ts","../src/components/Item/Inventory/ItemSlot.tsx","../src/components/Item/Cards/ItemInfo.tsx","../src/components/Item/Cards/ItemInfoDisplay.tsx","../src/components/Item/Cards/ItemTooltip.tsx","../src/components/Item/Cards/ItemInfoWrapper.tsx","../src/components/CraftBook/CraftingRecipe.tsx","../src/components/CraftBook/CraftBook.tsx","../src/components/Dropdown.tsx","../src/components/DropdownSelectorContainer.tsx","../src/components/Equipment/EquipmentSet.tsx","../src/components/Abstractions/SlotsContainer.tsx","../src/components/NPCDialog/NPCMultiDialog.tsx","../src/components/Item/Inventory/ItemQuantitySelector.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/components/itemSelector/ItemSelector.tsx","../src/components/ListMenu.tsx","../src/components/Marketplace/MarketplaceRows.tsx","../src/components/Marketplace/Marketplace.tsx","../src/components/NPCDialog/NPCDialog.tsx","../src/hooks/useEventListener.ts","../src/components/typography/DynamicText.tsx","../src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx","../src/components/ProgressBar.tsx","../src/components/QuestInfo/QuestInfo.tsx","../src/components/QuestList.tsx","../src/components/RPGUIRoot.tsx","../src/components/Shortcuts/Shortcuts.tsx","../src/components/SimpleProgressBar.tsx","../src/components/SkillProgressBar.tsx","../src/components/SkillsContainer.tsx","../src/components/Spellbook/cards/SpellInfo.tsx","../src/libs/CastingTypeHelper.ts","../src/components/Spellbook/cards/SpellInfoDisplay.tsx","../src/components/Spellbook/cards/MobileSpellTooltip.tsx","../src/components/Spellbook/cards/SpellTooltip.tsx","../src/components/Spellbook/cards/SpellInfoWrapper.tsx","../src/components/Spellbook/Spell.tsx","../src/components/Spellbook/Spellbook.tsx","../src/components/TimeWidget/DayNightPeriod/DayNightPeriod.tsx","../src/components/TimeWidget/TimeWidget.tsx","../src/components/TradingMenu/TradingItemRow.tsx","../src/components/TradingMenu/TradingMenu.tsx","../src/components/Truncate.tsx","../src/constants/uiDevices.ts","../src/components/NPCDialog/NPCDialogText.tsx","../src/libs/StringHelpers.ts","../src/components/HistoryDialog.tsx","../src/components/CheckButton.tsx","../src/components/RadioButton.tsx","../src/components/TextArea.tsx"],"sourcesContent":["export const uiFonts = {\r\n size: {\r\n xxsmall: '8px',\r\n xsmall: '9px',\r\n small: '12px',\r\n medium: '14px',\r\n large: '16px',\r\n xLarge: '18px',\r\n xxLarge: '20px',\r\n xxxLarge: '24px',\r\n },\r\n};\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\n\r\nexport enum ButtonTypes {\r\n RPGUIButton = 'rpgui-button',\r\n RPGUIGoldButton = 'rpgui-button golden',\r\n}\r\n\r\nexport interface IButtonProps\r\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\r\n disabled?: boolean;\r\n children: React.ReactNode;\r\n buttonType: ButtonTypes;\r\n onPointerDown?: (e: any) => void;\r\n}\r\n\r\nexport const Button = ({\r\n disabled = false,\r\n children,\r\n buttonType,\r\n onPointerDown,\r\n ...props\r\n}: IButtonProps) => {\r\n return (\r\n <ButtonContainer\r\n className={`${buttonType}`}\r\n disabled={disabled}\r\n {...props}\r\n onPointerDown={onPointerDown}\r\n >\r\n <p>{children}</p>\r\n </ButtonContainer>\r\n );\r\n};\r\n\r\nconst ButtonContainer = styled.button`\r\n height: 45px;\r\n font-size: ${uiFonts.size.small};\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nexport enum RPGUIContainerTypes {\r\n Framed = 'framed',\r\n FramedGold = 'framed-golden',\r\n FramedGold2 = 'framed-golden-2',\r\n FramedGrey = 'framed-grey',\r\n}\r\nexport interface IRPGUIContainerProps {\r\n type: RPGUIContainerTypes;\r\n children: React.ReactNode;\r\n width?: string;\r\n height?: string;\r\n className?: string;\r\n}\r\n\r\nexport const RPGUIContainer: React.FC<IRPGUIContainerProps> = ({\r\n children,\r\n type,\r\n width = '50%',\r\n height,\r\n className,\r\n}) => {\r\n return (\r\n <Container\r\n width={width}\r\n height={height || 'auto'}\r\n className={`rpgui-container ${type} ${className}`}\r\n >\r\n {children}\r\n </Container>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n width: string;\r\n height: string;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n height: ${props => props.height};\r\n width: ${({ width }) => width};\r\n display: flex;\r\n flex-wrap: wrap;\r\n image-rendering: pixelated;\r\n`;\r\n","import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\n\r\ninterface IProps {\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n spriteKey: string;\r\n width?: number;\r\n height?: number;\r\n grayScale?: boolean;\r\n opacity?: number;\r\n onPointerDown?: () => void;\r\n containerStyle?: any;\r\n imgStyle?: any;\r\n imgScale?: number;\r\n imgClassname?: string;\r\n}\r\n\r\nexport const SpriteFromAtlas: React.FC<IProps> = ({\r\n atlasJSON,\r\n atlasIMG,\r\n spriteKey,\r\n width = GRID_WIDTH,\r\n height = GRID_HEIGHT,\r\n imgScale = 2,\r\n imgStyle,\r\n onPointerDown,\r\n containerStyle,\r\n grayScale = false,\r\n opacity = 1,\r\n imgClassname,\r\n}) => {\r\n //! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).\r\n //!Due to React's limitations, we cannot import it from the public folder directly!\r\n\r\n const spriteData =\r\n atlasJSON.frames[spriteKey] || atlasJSON.frames['others/no-image.png'];\r\n\r\n if (!spriteData) throw new Error(`Sprite ${spriteKey} not found in atlas!`);\r\n\r\n return (\r\n <Container\r\n width={width}\r\n height={height}\r\n hasHover={grayScale}\r\n onPointerDown={onPointerDown}\r\n style={containerStyle}\r\n >\r\n <ImgSprite\r\n className={`sprite-from-atlas-img ${imgClassname || ''}`}\r\n atlasIMG={atlasIMG}\r\n frame={spriteData.frame}\r\n scale={imgScale}\r\n grayScale={grayScale}\r\n opacity={opacity}\r\n style={imgStyle}\r\n />\r\n </Container>\r\n );\r\n};\r\n\r\ninterface IImgSpriteProps {\r\n atlasIMG: any;\r\n frame: {\r\n x: number;\r\n y: number;\r\n w: number;\r\n h: number;\r\n };\r\n scale: number;\r\n grayScale: boolean;\r\n opacity: number;\r\n}\r\n\r\ninterface IContainerProps {\r\n width: number;\r\n height: number;\r\n hasHover: boolean;\r\n}\r\n\r\nconst Container = styled.div`\r\n width: ${(props: IContainerProps) => props.width}px;\r\n height: ${(props: IContainerProps) => props.height}px;\r\n ${(props: IContainerProps) =>\r\n !props.hasHover\r\n ? `&:hover {\r\n filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg);\r\n }`\r\n : ``}\r\n`;\r\n\r\nconst ImgSprite = styled.div<IImgSpriteProps>`\r\n width: ${props => props.frame.w}px;\r\n height: ${props => props.frame.h}px;\r\n background-image: url(${props => props.atlasIMG});\r\n background-position: -${props => props.frame.x}px -${props => props.frame.y}px;\r\n transform: scale(${props => props.scale});\r\n position: relative;\r\n top: 8px;\r\n left: 8px;\r\n filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};\r\n opacity: ${props => props.opacity};\r\n`;\r\n","import React, { Component, ErrorInfo, ReactNode } from 'react';\r\nimport atlasJSON from '../../../mocks/atlas/items/items.json';\r\nimport atlasIMG from '../../../mocks/atlas/items/items.png';\r\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\r\n\r\ninterface Props {\r\n children?: ReactNode;\r\n}\r\n\r\ninterface State {\r\n hasError: boolean;\r\n}\r\n\r\nexport class ErrorBoundary extends Component<Props, State> {\r\n public state: State = {\r\n hasError: false,\r\n };\r\n\r\n public static getDerivedStateFromError(_: Error): State {\r\n // Update state so the next render will show the fallback UI.\r\n return { hasError: true };\r\n }\r\n\r\n public componentDidCatch(error: Error, errorInfo: ErrorInfo) {\r\n console.error('Uncaught error:', error, errorInfo);\r\n }\r\n\r\n public render() {\r\n if (this.state.hasError) {\r\n return (\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={'others/no-image.png'}\r\n imgScale={3}\r\n />\r\n );\r\n }\r\n\r\n return this.props.children;\r\n }\r\n}\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport LeftArrowClickIcon from './img/arrow01-left-clicked.png';\r\nimport LeftArrowIcon from './img/arrow01-left.png';\r\nimport RightArrowClickIcon from './img/arrow01-right-clicked.png';\r\nimport RightArrowIcon from './img/arrow01-right.png';\r\n\r\nexport interface ArrowBarProps extends React.HTMLAttributes<HTMLDivElement> {\r\n direction: 'right' | 'left';\r\n onPointerDown: () => void;\r\n size?: number;\r\n}\r\n\r\nexport const SelectArrow: React.FC<ArrowBarProps> = ({\r\n direction = 'left',\r\n size,\r\n onPointerDown,\r\n ...props\r\n}) => {\r\n return (\r\n <>\r\n {direction === 'left' ? (\r\n <LeftArrow\r\n size={size}\r\n onPointerDown={() => onPointerDown()}\r\n {...props}\r\n ></LeftArrow>\r\n ) : (\r\n <RightArrow\r\n size={size}\r\n onPointerDown={() => onPointerDown()}\r\n {...props}\r\n ></RightArrow>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\ninterface IArrowProps {\r\n size?: number;\r\n}\r\n\r\nconst LeftArrow = styled.span<IArrowProps>`\r\n background-image: url(${LeftArrowIcon});\r\n background-size: 100% 100%;\r\n left: 0;\r\n position: absolute;\r\n width: ${props => props.size || 40}px;\r\n height: ${props => props.size || 42}px;\r\n :active {\r\n background-image: url(${LeftArrowClickIcon});\r\n }\r\n z-index: 2;\r\n`;\r\n\r\nconst RightArrow = styled.span<IArrowProps>`\r\n background-image: url(${RightArrowIcon});\r\n right: 0;\r\n position: absolute;\r\n width: ${props => props.size || 40}px;\r\n height: ${props => props.size || 42}px;\r\n background-size: 100% 100%;\r\n :active {\r\n background-image: url(${RightArrowClickIcon});\r\n }\r\n z-index: 2;\r\n`;\r\n\r\nexport default SelectArrow;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\n\r\ninterface IProps {\r\n children: React.ReactNode;\r\n maxLines: 1 | 2 | 3;\r\n maxWidth: string;\r\n fontSize?: string;\r\n center?: boolean;\r\n}\r\n\r\nexport const Ellipsis = ({\r\n children,\r\n maxLines,\r\n maxWidth,\r\n fontSize,\r\n center,\r\n}: IProps) => {\r\n return (\r\n <Container maxWidth={maxWidth} fontSize={fontSize} center={center}>\r\n <div className={`ellipsis-${maxLines}-lines`}>{children}</div>\r\n </Container>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n maxWidth?: string;\r\n fontSize?: string;\r\n center?: boolean;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n .ellipsis-1-lines {\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n max-width: ${props => props.maxWidth};\r\n font-size: ${props => props.fontSize};\r\n\r\n ${props => props.center && `margin: 0 auto;`}\r\n }\r\n .ellipsis-2-lines {\r\n display: -webkit-box;\r\n max-width: ${props => props.maxWidth}px;\r\n\r\n height: 25px;\r\n margin: 0 auto;\r\n line-height: 1;\r\n -webkit-line-clamp: 2;\r\n -webkit-box-orient: vertical;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n font-size: ${props => props.fontSize};\r\n }\r\n .ellipsis-3-lines {\r\n display: -webkit-box;\r\n max-width: ${props => props.maxWidth}px;\r\n\r\n height: 43px;\r\n margin: 0 auto;\r\n line-height: 1;\r\n -webkit-line-clamp: 3;\r\n -webkit-box-orient: vertical;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n font-size: ${props => props.fontSize};\r\n }\r\n`;\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport SelectArrow from '../Arrow/SelectArrow';\r\nimport { Ellipsis } from '../shared/Ellipsis';\r\n\r\nexport interface IPropertySelectProps {\r\n availableProperties: Array<IPropertiesProps>;\r\n selectedProperty?: IPropertiesProps;\r\n children?: React.ReactNode;\r\n onChange: (selectedProperty: IPropertiesProps) => void;\r\n}\r\n\r\nexport interface IPropertiesProps {\r\n id: string;\r\n name: string;\r\n}\r\n\r\nexport const PropertySelect: React.FC<IPropertySelectProps> = ({\r\n availableProperties,\r\n onChange,\r\n}) => {\r\n const [currentIndex, setCurrentIndex] = useState(0);\r\n const propertiesLength = availableProperties.length - 1;\r\n\r\n const onLeftClick = () => {\r\n if (currentIndex === 0) setCurrentIndex(propertiesLength);\r\n else setCurrentIndex(index => index - 1);\r\n };\r\n const onRightClick = () => {\r\n if (currentIndex === propertiesLength) setCurrentIndex(0);\r\n else setCurrentIndex(index => index + 1);\r\n };\r\n\r\n useEffect(() => {\r\n onChange(availableProperties[currentIndex]);\r\n }, [currentIndex]);\r\n\r\n useEffect(() => {\r\n setCurrentIndex(0);\r\n }, [JSON.stringify(availableProperties)]);\r\n\r\n const getCurrentSelectionName = () => {\r\n const item = availableProperties[currentIndex];\r\n if (item) {\r\n return item.name;\r\n }\r\n return '';\r\n };\r\n\r\n return (\r\n <Container>\r\n <TextOverlay>\r\n <p>\r\n <Item>\r\n <Ellipsis maxLines={1} maxWidth=\"60%\" center>\r\n {getCurrentSelectionName()}\r\n </Ellipsis>\r\n </Item>\r\n </p>\r\n </TextOverlay>\r\n <div className=\"rpgui-progress-track\"></div>\r\n\r\n <SelectArrow direction=\"left\" onPointerDown={onLeftClick}></SelectArrow>\r\n <SelectArrow direction=\"right\" onPointerDown={onRightClick}></SelectArrow>\r\n </Container>\r\n );\r\n};\r\n\r\nconst Item = styled.span`\r\n font-size: 1rem;\r\n color: white;\r\n text-align: center;\r\n z-index: 1;\r\n position: absolute;\r\n top: 12px;\r\n width: 100%;\r\n\r\n p {\r\n margin: 0 auto;\r\n font-size: ${uiFonts.size.small};\r\n }\r\n`;\r\n\r\nconst TextOverlay = styled.div`\r\n width: 100%;\r\n position: relative;\r\n`;\r\n\r\ninterface IContainerProps {\r\n percentageWidth?: number;\r\n minWidth?: number;\r\n style?: Record<string, any>;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n position: relative;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: start;\r\n align-items: flex-start;\r\n min-width: 100px;\r\n width: 40%;\r\n`;\r\n\r\nexport default PropertySelect;\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\n\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\n\r\nimport { ErrorBoundary } from '../Item/Inventory/ErrorBoundary';\r\nimport PropertySelect, {\r\n IPropertiesProps,\r\n} from '../PropertySelect/PropertySelect';\r\n\r\nexport interface ICharacterProps {\r\n name: string;\r\n textureKey: string;\r\n}\r\n\r\nexport interface ICharacterSelectionProps {\r\n availableCharacters: ICharacterProps[];\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n onChange: (textureKey: string) => void;\r\n}\r\n\r\nexport const CharacterSelection: React.FC<ICharacterSelectionProps> = ({\r\n availableCharacters,\r\n atlasJSON,\r\n atlasIMG,\r\n onChange,\r\n}) => {\r\n const propertySelectValues = availableCharacters.map((item) => {\r\n return {\r\n id: item.textureKey,\r\n name: item.name,\r\n };\r\n });\r\n\r\n const [selectedValue, setSelectedValue] = useState<IPropertiesProps>();\r\n const [selectedSpriteKey, setSelectedSpriteKey] = useState('');\r\n\r\n const onSelectedValueChange = () => {\r\n const textureKey = selectedValue ? selectedValue.id : '';\r\n const spriteKey = textureKey ? textureKey + '/down/standing/0.png' : '';\r\n\r\n if (spriteKey === selectedSpriteKey) {\r\n return;\r\n }\r\n\r\n setSelectedSpriteKey(spriteKey);\r\n onChange(textureKey);\r\n };\r\n\r\n useEffect(() => {\r\n onSelectedValueChange();\r\n }, [selectedValue]);\r\n\r\n useEffect(() => {\r\n setSelectedValue(propertySelectValues[0]);\r\n }, [availableCharacters]);\r\n\r\n return (\r\n <Container>\r\n {selectedSpriteKey && atlasIMG && atlasJSON && (\r\n <ErrorBoundary>\r\n <SpriteFromAtlas\r\n spriteKey={selectedSpriteKey}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n imgScale={4}\r\n height={80}\r\n width={64}\r\n containerStyle={{\r\n display: 'flex',\r\n alignItems: 'center',\r\n paddingBottom: '15px',\r\n }}\r\n imgStyle={{\r\n left: '22px',\r\n }}\r\n />\r\n </ErrorBoundary>\r\n )}\r\n <PropertySelect\r\n availableProperties={propertySelectValues}\r\n onChange={(value) => {\r\n setSelectedValue(value);\r\n }}\r\n />\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n image-rendering: pixelated;\r\n`;\r\n\r\nexport default CharacterSelection;\r\n","import styled from 'styled-components';\r\n\r\ninterface IColumn {\r\n flex?: number;\r\n alignItems?: string;\r\n justifyContent?: string;\r\n flexWrap?: string;\r\n}\r\n\r\nexport const Column = styled.div<IColumn>`\r\n flex: ${props => props.flex || 'auto'};\r\n display: flex;\r\n flex-wrap: ${props => props.flexWrap || 'nowrap'};\r\n align-items: ${props => props.alignItems || 'flex-start'};\r\n justify-content: ${props => props.justifyContent || 'flex-start'};\r\n`;\r\n","import { IChatMessage } from '@rpg-engine/shared';\r\nimport dayjs from 'dayjs';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { ErrorBoundary } from 'react-error-boundary';\r\nimport { RxPaperPlane } from 'react-icons/rx';\r\nimport styled from 'styled-components';\r\nimport { Column } from '../shared/Column';\r\n\r\ninterface IEmitter {\r\n _id: string;\r\n name: string;\r\n}\r\n\r\ninterface IStyles {\r\n textColor?: string;\r\n buttonColor?: string;\r\n buttonBackgroundColor?: string;\r\n width?: string;\r\n height?: string;\r\n}\r\n\r\nexport interface IChatProps {\r\n chatMessages: IChatMessage[];\r\n onSendChatMessage: (message: string) => void;\r\n onCloseButton: () => void;\r\n onFocus?: () => void;\r\n onBlur?: () => void;\r\n opacity?: number;\r\n sendMessage: boolean;\r\n styles?: IStyles;\r\n}\r\n\r\nexport const Chat: React.FC<IChatProps> = ({\r\n chatMessages,\r\n onSendChatMessage,\r\n onFocus,\r\n onBlur,\r\n styles = {\r\n textColor: '#c65102',\r\n buttonColor: '#005b96',\r\n buttonBackgroundColor: 'rgba(0,0,0,.2)',\r\n width: '80%',\r\n height: 'auto',\r\n },\r\n}) => {\r\n const [message, setMessage] = useState('');\r\n\r\n useEffect(() => {\r\n scrollChatToBottom();\r\n }, []);\r\n\r\n useEffect(() => {\r\n scrollChatToBottom();\r\n }, [chatMessages]);\r\n\r\n const scrollChatToBottom = () => {\r\n const scrollingElement = document.querySelector('.chat-body');\r\n if (scrollingElement) {\r\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\r\n }\r\n };\r\n\r\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\r\n event.preventDefault();\r\n if (!message || message.trim() === '') return;\r\n onSendChatMessage(message);\r\n setMessage('');\r\n };\r\n const getInputValue = (value: string) => {\r\n setMessage(value);\r\n };\r\n\r\n const onRenderMessageLines = (\r\n emitter: IEmitter,\r\n createdAt: string | undefined,\r\n message: string\r\n ) => {\r\n return `${dayjs(createdAt || new Date()).format('HH:mm')} ${\r\n emitter?.name ? `${emitter.name}: ` : 'Unknown: '\r\n } ${message}`;\r\n };\r\n\r\n const onRenderChatMessages = (chatMessages: IChatMessage[]) => {\r\n return chatMessages?.length ? (\r\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\r\n <Message color={styles?.textColor || '#c65102'} key={`${_id}_${index}`}>\r\n {onRenderMessageLines(emitter, createdAt as string, message)}\r\n </Message>\r\n ))\r\n ) : (\r\n <Message color={styles?.textColor || '#c65102'}>\r\n No messages available.\r\n </Message>\r\n );\r\n };\r\n\r\n return (\r\n <ChatContainer\r\n width={styles?.width || '80%'}\r\n height={styles?.height || 'auto'}\r\n >\r\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\r\n <MessagesContainer className=\"chat-body\">\r\n {onRenderChatMessages(chatMessages)}\r\n </MessagesContainer>\r\n\r\n <Form onSubmit={handleSubmit}>\r\n <Column flex={70}>\r\n <TextField\r\n value={message}\r\n id=\"inputMessage\"\r\n onChange={e => getInputValue(e.target.value)}\r\n height={20}\r\n type=\"text\"\r\n autoComplete=\"off\"\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n onPointerDown={onFocus}\r\n autoFocus\r\n />\r\n </Column>\r\n <Column justifyContent=\"flex-end\">\r\n <Button\r\n buttonColor={styles?.buttonColor || '#005b96'}\r\n buttonBackgroundColor={\r\n styles?.buttonBackgroundColor || 'rgba(0,0,0,.5)'\r\n }\r\n id=\"chat-send-button\"\r\n style={{ borderRadius: '20%' }}\r\n >\r\n <RxPaperPlane size={15} />\r\n </Button>\r\n </Column>\r\n </Form>\r\n </ErrorBoundary>\r\n </ChatContainer>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n width: string;\r\n height: string;\r\n}\r\n\r\ninterface IMessageProps {\r\n color: string;\r\n}\r\n\r\ninterface IButtonProps {\r\n buttonColor: string;\r\n buttonBackgroundColor: string;\r\n}\r\n\r\nconst ChatContainer = styled.div<IContainerProps>`\r\n height: ${props => props.height};\r\n width: ${({ width }) => width};\r\n padding: 10px;\r\n background-color: rgba(0, 0, 0, 0.2);\r\n height: auto;\r\n`;\r\n\r\nconst TextField = styled.input`\r\n width: 100%;\r\n background-color: rgba(0, 0, 0, 0.25) !important;\r\n border: none !important;\r\n max-height: 28px !important;\r\n`;\r\n\r\nconst MessagesContainer = styled.div`\r\n height: 70%;\r\n margin-bottom: 10px;\r\n .chat-body {\r\n max-height: auto;\r\n overflow-y: auto;\r\n }\r\n`;\r\n\r\nconst Message = styled.div<IMessageProps>`\r\n margin-bottom: 8px;\r\n color: ${({ color }) => color};\r\n`;\r\n\r\nconst Form = styled.form`\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n align-items: center;\r\n`;\r\n\r\nconst Button = styled.button<IButtonProps>`\r\n color: ${({ buttonColor }) => buttonColor};\r\n background-color: ${({ buttonBackgroundColor }) => buttonBackgroundColor};\r\n width: 28px;\r\n height: 28px;\r\n border: none !important;\r\n`;\r\n","import React from 'react';\r\n\r\nexport interface IInputProps\r\n extends React.DetailedHTMLProps<\r\n React.InputHTMLAttributes<HTMLInputElement>,\r\n HTMLInputElement\r\n > {\r\n innerRef?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\nexport const Input: React.FC<IInputProps> = ({ ...props }) => {\r\n const { innerRef, ...rest } = props;\r\n\r\n return <input {...rest} ref={props.innerRef} />;\r\n};\r\n","import { IChatMessage } from '@rpg-engine/shared';\r\nimport dayjs from 'dayjs';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { ErrorBoundary } from 'react-error-boundary';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { Input } from '../Input';\r\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { Column } from '../shared/Column';\r\n\r\ninterface IEmitter {\r\n _id: string;\r\n name: string;\r\n}\r\nexport interface IChatDeprecatedProps {\r\n chatMessages: IChatMessage[];\r\n onSendChatMessage: (message: string) => void;\r\n onCloseButton: () => void;\r\n onFocus?: () => void;\r\n onBlur?: () => void;\r\n opacity?: number;\r\n width?: string;\r\n height?: string;\r\n}\r\n\r\nexport const ChatDeprecated: React.FC<IChatDeprecatedProps> = ({\r\n chatMessages,\r\n onSendChatMessage,\r\n opacity = 1,\r\n width = '100%',\r\n height = '250px',\r\n onCloseButton,\r\n onFocus,\r\n onBlur,\r\n}) => {\r\n const [message, setMessage] = useState('');\r\n\r\n useEffect(() => {\r\n scrollChatToBottom();\r\n }, []);\r\n\r\n useEffect(() => {\r\n scrollChatToBottom();\r\n }, [chatMessages]);\r\n\r\n const scrollChatToBottom = () => {\r\n const scrollingElement = document.querySelector('.chat-body');\r\n if (scrollingElement) {\r\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\r\n }\r\n };\r\n\r\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\r\n event.preventDefault();\r\n onSendChatMessage(message);\r\n setMessage('');\r\n };\r\n const getInputValue = (value: string) => {\r\n setMessage(value);\r\n };\r\n\r\n const onRenderMessageLines = (\r\n emitter: IEmitter,\r\n createdAt: string | undefined,\r\n message: string\r\n ) => {\r\n return `${dayjs(createdAt || new Date()).format('HH:mm')} ${\r\n emitter?.name ? `${emitter.name}: ` : 'Unknown: '\r\n } ${message}`;\r\n };\r\n\r\n const onRenderChatMessages = (chatMessages: IChatMessage[]) => {\r\n return chatMessages?.length ? (\r\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\r\n <MessageText key={`${_id}_${index}`}>\r\n {onRenderMessageLines(emitter, createdAt as string, message)}\r\n </MessageText>\r\n ))\r\n ) : (\r\n <MessageText>No messages available.</MessageText>\r\n );\r\n };\r\n\r\n return (\r\n <Container>\r\n <CustomContainer\r\n type={RPGUIContainerTypes.FramedGrey}\r\n width={width}\r\n height={height}\r\n className=\"chat-container\"\r\n opacity={opacity}\r\n >\r\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\r\n {onCloseButton && (\r\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\r\n )}\r\n <RPGUIContainer\r\n type={RPGUIContainerTypes.FramedGrey}\r\n width={'100%'}\r\n height={'80%'}\r\n className=\"chat-body dark-background\"\r\n >\r\n {onRenderChatMessages(chatMessages)}\r\n </RPGUIContainer>\r\n\r\n <Form onSubmit={handleSubmit}>\r\n <Column flex={70}>\r\n <CustomInput\r\n value={message}\r\n id=\"inputMessage\"\r\n onChange={e => getInputValue(e.target.value)}\r\n height={20}\r\n className=\"chat-input dark-background\"\r\n type=\"text\"\r\n autoComplete=\"off\"\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n />\r\n </Column>\r\n <Column justifyContent=\"flex-end\">\r\n <Button\r\n buttonType={ButtonTypes.RPGUIButton}\r\n id=\"chat-send-button\"\r\n >\r\n Send\r\n </Button>\r\n </Column>\r\n </Form>\r\n </ErrorBoundary>\r\n </CustomContainer>\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n position: relative;\r\n`;\r\n\r\nconst CloseButton = styled.div`\r\n position: absolute;\r\n top: 2px;\r\n right: 0px;\r\n color: white;\r\n z-index: 22;\r\n font-size: 0.7rem;\r\n`;\r\n\r\nconst CustomInput = styled(Input)`\r\n height: 30px;\r\n width: 100%;\r\n\r\n .rpgui-content .input {\r\n min-height: 39px;\r\n }\r\n`;\r\n\r\ninterface ICustomContainerProps {\r\n opacity: number;\r\n}\r\n\r\nconst CustomContainer = styled(RPGUIContainer)`\r\n display: block;\r\n\r\n opacity: ${(props: ICustomContainerProps) => props.opacity};\r\n\r\n &:hover {\r\n opacity: 1;\r\n }\r\n\r\n .dark-background {\r\n background-color: ${uiColors.darkGray} !important;\r\n }\r\n\r\n .chat-body {\r\n &.rpgui-container.framed-grey {\r\n background: unset;\r\n }\r\n max-height: 170px;\r\n overflow-y: auto;\r\n }\r\n`;\r\n\r\nconst Form = styled.form`\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n align-items: center;\r\n`;\r\n\r\nconst MessageText = styled.p`\r\n display: block !important;\r\n width: 100%;\r\n font-size: ${uiFonts.size.xsmall} !important;\r\n overflow-y: auto;\r\n margin: 0;\r\n`;\r\n","export const uiColors = {\r\n lightGray: '#888',\r\n gray: '#4E4A4E',\r\n darkGray: '#3e3e3e',\r\n darkYellow: '#FFC857',\r\n yellow: '#FFFF00',\r\n orange: '#D27D2C',\r\n cardinal: '#C5283D',\r\n red: '#D04648',\r\n darkRed: '#442434',\r\n raisinBlack: '#191923',\r\n navyBlue: '#0E79B2',\r\n purple: '#6833A3',\r\n darkPurple: '#522761',\r\n blue: '#597DCE',\r\n darkBlue: '#30346D',\r\n brown: '#854C30',\r\n lightGreen: '#66cd1c',\r\n brownGreen: '#346524',\r\n};\r\n","import styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\n\r\nexport const SingleShortcut = styled.button`\r\n width: 3rem;\r\n height: 3rem;\r\n background-color: ${uiColors.lightGray};\r\n border: 2px solid ${uiColors.darkGray};\r\n border-radius: 50%;\r\n text-transform: uppercase;\r\n font-size: 0.7rem;\r\n font-weight: bold;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n\r\n span {\r\n pointer-events: none;\r\n }\r\n\r\n .mana {\r\n position: absolute;\r\n top: -5px;\r\n right: 0;\r\n font-size: 0.65rem;\r\n color: ${uiColors.blue};\r\n }\r\n\r\n .qty {\r\n position: absolute;\r\n top: -5px;\r\n right: 0;\r\n font-size: 0.65rem;\r\n }\r\n\r\n .magicWords {\r\n margin-top: 4px;\r\n }\r\n\r\n .keyboard {\r\n position: absolute;\r\n bottom: -5px;\r\n left: 0;\r\n font-size: 0.65rem;\r\n color: ${uiColors.yellow};\r\n }\r\n\r\n .onCooldown {\r\n color: ${uiColors.gray};\r\n }\r\n\r\n .cooldown {\r\n position: absolute;\r\n z-index: 1;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n border-radius: inherit;\r\n background-color: rgba(0 0 0 / 60%);\r\n font-size: 0.7rem;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n color: ${uiColors.darkYellow};\r\n }\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: ${uiColors.darkGray};\r\n }\r\n\r\n &:active {\r\n background-color: ${uiColors.gray};\r\n border-color: ${uiColors.yellow};\r\n }\r\n\r\n &:disabled {\r\n opacity: 0.5;\r\n }\r\n`;\r\n","import { useEffect, useRef, useState } from \"react\";\r\n\r\nexport const useShortcutCooldown = (onShortcutCast: (index: number) => void) => {\r\n const [shortcutCooldown, setShortcutCooldown] = useState(0);\r\n const cooldownTimeout = useRef<NodeJS.Timeout | null>(null);\r\n\r\n const handleShortcutCast = (index: number) => {\r\n console.log(shortcutCooldown);\r\n if (shortcutCooldown <= 0) setShortcutCooldown(1.5);\r\n onShortcutCast(index);\r\n };\r\n\r\n useEffect(() => {\r\n if (cooldownTimeout.current) clearTimeout(cooldownTimeout.current);\r\n\r\n if (shortcutCooldown > 0) {\r\n cooldownTimeout.current = setTimeout(() => {\r\n setShortcutCooldown(shortcutCooldown - 0.1);\r\n }, 100);\r\n }\r\n }, [shortcutCooldown]);\r\n\r\n return { shortcutCooldown, handleShortcutCast };\r\n};","import {\r\n getItemTextureKeyPath,\r\n IItem,\r\n IItemContainer,\r\n IRawSpell,\r\n IShortcut,\r\n ShortcutType,\r\n} from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\nimport { SingleShortcut } from '../Shortcuts/SingleShortcut';\r\nimport { useShortcutCooldown } from '../Shortcuts/useShortcutCooldown';\r\n\r\nexport type CircularControllerProps = {\r\n onActionClick: () => void;\r\n onCancelClick: () => void;\r\n onShortcutClick: (index: number) => void;\r\n mana: number;\r\n shortcuts: IShortcut[];\r\n inventory?: IItemContainer | null;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n spellCooldowns?: Record<string, number>;\r\n};\r\n\r\nexport const CircularController: React.FC<CircularControllerProps> = ({\r\n onActionClick,\r\n onCancelClick,\r\n onShortcutClick,\r\n mana,\r\n shortcuts,\r\n inventory,\r\n atlasIMG,\r\n atlasJSON,\r\n spellCooldowns,\r\n}) => {\r\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\r\n onShortcutClick\r\n );\r\n\r\n const onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\r\n const target = e.target as HTMLButtonElement;\r\n target?.classList.add('active');\r\n };\r\n\r\n const onTouchEnd = (\r\n action: () => void,\r\n e: React.TouchEvent<HTMLButtonElement>\r\n ) => {\r\n const target = e.target as HTMLButtonElement;\r\n setTimeout(() => {\r\n target?.classList.remove('active');\r\n }, 100);\r\n action();\r\n };\r\n\r\n const renderShortcut = (i: number) => {\r\n const buildClassName = (classBase: string, isOnCooldown: boolean) => {\r\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\r\n };\r\n\r\n let variant = '';\r\n\r\n if (i === 0) variant = 'top';\r\n else if (i >= 3) variant = `bottom-${i - 3}`;\r\n\r\n const onShortcutClickBinded =\r\n shortcuts[i]?.type !== ShortcutType.None\r\n ? handleShortcutCast.bind(null, i)\r\n : () => {};\r\n\r\n const isOnShortcutCooldown = shortcutCooldown > 0;\r\n\r\n if (shortcuts[i]?.type === ShortcutType.Item) {\r\n const payload = shortcuts[i]?.payload as IItem | undefined;\r\n\r\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\r\n\r\n if (inventory) {\r\n Object.keys(inventory.slots).forEach(i => {\r\n const index = parseInt(i);\r\n\r\n if (inventory.slots[index]?.key === payload?.key) {\r\n itemsFromEquipment.push(inventory.slots[index]);\r\n }\r\n });\r\n }\r\n\r\n const totalQty = itemsFromEquipment.reduce(\r\n (acc, item) => acc + (item?.stackQty || 1),\r\n 0\r\n );\r\n\r\n return (\r\n <StyledShortcut\r\n key={i}\r\n onTouchStart={onTouchStart}\r\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\r\n disabled={false}\r\n className={variant}\r\n >\r\n {isOnShortcutCooldown && (\r\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\r\n )}\r\n {payload && (\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: payload.texturePath,\r\n texturePath: payload.texturePath,\r\n stackQty: payload.stackQty || 1,\r\n isStackable: payload.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n width={32}\r\n height={32}\r\n imgScale={1.4}\r\n imgStyle={{ left: '4px' }}\r\n containerStyle={{ pointerEvents: 'none' }}\r\n />\r\n )}\r\n <span className={buildClassName('qty', isOnShortcutCooldown)}>\r\n {totalQty}\r\n </span>\r\n </StyledShortcut>\r\n );\r\n }\r\n\r\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\r\n\r\n const spellCooldown = !payload\r\n ? 0\r\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\r\n shortcutCooldown;\r\n const cooldown =\r\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\r\n const isOnCooldown = cooldown > 0 && !!payload;\r\n\r\n return (\r\n <StyledShortcut\r\n key={i}\r\n onTouchStart={onTouchStart}\r\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\r\n disabled={mana < (payload?.manaCost ?? 0)}\r\n className={variant}\r\n >\r\n {isOnCooldown && (\r\n <span className=\"cooldown\">\r\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\r\n </span>\r\n )}\r\n <span className={buildClassName('mana', isOnCooldown)}>\r\n {payload && payload.manaCost}\r\n </span>\r\n <span className=\"magicWords\">\r\n {payload?.magicWords.split(' ').map(word => word[0])}\r\n </span>\r\n </StyledShortcut>\r\n );\r\n };\r\n\r\n return (\r\n <ButtonsContainer>\r\n <ShortcutsContainer>\r\n {Array.from({ length: 6 }).map((_, i) => renderShortcut(i))}\r\n </ShortcutsContainer>\r\n <Button\r\n onTouchStart={onTouchStart}\r\n onTouchEnd={onTouchEnd.bind(null, onActionClick)}\r\n >\r\n <div className=\"rpgui-icon sword\" />\r\n </Button>\r\n\r\n <CancelButton\r\n onTouchStart={onTouchStart}\r\n onTouchEnd={onTouchEnd.bind(null, onCancelClick)}\r\n >\r\n <span>X</span>\r\n </CancelButton>\r\n </ButtonsContainer>\r\n );\r\n};\r\n\r\nconst Button = styled.button`\r\n width: 4.3rem;\r\n height: 4.3rem;\r\n background-color: ${uiColors.lightGray};\r\n border: 2px solid ${uiColors.darkGray};\r\n border-radius: 50%;\r\n text-transform: uppercase;\r\n font-size: 0.7rem;\r\n font-weight: bold;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n transition: all 0.1s;\r\n margin-top: -3rem;\r\n\r\n &.active {\r\n background-color: ${uiColors.gray};\r\n border-color: ${uiColors.yellow};\r\n }\r\n\r\n .sword {\r\n transform: rotate(-45deg);\r\n height: 2.5rem;\r\n width: 1.9rem;\r\n pointer-events: none;\r\n }\r\n`;\r\n\r\nconst CancelButton = styled(Button)`\r\n width: 3rem;\r\n height: 3rem;\r\n font-size: 0.8rem;\r\n\r\n span {\r\n margin-top: 4px;\r\n margin-left: 2px;\r\n pointer-events: none;\r\n }\r\n`;\r\n\r\nconst ButtonsContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 0.5rem;\r\n`;\r\n\r\nconst ShortcutsContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 0.5rem;\r\n flex-direction: column;\r\n margin-top: 3rem;\r\n\r\n .top {\r\n transform: translate(93%, 25%);\r\n }\r\n\r\n .bottom-0 {\r\n transform: translate(93%, -25%);\r\n }\r\n\r\n .bottom-1 {\r\n transform: translate(-120%, calc(-5.5rem));\r\n }\r\n\r\n .bottom-2 {\r\n transform: translate(-30%, calc(-5.5rem - 25%));\r\n }\r\n`;\r\n\r\nconst StyledShortcut = styled(SingleShortcut)`\r\n width: 2.5rem;\r\n height: 2.5rem;\r\n transition: all 0.1s;\r\n\r\n .mana,\r\n .qty {\r\n font-size: 0.5rem;\r\n }\r\n\r\n &:hover,\r\n &:focus,\r\n &:active {\r\n background-color: ${uiColors.lightGray};\r\n }\r\n\r\n &.active {\r\n background-color: ${uiColors.gray};\r\n border-color: ${uiColors.yellow};\r\n }\r\n`;\r\n","import { useEffect } from 'react';\r\n\r\nexport function useOutsideClick(ref: any, id: string) {\r\n useEffect(() => {\r\n /**\r\n * Alert if clicked on outside of element\r\n */\r\n function handleClickOutside(event: any) {\r\n if (ref.current && !ref.current.contains(event.target)) {\r\n const event = new CustomEvent('clickOutside', {\r\n detail: {\r\n id,\r\n },\r\n });\r\n document.dispatchEvent(event);\r\n }\r\n }\r\n // Bind the event listener\r\n document.addEventListener('pointerdown', handleClickOutside);\r\n return () => {\r\n // Unbind the event listener on clean up\r\n document.removeEventListener('pointerdown', handleClickOutside);\r\n };\r\n }, [ref]);\r\n}\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nexport enum RangeSliderType {\r\n Slider = 'rpgui-slider',\r\n GoldSlider = 'rpgui-slider golden',\r\n}\r\n\r\nexport interface IRangeSliderProps {\r\n type: RangeSliderType;\r\n valueMin: number;\r\n valueMax: number;\r\n width: string;\r\n onChange: (value: number) => void;\r\n value: number;\r\n}\r\n\r\nexport const RangeSlider: React.FC<IRangeSliderProps> = ({\r\n type,\r\n valueMin,\r\n valueMax,\r\n width,\r\n onChange,\r\n value,\r\n}) => {\r\n const sliderId = uuidv4();\r\n\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const [left, setLeft] = useState(0);\r\n\r\n useEffect(() => {\r\n const calculatedWidth = containerRef.current?.clientWidth || 0;\r\n setLeft(\r\n Math.max(\r\n ((value - valueMin) / (valueMax - valueMin)) * (calculatedWidth - 35) +\r\n 10\r\n )\r\n );\r\n }, [value, valueMin, valueMax]);\r\n\r\n const typeClass = type === RangeSliderType.GoldSlider ? 'golden' : '';\r\n\r\n return (\r\n <div\r\n style={{ width: width, position: 'relative' }}\r\n className={`rpgui-slider-container ${typeClass}`}\r\n id={`rpgui-slider-${sliderId}`}\r\n ref={containerRef}\r\n >\r\n <div style={{ pointerEvents: 'none' }}>\r\n <div className={`rpgui-slider-track ${typeClass}`} />\r\n <div className={`rpgui-slider-left-edge ${typeClass}`} />\r\n <div className={`rpgui-slider-right-edge ${typeClass}`} />\r\n <div className={`rpgui-slider-thumb ${typeClass}`} style={{ left }} />\r\n </div>\r\n <Input\r\n type=\"range\"\r\n style={{ width: width }}\r\n min={valueMin}\r\n max={valueMax}\r\n onChange={e => onChange(Number(e.target.value))}\r\n value={value}\r\n className=\"rpgui-cursor-point\"\r\n />\r\n </div>\r\n );\r\n};\r\n\r\nconst Input = styled.input`\r\n opacity: 0;\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n top: 0;\r\n left: 0;\r\n margin-top: -5px;\r\n`;\r\n","import React, { useEffect, useRef } from 'react';\r\nimport Draggable from 'react-draggable';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\r\nimport { IPosition } from '../types/eventTypes';\r\nimport { RPGUIContainerTypes } from './RPGUIContainer';\r\n\r\nexport interface IDraggableContainerProps {\r\n children: React.ReactNode;\r\n width?: string;\r\n height?: string;\r\n className?: string;\r\n type?: RPGUIContainerTypes;\r\n title?: string;\r\n imgSrc?: string;\r\n imgWidth?: string;\r\n onCloseButton?: () => void;\r\n cancelDrag?: string;\r\n onPositionChange?: (position: IPosition) => void;\r\n onPositionChangeEnd?: (position: IPosition) => void;\r\n onPositionChangeStart?: (position: IPosition) => void;\r\n onOutsideClick?: () => void;\r\n initialPosition?: IPosition;\r\n scale?: number;\r\n}\r\n\r\nexport const DraggableContainer: React.FC<IDraggableContainerProps> = ({\r\n children,\r\n width = '50%',\r\n height,\r\n className,\r\n type = RPGUIContainerTypes.FramedGold,\r\n onCloseButton,\r\n title,\r\n imgSrc,\r\n imgWidth = '20px',\r\n cancelDrag,\r\n onPositionChange,\r\n onPositionChangeEnd,\r\n onPositionChangeStart,\r\n onOutsideClick,\r\n initialPosition = { x: 0, y: 0 },\r\n scale,\r\n}) => {\r\n const draggableRef = useRef(null);\r\n\r\n useOutsideClick(draggableRef, 'item-container');\r\n\r\n useEffect(() => {\r\n document.addEventListener('clickOutside', event => {\r\n const e = event as CustomEvent;\r\n\r\n if (e.detail.id === 'item-container') {\r\n if (onOutsideClick) {\r\n onOutsideClick();\r\n }\r\n }\r\n });\r\n\r\n return () => {\r\n document.removeEventListener('clickOutside', _e => {});\r\n };\r\n }, []);\r\n\r\n return (\r\n <Draggable\r\n cancel={`.container-close,${cancelDrag}`}\r\n onDrag={(_e, data) => {\r\n if (onPositionChange) {\r\n onPositionChange({\r\n x: data.x,\r\n y: data.y,\r\n });\r\n }\r\n }}\r\n onStop={(_e, data) => {\r\n if (onPositionChangeEnd) {\r\n onPositionChangeEnd({\r\n x: data.x,\r\n y: data.y,\r\n });\r\n }\r\n }}\r\n onStart={(_e, data) => {\r\n if (onPositionChangeStart) {\r\n onPositionChangeStart({\r\n x: data.x,\r\n y: data.y,\r\n });\r\n }\r\n }}\r\n defaultPosition={initialPosition}\r\n scale={scale}\r\n >\r\n <Container\r\n ref={draggableRef}\r\n width={width}\r\n height={height || 'auto'}\r\n className={`rpgui-container ${type} ${className}`}\r\n >\r\n {title && (\r\n <TitleContainer className=\"drag-handler\">\r\n <Title>\r\n {imgSrc && <Icon src={imgSrc} width={imgWidth} />}\r\n {title}\r\n </Title>\r\n </TitleContainer>\r\n )}\r\n {onCloseButton && (\r\n <CloseButton\r\n className=\"container-close\"\r\n onPointerDown={onCloseButton}\r\n >\r\n X\r\n </CloseButton>\r\n )}\r\n\r\n {children}\r\n </Container>\r\n </Draggable>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n width: string;\r\n height: string;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n height: ${props => props.height};\r\n width: ${({ width }) => width};\r\n display: flex;\r\n flex-wrap: wrap;\r\n image-rendering: pixelated;\r\n\r\n &.rpgui-container {\r\n padding-top: 1.5rem;\r\n }\r\n`;\r\n\r\nconst CloseButton = styled.div`\r\n position: absolute;\r\n top: 3px;\r\n right: 0px;\r\n color: white;\r\n z-index: 22;\r\n font-size: 1.1rem;\r\n @media (max-width: 950px) {\r\n font-size: 1.7rem;\r\n padding: 12px;\r\n }\r\n`;\r\n\r\nconst TitleContainer = styled.div`\r\n width: 100%;\r\n height: 100%;\r\n display: flex;\r\n flex-wrap: wrap;\r\n justify-content: flex-start;\r\n align-items: center;\r\n`;\r\n\r\nconst Title = styled.h1`\r\n color: white;\r\n z-index: 22;\r\n font-size: ${uiFonts.size.large};\r\n`;\r\n\r\ninterface ICustomIconProps {\r\n width: string;\r\n}\r\n\r\nconst Icon = styled.img`\r\n color: white;\r\n z-index: 22;\r\n font-size: ${uiFonts.size.xsmall};\r\n width: ${(props: ICustomIconProps) => props.width};\r\n margin-right: 0.5rem;\r\n`;\r\n","import React from 'react';\r\n\r\ninterface IProps\r\n extends React.DetailedHTMLProps<\r\n React.InputHTMLAttributes<HTMLInputElement>,\r\n HTMLInputElement\r\n > {\r\n label: string;\r\n name: string;\r\n value: string;\r\n isChecked: boolean;\r\n onRadioSelect: (value: string) => void;\r\n}\r\n\r\nexport const InputRadio: React.FC<IProps> = ({\r\n label,\r\n name,\r\n value,\r\n isChecked,\r\n onRadioSelect,\r\n}) => {\r\n const onRadioClick = (): void => {\r\n onRadioSelect(value);\r\n };\r\n\r\n return (\r\n <div onPointerUp={onRadioClick}>\r\n <input\r\n className=\"rpgui-radio\"\r\n name={name}\r\n value={value}\r\n type=\"radio\"\r\n data-rpguitype=\"radio\"\r\n checked={isChecked}\r\n // rpgui breaks onChange on this input (doesn't work). That's why I had to wrap it with a div and a onClick listener.\r\n readOnly\r\n ></input>\r\n <label>{label}</label>\r\n </div>\r\n );\r\n};\r\n","import { IItem, IItemContainer } from \"@rpg-engine/shared\";\r\n\r\nexport const countItemFromInventory = (itemKey: string, inventory: IItemContainer) => {\r\n let itemsFromInventory: (IItem | undefined | null)[] = [];\r\n\r\n if (inventory) {\r\n Object.keys(inventory.slots).forEach(i => {\r\n const index = parseInt(i);\r\n\r\n if (inventory.slots[index]?.key === itemKey) {\r\n itemsFromInventory.push(inventory.slots[index]);\r\n }\r\n });\r\n }\r\n\r\n const totalQty = itemsFromInventory.reduce(\r\n (acc, item) => acc + (item?.stackQty || 1),\r\n 0\r\n );\r\n\r\n return totalQty;\r\n};","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport styled from 'styled-components';\r\n\r\nconst modalRoot = document.getElementById('modal-root')!;\r\n\r\ninterface ModalPortalProps {\r\n children: React.ReactNode;\r\n}\r\n\r\nconst ModalPortal: React.FC<ModalPortalProps> = ({ children }) => {\r\n return ReactDOM.createPortal(\r\n <Container className=\"rpgui-content\">{children}</Container>,\r\n modalRoot\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n position: static !important;\r\n`;\r\n\r\nexport default ModalPortal;\r\n","import React, { useEffect, useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\r\nimport ModalPortal from './Abstractions/ModalPortal';\r\n\r\ninterface IListMenuOption {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nexport interface IRelativeMenuProps {\r\n options: IListMenuOption[];\r\n onSelected: (selectedOptionId: string) => void;\r\n fontSize?: number;\r\n onOutsideClick?: () => void;\r\n pos: { x: number; y: number };\r\n}\r\n\r\nexport const RelativeListMenu: React.FC<IRelativeMenuProps> = ({\r\n options,\r\n onSelected,\r\n onOutsideClick,\r\n fontSize = 0.8,\r\n pos,\r\n}) => {\r\n const ref = useRef(null);\r\n\r\n useOutsideClick(ref, 'relative-context-menu');\r\n\r\n useEffect(() => {\r\n document.addEventListener('clickOutside', event => {\r\n const e = event as CustomEvent;\r\n\r\n if (e.detail.id === 'relative-context-menu') {\r\n if (onOutsideClick) {\r\n onOutsideClick();\r\n }\r\n }\r\n });\r\n\r\n return () => {\r\n document.removeEventListener('clickOutside', _e => {});\r\n };\r\n }, []);\r\n\r\n return (\r\n <ModalPortal>\r\n <Container fontSize={fontSize} ref={ref} {...pos}>\r\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\r\n {options.map((params, index) => (\r\n <ListElement\r\n key={params?.id || index}\r\n onPointerDown={() => {\r\n onSelected(params?.id);\r\n }}\r\n >\r\n {params?.text || 'No text'}\r\n </ListElement>\r\n ))}\r\n </ul>\r\n </Container>\r\n </ModalPortal>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n fontSize?: number;\r\n x: number;\r\n y: number;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n position: absolute;\r\n top: ${props => props.y}px;\r\n left: ${props => props.x}px;\r\n\r\n display: flex;\r\n flex-direction: column;\r\n width: max-content;\r\n justify-content: start;\r\n align-items: flex-start;\r\n\r\n li {\r\n font-size: ${props => props.fontSize}em;\r\n }\r\n`;\r\n\r\nconst ListElement = styled.li`\r\n margin-right: 0.5rem;\r\n`;\r\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\r\nimport React, { useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport ModalPortal from '../../Abstractions/ModalPortal';\r\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\r\n\r\ninterface IListMenuOption {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nexport interface MobileItemTooltipProps {\r\n item: IItem;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n closeTooltip: () => void;\r\n equipmentSet?: IEquipmentSet | null;\r\n scale?: number;\r\n options?: IListMenuOption[];\r\n onSelected?: (selectedOptionId: string) => void;\r\n}\r\n\r\nexport const MobileItemTooltip: React.FC<MobileItemTooltipProps> = ({\r\n item,\r\n atlasIMG,\r\n atlasJSON,\r\n closeTooltip,\r\n equipmentSet,\r\n scale = 1,\r\n options,\r\n onSelected,\r\n}) => {\r\n const ref = useRef<HTMLDivElement>(null);\r\n\r\n const handleFadeOut = () => {\r\n ref.current?.classList.add('fadeOut');\r\n };\r\n\r\n return (\r\n <ModalPortal>\r\n <Container\r\n ref={ref}\r\n onTouchEnd={() => {\r\n handleFadeOut();\r\n setTimeout(() => {\r\n closeTooltip();\r\n }, 100);\r\n }}\r\n scale={scale}\r\n >\r\n <ItemInfoDisplay\r\n item={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n isMobile\r\n />\r\n <OptionsContainer>\r\n {options?.map(option => (\r\n <Option\r\n key={option.id}\r\n onTouchEnd={() => {\r\n handleFadeOut();\r\n setTimeout(() => {\r\n onSelected?.(option.id);\r\n closeTooltip();\r\n }, 100);\r\n }}\r\n >\r\n {option.text}\r\n </Option>\r\n ))}\r\n </OptionsContainer>\r\n </Container>\r\n </ModalPortal>\r\n );\r\n};\r\n\r\nconst Container = styled.div<{ scale: number }>`\r\n position: absolute;\r\n z-index: 100;\r\n left: 0;\r\n top: 0;\r\n width: 100vw;\r\n height: 100vh;\r\n background-color: rgba(0 0 0 / 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.5rem;\r\n transition: opacity 0.08s;\r\n animation: fadeIn 0.1s forwards;\r\n\r\n @keyframes fadeIn {\r\n 0% {\r\n opacity: 0;\r\n }\r\n 100% {\r\n opacity: 0.92;\r\n }\r\n }\r\n\r\n @keyframes fadeOut {\r\n 0% {\r\n opacity: 0.92;\r\n }\r\n 100% {\r\n opacity: 0;\r\n }\r\n }\r\n\r\n &.fadeOut {\r\n animation: fadeOut 0.1s forwards;\r\n }\r\n\r\n @media (max-width: 640px) {\r\n flex-direction: column;\r\n }\r\n`;\r\n\r\nconst OptionsContainer = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n gap: 0.5rem;\r\n flex-wrap: wrap;\r\n\r\n @media (max-width: 640px) {\r\n flex-direction: row;\r\n justify-content: center;\r\n }\r\n`;\r\n\r\nconst Option = styled.button`\r\n padding: 1rem;\r\n background-color: #333;\r\n color: white;\r\n border: none;\r\n border-radius: 3px;\r\n width: 8rem;\r\n transition: background-color 0.1s;\r\n\r\n &:hover {\r\n background-color: #555;\r\n }\r\n\r\n @media (max-width: 640px) {\r\n padding: 1rem 0.5rem;\r\n }\r\n`;\r\n","import {\r\n ActionsForEquipmentSet,\r\n ActionsForInventory,\r\n ActionsForLoot,\r\n ActionsForMapContainer,\r\n DepotSocketEvents,\r\n IItem,\r\n ItemContainerType,\r\n ItemSocketEvents,\r\n ItemSocketEventsDisplayLabels,\r\n ItemType,\r\n} from '@rpg-engine/shared';\r\n\r\nexport interface IContextMenuItem {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nconst generateContextMenuListOptions = (actionsByTypeList: any) => {\r\n const contextMenu: IContextMenuItem[] = actionsByTypeList.map(\r\n (action: string) => {\r\n return { id: action, text: ItemSocketEventsDisplayLabels[action] };\r\n }\r\n );\r\n return contextMenu;\r\n};\r\n\r\nexport const generateContextMenu = (\r\n item: IItem,\r\n itemContainerType: ItemContainerType | null,\r\n isDepotSystem?: boolean\r\n) => {\r\n let contextActionMenu: IContextMenuItem[] = [];\r\n\r\n if (itemContainerType === ItemContainerType.Inventory) {\r\n switch (item.type) {\r\n case ItemType.Weapon:\r\n case ItemType.Armor:\r\n case ItemType.Accessory:\r\n case ItemType.Jewelry:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.Equipment\r\n );\r\n break;\r\n case ItemType.Container:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.Container\r\n );\r\n break;\r\n case ItemType.Consumable:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.Consumable\r\n );\r\n break;\r\n case ItemType.CraftingResource:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.CraftingResource\r\n );\r\n break;\r\n case ItemType.Tool:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.Tool\r\n );\r\n break;\r\n\r\n default:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForInventory.Other\r\n );\r\n break;\r\n }\r\n\r\n if (isDepotSystem) {\r\n contextActionMenu.push({\r\n id: DepotSocketEvents.Deposit,\r\n text: 'Deposit',\r\n });\r\n }\r\n }\r\n if (itemContainerType === ItemContainerType.Equipment) {\r\n switch (item.type) {\r\n case ItemType.Container:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForEquipmentSet.Container\r\n );\r\n\r\n break;\r\n default:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForEquipmentSet.Equipment\r\n );\r\n }\r\n }\r\n if (itemContainerType === ItemContainerType.Loot) {\r\n switch (item.type) {\r\n case ItemType.Weapon:\r\n case ItemType.Armor:\r\n case ItemType.Accessory:\r\n case ItemType.Jewelry:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForLoot.Equipment\r\n );\r\n break;\r\n case ItemType.Consumable:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForLoot.Consumable\r\n );\r\n break;\r\n case ItemType.CraftingResource:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForLoot.CraftingResource\r\n );\r\n break;\r\n case ItemType.Tool:\r\n contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Tool);\r\n break;\r\n default:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForLoot.Other\r\n );\r\n break;\r\n }\r\n }\r\n if (itemContainerType === ItemContainerType.MapContainer) {\r\n switch (item.type) {\r\n case ItemType.Weapon:\r\n case ItemType.Armor:\r\n case ItemType.Accessory:\r\n case ItemType.Jewelry:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForMapContainer.Equipment\r\n );\r\n break;\r\n case ItemType.Consumable:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForMapContainer.Consumable\r\n );\r\n break;\r\n case ItemType.CraftingResource:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForMapContainer.CraftingResource\r\n );\r\n break;\r\n case ItemType.Tool:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForMapContainer.Tool\r\n );\r\n break;\r\n default:\r\n contextActionMenu = generateContextMenuListOptions(\r\n ActionsForMapContainer.Other\r\n );\r\n break;\r\n }\r\n\r\n const contextActionMenuDontHaveUseWith = !contextActionMenu.find(action =>\r\n action.text.toLowerCase().includes('use with')\r\n );\r\n\r\n if (item.hasUseWith && contextActionMenuDontHaveUseWith) {\r\n contextActionMenu.push({ id: 'use-with', text: 'Use with...' });\r\n }\r\n }\r\n if (itemContainerType === ItemContainerType.Depot) {\r\n contextActionMenu = [\r\n {\r\n id: ItemSocketEvents.GetItemInfo,\r\n text: ItemSocketEventsDisplayLabels.GetItemInfo,\r\n },\r\n { id: DepotSocketEvents.Withdraw, text: 'Withdraw' },\r\n ];\r\n }\r\n\r\n return contextActionMenu;\r\n};\r\n","import {\r\n getItemTextureKeyPath,\r\n IEquipmentSet,\r\n IItem,\r\n IItemContainer,\r\n ItemContainerType,\r\n ItemRarities,\r\n ItemSlotType,\r\n ItemType,\r\n} from '@rpg-engine/shared';\r\n\r\nimport { observer } from 'mobx-react-lite';\r\nimport React, { useEffect, useRef, useState } from 'react';\r\nimport Draggable from 'react-draggable';\r\nimport styled from 'styled-components';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { uiFonts } from '../../../constants/uiFonts';\r\nimport { IPosition } from '../../../types/eventTypes';\r\nimport { RelativeListMenu } from '../../RelativeListMenu';\r\nimport { Ellipsis } from '../../shared/Ellipsis';\r\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\r\nimport { ItemTooltip } from '../Cards/ItemTooltip';\r\nimport { MobileItemTooltip } from '../Cards/MobileItemTooltip';\r\nimport { ErrorBoundary } from './ErrorBoundary';\r\nimport { generateContextMenu, IContextMenuItem } from './itemContainerHelper';\r\n\r\nexport const EquipmentSlotSpriteByType: any = {\r\n Neck: 'accessories/corruption-necklace.png',\r\n LeftHand: 'swords/broad-sword.png',\r\n Ring: 'rings/iron-ring.png',\r\n Head: 'helmets/viking-helmet.png',\r\n Torso: 'armors/iron-armor.png',\r\n Legs: 'legs/studded-legs.png',\r\n Feet: 'boots/iron-boots.png',\r\n Inventory: 'containers/bag.png',\r\n RightHand: 'shields/plate-shield.png',\r\n Accessory: 'ranged-weapons/arrow.png',\r\n};\r\n\r\ninterface IProps {\r\n slotIndex: number;\r\n item: IItem | null;\r\n itemContainer?: IItemContainer | null;\r\n itemContainerType: ItemContainerType | null;\r\n slotSpriteMask?: ItemSlotType | null;\r\n onSelected: (selectedOption: string, item: IItem) => void;\r\n onMouseOver: (\r\n event: any,\r\n slotIndex: number,\r\n item: IItem | null,\r\n x: number,\r\n y: number\r\n ) => void;\r\n onMouseOut?: () => void;\r\n onPointerDown: (\r\n ItemType: ItemType,\r\n itemContainerType: ItemContainerType | null,\r\n item: IItem\r\n ) => void;\r\n onDragStart: (\r\n item: IItem,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onDragEnd: (quantity?: number) => void;\r\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\r\n dragScale?: number;\r\n checkIfItemCanBeMoved: () => boolean;\r\n checkIfItemShouldDragEnd?: () => boolean;\r\n openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;\r\n onPlaceDrop: (\r\n item: IItem | null,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n isContextMenuDisabled?: boolean;\r\n isSelectingShortcut?: boolean;\r\n equipmentSet?: IEquipmentSet | null;\r\n setItemShortcut?: (item: IItem, shortcutIndex: number) => void;\r\n isDepotSystem?: boolean;\r\n}\r\n\r\nexport const ItemSlot: React.FC<IProps> = observer(\r\n ({\r\n slotIndex,\r\n item,\r\n itemContainerType: containerType,\r\n slotSpriteMask,\r\n onMouseOver,\r\n onMouseOut,\r\n onPointerDown,\r\n onSelected,\r\n atlasJSON,\r\n atlasIMG,\r\n isContextMenuDisabled = false,\r\n onDragEnd,\r\n onDragStart,\r\n onPlaceDrop,\r\n onOutsideDrop: onDrop,\r\n checkIfItemCanBeMoved,\r\n openQuantitySelector,\r\n checkIfItemShouldDragEnd,\r\n dragScale,\r\n isSelectingShortcut,\r\n equipmentSet,\r\n setItemShortcut,\r\n isDepotSystem,\r\n }) => {\r\n const [isTooltipVisible, setTooltipVisible] = useState(false);\r\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\r\n\r\n const [isContextMenuVisible, setIsContextMenuVisible] = useState(false);\r\n const [contextMenuPosition, setContextMenuPosition] = useState({\r\n x: 0,\r\n y: 0,\r\n });\r\n\r\n const [isFocused, setIsFocused] = useState(false);\r\n const [wasDragged, setWasDragged] = useState(false);\r\n const [dragPosition, setDragPosition] = useState<IPosition>({ x: 0, y: 0 });\r\n const [dropPosition, setDropPosition] = useState<IPosition | null>(null);\r\n const dragContainer = useRef<HTMLDivElement>(null);\r\n\r\n const [contextActions, setContextActions] = useState<IContextMenuItem[]>(\r\n []\r\n );\r\n\r\n useEffect(() => {\r\n setDragPosition({ x: 0, y: 0 });\r\n setIsFocused(false);\r\n\r\n if (item) {\r\n setContextActions(\r\n generateContextMenu(item, containerType, isDepotSystem)\r\n );\r\n }\r\n }, [item, isDepotSystem]);\r\n\r\n useEffect(() => {\r\n if (onDrop && item && dropPosition) {\r\n onDrop(item, dropPosition);\r\n }\r\n }, [dropPosition]);\r\n\r\n const getStackInfo = (itemId: string, stackQty: number) => {\r\n const isFractionalStackQty = stackQty % 1 !== 0;\r\n const isLargerThan999 = stackQty > 999;\r\n\r\n let qtyClassName = 'regular';\r\n if (isLargerThan999) qtyClassName = 'small';\r\n if (isFractionalStackQty) qtyClassName = 'xsmall';\r\n\r\n if (stackQty > 1) {\r\n return (\r\n <ItemQtyContainer key={`qty-${itemId}`}>\r\n <Ellipsis maxLines={1} maxWidth=\"48px\">\r\n <ItemQty className={qtyClassName}>\r\n {Math.round(stackQty * 100) / 100}{' '}\r\n </ItemQty>\r\n </Ellipsis>\r\n </ItemQtyContainer>\r\n );\r\n }\r\n return undefined;\r\n };\r\n\r\n const renderItem = (itemToRender: IItem | null) => {\r\n const element = [];\r\n\r\n if (itemToRender?.texturePath) {\r\n element.push(\r\n <ErrorBoundary key={itemToRender._id}>\r\n <SpriteFromAtlas\r\n key={itemToRender._id}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: itemToRender.texturePath,\r\n texturePath: itemToRender.texturePath,\r\n stackQty: itemToRender.stackQty || 1,\r\n isStackable: itemToRender.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n imgScale={3}\r\n imgClassname=\"sprite-from-atlas-img--item\"\r\n />\r\n </ErrorBoundary>\r\n );\r\n }\r\n const stackInfo = getStackInfo(\r\n itemToRender?._id ?? '',\r\n itemToRender?.stackQty ?? 0\r\n );\r\n if (stackInfo) {\r\n element.push(stackInfo);\r\n }\r\n\r\n return element;\r\n };\r\n\r\n const renderEquipment = (itemToRender: IItem | null) => {\r\n if (\r\n itemToRender?.texturePath &&\r\n itemToRender.allowedEquipSlotType?.includes(slotSpriteMask!)\r\n ) {\r\n const element = [];\r\n\r\n element.push(\r\n <ErrorBoundary key={itemToRender._id}>\r\n <SpriteFromAtlas\r\n key={itemToRender._id}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: itemToRender.texturePath,\r\n texturePath: itemToRender.texturePath,\r\n stackQty: itemToRender.stackQty || 1,\r\n isStackable: itemToRender.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n imgScale={3}\r\n imgClassname=\"sprite-from-atlas-img--item\"\r\n />\r\n </ErrorBoundary>\r\n );\r\n const stackInfo = getStackInfo(\r\n itemToRender?._id ?? '',\r\n itemToRender?.stackQty ?? 0\r\n );\r\n if (stackInfo) {\r\n element.push(stackInfo);\r\n }\r\n return element;\r\n } else {\r\n return (\r\n <ErrorBoundary key={uuidv4()}>\r\n <SpriteFromAtlas\r\n key={uuidv4()}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={EquipmentSlotSpriteByType[slotSpriteMask!]}\r\n imgScale={3}\r\n grayScale={true}\r\n opacity={0.4}\r\n imgClassname=\"sprite-from-atlas-img--item\"\r\n />\r\n </ErrorBoundary>\r\n );\r\n }\r\n };\r\n\r\n const onRenderSlot = (itemToRender: IItem | null) => {\r\n switch (containerType) {\r\n case ItemContainerType.Equipment:\r\n return renderEquipment(itemToRender);\r\n case ItemContainerType.Inventory:\r\n return renderItem(itemToRender);\r\n default:\r\n return renderItem(itemToRender);\r\n }\r\n };\r\n\r\n const resetItem = () => {\r\n setTooltipVisible(false);\r\n setWasDragged(false);\r\n };\r\n\r\n const onSuccesfulDrag = (quantity?: number) => {\r\n resetItem();\r\n\r\n if (quantity === -1) {\r\n setDragPosition({ x: 0, y: 0 });\r\n setIsFocused(false);\r\n } else if (item) {\r\n onDragEnd(quantity);\r\n }\r\n };\r\n\r\n return (\r\n <Container\r\n item={item}\r\n className=\"rpgui-icon empty-slot\"\r\n onMouseUp={() => {\r\n const data = item ? item : null;\r\n if (onPlaceDrop) onPlaceDrop(data, slotIndex, containerType);\r\n }}\r\n onTouchEnd={e => {\r\n const { clientX, clientY } = e.changedTouches[0];\r\n const simulatedEvent = new MouseEvent('mouseup', {\r\n clientX,\r\n clientY,\r\n bubbles: true,\r\n });\r\n\r\n document\r\n .elementFromPoint(clientX, clientY)\r\n ?.dispatchEvent(simulatedEvent);\r\n }}\r\n isSelectingShortcut={\r\n isSelectingShortcut &&\r\n (item?.type === ItemType.Consumable || item?.type === ItemType.Tool)\r\n }\r\n >\r\n <Draggable\r\n axis={isSelectingShortcut ? 'none' : 'both'}\r\n defaultClassName={item ? 'draggable' : 'empty-slot'}\r\n scale={dragScale}\r\n onStop={(e, data) => {\r\n const target = e.target as HTMLElement;\r\n if (\r\n target?.id.includes('shortcutSetter') &&\r\n setItemShortcut &&\r\n item\r\n ) {\r\n const index = parseInt(target.id.split('_')[1]);\r\n if (!isNaN(index)) {\r\n setItemShortcut(item, index);\r\n }\r\n }\r\n\r\n if (wasDragged && item && !isSelectingShortcut) {\r\n //@ts-ignore\r\n const classes: string[] = Array.from(e.target?.classList);\r\n\r\n const isOutsideDrop =\r\n classes.some(elm => {\r\n return elm.includes('rpgui-content');\r\n }) || classes.length === 0;\r\n\r\n if (isOutsideDrop) {\r\n setDropPosition({\r\n x: data.x,\r\n y: data.y,\r\n });\r\n }\r\n\r\n setWasDragged(false);\r\n\r\n const target = dragContainer.current;\r\n if (!target || !wasDragged) return;\r\n\r\n const style = window.getComputedStyle(target);\r\n const matrix = new DOMMatrixReadOnly(style.transform);\r\n const x = matrix.m41;\r\n const y = matrix.m42;\r\n\r\n setDragPosition({ x, y });\r\n\r\n setTimeout(() => {\r\n if (checkIfItemCanBeMoved()) {\r\n if (checkIfItemShouldDragEnd && !checkIfItemShouldDragEnd())\r\n return;\r\n\r\n if (\r\n item.stackQty &&\r\n item.stackQty !== 1 &&\r\n openQuantitySelector\r\n )\r\n openQuantitySelector(item.stackQty, onSuccesfulDrag);\r\n else onSuccesfulDrag(item.stackQty);\r\n } else {\r\n resetItem();\r\n setIsFocused(false);\r\n setDragPosition({ x: 0, y: 0 });\r\n }\r\n }, 100);\r\n } else if (item) {\r\n let isTouch = false;\r\n if (\r\n !isContextMenuDisabled &&\r\n e.type === 'touchend' &&\r\n !isSelectingShortcut\r\n ) {\r\n isTouch = true;\r\n setIsTooltipMobileVisible(true);\r\n }\r\n\r\n if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch) {\r\n setIsContextMenuVisible(!isContextMenuVisible);\r\n const event = e as MouseEvent;\r\n\r\n if (event.clientX && event.clientY) {\r\n setContextMenuPosition({\r\n x: event.clientX - 10,\r\n y: event.clientY - 5,\r\n });\r\n }\r\n }\r\n\r\n onPointerDown(item.type, containerType, item);\r\n }\r\n }}\r\n onStart={() => {\r\n if (!item || isSelectingShortcut) {\r\n return;\r\n }\r\n\r\n if (onDragStart) {\r\n onDragStart(item, slotIndex, containerType);\r\n }\r\n }}\r\n onDrag={(_e, data) => {\r\n if (\r\n Math.abs(data.x - dragPosition.x) > 5 ||\r\n Math.abs(data.y - dragPosition.y) > 5\r\n ) {\r\n setWasDragged(true);\r\n setIsFocused(true);\r\n }\r\n }}\r\n position={dragPosition}\r\n cancel=\".empty-slot\"\r\n >\r\n <ItemContainer\r\n ref={dragContainer}\r\n isFocused={isFocused}\r\n onMouseOver={event => {\r\n onMouseOver(event, slotIndex, item, event.clientX, event.clientY);\r\n }}\r\n onMouseOut={() => {\r\n if (onMouseOut) onMouseOut();\r\n }}\r\n onMouseEnter={() => {\r\n setTooltipVisible(true);\r\n }}\r\n onMouseLeave={() => {\r\n setTooltipVisible(false);\r\n }}\r\n >\r\n {onRenderSlot(item)}\r\n </ItemContainer>\r\n </Draggable>\r\n\r\n {isTooltipVisible && item && !isFocused && (\r\n <ItemTooltip\r\n item={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n />\r\n )}\r\n\r\n {isTooltipMobileVisible && item && (\r\n <MobileItemTooltip\r\n item={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n closeTooltip={() => {\r\n setIsTooltipMobileVisible(false);\r\n }}\r\n scale={dragScale}\r\n options={contextActions}\r\n onSelected={(optionId: string) => {\r\n setIsContextMenuVisible(false);\r\n if (item) {\r\n onSelected(optionId, item);\r\n }\r\n }}\r\n />\r\n )}\r\n\r\n {!isContextMenuDisabled && isContextMenuVisible && contextActions && (\r\n <RelativeListMenu\r\n options={contextActions}\r\n onSelected={(optionId: string) => {\r\n setIsContextMenuVisible(false);\r\n if (item) {\r\n onSelected(optionId, item);\r\n }\r\n }}\r\n onOutsideClick={() => {\r\n setIsContextMenuVisible(false);\r\n }}\r\n pos={contextMenuPosition}\r\n />\r\n )}\r\n </Container>\r\n );\r\n }\r\n);\r\n\r\nexport const rarityColor = (item: IItem | null) => {\r\n switch (item?.rarity) {\r\n case ItemRarities.Uncommon:\r\n return 'rgba(13, 193, 13, 0.6)';\r\n case ItemRarities.Rare:\r\n return 'rgba(8, 104, 187, 0.6)';\r\n case ItemRarities.Epic:\r\n return 'rgba(191, 0, 255, 0.6)';\r\n case ItemRarities.Legendary:\r\n return 'rgba(255, 191, 0,0.6)';\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\ninterface ContainerTypes {\r\n item: IItem | null;\r\n isSelectingShortcut?: boolean;\r\n}\r\n\r\nconst Container = styled.div<ContainerTypes>`\r\n margin: 0.1rem;\r\n .sprite-from-atlas-img--item {\r\n position: relative;\r\n top: 1.5rem;\r\n left: 1.5rem;\r\n border-color: ${({ item }) => rarityColor(item)};\r\n box-shadow: ${({ item }) => `0 0 5px 2px ${rarityColor(item)}`} inset, ${({\r\n item,\r\n}) => `0 0 4px 3px ${rarityColor(item)}`};\r\n //background-color: ${({ item }) => rarityColor(item)};\r\n }\r\n position: relative;\r\n\r\n &::before {\r\n content: '';\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n z-index: 1;\r\n border-radius: 12px;\r\n pointer-events: none;\r\n animation: ${({ isSelectingShortcut }) =>\r\n isSelectingShortcut ? 'bg-color-change 1s infinite' : 'none'};\r\n\r\n @keyframes bg-color-change {\r\n 0% {\r\n background-color: rgba(255 255 255 / 0.5);\r\n }\r\n 50% {\r\n background-color: transparent;\r\n }\r\n 100% {\r\n background-color: rgba(255 255 255 / 0.5);\r\n }\r\n }\r\n }\r\n`;\r\n\r\nconst ItemContainer = styled.div<{ isFocused?: boolean }>`\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n\r\n ${props => props.isFocused && 'z-index: 100; pointer-events: none;'}\r\n`;\r\n\r\nconst ItemQtyContainer = styled.div`\r\n position: relative;\r\n width: 85%;\r\n height: 16px;\r\n top: 25px;\r\n left: 2px;\r\n pointer-events: none;\r\n\r\n display: flex;\r\n justify-content: flex-end;\r\n`;\r\n\r\nconst ItemQty = styled.span`\r\n &.regular {\r\n font-size: ${uiFonts.size.small};\r\n }\r\n &.small {\r\n font-size: ${uiFonts.size.xsmall};\r\n }\r\n &.xsmall {\r\n font-size: ${uiFonts.size.xxsmall};\r\n }\r\n`;\r\n","import { IItem } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../../constants/uiColors';\r\nimport { uiFonts } from '../../../constants/uiFonts';\r\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\r\nimport { ErrorBoundary } from '../Inventory/ErrorBoundary';\r\nimport { EquipmentSlotSpriteByType, rarityColor } from '../Inventory/ItemSlot';\r\n\r\ninterface IItemInfoProps {\r\n item: IItem;\r\n itemToCompare?: IItem;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n}\r\n\r\ninterface IItemStat {\r\n key: keyof IItem;\r\n label?: string;\r\n higherIsWorse?: boolean;\r\n}\r\n\r\nconst statisticsToDisplay: IItemStat[] = [\r\n { key: 'attack' },\r\n { key: 'defense' },\r\n { key: 'maxRange', label: 'Range' },\r\n { key: 'weight', higherIsWorse: true },\r\n];\r\n\r\nexport const ItemInfo: React.FC<IItemInfoProps> = ({\r\n item,\r\n itemToCompare,\r\n atlasIMG,\r\n atlasJSON,\r\n}) => {\r\n const renderStatistics = () => {\r\n const statistics = [];\r\n\r\n for (const stat of statisticsToDisplay) {\r\n const itemStatistic = item[stat.key];\r\n\r\n if (itemStatistic) {\r\n const label =\r\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\r\n\r\n const isItemToCompare = !!itemToCompare;\r\n\r\n const isOnlyInOneItem = isItemToCompare && !itemToCompare?.[stat.key];\r\n const statDiff =\r\n parseInt(itemStatistic.toString()) -\r\n parseInt(itemToCompare?.[stat.key]?.toString() ?? '0');\r\n\r\n const isDifference = isItemToCompare && statDiff !== 0;\r\n const isBetter =\r\n (statDiff > 0 && !stat.higherIsWorse) ||\r\n (statDiff < 0 && stat.higherIsWorse);\r\n\r\n statistics.push(\r\n <Statistic key={stat.key} className={isOnlyInOneItem ? 'better' : ''}>\r\n <div className=\"label\">{label}:</div>\r\n <div\r\n className={`value ${\r\n isDifference ? (isBetter ? 'better' : 'worse') : ''\r\n }`}\r\n >\r\n {`${itemStatistic.toString()} ${\r\n isDifference ? `(${statDiff > 0 ? '+' : ''}${statDiff})` : ''\r\n }`}\r\n </div>\r\n </Statistic>\r\n );\r\n }\r\n }\r\n\r\n return statistics;\r\n };\r\n\r\n const renderMissingStatistic = () => {\r\n const statistics = [];\r\n\r\n for (const stat of statisticsToDisplay) {\r\n const itemToCompareStatistic = itemToCompare?.[stat.key];\r\n\r\n if (itemToCompareStatistic && !item[stat.key]) {\r\n const label =\r\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\r\n\r\n statistics.push(\r\n <Statistic key={stat.key} className=\"worse\">\r\n <div className=\"label\">{label}:</div>\r\n <div className=\"value worse\">\r\n {itemToCompareStatistic.toString()}\r\n </div>\r\n </Statistic>\r\n );\r\n }\r\n }\r\n\r\n return statistics;\r\n };\r\n\r\n const renderEntityEffects = () => {\r\n if (!item.entityEffects || !item.entityEffectChance) return null;\r\n\r\n return item.entityEffects.map((effect, index) => (\r\n <Statistic key={index} $isSpecial>\r\n {effect[0].toUpperCase() + effect.slice(1)} ({item.entityEffectChance}%)\r\n </Statistic>\r\n ));\r\n };\r\n\r\n const renderAvaibleSlots = () => {\r\n if (!item.allowedEquipSlotType) return null;\r\n\r\n return item.allowedEquipSlotType.map((slotType, index) => (\r\n <ErrorBoundary key={index}>\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={EquipmentSlotSpriteByType[slotType]}\r\n imgScale={2}\r\n grayScale={true}\r\n opacity={0.4}\r\n containerStyle={{ width: '32px', height: '32px' }}\r\n />\r\n </ErrorBoundary>\r\n ));\r\n };\r\n\r\n return (\r\n <Container item={item}>\r\n <Header>\r\n <div>\r\n <Title>{item.name}</Title>\r\n {item.rarity !== 'Common' && (\r\n <Rarity item={item}>{item.rarity}</Rarity>\r\n )}\r\n <Type>{item.subType}</Type>\r\n </div>\r\n <AllowedSlots>{renderAvaibleSlots()}</AllowedSlots>\r\n </Header>\r\n\r\n {item.minRequirements && (\r\n <LevelRequirement>\r\n <div className=\"title\">Requirements:</div>\r\n <div>- Level: {item.minRequirements.level}</div>\r\n <div>\r\n -{' '}\r\n {item.minRequirements.skill.name[0].toUpperCase() +\r\n item.minRequirements.skill.name.slice(1)}\r\n : {item.minRequirements.skill.level}\r\n </div>\r\n </LevelRequirement>\r\n )}\r\n\r\n {renderStatistics()}\r\n {renderEntityEffects()}\r\n {item.usableEffectDescription && (\r\n <Statistic $isSpecial>{item.usableEffectDescription}</Statistic>\r\n )}\r\n {item.equippedBuffDescription && (\r\n <Statistic $isSpecial>{item.equippedBuffDescription}</Statistic>\r\n )}\r\n {item.isTwoHanded && <Statistic $isSpecial>Two handed</Statistic>}\r\n\r\n <Description>{item.description}</Description>\r\n\r\n {item.maxStackSize && item.maxStackSize !== 1 && (\r\n <StackInfo>\r\n x{Math.round((item.stackQty ?? 1) * 100) / 100}({item.maxStackSize})\r\n </StackInfo>\r\n )}\r\n\r\n {renderMissingStatistic().length > 0 && (\r\n <MissingStatistics>\r\n <Statistic>Equipped Diff</Statistic>\r\n {itemToCompare && renderMissingStatistic()}\r\n </MissingStatistics>\r\n )}\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div<{ item: IItem }>`\r\n color: white;\r\n background-color: #222;\r\n border-radius: 5px;\r\n padding: 0.5rem;\r\n font-size: ${uiFonts.size.small};\r\n border: 3px solid ${({ item }) => rarityColor(item) ?? uiColors.lightGray};\r\n height: max-content;\r\n width: 18rem;\r\n\r\n @media (max-width: 640px) {\r\n width: 80vw;\r\n }\r\n`;\r\n\r\nconst Title = styled.div`\r\n font-size: ${uiFonts.size.medium};\r\n font-weight: bold;\r\n margin-bottom: 0.5rem;\r\n display: flex;\r\n align-items: center;\r\n margin: 0;\r\n`;\r\n\r\nconst Rarity = styled.div<{ item: IItem }>`\r\n font-size: ${uiFonts.size.small};\r\n font-weight: normal;\r\n margin-top: 0.2rem;\r\n color: ${({ item }) => rarityColor(item)};\r\n filter: brightness(1.5);\r\n`;\r\n\r\nconst Type = styled.div`\r\n font-size: ${uiFonts.size.small};\r\n margin-top: 0.2rem;\r\n color: ${uiColors.lightGray};\r\n`;\r\n\r\nconst LevelRequirement = styled.div`\r\n font-size: ${uiFonts.size.small};\r\n margin-top: 0.2rem;\r\n margin-bottom: 1rem;\r\n color: ${uiColors.orange};\r\n\r\n .title {\r\n margin-bottom: 4px;\r\n }\r\n\r\n div {\r\n margin-bottom: 2px;\r\n }\r\n`;\r\n\r\nconst Statistic = styled.div<{ $isSpecial?: boolean }>`\r\n margin-bottom: 0.4rem;\r\n width: 100%;\r\n color: ${({ $isSpecial }) => ($isSpecial ? uiColors.darkYellow : 'inherit')};\r\n\r\n .label {\r\n display: inline-block;\r\n margin-right: 0.5rem;\r\n color: inherit;\r\n }\r\n\r\n .value {\r\n display: inline-block;\r\n color: inherit;\r\n }\r\n\r\n &.better,\r\n .better {\r\n color: ${uiColors.lightGreen};\r\n }\r\n\r\n &.worse,\r\n .worse {\r\n color: ${uiColors.cardinal};\r\n }\r\n`;\r\n\r\nconst Description = styled.div`\r\n margin-top: 1.5rem;\r\n font-size: ${uiFonts.size.small};\r\n color: ${uiColors.lightGray};\r\n font-style: italic;\r\n`;\r\n\r\nconst Header = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n margin-bottom: 0.5rem;\r\n`;\r\n\r\nconst AllowedSlots = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 0.5rem;\r\n margin-left: auto;\r\n align-self: flex-start;\r\n`;\r\n\r\nconst StackInfo = styled.div`\r\n width: 100%;\r\n text-align: right;\r\n font-size: ${uiFonts.size.small};\r\n color: ${uiColors.orange};\r\n margin-top: 1rem;\r\n`;\r\n\r\nconst MissingStatistics = styled.div`\r\n margin-top: 1rem;\r\n color: ${uiColors.cardinal};\r\n`;\r\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\r\nimport { camelCase } from 'lodash';\r\nimport React, { useMemo } from 'react';\r\nimport styled from 'styled-components';\r\nimport { ItemInfo } from './ItemInfo';\r\n\r\nexport interface IItemInfoDisplayProps {\r\n item: IItem;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n equipmentSet?: IEquipmentSet | null;\r\n isMobile?: boolean;\r\n}\r\n\r\ntype EquipmentSlotTypes =\r\n | 'head'\r\n | 'neck'\r\n | 'leftHand'\r\n | 'rightHand'\r\n | 'ring'\r\n | 'legs'\r\n | 'boot'\r\n | 'accessory'\r\n | 'armor'\r\n | 'inventory';\r\n\r\nconst itemSlotTypes: EquipmentSlotTypes[] = [\r\n 'head',\r\n 'neck',\r\n 'leftHand',\r\n 'rightHand',\r\n 'ring',\r\n 'legs',\r\n 'boot',\r\n 'accessory',\r\n 'armor',\r\n 'inventory',\r\n];\r\n\r\nconst getSlotType = (\r\n itemSlotTypes: string[],\r\n slotType: string,\r\n subType: string\r\n): keyof IEquipmentSet => {\r\n if (!itemSlotTypes.includes(slotType)) {\r\n return subType as keyof IEquipmentSet;\r\n }\r\n return slotType as keyof IEquipmentSet;\r\n};\r\n\r\nexport const ItemInfoDisplay: React.FC<IItemInfoDisplayProps> = ({\r\n item,\r\n atlasIMG,\r\n atlasJSON,\r\n equipmentSet,\r\n isMobile,\r\n}) => {\r\n const itemToCompare = useMemo(() => {\r\n if (equipmentSet && item.allowedEquipSlotType?.length) {\r\n const allowedSlotTypeCamelCase = camelCase(item.allowedEquipSlotType[0]);\r\n const itemSubTypeCamelCase = camelCase(item.subType);\r\n\r\n const slotType = getSlotType(\r\n itemSlotTypes,\r\n allowedSlotTypeCamelCase,\r\n itemSubTypeCamelCase\r\n );\r\n\r\n const itemSubTypeFromEquipment = Object.values(equipmentSet).find(\r\n item => camelCase(item?.subType ?? '') === itemSubTypeCamelCase\r\n );\r\n\r\n const itemFromEquipment = itemSubTypeFromEquipment\r\n ? itemSubTypeFromEquipment\r\n : (equipmentSet[slotType] as IItem);\r\n\r\n if (\r\n itemFromEquipment &&\r\n (!item._id || itemFromEquipment._id !== item._id)\r\n ) {\r\n return itemFromEquipment;\r\n }\r\n }\r\n\r\n return undefined;\r\n }, [equipmentSet, item]);\r\n\r\n return (\r\n <Flex $isMobile={isMobile}>\r\n <ItemInfo\r\n item={item}\r\n itemToCompare={itemToCompare}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n\r\n {itemToCompare && (\r\n <CompareContainer>\r\n <Equipped>\r\n <span>Equipped</span>\r\n </Equipped>\r\n <ItemInfo\r\n item={itemToCompare}\r\n itemToCompare={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n </CompareContainer>\r\n )}\r\n </Flex>\r\n );\r\n};\r\n\r\nconst Flex = styled.div<{ $isMobile?: boolean }>`\r\n display: flex;\r\n gap: 0.5rem;\r\n flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};\r\n align-items: center;\r\n\r\n @media (max-width: 640px) {\r\n flex-direction: column-reverse;\r\n align-items: center;\r\n }\r\n`;\r\n\r\nconst Equipped = styled.div`\r\n position: absolute;\r\n bottom: 100%;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n`;\r\n\r\nconst CompareContainer = styled.div`\r\n position: relative;\r\n`;\r\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\r\nimport React, { useEffect, useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport ModalPortal from '../../Abstractions/ModalPortal';\r\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\r\n\r\nexport interface IItemTooltipProps {\r\n item: IItem;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n equipmentSet?: IEquipmentSet | null;\r\n}\r\n\r\nconst offset = 20;\r\n\r\nexport const ItemTooltip: React.FC<IItemTooltipProps> = ({\r\n item,\r\n atlasIMG,\r\n atlasJSON,\r\n equipmentSet,\r\n}) => {\r\n const ref = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const { current } = ref;\r\n\r\n if (current) {\r\n const handleMouseMove = (event: MouseEvent) => {\r\n const { clientX, clientY } = event;\r\n\r\n // Adjust the position of the tooltip based on the mouse position\r\n const rect = current.getBoundingClientRect();\r\n\r\n const tooltipWidth = rect.width;\r\n const tooltipHeight = rect.height;\r\n const isOffScreenRight =\r\n clientX + tooltipWidth + offset > window.innerWidth;\r\n const isOffScreenBottom =\r\n clientY + tooltipHeight + offset > window.innerHeight;\r\n const x = isOffScreenRight\r\n ? clientX - tooltipWidth - offset\r\n : clientX + offset;\r\n const y = isOffScreenBottom\r\n ? clientY - tooltipHeight - offset\r\n : clientY + offset;\r\n\r\n current.style.transform = `translate(${x}px, ${y}px)`;\r\n current.style.opacity = '1';\r\n };\r\n\r\n window.addEventListener('mousemove', handleMouseMove);\r\n\r\n return () => {\r\n window.removeEventListener('mousemove', handleMouseMove);\r\n };\r\n }\r\n\r\n return;\r\n }, []);\r\n\r\n return (\r\n <ModalPortal>\r\n <Container ref={ref}>\r\n <ItemInfoDisplay\r\n item={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n />\r\n </Container>\r\n </ModalPortal>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n position: absolute;\r\n z-index: 100;\r\n pointer-events: none;\r\n left: 0;\r\n top: 0;\r\n opacity: 0;\r\n transition: opacity 0.08s;\r\n`;\r\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\r\nimport React, { useState } from 'react';\r\nimport { ItemTooltip } from './ItemTooltip';\r\nimport { MobileItemTooltip } from './MobileItemTooltip';\r\n\r\ninterface IItemInfoWrapperProps {\r\n item: IItem;\r\n children: React.ReactNode;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n equipmentSet?: IEquipmentSet | null;\r\n scale?: number;\r\n}\r\n\r\nexport const ItemInfoWrapper: React.FC<IItemInfoWrapperProps> = ({\r\n children,\r\n atlasIMG,\r\n atlasJSON,\r\n item,\r\n equipmentSet,\r\n scale,\r\n}) => {\r\n const [isTooltipVisible, setIsTooltipVisible] = useState(false);\r\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\r\n\r\n return (\r\n <div\r\n onMouseEnter={() => {\r\n if (!isTooltipMobileVisible) setIsTooltipVisible(true);\r\n }}\r\n onMouseLeave={setIsTooltipVisible.bind(null, false)}\r\n onTouchEnd={() => {\r\n setIsTooltipMobileVisible(true);\r\n setIsTooltipVisible(false);\r\n }}\r\n >\r\n {children}\r\n\r\n {isTooltipVisible && !isTooltipMobileVisible && (\r\n <ItemTooltip\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n item={item}\r\n />\r\n )}\r\n {isTooltipMobileVisible && (\r\n <MobileItemTooltip\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n closeTooltip={() => {\r\n setIsTooltipMobileVisible(false);\r\n console.log('close');\r\n }}\r\n item={item}\r\n scale={scale}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n","import {\r\n ICraftableItem,\r\n IEquipmentSet,\r\n IItemContainer,\r\n ISkill,\r\n} from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { countItemFromInventory } from '../../libs/itemCounter';\r\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\n\r\ninterface ICraftingRecipeProps {\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n equipmentSet?: IEquipmentSet | null;\r\n recipe: ICraftableItem;\r\n scale?: number;\r\n handleRecipeSelect: () => void;\r\n selectedCraftItemKey?: string;\r\n inventory?: IItemContainer | null;\r\n skills?: ISkill | null;\r\n}\r\n\r\nexport const CraftingRecipe: React.FC<ICraftingRecipeProps> = ({\r\n atlasIMG,\r\n atlasJSON,\r\n equipmentSet,\r\n recipe,\r\n scale,\r\n handleRecipeSelect,\r\n selectedCraftItemKey,\r\n inventory,\r\n skills,\r\n}) => {\r\n const modifyString = (str: string) => {\r\n // Split the string by \"/\" and \".\"\r\n let parts = str.split('/');\r\n let fileName = parts[parts.length - 1];\r\n parts = fileName.split('.');\r\n let name = parts[0];\r\n\r\n // Replace all occurrences of \"-\" with \" \"\r\n name = name.replace(/-/g, ' ');\r\n\r\n // Uppercase the first word\r\n let words = name.split(' ');\r\n let firstWord = words[0].slice(0, 1).toUpperCase() + words[0].slice(1);\r\n let modifiedWords = [firstWord].concat(words.slice(1));\r\n name = modifiedWords.join(' ');\r\n\r\n return name;\r\n };\r\n\r\n const levelInSkill =\r\n (skills?.[\r\n (recipe?.minCraftingRequirements?.[0] ?? '') as keyof ISkill\r\n ] as any)?.level ?? 1;\r\n\r\n return (\r\n <RadioOptionsWrapper>\r\n <SpriteAtlasWrapper>\r\n <ItemInfoWrapper\r\n item={recipe}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n scale={scale}\r\n >\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={recipe.texturePath}\r\n imgScale={3}\r\n grayScale={!recipe.canCraft}\r\n />\r\n </ItemInfoWrapper>\r\n </SpriteAtlasWrapper>\r\n <div>\r\n <div onPointerUp={recipe.canCraft ? handleRecipeSelect : undefined}>\r\n <input\r\n className=\"rpgui-radio\"\r\n type=\"radio\"\r\n value={recipe.name}\r\n name=\"test\"\r\n disabled={!recipe.canCraft}\r\n checked={selectedCraftItemKey === recipe.key}\r\n onChange={handleRecipeSelect}\r\n />\r\n <label style={{ display: 'flex', alignItems: 'center' }}>\r\n {modifyString(recipe.name)}\r\n </label>\r\n </div>\r\n\r\n <MinCraftingRequirementsText levelIsOk={recipe?.levelIsOk ?? false}>\r\n {modifyString(`${recipe?.minCraftingRequirements?.[0] ?? ''}`)} lvl{' '}\r\n {recipe?.minCraftingRequirements?.[1] ?? 0} ({levelInSkill})\r\n </MinCraftingRequirementsText>\r\n\r\n {recipe.ingredients.map((ingredient, index) => {\r\n const itemQtyInInventory = !inventory\r\n ? 0\r\n : countItemFromInventory(ingredient.key, inventory);\r\n\r\n return (\r\n <Recipe key={index}>\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={ingredient.texturePath}\r\n imgScale={1.2}\r\n />\r\n <Ingredient isQuantityOk={ingredient.qty <= itemQtyInInventory}>\r\n {modifyString(ingredient.key)} x{ingredient.qty} (\r\n {itemQtyInInventory})\r\n </Ingredient>\r\n </Recipe>\r\n );\r\n })}\r\n </div>\r\n </RadioOptionsWrapper>\r\n );\r\n};\r\n\r\nconst Ingredient = styled.p<{ isQuantityOk: boolean }>`\r\n margin: 0;\r\n margin-left: 14px;\r\n color: ${({ isQuantityOk }) =>\r\n isQuantityOk ? uiColors.lightGreen : uiColors.lightGray} !important;\r\n`;\r\n\r\nconst Recipe = styled.div`\r\n font-size: 0.6rem;\r\n margin-bottom: 3px;\r\n display: flex;\r\n align-items: center;\r\n margin-left: 4px;\r\n\r\n .sprite-from-atlas-img {\r\n top: 0px;\r\n left: 0px;\r\n }\r\n`;\r\n\r\nconst SpriteAtlasWrapper = styled.div`\r\n margin-right: 40px;\r\n`;\r\n\r\nconst RadioOptionsWrapper = styled.div`\r\n display: flex;\r\n align-items: stretch;\r\n margin-bottom: 40px;\r\n`;\r\n\r\nconst MinCraftingRequirementsText = styled.p<{ levelIsOk: boolean }>`\r\n font-size: 0.6rem !important;\r\n margin: 0 5px 0 35px;\r\n color: ${({ levelIsOk }) =>\r\n levelIsOk ? uiColors.lightGreen : uiColors.lightGray} !important;\r\n`;\r\n","import {\r\n ICraftableItem,\r\n IEquipmentSet,\r\n IItemContainer,\r\n ISkill,\r\n ItemSubType,\r\n} from '@rpg-engine/shared';\r\nimport React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { InputRadio } from '../InputRadio';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { CraftingRecipe } from './CraftingRecipe';\r\n\r\nexport interface IItemCraftSelectorProps {\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n onClose: () => void;\r\n onSelect: (value: string) => void;\r\n onCraftItem: (value: string | undefined) => void;\r\n craftablesItems: ICraftableItem[];\r\n equipmentSet?: IEquipmentSet | null;\r\n inventory?: IItemContainer | null;\r\n scale?: number;\r\n skills?: ISkill | null;\r\n savedSelectedType?: string;\r\n}\r\n\r\nexport interface ShowMessage {\r\n show: boolean;\r\n index: number;\r\n}\r\n\r\nconst desktop = {\r\n width: 'min(900px, 80%)',\r\n height: 'min(700px, 80%)',\r\n};\r\n\r\nconst mobileLanscape = {\r\n width: '800px',\r\n height: '500px',\r\n};\r\n\r\nconst mobilePortrait = {\r\n width: '500px',\r\n height: '700px',\r\n};\r\n\r\nexport const CraftBook: React.FC<IItemCraftSelectorProps> = ({\r\n atlasIMG,\r\n atlasJSON,\r\n onClose,\r\n onSelect,\r\n onCraftItem,\r\n craftablesItems,\r\n equipmentSet,\r\n scale,\r\n inventory,\r\n skills,\r\n savedSelectedType,\r\n}) => {\r\n const [craftItemKey, setCraftItemKey] = useState<string>();\r\n const [selectedType, setSelectedType] = useState<string>(\r\n savedSelectedType ?? Object.keys(ItemSubType)[0]\r\n );\r\n const [size, setSize] = useState<{ width: string; height: string }>();\r\n\r\n useEffect(() => {\r\n const handleResize = (): void => {\r\n if (\r\n window.innerWidth < 500 &&\r\n size?.width !== mobilePortrait.width &&\r\n (!scale || scale < 1)\r\n ) {\r\n setSize(mobilePortrait);\r\n } else if (\r\n (!scale || scale < 1) &&\r\n size?.width !== mobileLanscape.width\r\n ) {\r\n setSize(mobileLanscape);\r\n } else if (size?.width !== desktop.width) {\r\n setSize(desktop);\r\n }\r\n };\r\n handleResize();\r\n\r\n window.addEventListener('resize', handleResize);\r\n\r\n return () => window.removeEventListener('resize', handleResize);\r\n }, [scale]);\r\n\r\n const renderItemTypes = () => {\r\n const itemTypes = ['Suggested', ...Object.keys(ItemSubType)]\r\n .filter(type => type !== 'DeadBody')\r\n .sort((a, b) => {\r\n if (a === 'Suggested') return -1;\r\n if (b === 'Suggested') return 1;\r\n return a.localeCompare(b);\r\n });\r\n\r\n if (window.innerWidth > parseInt(mobilePortrait.width)) {\r\n return itemTypes.map(type => {\r\n return (\r\n <InputRadio\r\n key={type}\r\n value={type}\r\n label={type}\r\n name={type}\r\n isChecked={selectedType === type}\r\n onRadioSelect={value => {\r\n setSelectedType(value);\r\n onSelect(value);\r\n }}\r\n />\r\n );\r\n });\r\n }\r\n\r\n const rows: JSX.Element[][] = [[], []];\r\n\r\n itemTypes.forEach((type, index) => {\r\n let row = 0;\r\n\r\n if (index % 2 === 1) row = 1;\r\n\r\n rows[row].push(\r\n <InputRadio\r\n key={type}\r\n value={type}\r\n label={type}\r\n name={type}\r\n isChecked={selectedType === type}\r\n onRadioSelect={value => {\r\n setSelectedType(value);\r\n onSelect(value);\r\n }}\r\n />\r\n );\r\n });\r\n\r\n return rows.map((row, index) => (\r\n <div key={index} style={{ display: 'flex', gap: '10px' }}>\r\n {row}\r\n </div>\r\n ));\r\n };\r\n\r\n if (!size) return null;\r\n\r\n return (\r\n <DraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n width={size.width}\r\n height={size.height}\r\n cancelDrag=\".inputRadioCraftBook\"\r\n onCloseButton={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n scale={scale}\r\n >\r\n <Wrapper>\r\n <div style={{ width: '100%' }}>\r\n <Title>Craftbook</Title>\r\n <Subtitle>Select an item to craft</Subtitle>\r\n <hr className=\"golden\" />\r\n </div>\r\n\r\n <ContentContainer>\r\n <ItemTypes className=\"inputRadioCraftBook\">\r\n {renderItemTypes()}\r\n </ItemTypes>\r\n\r\n <RadioInputScroller className=\"inputRadioCraftBook\">\r\n {craftablesItems?.map(item => (\r\n <CraftingRecipe\r\n key={item.key}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n recipe={item}\r\n scale={scale}\r\n handleRecipeSelect={setCraftItemKey.bind(null, item.key)}\r\n selectedCraftItemKey={craftItemKey}\r\n inventory={inventory}\r\n skills={skills}\r\n />\r\n ))}\r\n </RadioInputScroller>\r\n </ContentContainer>\r\n <ButtonWrapper>\r\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\r\n Cancel\r\n </Button>\r\n <Button\r\n disabled={!craftItemKey}\r\n buttonType={ButtonTypes.RPGUIButton}\r\n onPointerDown={() => onCraftItem(craftItemKey)}\r\n >\r\n Craft\r\n </Button>\r\n </ButtonWrapper>\r\n </Wrapper>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst Wrapper = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n width: 100%;\r\n height: 100%;\r\n`;\r\n\r\nconst Title = styled.h1`\r\n font-size: 0.6rem;\r\n color: ${uiColors.yellow} !important;\r\n`;\r\n\r\nconst Subtitle = styled.h1`\r\n font-size: 0.4rem;\r\n color: ${uiColors.yellow} !important;\r\n`;\r\n\r\nconst RadioInputScroller = styled.div`\r\n padding-left: 15px;\r\n padding-top: 10px;\r\n margin-top: 1rem;\r\n align-items: center;\r\n align-items: flex-start;\r\n overflow-y: scroll;\r\n min-height: 0;\r\n flex: 1;\r\n margin-left: 10px;\r\n -webkit-overflow-scrolling: touch;\r\n\r\n @media (max-width: ${mobilePortrait.width}) {\r\n margin-left: 0;\r\n }\r\n`;\r\n\r\nconst ButtonWrapper = styled.div`\r\n display: flex;\r\n justify-content: flex-end;\r\n margin-top: 10px;\r\n width: 100%;\r\n\r\n button {\r\n padding: 0px 50px;\r\n margin: 5px;\r\n }\r\n\r\n @media (max-width: ${mobilePortrait.width}) {\r\n justify-content: center;\r\n }\r\n`;\r\n\r\nconst ContentContainer = styled.div`\r\n display: flex;\r\n width: 100%;\r\n min-height: 0;\r\n flex: 1;\r\n\r\n @media (max-width: ${mobilePortrait.width}) {\r\n flex-direction: column;\r\n }\r\n`;\r\n\r\nconst ItemTypes = styled.div`\r\n display: flex;\r\n overflow-y: scroll;\r\n overflow-x: hidden;\r\n width: max-content;\r\n flex-direction: column;\r\n padding-right: 5px;\r\n\r\n @media (max-width: ${mobilePortrait.width}) {\r\n overflow-x: scroll;\r\n overflow-y: hidden;\r\n padding-right: 0;\r\n width: 100%;\r\n }\r\n`;\r\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport interface IOptionsProps {\n id: number;\n value: string;\n option: string | JSX.Element;\n}\n\nexport interface IDropdownProps {\n options: IOptionsProps[];\n width?: string;\n onChange: (value: string) => void;\n}\n\nexport const Dropdown: React.FC<IDropdownProps> = ({\n options,\n width,\n onChange,\n}) => {\n const dropdownId = uuidv4();\n\n const [selectedValue, setSelectedValue] = useState<string>('');\n const [selectedOption, setSelectedOption] = useState<string | JSX.Element>(\n ''\n );\n const [opened, setOpened] = useState<boolean>(false);\n\n useEffect(() => {\n const firstOption = options[0];\n\n if (firstOption) {\n let change = !selectedValue;\n if (!change) {\n change = options.filter((o) => o.value === selectedValue).length < 1;\n }\n\n /**\n * make a selection if there is no selected value already present\n * or if there is a selected value but its not in new options\n */\n if (change) {\n setSelectedValue(firstOption.value);\n setSelectedOption(firstOption.option);\n }\n }\n }, [options]);\n\n useEffect(() => {\n if (selectedValue) {\n onChange(selectedValue);\n }\n }, [selectedValue]);\n\n return (\n <Container onMouseLeave={() => setOpened(false)} width={width}>\n <DropdownSelect\n id={`dropdown-${dropdownId}`}\n className=\"rpgui-dropdown-imp rpgui-dropdown-imp-header\"\n onPointerDown={() => setOpened((prev) => !prev)}\n >\n <label>▼</label> {selectedOption}\n </DropdownSelect>\n\n <DropdownOptions className=\"rpgui-dropdown-imp\" opened={opened}>\n {options.map((option) => {\n return (\n <li\n key={option.id}\n onPointerDown={() => {\n setSelectedValue(option.value);\n setSelectedOption(option.option);\n setOpened(false);\n }}\n >\n {option.option}\n </li>\n );\n })}\n </DropdownOptions>\n </Container>\n );\n};\n\nconst Container = styled.div<{ width: string | undefined }>`\n position: relative;\n width: ${(props) => props.width || '100%'};\n`;\n\nconst DropdownSelect = styled.p`\n width: 100%;\n box-sizing: border-box;\n`;\n\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n}>`\n position: absolute;\n width: 100%;\n display: ${(props) => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n @media (max-width: 768px) {\n padding: 8px 0;\n }\n`;\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\nimport { Dropdown } from './Dropdown';\r\n\r\ninterface IDropdownSelectorOption {\r\n id: string;\r\n name: string;\r\n}\r\n\r\nexport interface IDropdownSelectorContainer {\r\n onChange: (id: string) => void;\r\n options: IDropdownSelectorOption[];\r\n details?: string;\r\n title: string;\r\n}\r\n\r\nexport const DropdownSelectorContainer: React.FC<IDropdownSelectorContainer> = ({\r\n title,\r\n onChange,\r\n options,\r\n details,\r\n}) => {\r\n return (\r\n <div>\r\n <p>{title}</p>\r\n <Dropdown\r\n options={options.map((option, index) => ({\r\n option: option.name,\r\n value: option.id,\r\n id: index,\r\n }))}\r\n onChange={onChange}\r\n />\r\n <Details>{details}</Details>\r\n </div>\r\n );\r\n};\r\n\r\nconst Details = styled.p`\r\n font-size: ${uiFonts.size.xsmall} !important;\r\n`;\r\n","import {\r\n IEquipmentSet,\r\n IItem,\r\n IItemContainer,\r\n ItemContainerType,\r\n ItemSlotType,\r\n ItemType,\r\n} from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { IPosition } from '../../types/eventTypes';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { ItemSlot } from '../Item/Inventory/ItemSlot';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\n\r\nexport interface IEquipmentSetProps {\r\n equipmentSet: IEquipmentSet;\r\n onClose?: () => void;\r\n onItemClick?: (\r\n ItemType: ItemType,\r\n item: IItem,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onItemDragStart?: (\r\n item: IItem,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onItemDragEnd?: (quantity?: number) => void;\r\n onItemPlaceDrop?: (\r\n item: IItem | null,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onItemOutsideDrop?: (item: IItem, position: IPosition) => void;\r\n scale?: number;\r\n checkIfItemCanBeMoved: () => boolean;\r\n checkIfItemShouldDragEnd?: () => boolean;\r\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\r\n onSelected?: (optionId: string) => void;\r\n initialPosition?: { x: number; y: number };\r\n type: ItemContainerType | null;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n onPositionChangeEnd?: (position: IPosition) => void;\r\n onPositionChangeStart?: (position: IPosition) => void;\r\n}\r\n\r\nexport const EquipmentSet: React.FC<IEquipmentSetProps> = ({\r\n equipmentSet,\r\n onClose,\r\n onMouseOver,\r\n onSelected,\r\n onItemClick,\r\n atlasIMG,\r\n atlasJSON,\r\n onItemDragEnd,\r\n onItemDragStart,\r\n onItemPlaceDrop,\r\n onItemOutsideDrop,\r\n checkIfItemCanBeMoved,\r\n checkIfItemShouldDragEnd,\r\n scale,\r\n initialPosition,\r\n onPositionChangeEnd,\r\n onPositionChangeStart,\r\n}) => {\r\n const {\r\n neck,\r\n leftHand,\r\n ring,\r\n head,\r\n armor,\r\n legs,\r\n boot,\r\n inventory,\r\n rightHand,\r\n accessory,\r\n } = equipmentSet;\r\n\r\n const equipmentData = [\r\n neck,\r\n leftHand,\r\n ring,\r\n head,\r\n armor,\r\n legs,\r\n boot,\r\n inventory,\r\n rightHand,\r\n accessory,\r\n ];\r\n\r\n const equipmentMaskSlots = [\r\n ItemSlotType.Neck,\r\n ItemSlotType.LeftHand,\r\n ItemSlotType.Ring,\r\n ItemSlotType.Head,\r\n ItemSlotType.Torso,\r\n ItemSlotType.Legs,\r\n ItemSlotType.Feet,\r\n ItemSlotType.Inventory,\r\n ItemSlotType.RightHand,\r\n ItemSlotType.Accessory,\r\n ];\r\n\r\n const onRenderEquipmentSlotRange = (start: number, end: number) => {\r\n const equipmentRange = equipmentData.slice(start, end);\r\n const slotMaksRange = equipmentMaskSlots.slice(start, end);\r\n\r\n return equipmentRange.map((data, i) => {\r\n const item = data as IItem;\r\n const itemContainer =\r\n (item && (item.itemContainer as IItemContainer)) ?? null;\r\n\r\n return (\r\n <ItemSlot\r\n key={i}\r\n slotIndex={i}\r\n item={item}\r\n itemContainer={itemContainer}\r\n itemContainerType={ItemContainerType.Equipment}\r\n slotSpriteMask={slotMaksRange[i]}\r\n onMouseOver={(event, slotIndex, item) => {\r\n if (onMouseOver) onMouseOver(event, slotIndex, item);\r\n }}\r\n onPointerDown={(itemType, ContainerType) => {\r\n if (onItemClick) onItemClick(itemType, item, ContainerType);\r\n }}\r\n onSelected={(optionId: string) => {\r\n if (onSelected) onSelected(optionId);\r\n }}\r\n onDragStart={(item, slotIndex, itemContainerType) => {\r\n if (!item) {\r\n return;\r\n }\r\n\r\n if (onItemDragStart)\r\n onItemDragStart(item, slotIndex, itemContainerType);\r\n }}\r\n onDragEnd={quantity => {\r\n if (onItemDragEnd) onItemDragEnd(quantity);\r\n }}\r\n dragScale={scale}\r\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\r\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\r\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\r\n if (onItemPlaceDrop)\r\n onItemPlaceDrop(item, slotIndex, itemContainerType);\r\n }}\r\n onOutsideDrop={(item, position) => {\r\n if (onItemOutsideDrop) onItemOutsideDrop(item, position);\r\n }}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n );\r\n });\r\n };\r\n\r\n return (\r\n <DraggableContainer\r\n title={'Equipments'}\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) onClose();\r\n }}\r\n width=\"330px\"\r\n cancelDrag=\".equipment-container-body\"\r\n scale={scale}\r\n initialPosition={initialPosition}\r\n onPositionChangeEnd={onPositionChangeEnd}\r\n onPositionChangeStart={onPositionChangeStart}\r\n >\r\n <EquipmentSetContainer className=\"equipment-container-body\">\r\n <EquipmentColumn>{onRenderEquipmentSlotRange(0, 3)}</EquipmentColumn>\r\n <EquipmentColumn>{onRenderEquipmentSlotRange(3, 7)}</EquipmentColumn>\r\n <EquipmentColumn>{onRenderEquipmentSlotRange(7, 10)}</EquipmentColumn>\r\n </EquipmentSetContainer>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst EquipmentSetContainer = styled.div`\r\n width: inherit;\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n touch-action: none;\r\n`;\r\n\r\nconst EquipmentColumn = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\r\n flex-direction: column;\r\n touch-action: none;\r\n`;\r\n","import React from 'react';\r\nimport { IPosition } from '../../types/eventTypes';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\n\r\ninterface IProps {\r\n children: React.ReactNode;\r\n title: string;\r\n onClose?: () => void;\r\n onPositionChange?: (position: IPosition) => void;\r\n onPositionChangeEnd?: (position: IPosition) => void;\r\n onPositionChangeStart?: (position: IPosition) => void;\r\n onOutsideClick?: () => void;\r\n initialPosition?: IPosition;\r\n scale?: number;\r\n}\r\n\r\nexport const SlotsContainer: React.FC<IProps> = ({\r\n children,\r\n title,\r\n onClose,\r\n onPositionChange,\r\n onPositionChangeEnd,\r\n onPositionChangeStart,\r\n onOutsideClick,\r\n initialPosition,\r\n scale,\r\n}) => {\r\n return (\r\n <DraggableContainer\r\n title={title}\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n width=\"400px\"\r\n cancelDrag=\".item-container-body, #shortcuts_list\"\r\n onPositionChange={({ x, y }) => {\r\n if (onPositionChange) {\r\n onPositionChange({ x, y });\r\n }\r\n }}\r\n onPositionChangeEnd={({ x, y }) => {\r\n if (onPositionChangeEnd) {\r\n onPositionChangeEnd({ x, y });\r\n }\r\n }}\r\n onPositionChangeStart={({ x, y }) => {\r\n if (onPositionChangeStart) {\r\n onPositionChangeStart({ x, y });\r\n }\r\n }}\r\n onOutsideClick={onOutsideClick}\r\n initialPosition={initialPosition}\r\n scale={scale}\r\n >\r\n {children}\r\n </DraggableContainer>\r\n );\r\n};\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\r\nimport pressSpaceGif from './img/space.gif';\r\nimport { NPCDialogText } from './NPCDialogText';\r\n\r\nexport enum ImgSide {\r\n right = 'right',\r\n left = 'left',\r\n}\r\n\r\nexport interface NPCMultiDialogType {\r\n text: string;\r\n imagePath?: string;\r\n imageSide: ImgSide;\r\n}\r\n\r\nexport interface INPCMultiDialogProps {\r\n onClose: () => void;\r\n textAndTypeArray: NPCMultiDialogType[];\r\n}\r\n\r\nexport const NPCMultiDialog: React.FC<INPCMultiDialogProps> = ({\r\n onClose,\r\n textAndTypeArray,\r\n}) => {\r\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\r\n false\r\n );\r\n const [slide, setSlide] = useState<number>(0);\r\n\r\n const onHandleSpacePress = (event: KeyboardEvent) => {\r\n if (event.code === 'Space') {\r\n if (slide < textAndTypeArray?.length - 1) {\r\n setSlide(prev => prev + 1);\r\n } else {\r\n // if there's no more text chunks, close the dialog\r\n onClose();\r\n }\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n document.addEventListener('keydown', onHandleSpacePress);\r\n\r\n return () => document.removeEventListener('keydown', onHandleSpacePress);\r\n }, [slide]);\r\n\r\n return (\r\n <RPGUIContainer\r\n type={RPGUIContainerTypes.FramedGold}\r\n width={'50%'}\r\n height={'180px'}\r\n >\r\n <>\r\n <Container>\r\n {textAndTypeArray[slide]?.imageSide === 'right' && (\r\n <>\r\n <TextContainer flex={'70%'}>\r\n <NPCDialogText\r\n onStartStep={() => setShowGoNextIndicator(false)}\r\n onEndStep={() => setShowGoNextIndicator(true)}\r\n text={textAndTypeArray[slide].text || 'No text provided.'}\r\n onClose={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n />\r\n </TextContainer>\r\n <ThumbnailContainer>\r\n <NPCThumbnail\r\n src={\r\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\r\n }\r\n />\r\n </ThumbnailContainer>\r\n {showGoNextIndicator && (\r\n <PressSpaceIndicator right={'10.5rem'} src={pressSpaceGif} />\r\n )}\r\n </>\r\n )}\r\n {textAndTypeArray[slide].imageSide === 'left' && (\r\n <>\r\n <ThumbnailContainer>\r\n <NPCThumbnail\r\n src={\r\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\r\n }\r\n />\r\n </ThumbnailContainer>\r\n <TextContainer flex={'70%'}>\r\n <NPCDialogText\r\n onStartStep={() => setShowGoNextIndicator(false)}\r\n onEndStep={() => setShowGoNextIndicator(true)}\r\n text={textAndTypeArray[slide].text || 'No text provided.'}\r\n onClose={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n />\r\n </TextContainer>\r\n {showGoNextIndicator && (\r\n <PressSpaceIndicator right={'1rem'} src={pressSpaceGif} />\r\n )}\r\n </>\r\n )}\r\n </Container>\r\n )\r\n </>\r\n </RPGUIContainer>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n display: flex;\r\n width: 100%;\r\n height: 100%;\r\n\r\n box-sizing: border-box;\r\n justify-content: center;\r\n align-items: flex-start;\r\n position: relative;\r\n`;\r\n\r\ninterface ITextContainerProps {\r\n flex: string;\r\n}\r\n\r\nconst TextContainer = styled.div<ITextContainerProps>`\r\n flex: ${({ flex }) => flex} 0 0;\r\n width: 355px;\r\n`;\r\n\r\nconst ThumbnailContainer = styled.div`\r\n flex: 30% 0 0;\r\n display: flex;\r\n justify-content: flex-end;\r\n`;\r\n\r\nconst NPCThumbnail = styled.img`\r\n image-rendering: pixelated;\r\n height: 128px;\r\n width: 128px;\r\n`;\r\n\r\ninterface IPressSpaceIndicatorProps {\r\n right: string;\r\n}\r\n\r\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\r\n position: absolute;\r\n right: ${({ right }) => right};\r\n bottom: 1rem;\r\n height: 20.7px;\r\n image-rendering: -webkit-optimize-contrast;\r\n`;\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { Button, ButtonTypes } from '../../Button';\r\nimport { Input } from '../../Input';\r\nimport { RPGUIContainer, RPGUIContainerTypes } from '../../RPGUIContainer';\r\nimport { RangeSlider, RangeSliderType } from '../../RangeSlider';\r\n\r\nexport interface IItemQuantitySelectorProps {\r\n quantity: number;\r\n onConfirm: (quantity: number) => void;\r\n onClose: () => void;\r\n}\r\n\r\nexport const ItemQuantitySelector: React.FC<IItemQuantitySelectorProps> = ({\r\n quantity,\r\n onConfirm,\r\n onClose,\r\n}) => {\r\n const [value, setValue] = useState(quantity);\r\n\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n\r\n useEffect(() => {\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n inputRef.current.select();\r\n\r\n const closeSelector = (e: KeyboardEvent) => {\r\n if (e.key === 'Escape') {\r\n onClose();\r\n }\r\n };\r\n\r\n document.addEventListener('keydown', closeSelector);\r\n\r\n return () => {\r\n document.removeEventListener('keydown', closeSelector);\r\n };\r\n }\r\n\r\n return () => {};\r\n }, []);\r\n\r\n return (\r\n <StyledContainer type={RPGUIContainerTypes.Framed} width=\"25rem\">\r\n <CloseButton className=\"container-close\" onPointerDown={onClose}>\r\n X\r\n </CloseButton>\r\n <h2>Select quantity to move</h2>\r\n <StyledForm\r\n style={{ width: '100%' }}\r\n onSubmit={e => {\r\n e.preventDefault();\r\n\r\n const numberValue = Number(value);\r\n\r\n if (Number.isNaN(numberValue)) {\r\n return;\r\n }\r\n\r\n onConfirm(Math.max(1, Math.min(quantity, numberValue)));\r\n }}\r\n noValidate\r\n >\r\n <StyledInput\r\n innerRef={inputRef}\r\n placeholder=\"Enter quantity\"\r\n type=\"number\"\r\n min={1}\r\n max={quantity}\r\n value={value}\r\n onChange={e => {\r\n if (Number(e.target.value) >= quantity) {\r\n setValue(quantity);\r\n return;\r\n }\r\n\r\n setValue((e.target.value as unknown) as number);\r\n }}\r\n onBlur={e => {\r\n const newValue = Math.max(\r\n 1,\r\n Math.min(quantity, Number(e.target.value))\r\n );\r\n\r\n setValue(newValue);\r\n }}\r\n />\r\n <RangeSlider\r\n type={RangeSliderType.Slider}\r\n valueMin={1}\r\n valueMax={quantity}\r\n width=\"100%\"\r\n onChange={setValue}\r\n value={value}\r\n />\r\n <Button buttonType={ButtonTypes.RPGUIButton} type=\"submit\">\r\n Confirm\r\n </Button>\r\n </StyledForm>\r\n </StyledContainer>\r\n );\r\n};\r\n\r\nconst StyledContainer = styled(RPGUIContainer)`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n`;\r\n\r\nconst StyledForm = styled.form`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n width: 100%;\r\n`;\r\nconst StyledInput = styled(Input)`\r\n text-align: center;\r\n\r\n &::-webkit-outer-spin-button,\r\n &::-webkit-inner-spin-button {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n }\r\n\r\n &[type='number'] {\r\n -moz-appearance: textfield;\r\n }\r\n`;\r\n\r\nconst CloseButton = styled.div`\r\n position: absolute;\r\n top: 3px;\r\n right: 0px;\r\n color: white;\r\n z-index: 22;\r\n font-size: 0.8rem;\r\n`;\r\n","import {\r\n getItemTextureKeyPath,\r\n IItem,\r\n IRawSpell,\r\n IShortcut,\r\n ShortcutType,\r\n} from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\n\r\ntype ShortcutsSetterProps = {\r\n setSettingShortcutIndex: (index: number) => void;\r\n settingShortcutIndex: number;\r\n shortcuts: IShortcut[];\r\n removeShortcut: (index: number) => void;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n};\r\n\r\nexport const ShortcutsSetter: React.FC<ShortcutsSetterProps> = ({\r\n setSettingShortcutIndex,\r\n settingShortcutIndex,\r\n shortcuts,\r\n removeShortcut,\r\n atlasJSON,\r\n atlasIMG,\r\n}) => {\r\n const getContent = (index: number) => {\r\n if (shortcuts[index]?.type === ShortcutType.Item) {\r\n const payload = shortcuts[index]?.payload as IItem | undefined;\r\n\r\n if (!payload) return null;\r\n\r\n return (\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: payload.texturePath,\r\n texturePath: payload.texturePath,\r\n stackQty: payload.stackQty || 1,\r\n isStackable: payload.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n width={32}\r\n height={32}\r\n imgScale={1.6}\r\n imgStyle={{ left: '5px' }}\r\n />\r\n );\r\n }\r\n\r\n const payload = shortcuts[index]?.payload as IRawSpell | undefined;\r\n\r\n return <span>{payload?.magicWords.split(' ').map(word => word[0])}</span>;\r\n };\r\n\r\n return (\r\n <Container>\r\n <p>Shortcuts:</p>\r\n <List id=\"shortcuts_list\">\r\n {Array.from({ length: 6 }).map((_, i) => (\r\n <Shortcut\r\n key={i}\r\n onPointerDown={() => {\r\n if (settingShortcutIndex !== -1) setSettingShortcutIndex(-1);\r\n\r\n removeShortcut(i);\r\n if (\r\n settingShortcutIndex === -1 &&\r\n (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)\r\n )\r\n setSettingShortcutIndex(i);\r\n }}\r\n disabled={settingShortcutIndex !== -1 && settingShortcutIndex !== i}\r\n isBeingSet={settingShortcutIndex === i}\r\n id={`shortcutSetter_${i}`}\r\n >\r\n {getContent(i)}\r\n </Shortcut>\r\n ))}\r\n </List>\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n p {\r\n margin: 0;\r\n margin-left: 0.5rem;\r\n }\r\n`;\r\n\r\nconst Shortcut = styled.button<{ isBeingSet?: boolean }>`\r\n width: 2.6rem;\r\n height: 2.6rem;\r\n background-color: ${uiColors.lightGray};\r\n border: 2px solid\r\n ${({ isBeingSet }) => (isBeingSet ? uiColors.yellow : uiColors.darkGray)};\r\n border-radius: 50%;\r\n text-transform: uppercase;\r\n font-size: 0.7rem;\r\n font-weight: bold;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n\r\n span {\r\n margin-top: 4px;\r\n }\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: ${uiColors.darkGray};\r\n }\r\n\r\n &:active {\r\n background-color: ${uiColors.gray};\r\n }\r\n\r\n &:disabled {\r\n opacity: 0.5;\r\n }\r\n`;\r\n\r\nconst List = styled.div`\r\n width: 100%;\r\n display: flex;\r\n align-items: center;\r\n gap: 0.5rem;\r\n padding-bottom: 0.5rem;\r\n padding-left: 0.5rem;\r\n box-sizing: border-box;\r\n margin: 0 !important;\r\n`;\r\n","import {\r\n IEquipmentSet,\r\n IItem,\r\n IItemContainer,\r\n IShortcut,\r\n ItemContainerType,\r\n ItemType,\r\n} from '@rpg-engine/shared';\r\nimport React, { useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { SlotsContainer } from '../../Abstractions/SlotsContainer';\r\nimport { ItemQuantitySelector } from './ItemQuantitySelector';\r\n\r\nimport { IPosition } from '../../../types/eventTypes';\r\nimport ModalPortal from '../../Abstractions/ModalPortal';\r\nimport { ShortcutsSetter } from '../../Shortcuts/ShortcutsSetter';\r\nimport { ItemSlot } from './ItemSlot';\r\n\r\nexport interface IItemContainerProps {\r\n itemContainer: IItemContainer;\r\n onClose?: () => void;\r\n onItemClick?: (\r\n item: IItem,\r\n ItemType: IItem['type'],\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onItemDragStart?: (\r\n item: IItem,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n onItemDragEnd?: (quantity?: number) => void;\r\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\r\n onItemPlaceDrop?: (\r\n item: IItem | null,\r\n slotIndex: number,\r\n itemContainerType: ItemContainerType | null\r\n ) => void;\r\n scale?: number;\r\n checkIfItemCanBeMoved: () => boolean;\r\n checkIfItemShouldDragEnd?: () => boolean;\r\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\r\n onSelected?: (optionId: string, item: IItem) => void;\r\n type: ItemContainerType;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n disableContextMenu?: boolean;\r\n initialPosition?: { x: number; y: number };\r\n shortcuts?: IShortcut[];\r\n setItemShortcut?: (key: string, index: number) => void;\r\n removeShortcut?: (index: number) => void;\r\n equipmentSet?: IEquipmentSet | null;\r\n isDepotSystem?: boolean;\r\n onPositionChangeEnd?: (position: IPosition) => void;\r\n onPositionChangeStart?: (position: IPosition) => void;\r\n}\r\n\r\nexport const ItemContainer: React.FC<IItemContainerProps> = ({\r\n itemContainer,\r\n onClose,\r\n onMouseOver,\r\n onSelected,\r\n onItemClick,\r\n type,\r\n atlasJSON,\r\n atlasIMG,\r\n disableContextMenu = false,\r\n onItemDragEnd,\r\n onItemDragStart,\r\n onItemPlaceDrop,\r\n onOutsideDrop,\r\n checkIfItemCanBeMoved,\r\n initialPosition,\r\n checkIfItemShouldDragEnd,\r\n scale,\r\n shortcuts,\r\n setItemShortcut,\r\n removeShortcut,\r\n equipmentSet,\r\n isDepotSystem,\r\n onPositionChangeEnd,\r\n onPositionChangeStart,\r\n}) => {\r\n const [quantitySelect, setQuantitySelect] = useState({\r\n isOpen: false,\r\n maxQuantity: 1,\r\n callback: (_quantity: number) => {},\r\n });\r\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\r\n\r\n const handleSetShortcut = (item: IItem, index: number) => {\r\n if (item.type === ItemType.Consumable || item.type === ItemType.Tool) {\r\n setItemShortcut?.(item.key, index);\r\n }\r\n };\r\n\r\n const onRenderSlots = () => {\r\n const slots = [];\r\n\r\n for (let i = 0; i < itemContainer.slotQty; i++) {\r\n slots.push(\r\n <ItemSlot\r\n isContextMenuDisabled={disableContextMenu}\r\n key={i}\r\n slotIndex={i}\r\n item={itemContainer.slots?.[i] || null}\r\n itemContainerType={type}\r\n onMouseOver={(event, slotIndex, item) => {\r\n if (onMouseOver) onMouseOver(event, slotIndex, item);\r\n }}\r\n onPointerDown={(itemType, containerType, item) => {\r\n if (settingShortcutIndex !== -1) {\r\n setSettingShortcutIndex(-1);\r\n\r\n handleSetShortcut(item, settingShortcutIndex);\r\n } else if (onItemClick) onItemClick(item, itemType, containerType);\r\n }}\r\n onSelected={(optionId: string, item: IItem) => {\r\n if (onSelected) onSelected(optionId, item);\r\n }}\r\n onDragStart={(item, slotIndex, itemContainerType) => {\r\n if (onItemDragStart)\r\n onItemDragStart(item, slotIndex, itemContainerType);\r\n }}\r\n onDragEnd={quantity => {\r\n if (onItemDragEnd) onItemDragEnd(quantity);\r\n }}\r\n dragScale={scale}\r\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\r\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\r\n openQuantitySelector={(maxQuantity, callback) => {\r\n setQuantitySelect({\r\n isOpen: true,\r\n maxQuantity,\r\n callback,\r\n });\r\n }}\r\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\r\n if (onItemPlaceDrop)\r\n onItemPlaceDrop(item, slotIndex, itemContainerType);\r\n }}\r\n onOutsideDrop={(item, position) => {\r\n if (onOutsideDrop) onOutsideDrop(item, position);\r\n }}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n isSelectingShortcut={settingShortcutIndex !== -1}\r\n equipmentSet={equipmentSet}\r\n setItemShortcut={\r\n type === ItemContainerType.Inventory ? handleSetShortcut : undefined\r\n }\r\n isDepotSystem={isDepotSystem}\r\n />\r\n );\r\n }\r\n return slots;\r\n };\r\n\r\n return (\r\n <>\r\n <SlotsContainer\r\n title={itemContainer.name || 'Container'}\r\n onClose={onClose}\r\n initialPosition={initialPosition}\r\n scale={scale}\r\n onPositionChangeEnd={onPositionChangeEnd}\r\n onPositionChangeStart={onPositionChangeStart}\r\n >\r\n {type === ItemContainerType.Inventory &&\r\n shortcuts &&\r\n removeShortcut && (\r\n <ShortcutsSetter\r\n setSettingShortcutIndex={setSettingShortcutIndex}\r\n settingShortcutIndex={settingShortcutIndex}\r\n shortcuts={shortcuts}\r\n removeShortcut={removeShortcut}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n )}\r\n <ItemsContainer className=\"item-container-body\">\r\n {onRenderSlots()}\r\n </ItemsContainer>\r\n </SlotsContainer>\r\n {quantitySelect.isOpen && (\r\n <ModalPortal>\r\n <QuantitySelectorContainer>\r\n <ItemQuantitySelector\r\n quantity={quantitySelect.maxQuantity}\r\n onConfirm={quantity => {\r\n quantitySelect.callback(quantity);\r\n setQuantitySelect({\r\n isOpen: false,\r\n maxQuantity: 1,\r\n callback: () => {},\r\n });\r\n }}\r\n onClose={() => {\r\n quantitySelect.callback(-1);\r\n setQuantitySelect({\r\n isOpen: false,\r\n maxQuantity: 1,\r\n callback: () => {},\r\n });\r\n }}\r\n />\r\n </QuantitySelectorContainer>\r\n </ModalPortal>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nconst ItemsContainer = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nconst QuantitySelectorContainer = styled.div`\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100vw;\r\n height: 100vh;\r\n z-index: 100;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n`;\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\n\r\nexport interface IOptionsItemSelectorProps {\r\n name: string;\r\n description?: string;\r\n imageKey: string;\r\n}\r\n\r\nexport interface IItemSelectorProps {\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n options: IOptionsItemSelectorProps[];\r\n onClose: () => void;\r\n onSelect: (value: string) => void;\r\n}\r\n\r\nexport const ItemSelector: React.FC<IItemSelectorProps> = ({\r\n atlasIMG,\r\n atlasJSON,\r\n options,\r\n onClose,\r\n onSelect,\r\n}) => {\r\n const [selectedValue, setSelectedValue] = useState<string>();\r\n\r\n const handleClick = () => {\r\n let element = document.querySelector(\r\n `input[name='test']:checked`\r\n ) as HTMLInputElement;\r\n const elementValue = element.value;\r\n setSelectedValue(elementValue);\r\n };\r\n\r\n useEffect(() => {\r\n if (selectedValue) {\r\n onSelect(selectedValue);\r\n }\r\n }, [selectedValue]);\r\n return (\r\n <DraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n width=\"500px\"\r\n cancelDrag=\".equipment-container-body .arrow-selector\"\r\n onCloseButton={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n >\r\n <div style={{ width: '100%' }}>\r\n <Title>{'Harvesting instruments'}</Title>\r\n <Subtitle>{'Use the tool, you need it'}</Subtitle>\r\n <hr className=\"golden\" />\r\n </div>\r\n\r\n <RadioInputScroller>\r\n {options?.map((option, index) => (\r\n <RadioOptionsWrapper key={index}>\r\n <SpriteAtlasWrapper>\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={option.imageKey}\r\n imgScale={3}\r\n />\r\n </SpriteAtlasWrapper>\r\n <div>\r\n <input\r\n className=\"rpgui-radio\"\r\n type=\"radio\"\r\n value={option.name}\r\n name=\"test\"\r\n />\r\n <label\r\n onPointerDown={handleClick}\r\n style={{ display: 'flex', alignItems: 'center' }}\r\n >\r\n {option.name} <br />\r\n {option.description}\r\n </label>\r\n </div>\r\n </RadioOptionsWrapper>\r\n ))}\r\n </RadioInputScroller>\r\n <ButtonWrapper>\r\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\r\n Cancel\r\n </Button>\r\n <Button buttonType={ButtonTypes.RPGUIButton}>Select</Button>\r\n </ButtonWrapper>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst Title = styled.h1`\r\n font-size: 0.6rem;\r\n color: yellow !important;\r\n`;\r\nconst Subtitle = styled.h1`\r\n font-size: 0.4rem;\r\n color: yellow !important;\r\n`;\r\n\r\nconst RadioInputScroller = styled.div`\r\n padding-left: 15px;\r\n padding-top: 10px;\r\n width: 100%;\r\n margin-top: 1rem;\r\n align-items: center;\r\n margin-left: 20px;\r\n align-items: flex-start;\r\n overflow-y: scroll;\r\n height: 360px;\r\n`;\r\n\r\nconst SpriteAtlasWrapper = styled.div`\r\n margin-right: 40px;\r\n`;\r\n\r\nconst RadioOptionsWrapper = styled.div`\r\n display: flex;\r\n align-items: stretch;\r\n margin-bottom: 40px;\r\n`;\r\n\r\nconst ButtonWrapper = styled.div`\r\n display: flex;\r\n justify-content: space-around;\r\n padding-top: 20px;\r\n width: 100%;\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\n\r\ninterface IListMenuOption {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nexport interface IListMenuProps {\r\n x: number;\r\n y: number;\r\n options: IListMenuOption[];\r\n onSelected: (selectedOptionId: string) => void;\r\n}\r\n\r\nexport const ListMenu: React.FC<IListMenuProps> = ({\r\n options,\r\n onSelected,\r\n x,\r\n y,\r\n}) => {\r\n return (\r\n <Container x={x} y={y}>\r\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\r\n {options.map((params, index) => (\r\n <ListElement\r\n key={params?.id || index}\r\n onPointerDown={() => {\r\n onSelected(params?.id);\r\n }}\r\n >\r\n {params?.text || 'No text'}\r\n </ListElement>\r\n ))}\r\n </ul>\r\n </Container>\r\n );\r\n};\r\n\r\ninterface IContainerProps {\r\n x?: number;\r\n y?: number;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n display: flex;\r\n flex-direction: column;\r\n width: 100%;\r\n justify-content: start;\r\n align-items: flex-start;\r\n position: absolute;\r\n top: ${props => props.y || 0}px;\r\n left: ${props => props.x || 0}px;\r\n\r\n li {\r\n font-size: ${uiFonts.size.xsmall};\r\n }\r\n`;\r\n\r\nconst ListElement = styled.li`\r\n margin-right: 0.5rem;\r\n`;\r\n","import {\r\n getItemTextureKeyPath,\r\n IEquipmentSet,\r\n IItem,\r\n} from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\r\nimport { Ellipsis } from '../shared/Ellipsis';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\n\r\nexport interface IMarketPlaceRowsPropos {\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n item: IItem;\r\n itemPrice: number;\r\n equipmentSet?: IEquipmentSet | null;\r\n scale?: number;\r\n onHandleClick: (value: string) => void;\r\n}\r\n\r\nexport const MarketplaceRows: React.FC<IMarketPlaceRowsPropos> = ({\r\n atlasJSON,\r\n atlasIMG,\r\n item,\r\n itemPrice,\r\n equipmentSet,\r\n scale,\r\n onHandleClick,\r\n}) => {\r\n return (\r\n <MarketPlaceWrapper>\r\n <ItemIconContainer>\r\n <SpriteContainer>\r\n <ItemInfoWrapper\r\n item={item}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n scale={scale}\r\n >\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: item.key,\r\n stackQty: item.stackQty || 1,\r\n texturePath: item.texturePath,\r\n isStackable: item.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n imgScale={2}\r\n />\r\n </ItemInfoWrapper>\r\n </SpriteContainer>\r\n <PriceValue>\r\n <p>\r\n <Ellipsis maxLines={1} maxWidth=\"150px\" fontSize=\"10px\">\r\n {item.name}\r\n </Ellipsis>\r\n </p>\r\n </PriceValue>\r\n </ItemIconContainer>\r\n <QuantityContainer>\r\n <QuantityDisplay>\r\n <TextOverlay>\r\n <Item>\r\n <Ellipsis maxLines={1} maxWidth=\"150px\" fontSize=\"10px\">\r\n {item.rarity}\r\n </Ellipsis>\r\n </Item>\r\n </TextOverlay>\r\n </QuantityDisplay>\r\n </QuantityContainer>\r\n <ItemIconContainer>\r\n <SpriteContainer>\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={'others/gold-coin-qty-4.png'}\r\n imgScale={2}\r\n />\r\n </SpriteContainer>\r\n <PriceValue>\r\n <p>\r\n <Ellipsis maxLines={1} maxWidth=\"150px\" fontSize=\"10px\">\r\n ${itemPrice}\r\n </Ellipsis>\r\n </p>\r\n </PriceValue>\r\n </ItemIconContainer>\r\n <ButtonContainer>\r\n <Button\r\n buttonType={ButtonTypes.RPGUIButton}\r\n onClick={() => onHandleClick(item.name)}\r\n >\r\n Buy\r\n </Button>\r\n </ButtonContainer>\r\n </MarketPlaceWrapper>\r\n );\r\n};\r\n\r\nconst MarketPlaceWrapper = styled.div`\r\n margin: auto;\r\n display: grid;\r\n grid-template-columns: 35% 20% 20% 25%;\r\n\r\n &:hover {\r\n background-color: ${uiColors.darkGray};\r\n }\r\n padding: 0.5rem;\r\n p {\r\n font-size: 0.8rem;\r\n }\r\n`;\r\n\r\nconst ItemIconContainer = styled.div`\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n`;\r\n\r\nconst SpriteContainer = styled.div`\r\n position: relative;\r\n top: -0.5rem;\r\n left: 0.5rem;\r\n`;\r\n\r\nconst Item = styled.span`\r\n color: white;\r\n text-align: center;\r\n z-index: 1;\r\n width: 100%;\r\n`;\r\n\r\nconst TextOverlay = styled.div`\r\n width: 100%;\r\n position: relative;\r\n`;\r\n\r\ninterface IContainerProps {\r\n percentageWidth?: number;\r\n minWidth?: number;\r\n style?: Record<string, any>;\r\n}\r\n\r\nconst QuantityContainer = styled.div<IContainerProps>`\r\n position: relative;\r\n display: flex;\r\n min-width: 100px;\r\n justify-content: center;\r\n align-items: center;\r\n`;\r\n\r\nconst QuantityDisplay = styled.div`\r\n font-size: ${uiFonts.size.small};\r\n`;\r\n\r\nconst PriceValue = styled.div`\r\n margin-left: 40px;\r\n`;\r\n\r\nconst ButtonContainer = styled.div`\r\n margin: auto;\r\n`;\r\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\r\nimport React, { ChangeEvent } from 'react';\r\nimport styled from 'styled-components';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { Dropdown, IOptionsProps } from '../Dropdown';\r\nimport { Input } from '../Input';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { MarketplaceRows } from './MarketplaceRows';\r\n\r\nexport interface IMarketPlaceProps {\r\n items: IItem[] | null;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n optionsType: IOptionsProps[];\r\n optionsRarity: IOptionsProps[];\r\n optionsPrice: IOptionsProps[];\r\n onClose: () => void;\r\n onChangeType: (value: string) => void;\r\n onChangeRarity: (value: string) => void;\r\n onChangeOrder: (value: string) => void;\r\n onChangeNameInput: (event: ChangeEvent<HTMLInputElement>) => void;\r\n scale?: number;\r\n equipmentSet?: IEquipmentSet | null;\r\n onHandleClick: (value: string) => void;\r\n}\r\n\r\nexport const Marketplace: React.FC<IMarketPlaceProps> = ({\r\n items,\r\n atlasIMG,\r\n atlasJSON,\r\n onClose,\r\n optionsType,\r\n optionsRarity,\r\n optionsPrice,\r\n onChangeType,\r\n onChangeRarity,\r\n onChangeOrder,\r\n onChangeNameInput,\r\n scale,\r\n equipmentSet,\r\n onHandleClick,\r\n}) => {\r\n return (\r\n <DraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) onClose();\r\n }}\r\n width=\"800px\"\r\n cancelDrag=\"#MarketContainer\"\r\n scale={scale}\r\n >\r\n <>\r\n <InputWrapper>\r\n <p> Search By Name</p>\r\n <Input onChange={onChangeNameInput} placeholder={'Search...'} />\r\n </InputWrapper>\r\n\r\n <WrapperContainer>\r\n <StyledDropdown\r\n options={optionsType}\r\n onChange={onChangeType}\r\n width={'220px'}\r\n />\r\n <StyledDropdown\r\n options={optionsRarity}\r\n onChange={onChangeRarity}\r\n width={'220px'}\r\n />\r\n <StyledDropdown\r\n options={optionsPrice}\r\n onChange={onChangeOrder}\r\n width={'220px'}\r\n />\r\n </WrapperContainer>\r\n <ItemComponentScrollWrapper id=\"MarketContainer\">\r\n {items?.map((item, index) => (\r\n <MarketplaceRows\r\n key={`${item.key}_${index}`}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n item={item}\r\n itemPrice={10}\r\n equipmentSet={equipmentSet}\r\n onHandleClick={onHandleClick}\r\n />\r\n ))}\r\n </ItemComponentScrollWrapper>\r\n </>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst InputWrapper = styled.div`\r\n width: 95%;\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n margin: auto;\r\n margin-bottom: 10px;\r\n p {\r\n width: auto;\r\n margin-right: 20px;\r\n }\r\n input {\r\n width: 68%;\r\n height: 10px;\r\n }\r\n`;\r\n\r\nconst WrapperContainer = styled.div`\r\n display: grid;\r\n grid-template-columns: 30% 30% 30%;\r\n justify-content: space-between;\r\n width: 90%;\r\n margin-left: 10px;\r\n .rpgui-content .rpgui-dropdown-imp-header {\r\n padding: 0px 10px 0 !important;\r\n }\r\n`;\r\n\r\nconst ItemComponentScrollWrapper = styled.div`\r\n overflow-y: scroll;\r\n height: 390px;\r\n width: 100%;\r\n margin-top: 1rem;\r\n`;\r\n\r\nconst StyledDropdown = styled(Dropdown)`\r\n margin: 3px !important;\r\n width: 170px !important;\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { NPCDialogText } from './NPCDialogText';\r\nimport {\r\n IQuestionDialog,\r\n IQuestionDialogAnswer,\r\n QuestionDialog,\r\n} from './QuestionDialog/QuestionDialog';\r\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\r\n\r\nexport enum NPCDialogType {\r\n TextOnly = 'TextOnly',\r\n TextAndThumbnail = 'TextAndThumbnail',\r\n}\r\n\r\nexport interface INPCDialogProps {\r\n text?: string;\r\n type: NPCDialogType;\r\n imagePath?: string;\r\n onClose?: () => void;\r\n isQuestionDialog?: boolean;\r\n answers?: IQuestionDialogAnswer[];\r\n questions?: IQuestionDialog[];\r\n}\r\n\r\nexport const NPCDialog: React.FC<INPCDialogProps> = ({\r\n text,\r\n type,\r\n onClose,\r\n imagePath,\r\n isQuestionDialog = false,\r\n questions,\r\n answers,\r\n}) => {\r\n return (\r\n <RPGUIContainer\r\n type={RPGUIContainerTypes.FramedGold}\r\n width={isQuestionDialog ? '600px' : '80%'}\r\n height={'180px'}\r\n >\r\n {isQuestionDialog && questions && answers ? (\r\n <>\r\n <TextContainer\r\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\r\n >\r\n <QuestionDialog\r\n questions={questions}\r\n answers={answers}\r\n onClose={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n />\r\n </TextContainer>\r\n {type === NPCDialogType.TextAndThumbnail && (\r\n <ThumbnailContainer>\r\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\r\n </ThumbnailContainer>\r\n )}\r\n </>\r\n ) : (\r\n <>\r\n <Container>\r\n <TextContainer\r\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\r\n >\r\n <NPCDialogText\r\n type={type}\r\n text={text || 'No text provided.'}\r\n onClose={() => {\r\n if (onClose) {\r\n onClose();\r\n }\r\n }}\r\n />\r\n </TextContainer>\r\n {type === NPCDialogType.TextAndThumbnail && (\r\n <ThumbnailContainer>\r\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\r\n </ThumbnailContainer>\r\n )}\r\n </Container>\r\n </>\r\n )}\r\n </RPGUIContainer>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n display: flex;\r\n width: 100%;\r\n height: 100%;\r\n\r\n box-sizing: border-box;\r\n justify-content: center;\r\n align-items: flex-start;\r\n position: relative;\r\n`;\r\n\r\ninterface ITextContainerProps {\r\n flex: string;\r\n}\r\n\r\nconst TextContainer = styled.div<ITextContainerProps>`\r\n flex: ${({ flex }) => flex} 0 0;\r\n width: 355px;\r\n`;\r\n\r\nconst ThumbnailContainer = styled.div`\r\n flex: 30% 0 0;\r\n display: flex;\r\n justify-content: flex-end;\r\n`;\r\n\r\nconst NPCThumbnail = styled.img`\r\n image-rendering: pixelated;\r\n height: 128px;\r\n width: 128px;\r\n`;\r\n","import React from 'react';\r\n\r\n//@ts-ignore\r\nexport const useEventListener = (type, handler, el = window) => {\r\n const savedHandler = React.useRef();\r\n\r\n React.useEffect(() => {\r\n savedHandler.current = handler;\r\n }, [handler]);\r\n\r\n React.useEffect(() => {\r\n //@ts-ignore\r\n const listener = e => savedHandler.current(e);\r\n\r\n el.addEventListener(type, listener);\r\n\r\n return () => {\r\n el.removeEventListener(type, listener);\r\n };\r\n }, [type, el]);\r\n};\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\n\r\ninterface IProps {\r\n text: string;\r\n onFinish?: () => void;\r\n onStart?: () => void;\r\n}\r\n\r\nexport const DynamicText: React.FC<IProps> = ({ text, onFinish, onStart }) => {\r\n const [textState, setTextState] = useState<string>('');\r\n\r\n useEffect(() => {\r\n let i = 0;\r\n const interval = setInterval(() => {\r\n // on every interval, show one more character\r\n\r\n if (i === 0) {\r\n if (onStart) {\r\n onStart();\r\n }\r\n }\r\n\r\n if (i < text.length) {\r\n setTextState(text.substring(0, i + 1));\r\n i++;\r\n } else {\r\n clearInterval(interval);\r\n if (onFinish) {\r\n onFinish();\r\n }\r\n }\r\n }, 50);\r\n\r\n return () => {\r\n clearInterval(interval);\r\n };\r\n }, [text]);\r\n\r\n return <TextContainer>{textState}</TextContainer>;\r\n};\r\n\r\nconst TextContainer = styled.p`\r\n font-size: 0.7rem !important;\r\n color: white;\r\n text-shadow: 1px 1px 0px #000000;\r\n letter-spacing: 1.2px;\r\n word-break: normal;\r\n`;\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { useEventListener } from '../../../hooks/useEventListener';\r\nimport { DynamicText } from '../../typography/DynamicText';\r\n\r\nexport interface IQuestionDialogAnswer {\r\n id: number;\r\n text: string;\r\n nextQuestionId?: number;\r\n}\r\n\r\nexport interface IQuestionDialog {\r\n id: number;\r\n text: string;\r\n answerIds?: number[];\r\n}\r\n\r\nexport interface IProps {\r\n questions: IQuestionDialog[];\r\n answers: IQuestionDialogAnswer[];\r\n onClose: () => void;\r\n}\r\n\r\nexport const QuestionDialog: React.FC<IProps> = ({\r\n questions,\r\n answers,\r\n onClose,\r\n}) => {\r\n const [currentQuestion, setCurrentQuestion] = useState(questions[0]);\r\n\r\n const [canShowAnswers, setCanShowAnswers] = useState<boolean>(false);\r\n\r\n const onGetFirstAnswer = () => {\r\n if (!currentQuestion.answerIds || currentQuestion.answerIds.length === 0) {\r\n return null;\r\n }\r\n\r\n const firstAnswerId = currentQuestion.answerIds![0];\r\n\r\n return answers.find(answer => answer.id === firstAnswerId);\r\n };\r\n\r\n const [\r\n currentAnswer,\r\n setCurrentAnswer,\r\n ] = useState<IQuestionDialogAnswer | null>(onGetFirstAnswer()!);\r\n\r\n useEffect(() => {\r\n setCurrentAnswer(onGetFirstAnswer()!);\r\n }, [currentQuestion]);\r\n\r\n const onGetAnswers = (answerIds: number[]) => {\r\n return answerIds.map((answerId: number) =>\r\n answers.find(answer => answer.id === answerId)\r\n );\r\n };\r\n\r\n const onKeyPress = (e: KeyboardEvent) => {\r\n switch (e.key) {\r\n case 'ArrowDown':\r\n // select next answer, if any.\r\n // if no next answer, select first answer\r\n // const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\r\n // (answer) => answer?.id === currentAnswer!.id + 1\r\n // );\r\n\r\n const nextAnswerIndex = onGetAnswers(\r\n currentQuestion.answerIds!\r\n ).findIndex(answer => answer?.id === currentAnswer!.id + 1);\r\n\r\n const nextAnswerID = currentQuestion.answerIds![nextAnswerIndex];\r\n\r\n const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\r\n answer => answer?.id === nextAnswerID\r\n );\r\n\r\n setCurrentAnswer(nextAnswer || onGetFirstAnswer()!);\r\n\r\n break;\r\n case 'ArrowUp':\r\n // select previous answer, if any.\r\n // if no previous answer, select last answer\r\n\r\n const previousAnswerIndex = onGetAnswers(\r\n currentQuestion.answerIds!\r\n ).findIndex(answer => answer?.id === currentAnswer!.id - 1);\r\n\r\n const previousAnswerID =\r\n currentQuestion.answerIds &&\r\n currentQuestion.answerIds[previousAnswerIndex];\r\n\r\n const previousAnswer = onGetAnswers(currentQuestion.answerIds!).find(\r\n answer => answer?.id === previousAnswerID\r\n );\r\n\r\n if (previousAnswer) {\r\n setCurrentAnswer(previousAnswer);\r\n } else {\r\n setCurrentAnswer(onGetAnswers(currentQuestion.answerIds!).pop()!);\r\n }\r\n\r\n break;\r\n case 'Enter':\r\n setCanShowAnswers(false);\r\n\r\n if (!currentAnswer?.nextQuestionId) {\r\n onClose();\r\n return;\r\n } else {\r\n setCurrentQuestion(\r\n questions.find(\r\n question => question.id === currentAnswer!.nextQuestionId\r\n )!\r\n );\r\n }\r\n\r\n break;\r\n }\r\n };\r\n useEventListener('keydown', onKeyPress);\r\n\r\n const onAnswerClick = (answer: IQuestionDialogAnswer) => {\r\n setCanShowAnswers(false);\r\n if (answer.nextQuestionId) {\r\n // if there is a next question, go to it\r\n setCurrentQuestion(\r\n questions.find(question => question.id === answer.nextQuestionId)!\r\n );\r\n } else {\r\n // else, finish dialog!\r\n onClose();\r\n }\r\n };\r\n\r\n const onRenderCurrentAnswers = () => {\r\n const answerIds = currentQuestion.answerIds;\r\n if (!answerIds) {\r\n return null;\r\n }\r\n\r\n const answers = onGetAnswers(answerIds);\r\n\r\n if (!answers) {\r\n return null;\r\n }\r\n\r\n return answers.map(answer => {\r\n const isSelected = currentAnswer?.id === answer?.id;\r\n const selectedColor = isSelected ? 'yellow' : 'white';\r\n\r\n if (answer) {\r\n return (\r\n <AnswerRow key={`answer_${answer.id}`}>\r\n <AnswerSelectedIcon color={selectedColor}>\r\n {isSelected ? 'X' : null}\r\n </AnswerSelectedIcon>\r\n\r\n <Answer\r\n key={answer.id}\r\n onPointerDown={() => onAnswerClick(answer)}\r\n color={selectedColor}\r\n >\r\n {answer.text}\r\n </Answer>\r\n </AnswerRow>\r\n );\r\n }\r\n\r\n return null;\r\n });\r\n };\r\n\r\n return (\r\n <Container>\r\n <QuestionContainer>\r\n <DynamicText\r\n text={currentQuestion.text}\r\n onStart={() => setCanShowAnswers(false)}\r\n onFinish={() => setCanShowAnswers(true)}\r\n />\r\n </QuestionContainer>\r\n\r\n {canShowAnswers && (\r\n <AnswersContainer>{onRenderCurrentAnswers()}</AnswersContainer>\r\n )}\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n display: flex;\r\n word-break: break-all;\r\n box-sizing: border-box;\r\n justify-content: flex-start;\r\n align-items: flex-start;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nconst QuestionContainer = styled.div`\r\n flex: 100%;\r\n width: 100%;\r\n`;\r\n\r\nconst AnswersContainer = styled.div`\r\n flex: 100%;\r\n`;\r\n\r\ninterface IAnswerProps {\r\n color: string;\r\n}\r\n\r\nconst Answer = styled.p<IAnswerProps>`\r\n flex: auto;\r\n color: ${props => props.color} !important;\r\n font-size: 0.65rem !important;\r\n background: inherit;\r\n border: none;\r\n`;\r\n\r\nconst AnswerSelectedIcon = styled.span<IAnswerProps>`\r\n flex: 5% 0 0;\r\n color: ${props => props.color} !important;\r\n`;\r\n\r\nconst AnswerRow = styled.div`\r\n display: flex;\r\n flex-wrap: wrap;\r\n justify-content: center;\r\n align-items: center;\r\n margin-bottom: 0.5rem;\r\n height: 22px;\r\n p {\r\n line-height: unset;\r\n margin-top: 0;\r\n margin-bottom: 0rem;\r\n }\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\n\r\nexport interface IBarProps {\r\n max: number;\r\n value: number;\r\n color: 'red' | 'blue' | 'green';\r\n style?: Record<string, any>;\r\n displayText?: boolean;\r\n percentageWidth?: number;\r\n minWidth?: number;\r\n}\r\n\r\nexport const ProgressBar: React.FC<IBarProps> = ({\r\n max,\r\n value,\r\n color,\r\n displayText = true,\r\n percentageWidth = 40,\r\n minWidth = 100,\r\n style,\r\n}) => {\r\n value = Math.round(value);\r\n max = Math.round(max);\r\n\r\n const calculatePercentageValue = function(max: number, value: number) {\r\n if (value > max) {\r\n value = max;\r\n }\r\n return (value * 100) / max;\r\n };\r\n\r\n return (\r\n <Container\r\n className=\"rpgui-progress\"\r\n data-value={calculatePercentageValue(max, value) / 100}\r\n data-rpguitype=\"progress\"\r\n percentageWidth={percentageWidth}\r\n minWidth={minWidth}\r\n style={style}\r\n >\r\n {displayText && (\r\n <TextOverlay>\r\n <ProgressBarText>\r\n {value}/{max}\r\n </ProgressBarText>\r\n </TextOverlay>\r\n )}\r\n <div className=\" rpgui-progress-track\">\r\n <div\r\n className={`rpgui-progress-fill ${color} `}\r\n style={{\r\n left: '0px',\r\n width: calculatePercentageValue(max, value) + '%',\r\n }}\r\n ></div>\r\n </div>\r\n <div className=\" rpgui-progress-left-edge\"></div>\r\n <div className=\" rpgui-progress-right-edge\"></div>\r\n </Container>\r\n );\r\n};\r\n\r\nconst ProgressBarText = styled.span`\r\n font-size: ${uiFonts.size.small} !important;\r\n color: white;\r\n text-align: center;\r\n z-index: 1;\r\n position: absolute;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n top: 12px;\r\n`;\r\n\r\nconst TextOverlay = styled.div`\r\n width: 100%;\r\n position: relative;\r\n`;\r\n\r\ninterface IContainerProps {\r\n percentageWidth?: number;\r\n minWidth?: number;\r\n style?: Record<string, any>;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n display: flex;\r\n flex-direction: column;\r\n min-width: ${props => props.minWidth}px;\r\n width: ${props => props.percentageWidth}%;\r\n justify-content: start;\r\n align-items: flex-start;\r\n ${props => props.style}\r\n`;\r\n","import { IQuest } from '@rpg-engine/shared';\r\nimport React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport SelectArrow from '../Arrow/SelectArrow';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\n\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { Column } from '../shared/Column';\r\nimport thumbnailDefault from './img/default.png';\r\n\r\nexport interface IQuestsButtonProps {\r\n disabled: boolean;\r\n title: string;\r\n onClick: (questId: string, npcId: string) => void;\r\n}\r\n\r\nexport interface IQuestInfoProps {\r\n onClose?: () => void;\r\n buttons?: IQuestsButtonProps[];\r\n quests: IQuest[];\r\n onChangeQuest: (currentQuestIndex: number, currentQuestId: string) => void;\r\n scale?: number;\r\n}\r\n\r\nexport const QuestInfo: React.FC<IQuestInfoProps> = ({\r\n quests,\r\n onClose,\r\n buttons,\r\n onChangeQuest,\r\n scale,\r\n}) => {\r\n const [currentIndex, setCurrentIndex] = useState(0);\r\n const questsLength = quests.length - 1;\r\n\r\n useEffect(() => {\r\n if (onChangeQuest) {\r\n onChangeQuest(currentIndex, quests[currentIndex]._id);\r\n }\r\n }, [currentIndex]);\r\n\r\n const onLeftClick = () => {\r\n if (currentIndex === 0) setCurrentIndex(questsLength);\r\n else setCurrentIndex(index => index - 1);\r\n };\r\n const onRightClick = () => {\r\n if (currentIndex === questsLength) setCurrentIndex(0);\r\n else setCurrentIndex(index => index + 1);\r\n };\r\n\r\n return (\r\n <QuestDraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) onClose();\r\n }}\r\n width=\"730px\"\r\n cancelDrag=\".equipment-container-body .arrow-selector\"\r\n scale={scale}\r\n >\r\n {quests.length >= 2 ? (\r\n <QuestsContainer>\r\n {currentIndex !== 0 && (\r\n <SelectArrow\r\n direction=\"left\"\r\n onPointerDown={onLeftClick}\r\n ></SelectArrow>\r\n )}\r\n {currentIndex !== quests.length - 1 && (\r\n <SelectArrow\r\n direction=\"right\"\r\n onPointerDown={onRightClick}\r\n ></SelectArrow>\r\n )}\r\n\r\n <QuestContainer>\r\n <TitleContainer className=\"drag-handler\">\r\n <Title>\r\n <Thumbnail\r\n src={quests[currentIndex].thumbnail || thumbnailDefault}\r\n />\r\n {quests[currentIndex].title}\r\n </Title>\r\n <QuestSplitDiv>\r\n <hr className=\"golden\" />\r\n </QuestSplitDiv>\r\n </TitleContainer>\r\n <Content>\r\n <p>{quests[currentIndex].description}</p>\r\n </Content>\r\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\r\n {buttons &&\r\n buttons.map((button, index) => (\r\n <Button\r\n key={index}\r\n onPointerDown={() =>\r\n button.onClick(\r\n quests[currentIndex]._id,\r\n quests[currentIndex].npcId\r\n )\r\n }\r\n disabled={button.disabled}\r\n buttonType={ButtonTypes.RPGUIButton}\r\n id={`button-${index}`}\r\n >\r\n {button.title}\r\n </Button>\r\n ))}\r\n </QuestColumn>\r\n </QuestContainer>\r\n </QuestsContainer>\r\n ) : (\r\n <QuestsContainer>\r\n <QuestContainer>\r\n <TitleContainer className=\"drag-handler\">\r\n <Title>\r\n <Thumbnail src={quests[0].thumbnail || thumbnailDefault} />\r\n {quests[0].title}\r\n </Title>\r\n <QuestSplitDiv>\r\n <hr className=\"golden\" />\r\n </QuestSplitDiv>\r\n </TitleContainer>\r\n <Content>\r\n <p>{quests[0].description}</p>\r\n </Content>\r\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\r\n {buttons &&\r\n buttons.map((button, index) => (\r\n <Button\r\n key={index}\r\n onPointerDown={() =>\r\n button.onClick(quests[0]._id, quests[0].npcId)\r\n }\r\n disabled={button.disabled}\r\n buttonType={ButtonTypes.RPGUIButton}\r\n id={`button-${index}`}\r\n >\r\n {button.title}\r\n </Button>\r\n ))}\r\n </QuestColumn>\r\n </QuestContainer>\r\n </QuestsContainer>\r\n )}\r\n </QuestDraggableContainer>\r\n );\r\n};\r\n\r\nconst QuestDraggableContainer = styled(DraggableContainer)`\r\n border: 1px solid black;\r\n width: 600px;\r\n padding: 0 0 0 0 !important;\r\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\r\n height: auto;\r\n }\r\n .container-close {\r\n position: absolute;\r\n margin-left: auto;\r\n top: 20px;\r\n padding-right: 5px;\r\n }\r\n img {\r\n display: inline-block;\r\n vertical-align: middle;\r\n line-height: normal;\r\n }\r\n`;\r\n\r\nconst QuestContainer = styled.div`\r\n margin-right: 40px;\r\n margin-left: 40px;\r\n`;\r\n\r\nconst QuestsContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n`;\r\n\r\nconst Content = styled.div`\r\n padding: 18px;\r\n h1 {\r\n text-align: left;\r\n margin: 14px 0px;\r\n }\r\n`;\r\n\r\nconst QuestSplitDiv = styled.div`\r\n width: 100%;\r\n font-size: 11px;\r\n margin-bottom: 10px;\r\n hr {\r\n margin: 0px;\r\n padding: 0px;\r\n }\r\n p {\r\n margin-bottom: 0px;\r\n }\r\n`;\r\n\r\nconst QuestColumn = styled(Column)`\r\n padding-top: 5px;\r\n margin-bottom: 20px;\r\n display: flex;\r\n justify-content: space-evenly;\r\n`;\r\n\r\nconst TitleContainer = styled.div`\r\n width: 100%;\r\n display: flex;\r\n flex-wrap: wrap;\r\n justify-content: flex-start;\r\n align-items: center;\r\n margin-top: 1rem;\r\n`;\r\n\r\nconst Title = styled.h1`\r\n color: white;\r\n z-index: 22;\r\n font-size: ${uiFonts.size.medium} !important;\r\n color: ${uiColors.yellow} !important;\r\n`;\r\n\r\nconst Thumbnail = styled.img`\r\n color: white;\r\n z-index: 22;\r\n width: 32px * 1.5;\r\n margin-right: 0.5rem;\r\n position: relative;\r\n top: -4px;\r\n`;\r\n","import { IQuest } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../constants/uiFonts';\r\nimport { DraggableContainer } from './DraggableContainer';\r\nimport { RPGUIContainerTypes } from './RPGUIContainer';\r\n\r\nexport interface IQuestListProps {\r\n quests?: IQuest[];\r\n onClose: () => void;\r\n scale?: number;\r\n}\r\n\r\nexport const QuestList: React.FC<IQuestListProps> = ({\r\n quests,\r\n onClose,\r\n scale,\r\n}) => {\r\n return (\r\n <QuestDraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) onClose();\r\n }}\r\n width=\"520px\"\r\n scale={scale}\r\n >\r\n <div style={{ width: '100%' }}>\r\n <Title>Quests</Title>\r\n <hr className=\"golden\" />\r\n\r\n <QuestListContainer>\r\n {quests ? (\r\n quests.map((quest, i) => (\r\n <div className=\"quest-item\" key={i}>\r\n <span className=\"quest-number\">{i + 1}</span>\r\n <div className=\"quest-detail\">\r\n <p className=\"quest-detail__title\">{quest.title}</p>\r\n <p className=\"quest-detail__description\">\r\n {quest.description}\r\n </p>\r\n </div>\r\n </div>\r\n ))\r\n ) : (\r\n <NoQuestContainer>\r\n <p>There are no ongoing quests</p>\r\n </NoQuestContainer>\r\n )}\r\n </QuestListContainer>\r\n </div>\r\n </QuestDraggableContainer>\r\n );\r\n};\r\n\r\nconst QuestDraggableContainer = styled(DraggableContainer)`\r\n .container-close {\r\n top: 10px;\r\n right: 10px;\r\n }\r\n\r\n .quest-title {\r\n text-align: left;\r\n margin-left: 44px;\r\n margin-top: 20px;\r\n color: yellow;\r\n }\r\n\r\n .quest-desc {\r\n margin-top: 12px;\r\n margin-left: 44px;\r\n }\r\n\r\n .rpgui-progress {\r\n min-width: 80%;\r\n margin: 0 auto;\r\n }\r\n`;\r\n\r\nconst Title = styled.h1`\r\n z-index: 22;\r\n font-size: ${uiFonts.size.medium} !important;\r\n color: yellow !important;\r\n`;\r\n\r\nconst QuestListContainer = styled.div`\r\n margin-top: 20px;\r\n margin-bottom: 40px;\r\n overflow-y: auto;\r\n max-height: 400px;\r\n\r\n .quest-item {\r\n display: flex;\r\n align-items: flex-start;\r\n margin-bottom: 12px;\r\n }\r\n\r\n .quest-number {\r\n border-radius: 50%;\r\n width: 28px;\r\n height: 28px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n margin-right: 16px;\r\n background-color: brown;\r\n flex-shrink: 0;\r\n }\r\n\r\n .quest-number.completed {\r\n background-color: yellow;\r\n }\r\n\r\n p {\r\n margin: 0;\r\n }\r\n\r\n .quest-detail__title {\r\n color: yellow;\r\n }\r\n\r\n .quest-detail__description {\r\n margin-top: 5px;\r\n }\r\n .Noquest-detail__description {\r\n margin-top: 5px;\r\n margin: auto;\r\n }\r\n`;\r\nconst NoQuestContainer = styled.div`\r\n text-align: center;\r\n p {\r\n margin-top: 5px;\r\n }\r\n`;\r\n","import React from 'react';\r\nimport 'rpgui/rpgui.min.css';\r\nimport 'rpgui/rpgui.min.js';\r\n\r\ninterface IProps {\r\n children: React.ReactNode;\r\n}\r\n\r\n//@ts-ignore\r\nexport const _RPGUI = RPGUI;\r\n\r\nexport const RPGUIRoot: React.FC<IProps> = ({ children }) => {\r\n return <div className=\"rpgui-content\">{children}</div>;\r\n};\r\n","import {\r\n getItemTextureKeyPath,\r\n IItem,\r\n IItemContainer,\r\n IRawSpell,\r\n IShortcut,\r\n ShortcutType,\r\n} from '@rpg-engine/shared';\r\nimport React, { useEffect, useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { countItemFromInventory } from '../../libs/itemCounter';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\nimport { SingleShortcut } from './SingleShortcut';\r\nimport { useShortcutCooldown } from './useShortcutCooldown';\r\n\r\nexport type ShortcutsProps = {\r\n shortcuts: IShortcut[];\r\n onShortcutCast: (index: number) => void;\r\n mana: number;\r\n isBlockedCastingByKeyboard?: boolean;\r\n inventory?: IItemContainer | null;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n spellCooldowns?: Record<string, number>;\r\n};\r\n\r\nexport const Shortcuts: React.FC<ShortcutsProps> = ({\r\n shortcuts,\r\n onShortcutCast,\r\n mana,\r\n isBlockedCastingByKeyboard = false,\r\n atlasJSON,\r\n atlasIMG,\r\n inventory,\r\n spellCooldowns,\r\n}) => {\r\n const shortcutsRefs = useRef<HTMLButtonElement[]>([]);\r\n\r\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\r\n onShortcutCast\r\n );\r\n\r\n useEffect(() => {\r\n const handleKeyDown = (e: KeyboardEvent) => {\r\n if (isBlockedCastingByKeyboard) return;\r\n\r\n const shortcutIndex = Number(e.key) - 1;\r\n if (shortcutIndex >= 0 && shortcutIndex <= 5) {\r\n handleShortcutCast(shortcutIndex);\r\n shortcutsRefs.current[shortcutIndex]?.classList.add('active');\r\n setTimeout(() => {\r\n shortcutsRefs.current[shortcutIndex]?.classList.remove('active');\r\n }, 150);\r\n }\r\n };\r\n\r\n window.addEventListener('keydown', handleKeyDown);\r\n\r\n return () => {\r\n window.removeEventListener('keydown', handleKeyDown);\r\n };\r\n }, [shortcuts, isBlockedCastingByKeyboard, shortcutCooldown]);\r\n\r\n return (\r\n <List>\r\n {Array.from({ length: 6 }).map((_, i) => {\r\n const buildClassName = (classBase: string, isOnCooldown: boolean) => {\r\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\r\n };\r\n\r\n const isOnShortcutCooldown = shortcutCooldown > 0;\r\n\r\n if (shortcuts && shortcuts[i]?.type === ShortcutType.Item) {\r\n const payload = shortcuts[i]?.payload as IItem | undefined;\r\n\r\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\r\n\r\n if (inventory) {\r\n Object.keys(inventory.slots).forEach(i => {\r\n const index = parseInt(i);\r\n\r\n if (inventory.slots[index]?.key === payload?.key) {\r\n itemsFromEquipment.push(inventory.slots[index]);\r\n }\r\n });\r\n }\r\n\r\n const totalQty =\r\n payload && inventory\r\n ? countItemFromInventory(payload.key, inventory)\r\n : 0;\r\n\r\n return (\r\n <StyledShortcut\r\n key={i}\r\n onPointerDown={handleShortcutCast.bind(null, i)}\r\n disabled={false}\r\n ref={el => {\r\n if (el) shortcutsRefs.current[i] = el;\r\n }}\r\n >\r\n {isOnShortcutCooldown && (\r\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\r\n )}\r\n {payload && (\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: payload.texturePath,\r\n texturePath: payload.texturePath,\r\n stackQty: payload.stackQty || 1,\r\n isStackable: payload.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n width={32}\r\n height={32}\r\n />\r\n )}\r\n <span className={buildClassName('qty', isOnShortcutCooldown)}>\r\n {totalQty}\r\n </span>\r\n <span\r\n className={buildClassName('keyboard', isOnShortcutCooldown)}\r\n >\r\n {i + 1}\r\n </span>\r\n </StyledShortcut>\r\n );\r\n }\r\n\r\n const payload =\r\n shortcuts && (shortcuts[i]?.payload as IRawSpell | undefined); //check if shortcuts exists before using the ? operator.\r\n\r\n const spellCooldown = !payload\r\n ? 0\r\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\r\n shortcutCooldown;\r\n const cooldown =\r\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\r\n const isOnCooldown = cooldown > 0 && !!payload;\r\n\r\n return (\r\n <StyledShortcut\r\n key={i}\r\n onPointerDown={handleShortcutCast.bind(null, i)}\r\n disabled={mana < (payload?.manaCost ?? 0)}\r\n ref={el => {\r\n if (el) shortcutsRefs.current[i] = el;\r\n }}\r\n >\r\n {isOnCooldown && (\r\n <span className=\"cooldown\">\r\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\r\n </span>\r\n )}\r\n <span className={buildClassName('mana', isOnCooldown)}>\r\n {payload && payload.manaCost}\r\n </span>\r\n <span className=\"magicWords\">\r\n {payload?.magicWords.split(' ').map(word => word[0])}\r\n </span>\r\n <span className={buildClassName('keyboard', isOnCooldown)}>\r\n {i + 1}\r\n </span>\r\n </StyledShortcut>\r\n );\r\n })}\r\n </List>\r\n );\r\n};\r\n\r\nconst StyledShortcut = styled(SingleShortcut)`\r\n transition: all 0.15s;\r\n\r\n &.active {\r\n background-color: ${uiColors.gray};\r\n border-color: ${uiColors.yellow};\r\n }\r\n`;\r\n\r\nconst List = styled.p`\r\n width: 100%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 0.5rem;\r\n box-sizing: border-box;\r\n margin: 0 !important;\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nexport interface ISimpleProgressBarProps {\r\n value: number;\r\n bgColor?: string;\r\n margin?: number;\r\n}\r\n\r\nexport const SimpleProgressBar: React.FC<ISimpleProgressBarProps> = ({\r\n value,\r\n bgColor = 'red',\r\n margin = 20,\r\n}) => {\r\n return (\r\n <Container className=\"simple-progress-bar\">\r\n <ProgressBarContainer margin={margin}>\r\n <BackgroundBar>\r\n <Progress value={value} bgColor={bgColor} />\r\n </BackgroundBar>\r\n </ProgressBarContainer>\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n width: 100%;\r\n`;\r\n\r\nconst BackgroundBar = styled.span`\r\n background-color: rgba(0, 0, 0, 0.075);\r\n`;\r\n\r\ninterface ISimpleProgressBarThemeProps {\r\n value: number;\r\n bgColor: string;\r\n}\r\n\r\nconst Progress = styled.span`\r\n background-color: ${(props: ISimpleProgressBarThemeProps) => props.bgColor};\r\n width: ${(props: ISimpleProgressBarThemeProps) => props.value}%;\r\n`;\r\n\r\ninterface ISimpleProgressBarTheme2Props {\r\n margin: number;\r\n}\r\n\r\nconst ProgressBarContainer = styled.div`\r\n border-radius: 60px;\r\n border: 1px solid #282424;\r\n overflow: hidden;\r\n width: 100%;\r\n span {\r\n display: block;\r\n height: 100%;\r\n }\r\n height: 8px;\r\n margin-left: ${(props: ISimpleProgressBarTheme2Props) => props.margin}px;\r\n`;\r\n","import { getSPForLevel } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { ErrorBoundary } from './Item/Inventory/ErrorBoundary';\r\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\r\nimport { SimpleProgressBar } from './SimpleProgressBar';\r\n\r\nexport interface ISkillProgressBarProps {\r\n skillName: string;\r\n bgColor: string;\r\n level: number;\r\n skillPoints: number;\r\n skillPointsToNextLevel?: number;\r\n texturePath: string;\r\n showSkillPoints?: boolean;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n}\r\n\r\nexport const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({\r\n bgColor,\r\n skillName,\r\n level,\r\n skillPoints,\r\n skillPointsToNextLevel,\r\n texturePath,\r\n showSkillPoints = true,\r\n atlasIMG,\r\n atlasJSON,\r\n}) => {\r\n if (!skillPointsToNextLevel) {\r\n skillPointsToNextLevel = getSPForLevel(level + 1);\r\n }\r\n\r\n const nextLevelSPWillbe = skillPoints + skillPointsToNextLevel;\r\n\r\n const ratio = (skillPoints / nextLevelSPWillbe) * 100;\r\n\r\n return (\r\n <>\r\n <ProgressTitle>\r\n <TitleName>{skillName}</TitleName>\r\n <ValueDisplay>lv {level}</ValueDisplay>\r\n </ProgressTitle>\r\n <ProgressBody>\r\n <ProgressIconContainer>\r\n {atlasIMG && atlasJSON ? (\r\n <SpriteContainer>\r\n <ErrorBoundary>\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={texturePath}\r\n imgScale={1}\r\n grayScale\r\n opacity={0.5}\r\n />\r\n </ErrorBoundary>\r\n </SpriteContainer>\r\n ) : (\r\n <></>\r\n )}\r\n </ProgressIconContainer>\r\n\r\n <ProgressBarContainer>\r\n <SimpleProgressBar value={ratio} bgColor={bgColor} />\r\n </ProgressBarContainer>\r\n </ProgressBody>\r\n {showSkillPoints && (\r\n <SkillDisplayContainer>\r\n <SkillPointsDisplay>\r\n {skillPoints}/{nextLevelSPWillbe}\r\n </SkillPointsDisplay>\r\n </SkillDisplayContainer>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nconst ProgressBarContainer = styled.div`\r\n position: relative;\r\n top: 8px;\r\n width: 100%;\r\n height: auto;\r\n`;\r\n\r\nconst SpriteContainer = styled.div`\r\n position: relative;\r\n top: -3px;\r\n left: 0;\r\n`;\r\n\r\nconst SkillDisplayContainer = styled.div`\r\n margin: 0 auto;\r\n\r\n p {\r\n margin: 0;\r\n }\r\n`;\r\n\r\nconst SkillPointsDisplay = styled.p`\r\n font-size: 0.6rem !important;\r\n font-weight: bold;\r\n text-align: center;\r\n`;\r\n\r\nconst TitleName = styled.span`\r\n margin-left: 5px;\r\n`;\r\n\r\nconst ValueDisplay = styled.span``;\r\n\r\nconst ProgressIconContainer = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n`;\r\n\r\nconst ProgressBody = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n width: 100%;\r\n`;\r\n\r\nconst ProgressTitle = styled.div`\r\n width: 100%;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n span {\r\n font-size: 0.6rem;\r\n }\r\n`;\r\n","import { ISkill, ISkillDetails } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../constants/uiColors';\r\nimport { DraggableContainer } from './DraggableContainer';\r\nimport { SkillProgressBar } from './SkillProgressBar';\r\n\r\nexport interface ISkillContainerProps {\r\n skill: ISkill;\r\n onCloseButton: () => void;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n scale?: number;\r\n}\r\n\r\nconst skillProps = {\r\n attributes: {\r\n color: uiColors.purple,\r\n values: {\r\n stamina: 'spell-icons/regenerate.png',\r\n magic: 'spell-icons/fireball.png',\r\n magicResistance: 'spell-icons/freeze.png',\r\n strength: 'spell-icons/enchanted-blow.png',\r\n resistance: 'spell-icons/magic-shield.png',\r\n dexterity: 'spell-icons/haste.png',\r\n },\r\n },\r\n combat: {\r\n color: uiColors.cardinal,\r\n values: {\r\n first: 'gloves/leather-gloves.png',\r\n club: 'maces/club.png',\r\n sword: 'swords/double-edged-sword.png',\r\n axe: 'axes/double-axe.png',\r\n distance: 'ranged-weapons/horse-bow.png',\r\n shielding: 'shields/studded-shield.png',\r\n dagger: 'daggers/dagger.png',\r\n },\r\n },\r\n crafting: {\r\n color: uiColors.blue,\r\n values: {\r\n fishing: 'foods/fish.png',\r\n mining: 'crafting-resources/iron-ingot.png',\r\n lumberjacking: 'crafting-resources/greater-wooden-log.png',\r\n blacksmithing: 'hammers/hammer.png',\r\n cooking: 'foods/chickens-meat.png',\r\n alchemy: 'potions/greater-mana-potion.png',\r\n },\r\n },\r\n};\r\n\r\ninterface SkillMap {\r\n [key: string]: string;\r\n}\r\n\r\nconst skillNameMap: SkillMap = {\r\n stamina: 'Stamina',\r\n magic: 'Magic',\r\n magicResistance: 'Magic Resistance',\r\n strength: 'Strength',\r\n resistance: 'Resistance',\r\n dexterity: 'Dexterity',\r\n first: 'Fist',\r\n club: 'Club',\r\n sword: 'Sword',\r\n axe: 'Axe',\r\n distance: 'Distance',\r\n shielding: 'Shielding',\r\n dagger: 'Dagger',\r\n fishing: 'Fishing',\r\n mining: 'Mining',\r\n lumberjacking: 'Lumberjacking',\r\n blacksmithing: 'Blacksmithing',\r\n cooking: 'Cooking',\r\n alchemy: 'Alchemy',\r\n};\r\n\r\nexport const SkillsContainer: React.FC<ISkillContainerProps> = ({\r\n onCloseButton,\r\n skill,\r\n atlasIMG,\r\n atlasJSON,\r\n scale,\r\n}) => {\r\n const onRenderSkillCategory = (\r\n category: 'attributes' | 'combat' | 'crafting'\r\n ) => {\r\n const skillCategory = skillProps[category];\r\n\r\n const skillCategoryColor = skillCategory.color;\r\n\r\n const output = [];\r\n\r\n for (const [key, value] of Object.entries(skillCategory.values)) {\r\n if (key === 'stamina') {\r\n continue;\r\n }\r\n //@ts-ignore\r\n const skillDetails = (skill[key] as unknown) as ISkillDetails;\r\n\r\n output.push(\r\n <SkillProgressBar\r\n key={key}\r\n skillName={skillNameMap[key]}\r\n bgColor={skillCategoryColor}\r\n level={skillDetails.level || 0}\r\n skillPoints={Math.round(skillDetails.skillPoints) || 0}\r\n skillPointsToNextLevel={\r\n Math.round(skillDetails.skillPointsToNextLevel) || 0\r\n }\r\n texturePath={value}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n );\r\n }\r\n\r\n return output;\r\n };\r\n\r\n return (\r\n <SkillsDraggableContainer\r\n title=\"Skills\"\r\n cancelDrag=\"#skillsDiv\"\r\n scale={scale}\r\n >\r\n {onCloseButton && (\r\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\r\n )}\r\n <SkillsContainerDiv id=\"skillsDiv\">\r\n <SkillSplitDiv>\r\n <p>General</p>\r\n <hr className=\"golden\" />\r\n\r\n <SkillProgressBar\r\n skillName={'Level'}\r\n bgColor={uiColors.navyBlue}\r\n level={Math.round(skill.level) || 0}\r\n skillPoints={Math.round(skill.experience) || 0}\r\n skillPointsToNextLevel={Math.round(skill.xpToNextLevel) || 0}\r\n texturePath={'swords/broad-sword.png'}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n\r\n <p>Combat Skills</p>\r\n <hr className=\"golden\" />\r\n </SkillSplitDiv>\r\n\r\n {onRenderSkillCategory('combat')}\r\n\r\n <SkillSplitDiv>\r\n <p>Crafting Skills</p>\r\n <hr className=\"golden\" />\r\n </SkillSplitDiv>\r\n\r\n {onRenderSkillCategory('crafting')}\r\n\r\n <SkillSplitDiv>\r\n <p>Basic Attributes</p>\r\n <hr className=\"golden\" />\r\n </SkillSplitDiv>\r\n\r\n {onRenderSkillCategory('attributes')}\r\n </SkillsContainerDiv>\r\n </SkillsDraggableContainer>\r\n );\r\n};\r\n\r\nconst SkillsDraggableContainer = styled(DraggableContainer)`\r\n border: 1px solid black;\r\n\r\n max-width: 380px;\r\n\r\n height: 90%;\r\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\r\n width: auto;\r\n height: auto;\r\n }\r\n`;\r\n\r\nconst SkillsContainerDiv = styled.div`\r\n width: 100%;\r\n -webkit-overflow-y: scroll;\r\n overflow-y: scroll;\r\n height: 90%;\r\n padding-right: 10px;\r\n`;\r\n\r\nconst SkillSplitDiv = styled.div`\r\n width: 100%;\r\n font-size: 11px;\r\n hr {\r\n margin: 0;\r\n margin-bottom: 1rem;\r\n padding: 0px;\r\n }\r\n p {\r\n margin-bottom: 0px;\r\n }\r\n`;\r\n\r\nconst CloseButton = styled.div`\r\n position: absolute;\r\n top: 2px;\r\n right: 2px;\r\n color: white;\r\n z-index: 22;\r\n font-size: 1.1rem;\r\n`;\r\n","import { ISpell } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../../constants/uiColors';\r\nimport { uiFonts } from '../../../constants/uiFonts';\r\nimport { formatSpellCastingType } from '../../../libs/CastingTypeHelper';\r\n\r\ninterface ISpellInfoProps {\r\n spell: ISpell;\r\n}\r\n\r\nexport const SpellInfo: React.FC<ISpellInfoProps> = ({ spell }) => {\r\n const {\r\n magicWords,\r\n name,\r\n manaCost,\r\n requiredItem,\r\n description,\r\n castingType,\r\n cooldown,\r\n maxDistanceGrid,\r\n } = spell;\r\n return (\r\n <Container>\r\n <Header>\r\n <div>\r\n <Title>{name}</Title>\r\n <Type>{magicWords}</Type>\r\n </div>\r\n </Header>\r\n <Statistic>\r\n <div className=\"label\">Casting Type:</div>\r\n <div className=\"value\">{formatSpellCastingType(castingType)}</div>\r\n </Statistic>\r\n <Statistic>\r\n <div className=\"label\">Magic words:</div>\r\n <div className=\"value\">{magicWords}</div>\r\n </Statistic>\r\n <Statistic>\r\n <div className=\"label\">Mana cost:</div>\r\n <div className=\"value\">{manaCost}</div>\r\n </Statistic>\r\n <Statistic>\r\n <div className=\"label\">Cooldown:</div>\r\n <div className=\"value\">{cooldown}</div>\r\n </Statistic>\r\n {maxDistanceGrid && (\r\n <Statistic>\r\n <div className=\"label\">Max Distance Grid:</div>\r\n <div className=\"value\">{maxDistanceGrid}</div>\r\n </Statistic>\r\n )}\r\n <Statistic>\r\n {requiredItem && (\r\n <>\r\n <div className=\"label\">Required Item:</div>\r\n <div className=\"value\">{requiredItem}</div>\r\n </>\r\n )}\r\n </Statistic>\r\n <Description>{description}</Description>\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n color: white;\r\n background-color: #222;\r\n border-radius: 5px;\r\n padding: 0.5rem;\r\n font-size: ${uiFonts.size.small};\r\n border: 3px solid ${uiColors.lightGray};\r\n height: max-content;\r\n width: 30rem;\r\n\r\n @media (max-width: 580px) {\r\n width: 80vw;\r\n }\r\n`;\r\n\r\nconst Title = styled.div`\r\n font-size: ${uiFonts.size.medium};\r\n font-weight: bold;\r\n margin-bottom: 0.5rem;\r\n display: flex;\r\n align-items: center;\r\n margin: 0;\r\n`;\r\n\r\nconst Type = styled.div`\r\n font-size: ${uiFonts.size.small};\r\n margin-top: 0.2rem;\r\n color: ${uiColors.lightGray};\r\n`;\r\n\r\nconst Description = styled.div`\r\n margin-top: 1.5rem;\r\n font-size: ${uiFonts.size.small};\r\n color: ${uiColors.lightGray};\r\n font-style: italic;\r\n`;\r\n\r\nconst Header = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n margin-bottom: 0.5rem;\r\n`;\r\n\r\nconst Statistic = styled.div`\r\n margin-bottom: 0.4rem;\r\n width: max-content;\r\n\r\n .label {\r\n display: inline-block;\r\n margin-right: 0.5rem;\r\n color: inherit;\r\n }\r\n\r\n .value {\r\n display: inline-block;\r\n color: inherit;\r\n }\r\n\r\n &.better,\r\n .better {\r\n color: ${uiColors.lightGreen};\r\n }\r\n\r\n &.worse,\r\n .worse {\r\n color: ${uiColors.cardinal};\r\n }\r\n`;\r\n","export const formatSpellCastingType = (castingType: string): string => {\r\n const formattedCastingType = castingType\r\n .split(\"-\")\r\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\r\n .join(\" \");\r\n \r\n return formattedCastingType;\r\n };","import { ISpell } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { SpellInfo } from './SpellInfo';\r\n\r\nexport interface ISpellInfoDisplayProps {\r\n spell: ISpell;\r\n isMobile?: boolean;\r\n}\r\n\r\nexport const SpellInfoDisplay: React.FC<ISpellInfoDisplayProps> = ({\r\n spell,\r\n isMobile,\r\n}) => {\r\n return (\r\n <Flex $isMobile={isMobile}>\r\n <SpellInfo spell={spell} />\r\n </Flex>\r\n );\r\n};\r\n\r\nconst Flex = styled.div<{ $isMobile?: boolean }>`\r\n display: flex;\r\n gap: 0.5rem;\r\n flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};\r\n\r\n @media (max-width: 580px) {\r\n flex-direction: column-reverse;\r\n align-items: center;\r\n }\r\n`;\r\n","import { ISpell } from '@rpg-engine/shared';\r\nimport React, { useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport ModalPortal from '../../Abstractions/ModalPortal';\r\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\r\n\r\ninterface IListMenuOption {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nexport interface MobileSpellTooltipProps {\r\n spell: ISpell;\r\n closeTooltip: () => void;\r\n scale?: number;\r\n options?: IListMenuOption[];\r\n onSelected?: (selectedOptionId: string) => void;\r\n}\r\n\r\nexport const MobileSpellTooltip: React.FC<MobileSpellTooltipProps> = ({\r\n spell,\r\n closeTooltip,\r\n scale = 1,\r\n options,\r\n onSelected,\r\n}) => {\r\n const ref = useRef<HTMLDivElement>(null);\r\n\r\n const handleFadeOut = () => {\r\n ref.current?.classList.add('fadeOut');\r\n };\r\n\r\n return (\r\n <ModalPortal>\r\n <Container\r\n ref={ref}\r\n onTouchEnd={() => {\r\n handleFadeOut();\r\n setTimeout(() => {\r\n closeTooltip();\r\n }, 100);\r\n }}\r\n scale={scale}\r\n >\r\n <SpellInfoDisplay spell={spell} isMobile />\r\n <OptionsContainer>\r\n {options?.map(option => (\r\n <Option\r\n key={option.id}\r\n onTouchEnd={() => {\r\n handleFadeOut();\r\n setTimeout(() => {\r\n onSelected?.(option.id);\r\n closeTooltip();\r\n }, 100);\r\n }}\r\n >\r\n {option.text}\r\n </Option>\r\n ))}\r\n </OptionsContainer>\r\n </Container>\r\n </ModalPortal>\r\n );\r\n};\r\n\r\nconst Container = styled.div<{ scale: number }>`\r\n position: absolute;\r\n z-index: 100;\r\n left: 0;\r\n top: 0;\r\n width: 100vw;\r\n height: 100vh;\r\n background-color: rgba(0 0 0 / 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.5rem;\r\n transition: opacity 0.08s;\r\n animation: fadeIn 0.1s forwards;\r\n\r\n @keyframes fadeIn {\r\n 0% {\r\n opacity: 0;\r\n }\r\n 100% {\r\n opacity: 0.92;\r\n }\r\n }\r\n\r\n @keyframes fadeOut {\r\n 0% {\r\n opacity: 0.92;\r\n }\r\n 100% {\r\n opacity: 0;\r\n }\r\n }\r\n\r\n &.fadeOut {\r\n animation: fadeOut 0.1s forwards;\r\n }\r\n\r\n @media (max-width: 580px) {\r\n flex-direction: column;\r\n }\r\n`;\r\n\r\nconst OptionsContainer = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n gap: 0.5rem;\r\n flex-wrap: wrap;\r\n\r\n @media (max-width: 580px) {\r\n flex-direction: row;\r\n justify-content: center;\r\n }\r\n`;\r\n\r\nconst Option = styled.button`\r\n padding: 1rem;\r\n background-color: #333;\r\n color: white;\r\n border: none;\r\n border-radius: 3px;\r\n width: 8rem;\r\n transition: background-color 0.1s;\r\n\r\n &:hover {\r\n background-color: #555;\r\n }\r\n\r\n @media (max-width: 580px) {\r\n padding: 1rem 0.5rem;\r\n }\r\n`;\r\n","import { ISpell } from '@rpg-engine/shared';\r\nimport React, { useEffect, useRef } from 'react';\r\nimport styled from 'styled-components';\r\nimport ModalPortal from '../../Abstractions/ModalPortal';\r\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\r\n\r\nexport interface IMagicTooltipProps {\r\n spell: ISpell;\r\n}\r\n\r\nconst offset = 20;\r\n\r\nexport const MagicTooltip: React.FC<IMagicTooltipProps> = ({ spell }) => {\r\n const ref = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const { current } = ref;\r\n\r\n if (current) {\r\n const handleMouseMove = (event: MouseEvent) => {\r\n const { clientX, clientY } = event;\r\n\r\n // Adjust the position of the tooltip based on the mouse position\r\n const rect = current.getBoundingClientRect();\r\n\r\n const tooltipWidth = rect.width;\r\n const tooltipHeight = rect.height;\r\n const isOffScreenRight =\r\n clientX + tooltipWidth + offset > window.innerWidth;\r\n const isOffScreenBottom =\r\n clientY + tooltipHeight + offset > window.innerHeight;\r\n const x = isOffScreenRight\r\n ? clientX - tooltipWidth - offset\r\n : clientX + offset;\r\n const y = isOffScreenBottom\r\n ? clientY - tooltipHeight - offset\r\n : clientY + offset;\r\n\r\n current.style.transform = `translate(${x}px, ${y}px)`;\r\n current.style.opacity = '1';\r\n };\r\n\r\n window.addEventListener('mousemove', handleMouseMove);\r\n\r\n return () => {\r\n window.removeEventListener('mousemove', handleMouseMove);\r\n };\r\n }\r\n\r\n return;\r\n }, []);\r\n\r\n return (\r\n <ModalPortal>\r\n <Container ref={ref}>\r\n <SpellInfoDisplay spell={spell} />\r\n </Container>\r\n </ModalPortal>\r\n );\r\n};\r\n\r\nconst Container = styled.div`\r\n position: absolute;\r\n z-index: 100;\r\n pointer-events: none;\r\n left: 0;\r\n top: 0;\r\n opacity: 0;\r\n transition: opacity 0.08s;\r\n`;\r\n","import { ISpell } from '@rpg-engine/shared';\r\nimport React, { useState } from 'react';\r\nimport { MobileSpellTooltip } from './MobileSpellTooltip';\r\nimport { MagicTooltip } from './SpellTooltip';\r\n\r\ninterface ISpellInfoWrapperProps {\r\n spell: ISpell;\r\n children: React.ReactNode;\r\n scale?: number;\r\n}\r\n\r\nexport const SpellInfoWrapper: React.FC<ISpellInfoWrapperProps> = ({\r\n children,\r\n spell,\r\n scale,\r\n}) => {\r\n const [isTooltipVisible, setIsTooltipVisible] = useState(false);\r\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\r\n\r\n return (\r\n <div\r\n onMouseEnter={() => {\r\n if (!isTooltipMobileVisible) setIsTooltipVisible(true);\r\n }}\r\n onMouseLeave={setIsTooltipVisible.bind(null, false)}\r\n onTouchEnd={() => {\r\n setIsTooltipMobileVisible(true);\r\n setIsTooltipVisible(false);\r\n }}\r\n >\r\n {children}\r\n\r\n {isTooltipVisible && !isTooltipMobileVisible && (\r\n <MagicTooltip spell={spell} />\r\n )}\r\n {isTooltipMobileVisible && (\r\n <MobileSpellTooltip\r\n closeTooltip={() => {\r\n setIsTooltipMobileVisible(false);\r\n console.log('close');\r\n }}\r\n spell={spell}\r\n scale={scale}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n","import { ISpell } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport { SpellInfoWrapper } from './cards/SpellInfoWrapper';\r\n\r\nexport interface ISpellProps {\r\n charMana: number;\r\n charMagicLevel: number;\r\n onPointerUp?: (spellKey: string) => void;\r\n isSettingShortcut?: boolean;\r\n spellKey: string;\r\n spell: ISpell;\r\n activeCooldown?: number;\r\n}\r\n\r\nexport const Spell: React.FC<ISpellProps> = ({\r\n spellKey,\r\n charMana,\r\n charMagicLevel,\r\n onPointerUp,\r\n isSettingShortcut,\r\n spell,\r\n activeCooldown,\r\n}) => {\r\n const {\r\n manaCost,\r\n minMagicLevelRequired,\r\n magicWords,\r\n name,\r\n description,\r\n } = spell;\r\n const disabled = isSettingShortcut\r\n ? charMagicLevel < minMagicLevelRequired\r\n : manaCost > charMana || charMagicLevel < minMagicLevelRequired;\r\n\r\n return (\r\n <SpellInfoWrapper spell={spell}>\r\n <Container\r\n disabled={disabled || (activeCooldown ?? 0) > 0}\r\n onPointerUp={onPointerUp?.bind(null, spellKey)}\r\n isSettingShortcut={isSettingShortcut && !disabled}\r\n className=\"spell\"\r\n >\r\n {disabled && (\r\n <Overlay>\r\n {charMagicLevel < minMagicLevelRequired\r\n ? 'Low magic level'\r\n : manaCost > charMana && 'No mana'}\r\n </Overlay>\r\n )}\r\n <SpellImage>\r\n {activeCooldown && activeCooldown > 0 ? (\r\n <span className=\"cooldown\">\r\n {activeCooldown.toFixed(activeCooldown > 10 ? 0 : 1)}\r\n </span>\r\n ) : null}\r\n {magicWords.split(' ').map(word => word[0])}\r\n </SpellImage>\r\n <Info>\r\n <Title>\r\n <span>{name}</span>\r\n <span className=\"spell\">({magicWords})</span>\r\n </Title>\r\n <Description>{description}</Description>\r\n </Info>\r\n\r\n <Divider />\r\n <Cost>\r\n <span>Mana cost:</span>\r\n <span className=\"mana\">{manaCost}</span>\r\n </Cost>\r\n </Container>\r\n </SpellInfoWrapper>\r\n );\r\n};\r\n\r\nconst Container = styled.button<{ isSettingShortcut?: boolean }>`\r\n display: block;\r\n background: none;\r\n border: 2px solid transparent;\r\n border-radius: 1rem;\r\n width: 100%;\r\n display: flex;\r\n\r\n gap: 1rem;\r\n align-items: center;\r\n padding: 0 1rem;\r\n text-align: left;\r\n position: relative;\r\n\r\n animation: ${({ isSettingShortcut }) =>\r\n isSettingShortcut ? 'border-color-change 1s infinite' : 'none'};\r\n\r\n @keyframes border-color-change {\r\n 0% {\r\n border-color: ${uiColors.yellow};\r\n }\r\n 50% {\r\n border-color: transparent;\r\n }\r\n 100% {\r\n border-color: ${uiColors.yellow};\r\n }\r\n }\r\n\r\n &:hover,\r\n &:focus {\r\n background-color: ${uiColors.darkGray};\r\n }\r\n\r\n &:active {\r\n background: none;\r\n }\r\n`;\r\n\r\nconst SpellImage = styled.div`\r\n width: 4rem;\r\n height: 4rem;\r\n font-size: ${uiFonts.size.xLarge};\r\n font-weight: bold;\r\n background-color: ${uiColors.darkGray};\r\n color: ${uiColors.lightGray};\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n text-transform: uppercase;\r\n position: relative;\r\n overflow: hidden;\r\n\r\n .cooldown {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0 0 0 / 20%);\r\n color: ${uiColors.darkYellow};\r\n font-weight: bold;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n }\r\n`;\r\n\r\nconst Info = styled.span`\r\n width: 0;\r\n flex: 1;\r\n\r\n @media (orientation: portrait) {\r\n display: none;\r\n }\r\n`;\r\nconst Title = styled.p`\r\n display: flex;\r\n flex-wrap: wrap;\r\n align-items: center;\r\n margin-bottom: 5px;\r\n margin: 0;\r\n\r\n span {\r\n font-size: ${uiFonts.size.medium} !important;\r\n font-weight: bold !important;\r\n color: ${uiColors.yellow} !important;\r\n margin-right: 0.5rem;\r\n }\r\n\r\n .spell {\r\n font-size: ${uiFonts.size.small} !important;\r\n font-weight: normal !important;\r\n color: ${uiColors.lightGray} !important;\r\n }\r\n`;\r\n\r\nconst Description = styled.div`\r\n font-size: ${uiFonts.size.small} !important;\r\n line-height: 1.1 !important;\r\n`;\r\n\r\nconst Divider = styled.div`\r\n width: 1px;\r\n height: 100%;\r\n margin: 0 1rem;\r\n background-color: ${uiColors.lightGray};\r\n`;\r\n\r\nconst Cost = styled.p`\r\n display: flex;\r\n align-items: center;\r\n flex-direction: column;\r\n gap: 0.5rem;\r\n\r\n div {\r\n z-index: 1;\r\n }\r\n\r\n .mana {\r\n position: relative;\r\n font-size: ${uiFonts.size.medium};\r\n font-weight: bold;\r\n z-index: 1;\r\n\r\n &::after {\r\n position: absolute;\r\n content: '';\r\n top: 0;\r\n left: 0;\r\n background-color: ${uiColors.blue};\r\n width: 100%;\r\n height: 100%;\r\n border-radius: 50%;\r\n transform: scale(1.8);\r\n filter: blur(10px);\r\n z-index: -1;\r\n }\r\n }\r\n`;\r\n\r\nconst Overlay = styled.p`\r\n margin: 0 !important;\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n border-radius: 1rem;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n color: ${uiColors.yellow};\r\n font-size: ${uiFonts.size.large} !important;\r\n font-weight: bold;\r\n z-index: 10;\r\n background-color: rgba(0 0 0 / 0.2);\r\n`;\r\n","import { IShortcut, ISpell } from '@rpg-engine/shared';\r\nimport React, { Fragment, useEffect, useMemo, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { Input } from '../Input';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { ShortcutsSetter } from '../Shortcuts/ShortcutsSetter';\r\nimport { Spell } from './Spell';\r\n\r\nexport interface ISpellbookProps {\r\n onClose?: () => void;\r\n onInputFocus?: () => void;\r\n onInputBlur?: () => void;\r\n spells: ISpell[];\r\n magicLevel: number;\r\n mana: number;\r\n onSpellClick: (spellKey: string) => void;\r\n setSpellShortcut: (key: string, index: number) => void;\r\n shortcuts: IShortcut[];\r\n removeShortcut: (index: number) => void;\r\n atlasIMG: any;\r\n atlasJSON: any;\r\n scale?: number;\r\n spellCooldowns?: Record<string, number>;\r\n}\r\n\r\nexport const Spellbook: React.FC<ISpellbookProps> = ({\r\n onClose,\r\n onInputFocus,\r\n onInputBlur,\r\n spells,\r\n magicLevel,\r\n mana,\r\n onSpellClick,\r\n setSpellShortcut,\r\n shortcuts,\r\n removeShortcut,\r\n atlasIMG,\r\n atlasJSON,\r\n scale,\r\n spellCooldowns,\r\n}) => {\r\n const [search, setSearch] = useState('');\r\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\r\n\r\n useEffect(() => {\r\n const handleEscapeClose = (e: KeyboardEvent) => {\r\n if (e.key === 'Escape') {\r\n onClose?.();\r\n }\r\n };\r\n\r\n document.addEventListener('keydown', handleEscapeClose);\r\n\r\n return () => {\r\n document.removeEventListener('keydown', handleEscapeClose);\r\n };\r\n }, [onClose]);\r\n\r\n const spellsToDisplay = useMemo(() => {\r\n return spells\r\n .sort((a, b) => {\r\n if (a.minMagicLevelRequired > b.minMagicLevelRequired) return 1;\r\n if (a.minMagicLevelRequired < b.minMagicLevelRequired) return -1;\r\n return 0;\r\n })\r\n .filter(\r\n spell =>\r\n spell.name.toLocaleLowerCase().includes(search.toLocaleLowerCase()) ||\r\n spell.magicWords\r\n .toLocaleLowerCase()\r\n .includes(search.toLocaleLowerCase())\r\n );\r\n }, [search, spells]);\r\n\r\n const setShortcut = (spellKey: string) => {\r\n setSpellShortcut?.(spellKey, settingShortcutIndex);\r\n setSettingShortcutIndex(-1);\r\n };\r\n\r\n return (\r\n <DraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={onClose}\r\n width=\"inherit\"\r\n height=\"inherit\"\r\n cancelDrag=\"#spellbook-search, #shortcuts_list, .spell\"\r\n scale={scale}\r\n >\r\n <Container>\r\n <Title>Learned Spells</Title>\r\n\r\n <ShortcutsSetter\r\n setSettingShortcutIndex={setSettingShortcutIndex}\r\n settingShortcutIndex={settingShortcutIndex}\r\n shortcuts={shortcuts}\r\n removeShortcut={removeShortcut}\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n />\r\n\r\n <Input\r\n placeholder=\"Search for spell\"\r\n value={search}\r\n onChange={e => setSearch(e.target.value)}\r\n onFocus={onInputFocus}\r\n onBlur={onInputBlur}\r\n id=\"spellbook-search\"\r\n />\r\n\r\n <SpellList>\r\n {spellsToDisplay.map(spell => (\r\n <Fragment key={spell.key}>\r\n <Spell\r\n charMana={mana}\r\n charMagicLevel={magicLevel}\r\n onPointerUp={\r\n settingShortcutIndex !== -1 ? setShortcut : onSpellClick\r\n }\r\n spellKey={spell.key}\r\n isSettingShortcut={settingShortcutIndex !== -1}\r\n spell={spell}\r\n activeCooldown={\r\n spellCooldowns?.[spell.magicWords.replaceAll(' ', '_')]\r\n }\r\n {...spell}\r\n />\r\n </Fragment>\r\n ))}\r\n </SpellList>\r\n </Container>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst Title = styled.h1`\r\n font-size: ${uiFonts.size.large} !important;\r\n margin-bottom: 0 !important;\r\n \r\n`;\r\n\r\nconst Container = styled.div`\r\n width: 100%;\r\n height: 100%;\r\n color: white;\r\n display: flex;\r\n flex-direction: column;\r\n \r\n`;\r\n\r\nconst SpellList = styled.div`\r\n width: 100%;\r\n min-height: 0;\r\n flex: 1;\r\n overflow-y: auto;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 1.5rem;\r\n margin-top: 1rem;\r\n`;\r\n","import React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nimport { PeriodOfDay } from '@rpg-engine/shared';\r\nimport AfternoonGif from './gif/afternoon.gif';\r\nimport MorningGif from './gif/morning.gif';\r\nimport NightGif from './gif/night.gif';\r\n\r\nexport interface IPeriodOfDayDisplayProps {\r\n periodOfDay: PeriodOfDay;\r\n}\r\n\r\nexport const DayNightPeriod: React.FC<IPeriodOfDayDisplayProps> = ({\r\n periodOfDay,\r\n}) => {\r\n const periodOfDaySrcFiles = {\r\n [PeriodOfDay.Morning]: MorningGif,\r\n [PeriodOfDay.Afternoon]: AfternoonGif,\r\n [PeriodOfDay.Night]: NightGif,\r\n };\r\n\r\n return (\r\n <GifContainer>\r\n <img src={periodOfDaySrcFiles[periodOfDay]} />\r\n </GifContainer>\r\n );\r\n};\r\n\r\nconst GifContainer = styled.div`\r\n width: 100%;\r\n\r\n img {\r\n width: 67%;\r\n }\r\n`;\r\n","import { PeriodOfDay } from '@rpg-engine/shared';\r\nimport React from 'react';\r\nimport Draggable from 'react-draggable';\r\nimport styled from 'styled-components';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport { DayNightPeriod } from './DayNightPeriod/DayNightPeriod';\r\n\r\nimport ClockWidgetImg from './img/clockwidget.png';\r\n\r\nexport interface IClockWidgetProps {\r\n onClose?: () => void;\r\n TimeClock: string;\r\n periodOfDay: PeriodOfDay;\r\n scale?: number;\r\n}\r\n\r\nexport const TimeWidget: React.FC<IClockWidgetProps> = ({\r\n onClose,\r\n TimeClock,\r\n periodOfDay,\r\n scale,\r\n}) => {\r\n return (\r\n <Draggable scale={scale}>\r\n <WidgetContainer>\r\n <CloseButton onPointerDown={onClose}>X</CloseButton>\r\n <DayNightContainer>\r\n <DayNightPeriod periodOfDay={periodOfDay} />\r\n </DayNightContainer>\r\n <Time>{TimeClock}</Time>\r\n </WidgetContainer>\r\n </Draggable>\r\n );\r\n};\r\n\r\nconst WidgetContainer = styled.div`\r\n background-image: url(${ClockWidgetImg});\r\n background-size: 10rem;\r\n background-repeat: no-repeat;\r\n width: 10rem;\r\n position: absolute;\r\n height: 100px;\r\n`;\r\n\r\nconst Time = styled.div`\r\n top: 0.75rem;\r\n right: 0.5rem;\r\n position: absolute;\r\n font-size: ${uiFonts.size.small};\r\n color: white;\r\n`;\r\n\r\nconst CloseButton = styled.p`\r\n position: absolute;\r\n top: -0.5rem;\r\n margin: 0;\r\n right: -0.2rem;\r\n font-size: ${uiFonts.size.small} !important;\r\n z-index: 1;\r\n`;\r\n\r\nconst DayNightContainer = styled.div`\r\n margin-top: -0.3rem;\r\n margin-left: -0.3rem;\r\n`;\r\n","import {\r\n getItemTextureKeyPath,\r\n IEquipmentSet,\r\n ITradeResponseItem,\r\n} from '@rpg-engine/shared';\r\nimport capitalize from 'lodash/capitalize';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { uiColors } from '../../constants/uiColors';\r\nimport { uiFonts } from '../../constants/uiFonts';\r\nimport SelectArrow from '../Arrow/SelectArrow';\r\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\r\nimport { Ellipsis } from '../shared/Ellipsis';\r\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\r\nexport interface ITradeComponentProps {\r\n traderItem: ITradeResponseItem;\r\n onQuantityChange: (\r\n traderItem: ITradeResponseItem,\r\n selectedQty: number\r\n ) => void;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n selectedQty: number;\r\n equipmentSet?: IEquipmentSet | null;\r\n scale?: number;\r\n}\r\n\r\nconst outerQty = 10;\r\n\r\nexport const TradingItemRow: React.FC<ITradeComponentProps> = ({\r\n atlasIMG,\r\n atlasJSON,\r\n onQuantityChange,\r\n traderItem,\r\n selectedQty,\r\n equipmentSet,\r\n scale,\r\n}) => {\r\n const onLeftClick = (qty = 1) => {\r\n onQuantityChange(traderItem, Math.max(0, selectedQty - qty));\r\n };\r\n\r\n const onRightClick = (qty = 1) => {\r\n onQuantityChange(\r\n traderItem,\r\n Math.min(traderItem.stackQty ?? 999, selectedQty + qty)\r\n );\r\n };\r\n\r\n return (\r\n <ItemWrapper>\r\n <ItemIconContainer>\r\n <SpriteContainer>\r\n <ItemInfoWrapper\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n equipmentSet={equipmentSet}\r\n item={traderItem}\r\n scale={scale}\r\n >\r\n <SpriteFromAtlas\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n spriteKey={getItemTextureKeyPath(\r\n {\r\n key: traderItem.key,\r\n stackQty: traderItem.stackQty || 1,\r\n texturePath: traderItem.texturePath,\r\n isStackable: traderItem.isStackable,\r\n },\r\n atlasJSON\r\n )}\r\n imgScale={2.5}\r\n />\r\n </ItemInfoWrapper>\r\n </SpriteContainer>\r\n </ItemIconContainer>\r\n\r\n <ItemNameContainer>\r\n <NameValue>\r\n <p>\r\n <Ellipsis maxLines={1} maxWidth=\"250px\">\r\n {capitalize(traderItem.name)}\r\n </Ellipsis>\r\n </p>\r\n <p>${traderItem.price}</p>\r\n </NameValue>\r\n </ItemNameContainer>\r\n <QuantityContainer>\r\n <SelectArrow\r\n size={32}\r\n className=\"arrow-selector\"\r\n direction=\"left\"\r\n onPointerDown={onLeftClick.bind(null, outerQty)}\r\n />\r\n <StyledArrow\r\n size={32}\r\n className=\"arrow-selector\"\r\n direction=\"left\"\r\n onPointerDown={onLeftClick}\r\n />\r\n <QuantityDisplay>\r\n <TextOverlay>\r\n <Item>{selectedQty}</Item>\r\n </TextOverlay>\r\n </QuantityDisplay>\r\n <StyledArrow\r\n size={32}\r\n className=\"arrow-selector\"\r\n direction=\"right\"\r\n onPointerDown={onRightClick}\r\n />\r\n <SelectArrow\r\n size={32}\r\n className=\"arrow-selector\"\r\n direction=\"right\"\r\n onPointerDown={onRightClick.bind(null, outerQty)}\r\n />\r\n </QuantityContainer>\r\n </ItemWrapper>\r\n );\r\n};\r\n\r\nconst StyledArrow = styled(SelectArrow)`\r\n margin: 40px;\r\n`;\r\n\r\nconst ItemWrapper = styled.div`\r\n width: 100%;\r\n margin: auto;\r\n display: flex;\r\n justify-content: space-between;\r\n margin-bottom: 1rem;\r\n\r\n &:hover {\r\n background-color: ${uiColors.darkGray};\r\n }\r\n padding: 0.5rem;\r\n`;\r\n\r\nconst ItemNameContainer = styled.div`\r\n flex: 60%;\r\n`;\r\n\r\nconst ItemIconContainer = styled.div`\r\n display: flex;\r\n justify-content: flex-start;\r\n align-items: center;\r\n\r\n flex: 0 0 58px;\r\n`;\r\n\r\nconst SpriteContainer = styled.div`\r\n position: relative;\r\n top: -0.5rem;\r\n left: 0.5rem;\r\n`;\r\n\r\nconst NameValue = styled.div`\r\n p {\r\n font-size: 0.75rem;\r\n margin: 0;\r\n }\r\n`;\r\n\r\nconst Item = styled.span`\r\n color: white;\r\n text-align: center;\r\n z-index: 1;\r\n\r\n width: 100%;\r\n`;\r\n\r\nconst TextOverlay = styled.div`\r\n width: 100%;\r\n position: relative;\r\n`;\r\n\r\ninterface IContainerProps {\r\n percentageWidth?: number;\r\n minWidth?: number;\r\n style?: Record<string, any>;\r\n}\r\n\r\nconst QuantityContainer = styled.div<IContainerProps>`\r\n position: relative;\r\n display: flex;\r\n\r\n min-width: 100px;\r\n width: 40%;\r\n justify-content: center;\r\n align-items: center;\r\n\r\n flex: 40%;\r\n`;\r\n\r\nconst QuantityDisplay = styled.div`\r\n font-size: ${uiFonts.size.small};\r\n`;\r\n","import {\r\n IEquipmentSet,\r\n ITradeRequestItem,\r\n ITradeResponseItem,\r\n TradeTransactionType,\r\n} from '@rpg-engine/shared';\r\nimport React, { useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { Button, ButtonTypes } from '../Button';\r\nimport { DraggableContainer } from '../DraggableContainer';\r\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\r\nimport { TradingItemRow } from './TradingItemRow';\r\n\r\nexport interface ITradingMenu {\r\n traderItems: ITradeResponseItem[];\r\n onClose: () => void;\r\n onConfirm: (items: ITradeRequestItem[]) => void;\r\n type: TradeTransactionType;\r\n atlasJSON: any;\r\n atlasIMG: any;\r\n characterAvailableGold: number;\r\n equipmentSet?: IEquipmentSet | null;\r\n scale?: number;\r\n}\r\n\r\nexport const TradingMenu: React.FC<ITradingMenu> = ({\r\n traderItems,\r\n onClose,\r\n type,\r\n atlasJSON,\r\n atlasIMG,\r\n characterAvailableGold,\r\n onConfirm,\r\n equipmentSet,\r\n scale,\r\n}) => {\r\n const [sum, setSum] = useState(0);\r\n const [qtyMap, setQtyMap] = useState(new Map());\r\n\r\n const onQuantityChange = (item: ITradeResponseItem, selectedQty: number) => {\r\n setQtyMap(new Map(qtyMap.set(item.key, selectedQty)));\r\n\r\n let newSum = 0;\r\n traderItems.forEach(item => {\r\n const qty = qtyMap.get(item.key);\r\n if (qty) newSum += qty * item.price;\r\n setSum(newSum);\r\n });\r\n };\r\n\r\n const isBuy = () => {\r\n return type == 'buy';\r\n };\r\n\r\n const hasGoldForSale = () => {\r\n if (isBuy()) {\r\n return !(sum > characterAvailableGold);\r\n }\r\n return true;\r\n };\r\n\r\n const getFinalGold = () => {\r\n if (isBuy()) {\r\n return characterAvailableGold - sum;\r\n } else {\r\n return characterAvailableGold + sum;\r\n }\r\n };\r\n\r\n const Capitalize = (word: string) => {\r\n return word[0].toUpperCase() + word.substring(1);\r\n };\r\n\r\n const onConfirmClick = () => {\r\n const items: ITradeRequestItem[] = [];\r\n\r\n traderItems.forEach(item => {\r\n const qty = qtyMap.get(item.key);\r\n if (qty) {\r\n items.push(Object.assign({}, item, { qty: qty }));\r\n }\r\n });\r\n\r\n onConfirm(items);\r\n };\r\n\r\n return (\r\n <DraggableContainer\r\n type={RPGUIContainerTypes.Framed}\r\n onCloseButton={() => {\r\n if (onClose) onClose();\r\n }}\r\n width=\"600px\"\r\n cancelDrag=\"#TraderContainer\"\r\n scale={scale}\r\n >\r\n <>\r\n <div style={{ width: '100%' }}>\r\n <Title>{Capitalize(type)} Menu</Title>\r\n <hr className=\"golden\" />\r\n </div>\r\n <TradingComponentScrollWrapper id=\"TraderContainer\">\r\n {traderItems.map((tradeItem, index) => (\r\n <ItemWrapper key={`${tradeItem.key}_${index}`}>\r\n <TradingItemRow\r\n atlasIMG={atlasIMG}\r\n atlasJSON={atlasJSON}\r\n onQuantityChange={onQuantityChange}\r\n traderItem={tradeItem}\r\n selectedQty={qtyMap.get(tradeItem.key) ?? 0}\r\n equipmentSet={equipmentSet}\r\n scale={scale}\r\n />\r\n </ItemWrapper>\r\n ))}\r\n </TradingComponentScrollWrapper>\r\n <GoldWrapper>\r\n <p>Available Gold:</p>\r\n <p>${characterAvailableGold}</p>\r\n </GoldWrapper>\r\n <TotalWrapper>\r\n <p>Total:</p>\r\n <p>${sum}</p>\r\n </TotalWrapper>\r\n {!hasGoldForSale() ? (\r\n <AlertWrapper>\r\n <p> Sorry, not enough money.</p>\r\n </AlertWrapper>\r\n ) : (\r\n <GoldWrapper>\r\n <p>Final Gold:</p>\r\n <p>${getFinalGold()}</p>\r\n </GoldWrapper>\r\n )}\r\n\r\n <ButtonWrapper>\r\n <Button\r\n buttonType={ButtonTypes.RPGUIButton}\r\n disabled={!hasGoldForSale()}\r\n onPointerDown={() => onConfirmClick()}\r\n >\r\n Confirm\r\n </Button>\r\n <Button\r\n buttonType={ButtonTypes.RPGUIButton}\r\n onPointerDown={() => onClose()}\r\n >\r\n Cancel\r\n </Button>\r\n </ButtonWrapper>\r\n </>\r\n </DraggableContainer>\r\n );\r\n};\r\n\r\nconst Title = styled.h1`\r\n z-index: 22;\r\n font-size: 0.6rem;\r\n color: yellow !important;\r\n`;\r\n\r\nconst TradingComponentScrollWrapper = styled.div`\r\n overflow-y: scroll;\r\n height: 390px;\r\n width: 100%;\r\n margin-top: 1rem;\r\n`;\r\n\r\nconst ItemWrapper = styled.div`\r\n margin: auto;\r\n display: flex;\r\n justify-content: space-between;\r\n`;\r\n\r\nconst TotalWrapper = styled.div`\r\n margin-top: 1rem;\r\n display: flex;\r\n justify-content: space-between;\r\n height: 20px;\r\n p {\r\n color: white !important;\r\n }\r\n width: 100%;\r\n margin-left: 0.8rem;\r\n`;\r\n\r\nconst GoldWrapper = styled.div`\r\n margin-top: 1rem;\r\n display: flex;\r\n justify-content: space-between;\r\n height: 20px;\r\n p {\r\n color: yellow !important;\r\n }\r\n width: 100%;\r\n margin-left: 0.8rem;\r\n`;\r\n\r\nconst AlertWrapper = styled.div`\r\n margin-top: 1rem;\r\n display: flex;\r\n width: 100%;\r\n justify-content: center;\r\n height: 20px;\r\n p {\r\n color: red !important;\r\n }\r\n`;\r\n\r\nconst ButtonWrapper = styled.div`\r\n display: flex;\r\n justify-content: space-around;\r\n padding-top: 20px;\r\n width: 100%;\r\n margin-top: 1rem;\r\n button {\r\n padding: 0px 50px;\r\n }\r\n`;\r\n","/* eslint-disable react/require-default-props */\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\n\r\ninterface IProps {\r\n maxLines?: number;\r\n children: React.ReactNode;\r\n}\r\n\r\nexport const Truncate: React.FC<IProps> = ({ maxLines = 1, children }) => {\r\n return <Container maxLines={maxLines}>{children}</Container>;\r\n};\r\n\r\ninterface IContainerProps {\r\n maxLines: number;\r\n}\r\n\r\nconst Container = styled.div<IContainerProps>`\r\n display: -webkit-box;\r\n max-width: 100%;\r\n max-height: 100%;\r\n -webkit-line-clamp: ${props => props.maxLines};\r\n -webkit-box-orient: vertical;\r\n overflow: hidden;\r\n`;\r\n","import { isMobileOrTablet } from '@rpg-engine/shared';\r\n\r\nexport const IS_MOBILE_OR_TABLET = isMobileOrTablet();\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { NPCDialogType } from '../..';\r\nimport { IS_MOBILE_OR_TABLET } from '../../constants/uiDevices';\r\nimport { chunkString } from '../../libs/StringHelpers';\r\nimport { DynamicText } from '../typography/DynamicText';\r\nimport pressButtonGif from './img/press-button.gif';\r\nimport pressSpaceGif from './img/space.gif';\r\n\r\ninterface IProps {\r\n text: string;\r\n onClose: () => void;\r\n onEndStep?: () => void;\r\n onStartStep?: () => void;\r\n type?: NPCDialogType;\r\n}\r\n\r\nexport const NPCDialogText: React.FC<IProps> = ({\r\n text,\r\n onClose,\r\n onEndStep,\r\n onStartStep,\r\n type,\r\n}) => {\r\n const windowSize = useRef([window.innerWidth, window.innerHeight]);\r\n function maxCharacters(width: number) {\r\n // Set the font size to 16 pixels\r\n var fontSize = 11.2;\r\n\r\n // Calculate the number of characters that can fit in one line\r\n var charactersPerLine = Math.floor(width / 2 / fontSize);\r\n\r\n // Calculate the number of lines that can fit in the div\r\n var linesPerDiv = Math.floor(180 / fontSize);\r\n\r\n // Calculate the maximum number of characters that can fit in the div\r\n var maxCharacters = charactersPerLine * linesPerDiv;\r\n\r\n // Return the maximum number of characters\r\n return Math.round(maxCharacters / 5);\r\n }\r\n\r\n const textChunks = chunkString(text, maxCharacters(windowSize.current[0]));\r\n\r\n const [chunkIndex, setChunkIndex] = useState<number>(0);\r\n const onHandleSpacePress = (event: KeyboardEvent) => {\r\n if (event.code === 'Space') {\r\n goToNextStep();\r\n }\r\n };\r\n\r\n const goToNextStep = () => {\r\n const hasNextChunk = textChunks?.[chunkIndex + 1] || false;\r\n\r\n if (hasNextChunk) {\r\n setChunkIndex(prev => prev + 1);\r\n } else {\r\n // if there's no more text chunks, close the dialog\r\n onClose();\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n document.addEventListener('keydown', onHandleSpacePress);\r\n\r\n return () => document.removeEventListener('keydown', onHandleSpacePress);\r\n }, [chunkIndex]);\r\n\r\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\r\n false\r\n );\r\n\r\n return (\r\n <Container>\r\n <DynamicText\r\n text={textChunks?.[chunkIndex] || ''}\r\n onFinish={() => {\r\n setShowGoNextIndicator(true);\r\n\r\n onEndStep && onEndStep();\r\n }}\r\n onStart={() => {\r\n setShowGoNextIndicator(false);\r\n\r\n onStartStep && onStartStep();\r\n }}\r\n />\r\n {showGoNextIndicator && (\r\n <PressSpaceIndicator\r\n right={type === NPCDialogType.TextOnly ? '1rem' : '10.5rem'}\r\n src={IS_MOBILE_OR_TABLET ? pressButtonGif : pressSpaceGif}\r\n onPointerDown={() => {\r\n goToNextStep();\r\n }}\r\n />\r\n )}\r\n </Container>\r\n );\r\n};\r\n\r\nconst Container = styled.div``;\r\n\r\ninterface IPressSpaceIndicatorProps {\r\n right: string;\r\n}\r\n\r\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\r\n position: absolute;\r\n right: ${({ right }) => right};\r\n bottom: 1rem;\r\n height: 20.7px;\r\n image-rendering: -webkit-optimize-contrast;\r\n`;\r\n","export const chunkString = (str: string, length: number) => {\r\n return str.match(new RegExp('.{1,' + length + '}', 'g'));\r\n};\r\n","import React, { useEffect, useState } from 'react';\r\nimport styled from 'styled-components';\r\nimport { NPCDialog, NPCDialogType } from './NPCDialog/NPCDialog';\r\nimport { NPCMultiDialog, NPCMultiDialogType } from './NPCDialog/NPCMultiDialog';\r\nimport {\r\n IQuestionDialog,\r\n IQuestionDialogAnswer,\r\n QuestionDialog,\r\n} from './NPCDialog/QuestionDialog/QuestionDialog';\r\n\r\nexport interface IHistoryDialogProps {\r\n backgroundImgPath: string[];\r\n fullCoverBackground: boolean;\r\n questions?: IQuestionDialog[];\r\n answers?: IQuestionDialogAnswer[];\r\n text?: string;\r\n imagePath?: string;\r\n textAndTypeArray?: NPCMultiDialogType[];\r\n onClose: () => void;\r\n}\r\n\r\nexport const HistoryDialog: React.FC<IHistoryDialogProps> = ({\r\n backgroundImgPath,\r\n fullCoverBackground,\r\n questions,\r\n answers,\r\n text,\r\n imagePath,\r\n textAndTypeArray,\r\n onClose,\r\n}) => {\r\n const [img, setImage] = useState<number>(0);\r\n const onHandleSpacePress = (event: KeyboardEvent) => {\r\n if (event.code === 'Space') {\r\n if (img < backgroundImgPath?.length - 1) {\r\n setImage(prev => prev + 1);\r\n } else {\r\n // if there's no more text chunks, close the dialog\r\n onClose();\r\n }\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n document.addEventListener('keydown', onHandleSpacePress);\r\n\r\n return () => document.removeEventListener('keydown', onHandleSpacePress);\r\n }, [backgroundImgPath]);\r\n return (\r\n <BackgroundContainer\r\n imgPath={backgroundImgPath[img]}\r\n fullImg={fullCoverBackground}\r\n >\r\n <DialogContainer>\r\n {textAndTypeArray ? (\r\n <NPCMultiDialog\r\n textAndTypeArray={textAndTypeArray}\r\n onClose={onClose}\r\n />\r\n ) : questions && answers ? (\r\n <QuestionDialog\r\n questions={questions}\r\n answers={answers}\r\n onClose={onClose}\r\n />\r\n ) : text && imagePath ? (\r\n <NPCDialog\r\n text={text}\r\n imagePath={imagePath}\r\n onClose={onClose}\r\n type={NPCDialogType.TextAndThumbnail}\r\n />\r\n ) : (\r\n <NPCDialog\r\n text={text}\r\n onClose={onClose}\r\n type={NPCDialogType.TextOnly}\r\n />\r\n )}\r\n </DialogContainer>\r\n </BackgroundContainer>\r\n );\r\n};\r\n\r\ninterface IImgContainerProps {\r\n imgPath: string;\r\n fullImg: boolean;\r\n}\r\n\r\nconst BackgroundContainer = styled.div<IImgContainerProps>`\r\n width: 100%;\r\n height: 100%;\r\n background-image: url(${props => props.imgPath});\r\n background-size: ${props => (props.imgPath ? 'cover' : 'auto')};\r\n display: flex;\r\n justify-content: space-evenly;\r\n align-items: center;\r\n`;\r\n\r\nconst DialogContainer = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n padding-top: 200px;\r\n`;\r\n","import React, { useEffect, useState } from 'react';\r\n\r\nexport interface ICheckItems {\r\n label: string;\r\n value: string;\r\n}\r\n\r\nexport interface ICheckProps {\r\n items: ICheckItems[];\r\n onChange: (selectedValues: IChecklistSelectedValues) => void;\r\n}\r\n\r\nexport interface IChecklistSelectedValues {\r\n [label: string]: boolean;\r\n}\r\n\r\nexport const CheckButton: React.FC<ICheckProps> = ({ items, onChange }) => {\r\n const generateSelectedValuesList = () => {\r\n const selectedValues: IChecklistSelectedValues = {};\r\n\r\n items.forEach(item => {\r\n selectedValues[item.label] = false;\r\n });\r\n\r\n return selectedValues;\r\n };\r\n\r\n const [selectedValues, setSelectedValues] = useState<\r\n IChecklistSelectedValues\r\n >(generateSelectedValuesList());\r\n\r\n const handleClick = (label: string) => {\r\n setSelectedValues({\r\n ...selectedValues,\r\n [label]: !selectedValues[label],\r\n });\r\n };\r\n\r\n useEffect(() => {\r\n if (selectedValues) {\r\n onChange(selectedValues);\r\n }\r\n }, [selectedValues]);\r\n\r\n return (\r\n <div id=\"elemento-checkbox\">\r\n {items?.map((element, index) => {\r\n return (\r\n <div key={`${element.label}_${index}`}>\r\n <input\r\n className=\"rpgui-checkbox\"\r\n type=\"checkbox\"\r\n checked={selectedValues[element.label]}\r\n onChange={() => {}}\r\n />\r\n <label onPointerDown={() => handleClick(element.label)}>\r\n {element.label}\r\n </label>\r\n <br />\r\n </div>\r\n );\r\n })}\r\n </div>\r\n );\r\n};\r\n","import React, { useEffect, useState } from 'react';\r\n\r\nexport interface IRadioItems {\r\n label: string;\r\n value: string;\r\n}\r\n\r\nexport interface IRadioProps {\r\n name: string;\r\n items: IRadioItems[];\r\n onChange: (value: string) => void;\r\n}\r\n\r\nexport const InputRadio: React.FC<IRadioProps> = ({\r\n name,\r\n items,\r\n onChange,\r\n}) => {\r\n const [selectedValue, setSelectedValue] = useState<string>();\r\n const handleClick = () => {\r\n let element = document.querySelector(\r\n `input[name=${name}]:checked`\r\n ) as HTMLInputElement;\r\n const elementValue = element.value;\r\n setSelectedValue(elementValue);\r\n };\r\n\r\n useEffect(() => {\r\n if (selectedValue) {\r\n onChange(selectedValue);\r\n }\r\n }, [selectedValue]);\r\n\r\n return (\r\n <div id=\"elemento-radio\">\r\n {items.map(element => {\r\n return (\r\n <>\r\n <input\r\n key={element.value}\r\n className=\"rpgui-radio\"\r\n value={element.value}\r\n name={name}\r\n type=\"radio\"\r\n />\r\n <label onPointerDown={handleClick}>{element.label}</label>\r\n <br />\r\n </>\r\n );\r\n })}\r\n </div>\r\n );\r\n};\r\n","import React from 'react';\r\n\r\nexport interface ITextArea\r\n extends React.DetailedHTMLProps<\r\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\r\n HTMLTextAreaElement\r\n > {}\r\n\r\nexport const TextArea: React.FC<ITextArea> = ({ ...props }) => {\r\n return <textarea {...props} />;\r\n};\r\n"],"names":["ButtonTypes","RPGUIContainerTypes","Button","disabled","children","buttonType","onPointerDown","props","React","ButtonContainer","className","styled","button","displayName","componentId","SpriteFromAtlas","atlasJSON","atlasIMG","spriteKey","_ref$width","width","GRID_WIDTH","_ref$height","height","GRID_HEIGHT","_ref$imgScale","imgScale","imgStyle","containerStyle","_ref$grayScale","grayScale","_ref$opacity","opacity","imgClassname","spriteData","frames","Error","Container","hasHover","style","ImgSprite","frame","scale","div","w","h","x","y","ErrorBoundary","args","_this","state","hasError","getDerivedStateFromError","_","_proto","componentDidCatch","error","errorInfo","console","render","this","Component","SelectArrow","direction","size","LeftArrow","RightArrow","span","Ellipsis","maxWidth","fontSize","center","maxLines","PropertySelect","item","availableProperties","onChange","useState","currentIndex","setCurrentIndex","propertiesLength","length","useEffect","JSON","stringify","TextOverlay","Item","name","index","Column","flex","flexWrap","alignItems","justifyContent","ChatContainer","TextField","input","MessagesContainer","Message","color","Form","form","buttonColor","buttonBackgroundColor","Input","rest","ref","innerRef","RPGUIContainer","type","CloseButton","CustomInput","CustomContainer","MessageText","p","SingleShortcut","useShortcutCooldown","onShortcutCast","shortcutCooldown","setShortcutCooldown","cooldownTimeout","useRef","current","clearTimeout","setTimeout","handleShortcutCast","log","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","id","handleClickOutside","event","contains","target","CustomEvent","detail","document","dispatchEvent","addEventListener","removeEventListener","RangeSliderType","DraggableContainer","_ref$type","FramedGold","onCloseButton","title","imgSrc","_ref$imgWidth","imgWidth","cancelDrag","onPositionChange","onPositionChangeEnd","onPositionChangeStart","onOutsideClick","_ref$initialPosition","initialPosition","draggableRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","h1","img","InputRadio","label","value","onRadioSelect","onPointerUp","checked","isChecked","readOnly","countItemFromInventory","itemKey","inventory","itemsFromInventory","Object","keys","slots","forEach","i","parseInt","_inventory$slots$inde","key","push","reduce","acc","stackQty","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","RelativeListMenu","options","onSelected","_ref$fontSize","pos","overflow","map","params","ListElement","text","li","MobileItemTooltip","closeTooltip","equipmentSet","_ref$scale","handleFadeOut","_ref$current","classList","add","onTouchEnd","ItemInfoDisplay","isMobile","OptionsContainer","option","Option","generateContextMenuListOptions","actionsByTypeList","action","ItemSocketEventsDisplayLabels","EquipmentSlotSpriteByType","Neck","LeftHand","Ring","Head","Torso","Legs","Feet","Inventory","RightHand","Accessory","ItemSlot","observer","slotIndex","containerType","itemContainerType","slotSpriteMask","onMouseOver","onMouseOut","_ref$isContextMenuDis","isContextMenuDisabled","onDragEnd","onDragStart","onPlaceDrop","onDrop","onOutsideDrop","checkIfItemCanBeMoved","openQuantitySelector","checkIfItemShouldDragEnd","dragScale","isSelectingShortcut","setItemShortcut","isDepotSystem","isTooltipVisible","setTooltipVisible","isTooltipMobileVisible","setIsTooltipMobileVisible","isContextMenuVisible","setIsContextMenuVisible","contextMenuPosition","setContextMenuPosition","isFocused","setIsFocused","wasDragged","setWasDragged","dragPosition","setDragPosition","dropPosition","setDropPosition","dragContainer","contextActions","setContextActions","contextActionMenu","ItemContainerType","ItemType","Weapon","Armor","Jewelry","ActionsForInventory","Equipment","Consumable","CraftingResource","Tool","Other","DepotSocketEvents","Deposit","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","contextActionMenuDontHaveUseWith","find","toLowerCase","includes","hasUseWith","Depot","ItemSocketEvents","GetItemInfo","Withdraw","generateContextMenu","getStackInfo","itemId","qtyClassName","ItemQtyContainer","ItemQty","Math","round","resetItem","onSuccesfulDrag","quantity","onMouseUp","e","changedTouches","clientX","clientY","simulatedEvent","MouseEvent","bubbles","elementFromPoint","_document$elementFrom","axis","defaultClassName","split","isNaN","classes","Array","from","_e$target","some","elm","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isTouch","abs","position","ItemContainer","onMouseEnter","onMouseLeave","itemToRender","texturePath","allowedEquipSlotType","_itemToRender$allowed","element","_id","getItemTextureKeyPath","isStackable","stackInfo","uuidv4","renderEquipment","renderItem","onRenderSlot","ItemTooltip","optionId","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","statisticsToDisplay","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","stat","itemToCompareStatistic","toUpperCase","slice","Statistic","toString","Header","Rarity","Type","subType","AllowedSlots","slotType","minRequirements","LevelRequirement","level","skill","itemStatistic","isItemToCompare","isOnlyInOneItem","statDiff","_itemToCompare$stat$k2","isDifference","isBetter","renderStatistics","entityEffects","entityEffectChance","effect","usableEffectDescription","equippedBuffDescription","isTwoHanded","Description","description","maxStackSize","StackInfo","MissingStatistics","$isSpecial","itemSlotTypes","useMemo","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","values","Flex","CompareContainer","Equipped","$isMobile","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","ItemInfoWrapper","setIsTooltipVisible","bind","CraftingRecipe","recipe","handleRecipeSelect","selectedCraftItemKey","skills","modifyString","str","parts","words","replace","concat","join","levelInSkill","minCraftingRequirements","_recipe$minCraftingRe2","_skills","RadioOptionsWrapper","SpriteAtlasWrapper","canCraft","undefined","display","MinCraftingRequirementsText","levelIsOk","_recipe$minCraftingRe4","_recipe$minCraftingRe6","ingredients","ingredient","itemQtyInInventory","Recipe","Ingredient","isQuantityOk","qty","desktop","mobileLanscape","mobilePortrait","Wrapper","Subtitle","RadioInputScroller","ButtonWrapper","ContentContainer","ItemTypes","Dropdown","dropdownId","selectedValue","setSelectedValue","selectedOption","setSelectedOption","opened","setOpened","firstOption","change","filter","o","DropdownSelect","prev","DropdownOptions","ul","Details","EquipmentSetContainer","EquipmentColumn","SlotsContainer","onClose","Framed","ImgSide","RangeSlider","valueMin","valueMax","sliderId","containerRef","left","setLeft","calculatedWidth","_containerRef$current","clientWidth","max","typeClass","GoldSlider","pointerEvents","min","Number","ItemQuantitySelector","onConfirm","setValue","inputRef","focus","select","closeSelector","StyledContainer","StyledForm","onSubmit","preventDefault","numberValue","noValidate","StyledInput","placeholder","onBlur","newValue","Slider","RPGUIButton","ShortcutsSetter","setSettingShortcutIndex","settingShortcutIndex","shortcuts","removeShortcut","List","Shortcut","ShortcutType","None","isBeingSet","_shortcuts$index","payload","_shortcuts$index2","_shortcuts$index3","magicWords","word","getContent","ItemsContainer","QuantitySelectorContainer","MarketplaceRows","itemPrice","onHandleClick","MarketPlaceWrapper","ItemIconContainer","SpriteContainer","PriceValue","QuantityContainer","QuantityDisplay","onClick","InputWrapper","WrapperContainer","ItemComponentScrollWrapper","StyledDropdown","NPCDialogType","NPCMultiDialog","textAndTypeArray","showGoNextIndicator","setShowGoNextIndicator","slide","setSlide","onHandleSpacePress","code","_textAndTypeArray$sli","imageSide","TextContainer","NPCDialogText","onStartStep","onEndStep","ThumbnailContainer","NPCThumbnail","imagePath","aliceDefaultThumbnail","PressSpaceIndicator","right","pressSpaceGif","useEventListener","handler","el","savedHandler","listener","DynamicText","onFinish","textState","setTextState","interval","setInterval","substring","clearInterval","QuestionDialog","questions","answers","currentQuestion","setCurrentQuestion","canShowAnswers","setCanShowAnswers","onGetFirstAnswer","answerIds","firstAnswerId","answer","currentAnswer","setCurrentAnswer","onGetAnswers","answerId","nextAnswerIndex","findIndex","nextAnswerID","nextAnswer","previousAnswerIndex","previousAnswerID","previousAnswer","pop","nextQuestionId","question","QuestionContainer","AnswersContainer","isSelected","selectedColor","AnswerRow","AnswerSelectedIcon","Answer","onAnswerClick","onRenderCurrentAnswers","ProgressBarText","minWidth","percentageWidth","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","NoQuestContainer","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","SkillProgressBar","skillName","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","getSPForLevel","nextLevelSPWillbe","ratio","ProgressTitle","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","stamina","magic","magicResistance","strength","resistance","dexterity","combat","first","club","sword","axe","distance","shielding","dagger","crafting","fishing","mining","lumberjacking","blacksmithing","cooking","alchemy","skillNameMap","SkillsDraggableContainer","SkillsContainerDiv","SkillSplitDiv","SpellInfo","spell","manaCost","requiredItem","castingType","cooldown","maxDistanceGrid","charAt","formatSpellCastingType","SpellInfoDisplay","MobileSpellTooltip","MagicTooltip","SpellInfoWrapper","Spell","charMana","charMagicLevel","isSettingShortcut","activeCooldown","minMagicLevelRequired","spellKey","Overlay","SpellImage","toFixed","Info","Divider","Cost","SpellList","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","TradingItemRow","onQuantityChange","traderItem","selectedQty","onLeftClick","onRightClick","ItemWrapper","ItemNameContainer","NameValue","capitalize","price","StyledArrow","TradingComponentScrollWrapper","TotalWrapper","GoldWrapper","AlertWrapper","IS_MOBILE_OR_TABLET","isMobileOrTablet","charactersPerLine","linesPerDiv","windowSize","textChunks","floor","match","RegExp","chunkIndex","setChunkIndex","goToNextStep","TextOnly","NPCDialog","_ref$isQuestionDialog","isQuestionDialog","TextAndThumbnail","BackgroundContainer","imgPath","DialogContainer","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","paddingBottom","chatMessages","onSendChatMessage","onFocus","_ref$styles","styles","textColor","message","setMessage","scrollChatToBottom","scrollingElement","querySelector","scrollTop","scrollHeight","fallback","emitter","createdAt","dayjs","Date","format","onRenderMessageLines","onRenderChatMessages","trim","autoComplete","autoFocus","borderRadius","RxPaperPlane","FramedGrey","items","selectedValues","generateSelectedValuesList","setSelectedValues","onActionClick","onCancelClick","mana","spellCooldowns","onShortcutClick","onTouchStart","remove","buildClassName","classBase","isOnCooldown","variant","onShortcutClickBinded","_shortcuts$i","isOnShortcutCooldown","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","totalQty","_shortcuts$i4","spellCooldown","replaceAll","renderShortcut","onSelect","onCraftItem","craftablesItems","savedSelectedType","craftItemKey","setCraftItemKey","ItemSubType","selectedType","setSelectedType","setSize","handleResize","itemTypes","sort","a","b","localeCompare","rows","row","gap","renderItemTypes","details","onItemClick","onItemDragEnd","onItemDragStart","onItemPlaceDrop","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","itemContainer","itemType","ContainerType","backgroundImgPath","fullCoverBackground","setImage","fullImg","handleClick","_ref$disableContextMe","disableContextMenu","isOpen","maxQuantity","callback","_quantity","quantitySelect","setQuantitySelect","handleSetShortcut","slotQty","_itemContainer$slots","onRenderSlots","imageKey","optionsType","optionsRarity","optionsPrice","onChangeType","onChangeRarity","onChangeOrder","onChangeNameInput","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","npcId","quest","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","_shortcutsRefs$curren2","onRenderSkillCategory","category","skillCategory","skillCategoryColor","output","entries","skillDetails","experience","xpToNextLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","search","setSearch","handleEscapeClose","spellsToDisplay","toLocaleLowerCase","setShortcut","Fragment","TimeClock","traderItems","characterAvailableGold","sum","setSum","Map","qtyMap","setQtyMap","set","newSum","get","isBuy","hasGoldForSale","tradeItem","assign"],"mappings":"mkCAAO,ICIKA,0DAAAA,EAAAA,sBAAAA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