mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-31 10:22:36 +01:00
More updates
This commit is contained in:
parent
8f2446186f
commit
0218743efa
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"socket.url": "wss://ws.nitrots.co:2096",
|
"socket.url": "wss://ws.nitrots.co:2096",
|
||||||
"asset.url": "https://nitro-assets.hrw.pw",
|
"asset.url": "https://nitro.nitrots.co",
|
||||||
"image.library.url": "https://swf.hrw.pw/c_images/",
|
"image.library.url": "https://swf.nitrots.co/c_images/",
|
||||||
"external.samples.url": "https://swf.hrw.pw/dcr/hof_furni/mp3/sound_machine_sample_%sample%.mp3",
|
"external.samples.url": "https://swf.nitrots.co/dcr/hof_furni/mp3/sound_machine_sample_%sample%.mp3",
|
||||||
"image.library.notifications.url": "${image.library.url}notifications/%image%.png",
|
"image.library.notifications.url": "${image.library.url}notifications/%image%.png",
|
||||||
"achievements.images.url": "${image.library.url}Quests/%image%.png",
|
"achievements.images.url": "${image.library.url}Quests/%image%.png",
|
||||||
"thumbnails.url": "${image.library.url}camera/thumbnails/%thumbnail%.png",
|
"thumbnails.url": "${image.library.url}camera/thumbnails/%thumbnail%.png",
|
||||||
@ -10,8 +10,8 @@
|
|||||||
"gamedata.url": "${asset.url}/gamedata",
|
"gamedata.url": "${asset.url}/gamedata",
|
||||||
"sounds.url": "${asset.url}/sounds",
|
"sounds.url": "${asset.url}/sounds",
|
||||||
"external.texts.url": "${gamedata.url}/json/ExternalTexts.json",
|
"external.texts.url": "${gamedata.url}/json/ExternalTexts.json",
|
||||||
"furnidata.url": "https://gamedata.hrw.pw/gamedata/json/furnidata/1",
|
"furnidata.url": "https://nitro.nitrots.co/gamedata/json/FurnitureData.json",
|
||||||
"productdata.url": "https://gamedata.hrw.pw/gamedata/json/productdata/1",
|
"productdata.url": "https://nitro.nitrots.co/gamedata/json/ProductData.json",
|
||||||
"avatar.actions.url": "${gamedata.url}/json/HabboAvatarActions.json",
|
"avatar.actions.url": "${gamedata.url}/json/HabboAvatarActions.json",
|
||||||
"avatar.figuredata.url": "${gamedata.url}/habbo/figuredata.xml",
|
"avatar.figuredata.url": "${gamedata.url}/habbo/figuredata.xml",
|
||||||
"avatar.figuremap.url": "${gamedata.url}/json/FigureMap.json",
|
"avatar.figuremap.url": "${gamedata.url}/json/FigureMap.json",
|
||||||
@ -117,7 +117,7 @@
|
|||||||
"elephants"
|
"elephants"
|
||||||
],
|
],
|
||||||
"furni.asset.url": "${asset.url}/bundled/furniture/%libname%.nitro",
|
"furni.asset.url": "${asset.url}/bundled/furniture/%libname%.nitro",
|
||||||
"furni.asset.icon.url": "https://swf.hrw.pw/dcr/hof_furni/icons/%libname%%param%_icon.png",
|
"furni.asset.icon.url": "https://swf.nitrots.co/dcr/hof_furni/icons/%libname%%param%_icon.png",
|
||||||
"room.asset.url": "${asset.url}/room/%libname%/%libname%.json",
|
"room.asset.url": "${asset.url}/room/%libname%/%libname%.json",
|
||||||
"badge.asset.url": "${image.library.url}album1584/%badgename%.gif",
|
"badge.asset.url": "${image.library.url}album1584/%badgename%.gif",
|
||||||
"badge.asset.group.url": "${asset.url}/group-badge/%badgedata%",
|
"badge.asset.group.url": "${asset.url}/group-badge/%badgedata%",
|
||||||
|
@ -4,6 +4,7 @@ import { useConfigurationEvent } from './hooks/events/core/configuration/configu
|
|||||||
import { useLocalizationEvent } from './hooks/events/nitro/localization/localization-event';
|
import { useLocalizationEvent } from './hooks/events/nitro/localization/localization-event';
|
||||||
import { dispatchMainEvent, useMainEvent } from './hooks/events/nitro/main-event';
|
import { dispatchMainEvent, useMainEvent } from './hooks/events/nitro/main-event';
|
||||||
import { useRoomEngineEvent } from './hooks/events/nitro/room/room-engine-event';
|
import { useRoomEngineEvent } from './hooks/events/nitro/room/room-engine-event';
|
||||||
|
import { GetConfiguration } from './utils/GetConfiguration';
|
||||||
import { LoadingView } from './views/loading/LoadingView';
|
import { LoadingView } from './views/loading/LoadingView';
|
||||||
import { MainView } from './views/main/MainView';
|
import { MainView } from './views/main/MainView';
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ export function App(): JSX.Element
|
|||||||
{
|
{
|
||||||
const urls: string[] = [];
|
const urls: string[] = [];
|
||||||
|
|
||||||
const assetUrls = Nitro.instance.getConfiguration<string[]>('preload.assets.urls');
|
const assetUrls = GetConfiguration<string[]>('preload.assets.urls');
|
||||||
|
|
||||||
if(assetUrls && assetUrls.length)
|
if(assetUrls && assetUrls.length)
|
||||||
{
|
{
|
||||||
|
@ -349,7 +349,7 @@ $container-max-widths: (
|
|||||||
// Set the number of columns and specify the width of the gutters.
|
// Set the number of columns and specify the width of the gutters.
|
||||||
|
|
||||||
$grid-columns: 12 !default;
|
$grid-columns: 12 !default;
|
||||||
$grid-gutter-width: 1.5rem !default;
|
$grid-gutter-width: 1rem !default;
|
||||||
$grid-row-columns: 6 !default;
|
$grid-row-columns: 6 !default;
|
||||||
|
|
||||||
$gutters: $spacers !default;
|
$gutters: $spacers !default;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.fas {
|
.fas {
|
||||||
line-height: unset !important;
|
line-height: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
i {
|
i {
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 4px;
|
width: 4px;
|
||||||
|
height: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-track {
|
::-webkit-scrollbar-track {
|
||||||
|
border-radius: $border-radius;
|
||||||
background: rgba(transparent, 0.1);
|
background: rgba(transparent, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
|
border-radius: $border-radius;
|
||||||
background: rgba($white, 0.7);
|
background: rgba($white, 0.7);
|
||||||
width: 4px;
|
width: 4px;
|
||||||
}
|
}
|
||||||
|
@ -53,3 +53,7 @@ ul {
|
|||||||
.r-0 {
|
.r-0 {
|
||||||
right: 0 !important;
|
right: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filter-none {
|
||||||
|
filter: unset !important;
|
||||||
|
}
|
||||||
|
6
src/utils/GetConfiguration.ts
Normal file
6
src/utils/GetConfiguration.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import { Nitro } from 'nitro-renderer';
|
||||||
|
|
||||||
|
export function GetConfiguration<T>(key: string, value: T = null): T
|
||||||
|
{
|
||||||
|
return Nitro.instance.getConfiguration(key, value);
|
||||||
|
}
|
@ -1,9 +1,9 @@
|
|||||||
import { Nitro } from 'nitro-renderer';
|
import { GetConfiguration } from '../GetConfiguration';
|
||||||
import { CurrencyIconProps } from './CurrencyIcon.types';
|
import { CurrencyIconProps } from './CurrencyIcon.types';
|
||||||
|
|
||||||
export function CurrencyIcon(props: CurrencyIconProps): JSX.Element
|
export function CurrencyIcon(props: CurrencyIconProps): JSX.Element
|
||||||
{
|
{
|
||||||
let url = Nitro.instance.getConfiguration<string>('currency.asset.icon.url', '');
|
let url = GetConfiguration<string>('currency.asset.icon.url', '');
|
||||||
|
|
||||||
url = url.replace('%type%', props.type.toString());
|
url = url.replace('%type%', props.type.toString());
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Nitro } from 'nitro-renderer';
|
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
import { GetConfiguration } from '../../utils/GetConfiguration';
|
||||||
import { BadgeImageViewProps } from './BadgeImageView.types';
|
import { BadgeImageViewProps } from './BadgeImageView.types';
|
||||||
|
|
||||||
export const BadgeImageView: FC<BadgeImageViewProps> = props =>
|
export const BadgeImageView: FC<BadgeImageViewProps> = props =>
|
||||||
@ -10,11 +10,11 @@ export const BadgeImageView: FC<BadgeImageViewProps> = props =>
|
|||||||
{
|
{
|
||||||
if(isGroup)
|
if(isGroup)
|
||||||
{
|
{
|
||||||
return ((Nitro.instance.getConfiguration<string>('badge.asset.group.url')).replace('%badgedata%', badgeCode));
|
return ((GetConfiguration<string>('badge.asset.group.url')).replace('%badgedata%', badgeCode));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return ((Nitro.instance.getConfiguration<string>('badge.asset.url')).replace('%badgename%', badgeCode));
|
return ((GetConfiguration<string>('badge.asset.url')).replace('%badgename%', badgeCode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,6 @@ export const FriendListView: FC<FriendListViewProps> = props =>
|
|||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
if(!messengerSettings) return;
|
if(!messengerSettings) return;
|
||||||
|
|
||||||
console.log(messengerSettings);
|
|
||||||
}, [ messengerSettings ]);
|
}, [ messengerSettings ]);
|
||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import { Nitro } from 'nitro-renderer';
|
import { Nitro } from 'nitro-renderer';
|
||||||
|
import { GetConfiguration } from '../../utils/GetConfiguration';
|
||||||
import { HotelViewProps } from './HotelView.types';
|
import { HotelViewProps } from './HotelView.types';
|
||||||
|
|
||||||
export function HotelView(props: HotelViewProps): JSX.Element
|
export function HotelView(props: HotelViewProps): JSX.Element
|
||||||
{
|
{
|
||||||
const backgroundColor = Nitro.instance.getConfiguration('hotelview.images')['background.colour'];
|
const backgroundColor = GetConfiguration('hotelview.images')['background.colour'];
|
||||||
const background = Nitro.instance.core.configuration.interpolate(Nitro.instance.getConfiguration('hotelview.images')['background']);
|
const background = Nitro.instance.core.configuration.interpolate(GetConfiguration('hotelview.images')['background']);
|
||||||
const sun = Nitro.instance.core.configuration.interpolate(Nitro.instance.getConfiguration('hotelview.images')['sun']);
|
const sun = Nitro.instance.core.configuration.interpolate(GetConfiguration('hotelview.images')['sun']);
|
||||||
const drape = Nitro.instance.core.configuration.interpolate(Nitro.instance.getConfiguration('hotelview.images')['drape']);
|
const drape = Nitro.instance.core.configuration.interpolate(GetConfiguration('hotelview.images')['drape']);
|
||||||
const left = Nitro.instance.core.configuration.interpolate(Nitro.instance.getConfiguration('hotelview.images')['left']);
|
const left = Nitro.instance.core.configuration.interpolate(GetConfiguration('hotelview.images')['left']);
|
||||||
//const rightRepeat = Nitro.instance.core.configuration.interpolate(Nitro.instance.getConfiguration('hotelview.images')['right.repeat']);
|
//const rightRepeat = Nitro.instance.core.configuration.interpolate(GetConfiguration('hotelview.images')['right.repeat']);
|
||||||
//const right = Nitro.instance.core.configuration.interpolate(Nitro.instance.getConfiguration('hotelview.images')['right']);
|
//const right = Nitro.instance.core.configuration.interpolate(GetConfiguration('hotelview.images')['right']);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="nitro-hotel-view" style={ (backgroundColor && backgroundColor) ? { background: backgroundColor } : {} }>
|
<div className="nitro-hotel-view" style={ (backgroundColor && backgroundColor) ? { background: backgroundColor } : {} }>
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { Nitro, UserCreditsEvent, UserCurrencyComposer, UserCurrencyEvent, UserCurrencyUpdateEvent } from 'nitro-renderer';
|
import { UserCreditsEvent, UserCurrencyComposer, UserCurrencyEvent, UserCurrencyUpdateEvent } from 'nitro-renderer';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
import { CreateMessageHook, SendMessageHook } from '../../hooks/messages/message-event';
|
import { CreateMessageHook, SendMessageHook } from '../../hooks/messages/message-event';
|
||||||
import { TransitionAnimation } from '../../transitions/TransitionAnimation';
|
import { TransitionAnimation } from '../../transitions/TransitionAnimation';
|
||||||
import { TransitionAnimationTypes } from '../../transitions/TransitionAnimation.types';
|
import { TransitionAnimationTypes } from '../../transitions/TransitionAnimation.types';
|
||||||
|
import { GetConfiguration } from '../../utils/GetConfiguration';
|
||||||
import { CurrencySet } from './currency/CurrencySet';
|
import { CurrencySet } from './currency/CurrencySet';
|
||||||
import { CurrencyView } from './currency/CurrencyView';
|
import { CurrencyView } from './currency/CurrencyView';
|
||||||
import { PurseViewProps } from './PurseView.types';
|
import { PurseViewProps } from './PurseView.types';
|
||||||
@ -12,7 +13,7 @@ export function PurseView(props: PurseViewProps): JSX.Element
|
|||||||
const [ currencies, setCurrencies ] = useState<CurrencySet[]>([ new CurrencySet(-1, 0) ]);
|
const [ currencies, setCurrencies ] = useState<CurrencySet[]>([ new CurrencySet(-1, 0) ]);
|
||||||
const [ isReady, setIsReady ] = useState(false);
|
const [ isReady, setIsReady ] = useState(false);
|
||||||
|
|
||||||
const displayedCurrencies = Nitro.instance.getConfiguration<number[]>('system.currency.types', []);
|
const displayedCurrencies = GetConfiguration<number[]>('system.currency.types', []);
|
||||||
|
|
||||||
const onUserCreditsEvent = useCallback((event: UserCreditsEvent) =>
|
const onUserCreditsEvent = useCallback((event: UserCreditsEvent) =>
|
||||||
{
|
{
|
||||||
@ -76,7 +77,7 @@ export function PurseView(props: PurseViewProps): JSX.Element
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TransitionAnimation className="nitro-purse position-relative mb-1" type={ TransitionAnimationTypes.FADE_DOWN } inProp={ isReady } timeout={ 300 }>
|
<TransitionAnimation className="nitro-purse position-relative mb-1" type={ TransitionAnimationTypes.FADE_DOWN } inProp={ isReady } timeout={ 300 }>
|
||||||
<div className="row px-0 mx-0">
|
<div className="row row-cols-2 g-0">
|
||||||
{ currencies && currencies.map((set, index) =>
|
{ currencies && currencies.map((set, index) =>
|
||||||
{
|
{
|
||||||
if(displayedCurrencies.indexOf(set.type) === -1) return null;
|
if(displayedCurrencies.indexOf(set.type) === -1) return null;
|
||||||
|
@ -1,9 +1,2 @@
|
|||||||
.nitro-currency {
|
.nitro-currency {
|
||||||
flex: 46%;
|
|
||||||
margin-right: 3px;
|
|
||||||
|
|
||||||
&:nth-child(2n),
|
|
||||||
&:last-child {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -7,21 +7,39 @@ import { CurrencyViewProps } from './CurrencyView.types';
|
|||||||
export function CurrencyView(props: CurrencyViewProps): JSX.Element
|
export function CurrencyView(props: CurrencyViewProps): JSX.Element
|
||||||
{
|
{
|
||||||
const { currencySet = null } = props;
|
const { currencySet = null } = props;
|
||||||
|
|
||||||
|
const [ firstRender, setFirstRender ] = useState(true);
|
||||||
const [ isAnimating, setIsAnimating ] = useState(false);
|
const [ isAnimating, setIsAnimating ] = useState(false);
|
||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
|
if(firstRender)
|
||||||
|
{
|
||||||
|
setFirstRender(false);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setIsAnimating(true);
|
setIsAnimating(true);
|
||||||
|
|
||||||
const timeout = setTimeout(() => setIsAnimating(false), 1000);
|
let timeout = setTimeout(() =>
|
||||||
|
{
|
||||||
|
setIsAnimating(false)
|
||||||
|
|
||||||
|
timeout = null
|
||||||
|
}, 300);
|
||||||
|
|
||||||
return () => clearTimeout(timeout);
|
return () => clearTimeout(timeout);
|
||||||
}, []);
|
}, [ firstRender, currencySet ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TransitionAnimation className="d-flex bg-primary rounded shadow border border-black mb-1 p-1 nitro-currency" type={ TransitionAnimationTypes.HEAD_SHAKE } inProp={ isAnimating } timeout={ 300 }>
|
<TransitionAnimation type={ TransitionAnimationTypes.FADE_IN } inProp={ isAnimating } timeout={ 300 }>
|
||||||
<div className="d-flex flex-grow-1 align-items-center justify-content-end">{ currencySet.amount }</div>
|
<div className="col pe-1 pb-1">
|
||||||
<div className="bg-secondary rounded ml-1"><CurrencyIcon type={ currencySet.type } /></div>
|
<div className="d-flex bg-primary rounded border overflow-hidden">
|
||||||
|
<div className="d-flex flex-grow-1 align-items-center justify-content-end pe-1">{ currencySet.amount }</div>
|
||||||
|
<div className="bg-secondary"><CurrencyIcon type={ currencySet.type } /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</TransitionAnimation>
|
</TransitionAnimation>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ export function RoomHostView(props: RoomHostViewProps): JSX.Element
|
|||||||
{
|
{
|
||||||
if(RoomId.isRoomPreviewerId(event.roomId)) return;
|
if(RoomId.isRoomPreviewerId(event.roomId)) return;
|
||||||
|
|
||||||
const session = GetRoomSession(event.roomId);
|
const session = GetRoomSession();
|
||||||
|
|
||||||
if(!session) return;
|
if(!session) return;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ export function FurnitureStickieView(props: FurnitureStickieViewProps): JSX.Elem
|
|||||||
color = data;
|
color = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
setStickieData(new FurnitureStickieData(widgetEvent.objectId, widgetEvent.category, color, text, (GetRoomSession(widgetEvent.roomId).isRoomOwner || GetSessionDataManager().isModerator), false));
|
setStickieData(new FurnitureStickieData(widgetEvent.objectId, widgetEvent.category, color, text, (GetRoomSession().isRoomOwner || GetSessionDataManager().isModerator), false));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case RoomWidgetRoomObjectUpdateEvent.FURNI_REMOVED: {
|
case RoomWidgetRoomObjectUpdateEvent.FURNI_REMOVED: {
|
||||||
@ -124,7 +124,7 @@ export function FurnitureStickieView(props: FurnitureStickieViewProps): JSX.Elem
|
|||||||
<div className="nitro-stickie-image stickie-trash header-trash" onClick={ event => processAction('trash') }></div>
|
<div className="nitro-stickie-image stickie-trash header-trash" onClick={ event => processAction('trash') }></div>
|
||||||
{ STICKIE_COLORS.map((color, index) =>
|
{ STICKIE_COLORS.map((color, index) =>
|
||||||
{
|
{
|
||||||
return <div className="stickie-color ml-1" key={ index } onClick={ event => processAction('changeColor', color) } style={ {backgroundColor: ColorUtils.makeColorHex(color) } } />
|
return <div className="stickie-color ms-1" key={ index } onClick={ event => processAction('changeColor', color) } style={ {backgroundColor: ColorUtils.makeColorHex(color) } } />
|
||||||
})}
|
})}
|
||||||
</> }
|
</> }
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user