diff --git a/public/renderer-config.json b/public/renderer-config.json index c6fa1e3a..bf3a12a3 100644 --- a/public/renderer-config.json +++ b/public/renderer-config.json @@ -22,6 +22,8 @@ "generic.asset.url": "${asset.url}/bundled/generic/%libname%.nitro", "badge.asset.url": "${image.library.url}album1584/%badgename%.gif", "badge.asset.group.url": "https://cdn.ironhotel.biz/group-badge/%badgedata%.gif", + "badge.asset.group.external.url": "", + "badge.asset.grouparts.url": "https://cdn.ironhotel.biz/static_iron_active/c_images/Badgeparts/badgepart_%part%.png", "furni.rotation.bounce.steps": 20, "furni.rotation.bounce.height": 0.0625, "enable.avatar.arrow": false, diff --git a/src/api/nitro/room/widgets/handlers/RoomWidgetInfostandHandler.ts b/src/api/nitro/room/widgets/handlers/RoomWidgetInfostandHandler.ts index 8693cb23..1ee584ce 100644 --- a/src/api/nitro/room/widgets/handlers/RoomWidgetInfostandHandler.ts +++ b/src/api/nitro/room/widgets/handlers/RoomWidgetInfostandHandler.ts @@ -522,7 +522,7 @@ export class RoomWidgetInfostandHandler extends RoomWidgetHandler } event.groupId = parseInt(userData.guildId); - //event._Str_5235 = GetSessionDataManager()._Str_17173(int(userData._Str_4592)); + event.groupBadgeId = GetSessionDataManager().getGroupBadge(event.groupId); event.groupName = userData.groupName; event.badges = this.container.roomSession.userDataManager.getUserBadges(userData.webID); event.figure = userData.figure; diff --git a/src/assets/images/groups/icons/group_favorite.png b/src/assets/images/groups/icons/group_favorite.png new file mode 100644 index 00000000..4cd734d1 Binary files /dev/null and b/src/assets/images/groups/icons/group_favorite.png differ diff --git a/src/assets/images/groups/icons/group_notfavorite.png b/src/assets/images/groups/icons/group_notfavorite.png new file mode 100644 index 00000000..835d8eb7 Binary files /dev/null and b/src/assets/images/groups/icons/group_notfavorite.png differ diff --git a/src/assets/styles/icons.scss b/src/assets/styles/icons.scss index 889f6c82..fe595b1b 100644 --- a/src/assets/styles/icons.scss +++ b/src/assets/styles/icons.scss @@ -591,6 +591,18 @@ height: 20px; } + &.icon-group-favorite { + background: url('../images/groups/icons/group_favorite.png'); + width: 14px; + height: 14px; + } + + &.icon-group-not-favorite { + background: url('../images/groups/icons/group_notfavorite.png'); + width: 14px; + height: 14px; + } + &.icon-navigator-info { background: url('../images/navigator/icons/info.png'); width: 18px; diff --git a/src/views/room/widgets/infostand/views/user/InfoStandWidgetUserView.tsx b/src/views/room/widgets/infostand/views/user/InfoStandWidgetUserView.tsx index 92a873b4..c952eff7 100644 --- a/src/views/room/widgets/infostand/views/user/InfoStandWidgetUserView.tsx +++ b/src/views/room/widgets/infostand/views/user/InfoStandWidgetUserView.tsx @@ -1,6 +1,7 @@ import { RelationshipStatusInfoEvent, RelationshipStatusInfoMessageParser, RoomSessionUserBadgesEvent, UserRelationshipsComposer } from '@nitrots/nitro-renderer'; +import classNames from 'classnames'; import { FC, FocusEvent, KeyboardEvent, useCallback, useEffect, useState } from 'react'; -import { LocalizeText, RoomWidgetChangeMottoMessage, RoomWidgetUpdateInfostandUserEvent } from '../../../../../../api'; +import { GetGroupInformation, LocalizeText, RoomWidgetChangeMottoMessage, RoomWidgetUpdateInfostandUserEvent } from '../../../../../../api'; import { CreateMessageHook, SendMessageHook } from '../../../../../../hooks'; import { CreateEventDispatcherHook } from '../../../../../../hooks/events'; import { AvatarImageView } from '../../../../../shared/avatar-image/AvatarImageView'; @@ -82,7 +83,7 @@ export const InfoStandWidgetUserView: FC = props = return (
-
+
@@ -98,26 +99,26 @@ export const InfoStandWidgetUserView: FC = props =
- { badges[0] && } + { badges[0] && }
-
- { userData.groupId > 0 && } +
0 }) } onClick={ () => GetGroupInformation(userData.groupId) }> + { userData.groupId > 0 && }
- { badges[1] && } + { badges[1] && }
- { badges[2] && } + { badges[2] && }
- { badges[3] && } + { badges[3] && }
- { badges[4] && } + { badges[4] && }
diff --git a/src/views/shared/badge-image/BadgeImage.scss b/src/views/shared/badge-image/BadgeImage.scss index bce21ef4..d7067045 100644 --- a/src/views/shared/badge-image/BadgeImage.scss +++ b/src/views/shared/badge-image/BadgeImage.scss @@ -4,4 +4,16 @@ height: 100%; background-repeat: no-repeat; background-position: center; + + .badge-information { + display: none; + } + + &:hover { + .badge-information { + display: block; + } + } + + @import './badge-info/BadgeInformationView'; } diff --git a/src/views/shared/badge-image/BadgeImageView.tsx b/src/views/shared/badge-image/BadgeImageView.tsx index 35ca8d7d..c815f7f7 100644 --- a/src/views/shared/badge-image/BadgeImageView.tsx +++ b/src/views/shared/badge-image/BadgeImageView.tsx @@ -1,10 +1,11 @@ import { FC } from 'react'; -import { GetConfiguration } from '../../../api'; +import { GetConfiguration, LocalizeBadgeDescription, LocalizeBadgeName, LocalizeText } from '../../../api'; +import { BadgeInformationView } from './badge-info/BadgeInformationView'; import { BadgeImageViewProps } from './BadgeImageView.types'; export const BadgeImageView: FC = props => { - const { badgeCode = null, isGroup = false } = props; + const { badgeCode = null, isGroup = false, showInfo = false, customTitle = null } = props; function getBadgeUrl(): string { @@ -20,5 +21,7 @@ export const BadgeImageView: FC = props => const url = `url('${ getBadgeUrl() }')`; - return
; + return
+ { showInfo && } +
; } diff --git a/src/views/shared/badge-image/BadgeImageView.types.ts b/src/views/shared/badge-image/BadgeImageView.types.ts index 73207a60..76fba1c5 100644 --- a/src/views/shared/badge-image/BadgeImageView.types.ts +++ b/src/views/shared/badge-image/BadgeImageView.types.ts @@ -2,4 +2,6 @@ export interface BadgeImageViewProps { badgeCode: string; isGroup?: boolean; + showInfo?: boolean; + customTitle?: string; } diff --git a/src/views/shared/badge-image/badge-info/BadgeInformationView.scss b/src/views/shared/badge-image/badge-info/BadgeInformationView.scss new file mode 100644 index 00000000..33b11dff --- /dev/null +++ b/src/views/shared/badge-image/badge-info/BadgeInformationView.scss @@ -0,0 +1,22 @@ +.badge-information { + position: absolute; + pointer-events: none; + user-select: none; + width: 260px; + border-radius: $border-radius; + background: $white; + left: -270px; + z-index: 100; + + &:before { + position: absolute; + content: ' '; + width: 0; + height: 0; + border-left: 10px solid $white; + border-bottom: 10px solid transparent; + border-top: 10px solid transparent; + top: 10px; + right: -10px; + } +} diff --git a/src/views/shared/badge-image/badge-info/BadgeInformationView.tsx b/src/views/shared/badge-image/badge-info/BadgeInformationView.tsx new file mode 100644 index 00000000..5d982d5d --- /dev/null +++ b/src/views/shared/badge-image/badge-info/BadgeInformationView.tsx @@ -0,0 +1,14 @@ +import { FC } from 'react'; +import { BadgeInformationViewProps } from './BadgeInformationView.types'; + +export const BadgeInformationView: FC = props => +{ + const { title = null, description = null } = props; + + return ( +
+
{ title }
+
{ description }
+
+ ); +}; diff --git a/src/views/shared/badge-image/badge-info/BadgeInformationView.types.ts b/src/views/shared/badge-image/badge-info/BadgeInformationView.types.ts new file mode 100644 index 00000000..dcabc965 --- /dev/null +++ b/src/views/shared/badge-image/badge-info/BadgeInformationView.types.ts @@ -0,0 +1,5 @@ +export interface BadgeInformationViewProps +{ + title: string; + description: string; +} diff --git a/src/views/user-profile/views/groups-container/GroupsContainerView.scss b/src/views/user-profile/views/groups-container/GroupsContainerView.scss index 0389d704..c4d8b17e 100644 --- a/src/views/user-profile/views/groups-container/GroupsContainerView.scss +++ b/src/views/user-profile/views/groups-container/GroupsContainerView.scss @@ -13,5 +13,11 @@ border-color: $grid-active-border-color !important; background-color: $grid-active-bg-color !important; } + + .icon { + z-index: 1; + top: 0px; + right: 0px; + } } } diff --git a/src/views/user-profile/views/groups-container/GroupsContainerView.tsx b/src/views/user-profile/views/groups-container/GroupsContainerView.tsx index dc7ee616..50eadaa5 100644 --- a/src/views/user-profile/views/groups-container/GroupsContainerView.tsx +++ b/src/views/user-profile/views/groups-container/GroupsContainerView.tsx @@ -1,4 +1,4 @@ -import { GroupInformationComposer, GroupInformationEvent, GroupInformationParser } from '@nitrots/nitro-renderer'; +import { GroupFavoriteComposer, GroupInformationComposer, GroupInformationEvent, GroupInformationParser } from '@nitrots/nitro-renderer'; import classNames from 'classnames'; import { FC, useCallback, useEffect, useState } from 'react'; import { CreateMessageHook, SendMessageHook } from '../../../../hooks'; @@ -36,6 +36,11 @@ export const GroupsContainerView: FC = props => if(selectedGroupId) SendMessageHook(new GroupInformationComposer(selectedGroupId, false)); }, [ selectedGroupId ]); + const favoriteGroup = useCallback((groupId: number) => + { + SendMessageHook(new GroupFavoriteComposer(groupId)); + }, []); + if(!groups) return null; return ( @@ -44,7 +49,8 @@ export const GroupsContainerView: FC = props =>
{ groups.map((group, index) => { - return
setSelectedGroupId(group.id) } className={ 'profile-groups-item flex-shrink-0 d-flex align-items-center justify-content-center cursor-pointer' + classNames({ ' active': selectedGroupId === group.id }) }> + return
setSelectedGroupId(group.id) } className={ 'profile-groups-item position-relative flex-shrink-0 d-flex align-items-center justify-content-center cursor-pointer' + classNames({ ' active': selectedGroupId === group.id }) }> + favoriteGroup(group.id) } />
}) } diff --git a/src/views/user-profile/views/user-container/UserContainerView.tsx b/src/views/user-profile/views/user-container/UserContainerView.tsx index 8d024a39..e639b8e6 100644 --- a/src/views/user-profile/views/user-container/UserContainerView.tsx +++ b/src/views/user-profile/views/user-container/UserContainerView.tsx @@ -33,7 +33,7 @@ export const UserContainerView: FC = props =>
{userProfile.username}
-
{userProfile.motto}
+
{userProfile.motto}
{LocalizeText('extendedprofile.achievementscore')} {userProfile.achievementPoints}