init: Fork from Original V2 Renderer

This commit is contained in:
duckietm
2024-04-03 09:16:49 +02:00
commit 110c3ad393
1425 changed files with 67522 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
import { GroupInformationComposer } from '@nitrots/nitro-renderer';
import { SendMessageComposer } from '../nitro';
export function GetGroupInformation(groupId: number): void
{
SendMessageComposer(new GroupInformationComposer(groupId, true));
}
+6
View File
@@ -0,0 +1,6 @@
import { CreateLinkEvent } from '@nitrots/nitro-renderer';
export function GetGroupManager(groupId: number): void
{
CreateLinkEvent(`groups/manage/${ groupId }`);
}
+7
View File
@@ -0,0 +1,7 @@
import { CreateLinkEvent } from '@nitrots/nitro-renderer';
export function GetGroupMembers(groupId: number, levelId?: number): void
{
if(!levelId) CreateLinkEvent(`group-members/${ groupId }`);
else CreateLinkEvent(`group-members/${ groupId }/${ levelId }`);
}
+30
View File
@@ -0,0 +1,30 @@
export class GroupBadgePart
{
public static BASE: string = 'b';
public static SYMBOL: string = 's';
public type: string;
public key: number;
public color: number;
public position: number;
constructor(type: string, key?: number, color?: number, position?: number)
{
this.type = type;
this.key = key ? key : 0;
this.color = color ? color : 0;
this.position = position ? position : 4;
}
public get code(): string
{
if((this.key === 0) && (this.type !== GroupBadgePart.BASE)) return null;
return GroupBadgePart.getCode(this.type, this.key, this.color, this.position);
}
public static getCode(type: string, key: number, color: number, position: number): string
{
return type + (key < 10 ? '0' : '') + key + (color < 10 ? '0' : '') + color + position;
}
}
+6
View File
@@ -0,0 +1,6 @@
export class GroupMembershipType
{
public static NOT_MEMBER: number = 0;
public static MEMBER: number = 1;
public static REQUEST_PENDING: number = 2;
}
+6
View File
@@ -0,0 +1,6 @@
export class GroupType
{
public static REGULAR: number = 0;
public static EXCLUSIVE: number = 1;
public static PRIVATE: number = 2;
}
+8
View File
@@ -0,0 +1,8 @@
export interface IGroupCustomize
{
badgeBases: { id: number, images: string[] }[];
badgeSymbols: { id: number, images: string[] }[];
badgePartColors: { id: number, color: string }[];
groupColorsA: { id: number, color: string }[];
groupColorsB: { id: number, color: string }[];
}
+13
View File
@@ -0,0 +1,13 @@
import { GroupBadgePart } from './GroupBadgePart';
export interface IGroupData
{
groupId: number;
groupName: string;
groupDescription: string;
groupHomeroomId: number;
groupState: number;
groupCanMembersDecorate: boolean;
groupColors: number[];
groupBadgeParts: GroupBadgePart[];
}
+7
View File
@@ -0,0 +1,7 @@
import { GroupFavoriteComposer, GroupUnfavoriteComposer, HabboGroupEntryData } from '@nitrots/nitro-renderer';
import { SendMessageComposer } from '../nitro';
export const ToggleFavoriteGroup = (group: HabboGroupEntryData) =>
{
SendMessageComposer(group.favourite ? new GroupUnfavoriteComposer(group.groupId) : new GroupFavoriteComposer(group.groupId));
}
+4
View File
@@ -0,0 +1,4 @@
import { GroupJoinComposer } from '@nitrots/nitro-renderer';
import { SendMessageComposer } from '../nitro';
export const TryJoinGroup = (groupId: number) => SendMessageComposer(new GroupJoinComposer(groupId));
+10
View File
@@ -0,0 +1,10 @@
export * from './GetGroupInformation';
export * from './GetGroupManager';
export * from './GetGroupMembers';
export * from './GroupBadgePart';
export * from './GroupMembershipType';
export * from './GroupType';
export * from './IGroupCustomize';
export * from './IGroupData';
export * from './ToggleFavoriteGroup';
export * from './TryJoinGroup';