mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
Merge pull request #115 from duckietm/Dev
🆙 Updated Background profiles
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@
|
||||
<div id="root" class="w-full h-full"></div>
|
||||
<script>
|
||||
window.NitroConfig = {
|
||||
"config.urls": ["renderer-config.json?v=" + Math.random(), "ui-config.json?v=" + Math.random()],
|
||||
"config.urls": ["renderer-config.json?v=" + Math.random(), "infostand_backgrounds.json?v=" + Math.random(), "ui-config.json?v=" + Math.random()],
|
||||
"sso.ticket": new URLSearchParams(window.location.search).get("sso") || null,
|
||||
"forward.type": new URLSearchParams(window.location.search).get("room", ) ? 2 : -1,
|
||||
"forward.id": new URLSearchParams(window.location.search).get("room") || 0,
|
||||
|
||||
@@ -0,0 +1,712 @@
|
||||
{
|
||||
"backgrounds.data": [
|
||||
{
|
||||
"backgroundId": 0
|
||||
},
|
||||
{
|
||||
"backgroundId": 1
|
||||
},
|
||||
{
|
||||
"backgroundId": 2
|
||||
},
|
||||
{
|
||||
"backgroundId": 3
|
||||
},
|
||||
{
|
||||
"backgroundId": 4
|
||||
},
|
||||
{
|
||||
"backgroundId": 5
|
||||
},
|
||||
{
|
||||
"backgroundId": 6
|
||||
},
|
||||
{
|
||||
"backgroundId": 7
|
||||
},
|
||||
{
|
||||
"backgroundId": 8
|
||||
},
|
||||
{
|
||||
"backgroundId": 9
|
||||
},
|
||||
{
|
||||
"backgroundId": 10
|
||||
},
|
||||
{
|
||||
"backgroundId": 11
|
||||
},
|
||||
{
|
||||
"backgroundId": 12
|
||||
},
|
||||
{
|
||||
"backgroundId": 13
|
||||
},
|
||||
{
|
||||
"backgroundId": 14
|
||||
},
|
||||
{
|
||||
"backgroundId": 15
|
||||
},
|
||||
{
|
||||
"backgroundId": 16
|
||||
},
|
||||
{
|
||||
"backgroundId": 17
|
||||
},
|
||||
{
|
||||
"backgroundId": 18
|
||||
},
|
||||
{
|
||||
"backgroundId": 19
|
||||
},
|
||||
{
|
||||
"backgroundId": 20
|
||||
},
|
||||
{
|
||||
"backgroundId": 21
|
||||
},
|
||||
{
|
||||
"backgroundId": 22
|
||||
},
|
||||
{
|
||||
"backgroundId": 23
|
||||
},
|
||||
{
|
||||
"backgroundId": 24
|
||||
},
|
||||
{
|
||||
"backgroundId": 25
|
||||
},
|
||||
{
|
||||
"backgroundId": 26
|
||||
},
|
||||
{
|
||||
"backgroundId": 27
|
||||
},
|
||||
{
|
||||
"backgroundId": 28
|
||||
},
|
||||
{
|
||||
"backgroundId": 29
|
||||
},
|
||||
{
|
||||
"backgroundId": 30
|
||||
},
|
||||
{
|
||||
"backgroundId": 31
|
||||
},
|
||||
{
|
||||
"backgroundId": 32
|
||||
},
|
||||
{
|
||||
"backgroundId": 33
|
||||
},
|
||||
{
|
||||
"backgroundId": 34
|
||||
},
|
||||
{
|
||||
"backgroundId": 35
|
||||
},
|
||||
{
|
||||
"backgroundId": 36
|
||||
},
|
||||
{
|
||||
"backgroundId": 37
|
||||
},
|
||||
{
|
||||
"backgroundId": 38
|
||||
},
|
||||
{
|
||||
"backgroundId": 39
|
||||
},
|
||||
{
|
||||
"backgroundId": 40
|
||||
},
|
||||
{
|
||||
"backgroundId": 41
|
||||
},
|
||||
{
|
||||
"backgroundId": 42
|
||||
},
|
||||
{
|
||||
"backgroundId": 43
|
||||
},
|
||||
{
|
||||
"backgroundId": 44
|
||||
},
|
||||
{
|
||||
"backgroundId": 45
|
||||
},
|
||||
{
|
||||
"backgroundId": 46
|
||||
},
|
||||
{
|
||||
"backgroundId": 47
|
||||
},
|
||||
{
|
||||
"backgroundId": 48
|
||||
},
|
||||
{
|
||||
"backgroundId": 49
|
||||
},
|
||||
{
|
||||
"backgroundId": 50
|
||||
},
|
||||
{
|
||||
"backgroundId": 51
|
||||
},
|
||||
{
|
||||
"backgroundId": 52
|
||||
},
|
||||
{
|
||||
"backgroundId": 53
|
||||
},
|
||||
{
|
||||
"backgroundId": 54
|
||||
},
|
||||
{
|
||||
"backgroundId": 55
|
||||
},
|
||||
{
|
||||
"backgroundId": 56
|
||||
},
|
||||
{
|
||||
"backgroundId": 57
|
||||
},
|
||||
{
|
||||
"backgroundId": 58
|
||||
},
|
||||
{
|
||||
"backgroundId": 59
|
||||
},
|
||||
{
|
||||
"backgroundId": 60
|
||||
},
|
||||
{
|
||||
"backgroundId": 61
|
||||
},
|
||||
{
|
||||
"backgroundId": 62
|
||||
},
|
||||
{
|
||||
"backgroundId": 63
|
||||
},
|
||||
{
|
||||
"backgroundId": 64
|
||||
},
|
||||
{
|
||||
"backgroundId": 65
|
||||
},
|
||||
{
|
||||
"backgroundId": 66
|
||||
},
|
||||
{
|
||||
"backgroundId": 67
|
||||
},
|
||||
{
|
||||
"backgroundId": 68
|
||||
},
|
||||
{
|
||||
"backgroundId": 69
|
||||
},
|
||||
{
|
||||
"backgroundId": 70
|
||||
},
|
||||
{
|
||||
"backgroundId": 71
|
||||
},
|
||||
{
|
||||
"backgroundId": 72
|
||||
},
|
||||
{
|
||||
"backgroundId": 73
|
||||
},
|
||||
{
|
||||
"backgroundId": 74
|
||||
},
|
||||
{
|
||||
"backgroundId": 75
|
||||
},
|
||||
{
|
||||
"backgroundId": 76
|
||||
},
|
||||
{
|
||||
"backgroundId": 77
|
||||
},
|
||||
{
|
||||
"backgroundId": 78
|
||||
},
|
||||
{
|
||||
"backgroundId": 79
|
||||
},
|
||||
{
|
||||
"backgroundId": 80
|
||||
},
|
||||
{
|
||||
"backgroundId": 81
|
||||
},
|
||||
{
|
||||
"backgroundId": 82
|
||||
},
|
||||
{
|
||||
"backgroundId": 83
|
||||
},
|
||||
{
|
||||
"backgroundId": 84
|
||||
},
|
||||
{
|
||||
"backgroundId": 85
|
||||
},
|
||||
{
|
||||
"backgroundId": 86
|
||||
},
|
||||
{
|
||||
"backgroundId": 87
|
||||
},
|
||||
{
|
||||
"backgroundId": 88
|
||||
},
|
||||
{
|
||||
"backgroundId": 89
|
||||
},
|
||||
{
|
||||
"backgroundId": 90
|
||||
},
|
||||
{
|
||||
"backgroundId": 91
|
||||
},
|
||||
{
|
||||
"backgroundId": 92
|
||||
},
|
||||
{
|
||||
"backgroundId": 93
|
||||
},
|
||||
{
|
||||
"backgroundId": 94
|
||||
},
|
||||
{
|
||||
"backgroundId": 95
|
||||
},
|
||||
{
|
||||
"backgroundId": 96
|
||||
},
|
||||
{
|
||||
"backgroundId": 97
|
||||
},
|
||||
{
|
||||
"backgroundId": 98
|
||||
},
|
||||
{
|
||||
"backgroundId": 99
|
||||
},
|
||||
{
|
||||
"backgroundId": 100
|
||||
},
|
||||
{
|
||||
"backgroundId": 101
|
||||
},
|
||||
{
|
||||
"backgroundId": 102
|
||||
},
|
||||
{
|
||||
"backgroundId": 103
|
||||
},
|
||||
{
|
||||
"backgroundId": 104
|
||||
},
|
||||
{
|
||||
"backgroundId": 105
|
||||
},
|
||||
{
|
||||
"backgroundId": 106
|
||||
},
|
||||
{
|
||||
"backgroundId": 107
|
||||
},
|
||||
{
|
||||
"backgroundId": 108
|
||||
},
|
||||
{
|
||||
"backgroundId": 109
|
||||
},
|
||||
{
|
||||
"backgroundId": 110
|
||||
},
|
||||
{
|
||||
"backgroundId": 111
|
||||
},
|
||||
{
|
||||
"backgroundId": 112
|
||||
},
|
||||
{
|
||||
"backgroundId": 113
|
||||
},
|
||||
{
|
||||
"backgroundId": 114
|
||||
},
|
||||
{
|
||||
"backgroundId": 115
|
||||
},
|
||||
{
|
||||
"backgroundId": 116
|
||||
},
|
||||
{
|
||||
"backgroundId": 117
|
||||
},
|
||||
{
|
||||
"backgroundId": 118
|
||||
},
|
||||
{
|
||||
"backgroundId": 119
|
||||
},
|
||||
{
|
||||
"backgroundId": 120
|
||||
},
|
||||
{
|
||||
"backgroundId": 121
|
||||
},
|
||||
{
|
||||
"backgroundId": 122
|
||||
},
|
||||
{
|
||||
"backgroundId": 123
|
||||
},
|
||||
{
|
||||
"backgroundId": 124
|
||||
},
|
||||
{
|
||||
"backgroundId": 125
|
||||
},
|
||||
{
|
||||
"backgroundId": 126
|
||||
},
|
||||
{
|
||||
"backgroundId": 127
|
||||
},
|
||||
{
|
||||
"backgroundId": 128
|
||||
},
|
||||
{
|
||||
"backgroundId": 129
|
||||
},
|
||||
{
|
||||
"backgroundId": 130
|
||||
},
|
||||
{
|
||||
"backgroundId": 131
|
||||
},
|
||||
{
|
||||
"backgroundId": 132
|
||||
},
|
||||
{
|
||||
"backgroundId": 133
|
||||
},
|
||||
{
|
||||
"backgroundId": 134
|
||||
},
|
||||
{
|
||||
"backgroundId": 135
|
||||
},
|
||||
{
|
||||
"backgroundId": 136
|
||||
},
|
||||
{
|
||||
"backgroundId": 137
|
||||
},
|
||||
{
|
||||
"backgroundId": 138
|
||||
},
|
||||
{
|
||||
"backgroundId": 139
|
||||
},
|
||||
{
|
||||
"backgroundId": 140
|
||||
},
|
||||
{
|
||||
"backgroundId": 141
|
||||
},
|
||||
{
|
||||
"backgroundId": 142
|
||||
},
|
||||
{
|
||||
"backgroundId": 143
|
||||
},
|
||||
{
|
||||
"backgroundId": 144
|
||||
},
|
||||
{
|
||||
"backgroundId": 145
|
||||
},
|
||||
{
|
||||
"backgroundId": 146
|
||||
},
|
||||
{
|
||||
"backgroundId": 147
|
||||
},
|
||||
{
|
||||
"backgroundId": 148
|
||||
},
|
||||
{
|
||||
"backgroundId": 149
|
||||
},
|
||||
{
|
||||
"backgroundId": 150
|
||||
},
|
||||
{
|
||||
"backgroundId": 151
|
||||
},
|
||||
{
|
||||
"backgroundId": 152
|
||||
},
|
||||
{
|
||||
"backgroundId": 153
|
||||
},
|
||||
{
|
||||
"backgroundId": 154
|
||||
},
|
||||
{
|
||||
"backgroundId": 155
|
||||
},
|
||||
{
|
||||
"backgroundId": 156
|
||||
},
|
||||
{
|
||||
"backgroundId": 157
|
||||
},
|
||||
{
|
||||
"backgroundId": 158
|
||||
},
|
||||
{
|
||||
"backgroundId": 159
|
||||
},
|
||||
{
|
||||
"backgroundId": 160
|
||||
},
|
||||
{
|
||||
"backgroundId": 161
|
||||
},
|
||||
{
|
||||
"backgroundId": 162
|
||||
},
|
||||
{
|
||||
"backgroundId": 163
|
||||
},
|
||||
{
|
||||
"backgroundId": 164
|
||||
},
|
||||
{
|
||||
"backgroundId": 165
|
||||
},
|
||||
{
|
||||
"backgroundId": 166
|
||||
},
|
||||
{
|
||||
"backgroundId": 167
|
||||
},
|
||||
{
|
||||
"backgroundId": 168
|
||||
},
|
||||
{
|
||||
"backgroundId": 169
|
||||
},
|
||||
{
|
||||
"backgroundId": 170
|
||||
},
|
||||
{
|
||||
"backgroundId": 171
|
||||
},
|
||||
{
|
||||
"backgroundId": 172
|
||||
},
|
||||
{
|
||||
"backgroundId": 173
|
||||
},
|
||||
{
|
||||
"backgroundId": 174
|
||||
},
|
||||
{
|
||||
"backgroundId": 175
|
||||
},
|
||||
{
|
||||
"backgroundId": 176
|
||||
},
|
||||
{
|
||||
"backgroundId": 177
|
||||
},
|
||||
{
|
||||
"backgroundId": 178
|
||||
},
|
||||
{
|
||||
"backgroundId": 179
|
||||
},
|
||||
{
|
||||
"backgroundId": 180
|
||||
},
|
||||
{
|
||||
"backgroundId": 181
|
||||
},
|
||||
{
|
||||
"backgroundId": 182
|
||||
},
|
||||
{
|
||||
"backgroundId": 183
|
||||
},
|
||||
{
|
||||
"backgroundId": 184
|
||||
},
|
||||
{
|
||||
"backgroundId": 185
|
||||
},
|
||||
{
|
||||
"backgroundId": 186
|
||||
},
|
||||
{
|
||||
"backgroundId": 187
|
||||
}
|
||||
],
|
||||
"stands.data": [
|
||||
{
|
||||
"standId": 0
|
||||
},
|
||||
{
|
||||
"standId": 1
|
||||
},
|
||||
{
|
||||
"standId": 2
|
||||
},
|
||||
{
|
||||
"standId": 3
|
||||
},
|
||||
{
|
||||
"standId": 4
|
||||
},
|
||||
{
|
||||
"standId": 5
|
||||
},
|
||||
{
|
||||
"standId": 6
|
||||
},
|
||||
{
|
||||
"standId": 7
|
||||
},
|
||||
{
|
||||
"standId": 8
|
||||
},
|
||||
{
|
||||
"standId": 9
|
||||
},
|
||||
{
|
||||
"standId": 10
|
||||
},
|
||||
{
|
||||
"standId": 11
|
||||
},
|
||||
{
|
||||
"standId": 12
|
||||
},
|
||||
{
|
||||
"standId": 13
|
||||
},
|
||||
{
|
||||
"standId": 14
|
||||
},
|
||||
{
|
||||
"standId": 15
|
||||
},
|
||||
{
|
||||
"standId": 16
|
||||
},
|
||||
{
|
||||
"standId": 17
|
||||
},
|
||||
{
|
||||
"standId": 18
|
||||
},
|
||||
{
|
||||
"standId": 19
|
||||
},
|
||||
{
|
||||
"standId": 20
|
||||
},
|
||||
{
|
||||
"standId": 21
|
||||
}
|
||||
],
|
||||
"overlays.data": [
|
||||
{
|
||||
"overlayId": 0
|
||||
},
|
||||
{
|
||||
"overlayId": 1
|
||||
},
|
||||
{
|
||||
"overlayId": 2
|
||||
},
|
||||
{
|
||||
"overlayId": 3
|
||||
},
|
||||
{
|
||||
"overlayId": 4
|
||||
},
|
||||
{
|
||||
"overlayId": 5
|
||||
},
|
||||
{
|
||||
"overlayId": 6
|
||||
},
|
||||
{
|
||||
"overlayId": 7
|
||||
},
|
||||
{
|
||||
"overlayId": 8
|
||||
}
|
||||
],
|
||||
"cards.data": [
|
||||
{
|
||||
"backgroundId": 1
|
||||
},
|
||||
{
|
||||
"backgroundId": 2
|
||||
},
|
||||
{
|
||||
"backgroundId": 3
|
||||
},
|
||||
{
|
||||
"backgroundId": 4
|
||||
},
|
||||
{
|
||||
"backgroundId": 5
|
||||
},
|
||||
{
|
||||
"backgroundId": 6
|
||||
},
|
||||
{
|
||||
"backgroundId": 7
|
||||
},
|
||||
{
|
||||
"backgroundId": 8
|
||||
},
|
||||
{
|
||||
"backgroundId": 9
|
||||
},
|
||||
{
|
||||
"backgroundId": 10
|
||||
},
|
||||
{
|
||||
"backgroundId": 11
|
||||
},
|
||||
{
|
||||
"backgroundId": 12
|
||||
},
|
||||
{
|
||||
"backgroundId": 13
|
||||
},
|
||||
{
|
||||
"backgroundId": 14
|
||||
},
|
||||
{
|
||||
"backgroundId": 15
|
||||
}
|
||||
]
|
||||
}
|
||||
+132
-1598
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,10 @@
|
||||
import { GetSessionDataManager, HabboClubLevelEnum} from '@nitrots/nitro-renderer';
|
||||
import { Dispatch, FC, SetStateAction, useCallback, useMemo, useState } from 'react';
|
||||
import { Base, Grid, Flex, NitroCardView, NitroCardHeaderView, NitroCardTabsView, NitroCardTabsItemView, NitroCardContentView, Text, LayoutCurrencyIcon } from '../../common';
|
||||
import { Base, Grid, Flex, NitroCardView, NitroCardHeaderView, NitroCardTabsView, NitroCardTabsItemView, NitroCardContentView, Text } from '../../common';
|
||||
import { useRoom } from '../../hooks';
|
||||
import { GetClubMemberLevel, GetConfigurationValue } from '../../api';
|
||||
import { GetConfigurationValue } from '../../api';
|
||||
|
||||
interface ItemData {
|
||||
interface ItemData {
|
||||
id: number;
|
||||
isHcOnly: boolean;
|
||||
minRank: number;
|
||||
isAmbassadorOnly: boolean;
|
||||
selectable: boolean;
|
||||
}
|
||||
|
||||
interface BackgroundsViewProps {
|
||||
@@ -40,30 +35,18 @@ export const BackgroundsView: FC<BackgroundsViewProps> = ({
|
||||
}) => {
|
||||
const [activeTab, setActiveTab] = useState<TabType>('backgrounds');
|
||||
const { roomSession } = useRoom();
|
||||
|
||||
const userData = useMemo(() => ({
|
||||
isHcMember: GetClubMemberLevel() >= HabboClubLevelEnum.CLUB,
|
||||
securityLevel: GetSessionDataManager().canChangeName,
|
||||
isAmbassador: GetSessionDataManager().isAmbassador
|
||||
}), []);
|
||||
|
||||
const processData = useCallback((configData: any[], dataType: string): ItemData[] => {
|
||||
const processData = useCallback((configData: any[], idField: string): ItemData[] => {
|
||||
if (!configData?.length) return [];
|
||||
|
||||
return configData
|
||||
.filter(item => {
|
||||
const meetsRank = userData.securityLevel >= item.minRank;
|
||||
const ambassadorEligible = !item.isAmbassadorOnly || userData.isAmbassador;
|
||||
return item.isHcOnly || (meetsRank && ambassadorEligible);
|
||||
})
|
||||
.map(item => ({ id: item[`${dataType}Id`], ...item, selectable: !item.isHcOnly || userData.isHcMember }));
|
||||
}, [userData]);
|
||||
|
||||
return configData.map(item => ({ id: item[idField] }));
|
||||
}, []);
|
||||
|
||||
const allData = useMemo(() => ({
|
||||
backgrounds: processData(GetConfigurationValue('backgrounds.data'), 'background'),
|
||||
stands: processData(GetConfigurationValue('stands.data'), 'stand'),
|
||||
overlays: processData(GetConfigurationValue('overlays.data'), 'overlay'),
|
||||
cards: processData(GetConfigurationValue('cards.data') || GetConfigurationValue('backgrounds.data'), 'background')
|
||||
backgrounds: processData(GetConfigurationValue('backgrounds.data'), 'backgroundId'),
|
||||
stands: processData(GetConfigurationValue('stands.data'), 'standId'),
|
||||
overlays: processData(GetConfigurationValue('overlays.data'), 'overlayId'),
|
||||
cards: processData(GetConfigurationValue('cards.data') || GetConfigurationValue('backgrounds.data'), 'backgroundId')
|
||||
}), [processData]);
|
||||
|
||||
const handleSelection = useCallback((id: number) => {
|
||||
@@ -83,14 +66,12 @@ export const BackgroundsView: FC<BackgroundsViewProps> = ({
|
||||
pointer
|
||||
position="relative"
|
||||
key={item.id}
|
||||
onClick={() => item.selectable && handleSelection(item.id)}
|
||||
className={item.selectable ? '' : 'non-selectable'}
|
||||
onClick={() => handleSelection(item.id)}
|
||||
>
|
||||
<Base
|
||||
className={`profile-${type} ${type}-${item.id}`}
|
||||
style={type === 'card-background' ? { width: 60, height: 80, borderRadius: 4 } : undefined}
|
||||
/>
|
||||
{item.isHcOnly && <LayoutCurrencyIcon position="absolute" className="top-1 inset-e-1" type="hc" />}
|
||||
</Flex>
|
||||
), [handleSelection]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user