mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 23:16:21 +00:00
🆙 Init V3
This commit is contained in:
@@ -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));
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { CreateLinkEvent } from '@nitrots/nitro-renderer';
|
||||
|
||||
export function GetGroupManager(groupId: number): void
|
||||
{
|
||||
CreateLinkEvent(`groups/manage/${ groupId }`);
|
||||
}
|
||||
@@ -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 }`);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export class GroupMembershipType
|
||||
{
|
||||
public static NOT_MEMBER: number = 0;
|
||||
public static MEMBER: number = 1;
|
||||
public static REQUEST_PENDING: number = 2;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export class GroupType
|
||||
{
|
||||
public static REGULAR: number = 0;
|
||||
public static EXCLUSIVE: number = 1;
|
||||
public static PRIVATE: number = 2;
|
||||
}
|
||||
@@ -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 }[];
|
||||
}
|
||||
@@ -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[];
|
||||
}
|
||||
@@ -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));
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
import { GroupJoinComposer } from '@nitrots/nitro-renderer';
|
||||
import { SendMessageComposer } from '../nitro';
|
||||
|
||||
export const TryJoinGroup = (groupId: number) => SendMessageComposer(new GroupJoinComposer(groupId));
|
||||
@@ -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';
|
||||
Reference in New Issue
Block a user