You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
🆕 Card Background
This commit is contained in:
@@ -2,6 +2,10 @@ export interface IRoomUserData
|
|||||||
{
|
{
|
||||||
readonly roomIndex: number;
|
readonly roomIndex: number;
|
||||||
activityPoints: number;
|
activityPoints: number;
|
||||||
|
background: number;
|
||||||
|
stand: number;
|
||||||
|
overlay: number;
|
||||||
|
cardBackground: number;
|
||||||
name: string;
|
name: string;
|
||||||
type: number;
|
type: number;
|
||||||
sex: string;
|
sex: string;
|
||||||
|
|||||||
+2
-2
@@ -4,9 +4,9 @@ export class RoomUnitBackgroundComposer implements IMessageComposer<ConstructorP
|
|||||||
{
|
{
|
||||||
private _data: ConstructorParameters<typeof RoomUnitBackgroundComposer>;
|
private _data: ConstructorParameters<typeof RoomUnitBackgroundComposer>;
|
||||||
|
|
||||||
constructor(backgroundImage: number, backgroundStand: number, backgroundOverlay: number)
|
constructor(backgroundImage: number, backgroundStand: number, backgroundOverlay: number, backgroundCard: number = 0)
|
||||||
{
|
{
|
||||||
this._data = [ backgroundImage, backgroundStand, backgroundOverlay ];
|
this._data = [ backgroundImage, backgroundStand, backgroundOverlay, backgroundCard ];
|
||||||
}
|
}
|
||||||
|
|
||||||
public getMessageArray()
|
public getMessageArray()
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export class RoomUnitInfoParser implements IMessageParser
|
|||||||
private _backgroundId: number;
|
private _backgroundId: number;
|
||||||
private _standId: number;
|
private _standId: number;
|
||||||
private _overlayId: number;
|
private _overlayId: number;
|
||||||
|
private _cardBackgroundId: number;
|
||||||
|
|
||||||
public flush(): boolean
|
public flush(): boolean
|
||||||
{
|
{
|
||||||
@@ -21,6 +22,7 @@ export class RoomUnitInfoParser implements IMessageParser
|
|||||||
this._backgroundId = 0;
|
this._backgroundId = 0;
|
||||||
this._standId = 0;
|
this._standId = 0;
|
||||||
this._overlayId = 0;
|
this._overlayId = 0;
|
||||||
|
this._cardBackgroundId = 0;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -36,7 +38,9 @@ export class RoomUnitInfoParser implements IMessageParser
|
|||||||
this._achievementScore = wrapper.readInt();
|
this._achievementScore = wrapper.readInt();
|
||||||
this._backgroundId = wrapper.readInt();
|
this._backgroundId = wrapper.readInt();
|
||||||
this._standId = wrapper.readInt();
|
this._standId = wrapper.readInt();
|
||||||
this._overlayId = wrapper.readInt();
|
this._overlayId = wrapper.readInt();
|
||||||
|
|
||||||
|
if(wrapper.bytesAvailable >= 4) this._cardBackgroundId = wrapper.readInt();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -80,4 +84,9 @@ export class RoomUnitInfoParser implements IMessageParser
|
|||||||
{
|
{
|
||||||
return this._overlayId;
|
return this._overlayId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get cardBackgroundId(): number
|
||||||
|
{
|
||||||
|
return this._cardBackgroundId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -37,6 +37,7 @@ export class RoomUnitParser implements IMessageParser
|
|||||||
const background = wrapper.readInt();
|
const background = wrapper.readInt();
|
||||||
const stand = wrapper.readInt();
|
const stand = wrapper.readInt();
|
||||||
const overlay = wrapper.readInt();
|
const overlay = wrapper.readInt();
|
||||||
|
const cardBackground = wrapper.readInt();
|
||||||
let figure = wrapper.readString();
|
let figure = wrapper.readString();
|
||||||
const roomIndex = wrapper.readInt();
|
const roomIndex = wrapper.readInt();
|
||||||
const x = wrapper.readInt();
|
const x = wrapper.readInt();
|
||||||
@@ -53,6 +54,7 @@ export class RoomUnitParser implements IMessageParser
|
|||||||
user.background = background;
|
user.background = background;
|
||||||
user.stand = stand;
|
user.stand = stand;
|
||||||
user.overlay = overlay;
|
user.overlay = overlay;
|
||||||
|
user.cardBackground = cardBackground;
|
||||||
user.x = x;
|
user.x = x;
|
||||||
user.y = y;
|
user.y = y;
|
||||||
user.z = z;
|
user.z = z;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export class UserMessageData
|
|||||||
private _background: number = 0;
|
private _background: number = 0;
|
||||||
private _stand: number = 0;
|
private _stand: number = 0;
|
||||||
private _overlay: number = 0;
|
private _overlay: number = 0;
|
||||||
|
private _cardBackground: number = 0;
|
||||||
private _webID: number = 0;
|
private _webID: number = 0;
|
||||||
private _groupID: number = 0;
|
private _groupID: number = 0;
|
||||||
private _groupStatus: number = 0;
|
private _groupStatus: number = 0;
|
||||||
@@ -214,6 +215,16 @@ export class UserMessageData
|
|||||||
this._overlay = k;
|
this._overlay = k;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get cardBackground(): number
|
||||||
|
{
|
||||||
|
return this._cardBackground;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set cardBackground(k: number)
|
||||||
|
{
|
||||||
|
this._cardBackground = k;
|
||||||
|
}
|
||||||
|
|
||||||
public get webID(): number
|
public get webID(): number
|
||||||
{
|
{
|
||||||
return this._webID;
|
return this._webID;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export class UserProfileParser implements IMessageParser
|
|||||||
private _backgroundId: number;
|
private _backgroundId: number;
|
||||||
private _standId: number;
|
private _standId: number;
|
||||||
private _overlayId: number;
|
private _overlayId: number;
|
||||||
|
private _cardBackgroundId: number;
|
||||||
|
|
||||||
public flush(): boolean
|
public flush(): boolean
|
||||||
{
|
{
|
||||||
@@ -38,6 +39,7 @@ export class UserProfileParser implements IMessageParser
|
|||||||
this._backgroundId = 0;
|
this._backgroundId = 0;
|
||||||
this._standId = 0;
|
this._standId = 0;
|
||||||
this._overlayId = 0;
|
this._overlayId = 0;
|
||||||
|
this._cardBackgroundId = 0;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -71,6 +73,8 @@ export class UserProfileParser implements IMessageParser
|
|||||||
this._backgroundId = wrapper.readInt();
|
this._backgroundId = wrapper.readInt();
|
||||||
this._standId = wrapper.readInt();
|
this._standId = wrapper.readInt();
|
||||||
this._overlayId = wrapper.readInt();
|
this._overlayId = wrapper.readInt();
|
||||||
|
|
||||||
|
if(wrapper.bytesAvailable >= 4) this._cardBackgroundId = wrapper.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -155,4 +159,9 @@ export class UserProfileParser implements IMessageParser
|
|||||||
{
|
{
|
||||||
return this._overlayId;
|
return this._overlayId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get cardBackgroundId(): number
|
||||||
|
{
|
||||||
|
return this._cardBackgroundId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent {
|
|||||||
private _backgroundId: number | null;
|
private _backgroundId: number | null;
|
||||||
private _standId: number | null;
|
private _standId: number | null;
|
||||||
private _overlayId: number | null;
|
private _overlayId: number | null;
|
||||||
|
private _cardBackgroundId: number | null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
session: IRoomSession,
|
session: IRoomSession,
|
||||||
@@ -22,7 +23,8 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent {
|
|||||||
achievementScore: number,
|
achievementScore: number,
|
||||||
backgroundId: number | null,
|
backgroundId: number | null,
|
||||||
standId: number | null,
|
standId: number | null,
|
||||||
overlayId: number | null
|
overlayId: number | null,
|
||||||
|
cardBackgroundId: number | null = 0
|
||||||
) {
|
) {
|
||||||
super(RoomSessionUserFigureUpdateEvent.USER_FIGURE, session);
|
super(RoomSessionUserFigureUpdateEvent.USER_FIGURE, session);
|
||||||
|
|
||||||
@@ -34,6 +36,7 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent {
|
|||||||
this._backgroundId = backgroundId;
|
this._backgroundId = backgroundId;
|
||||||
this._standId = standId;
|
this._standId = standId;
|
||||||
this._overlayId = overlayId;
|
this._overlayId = overlayId;
|
||||||
|
this._cardBackgroundId = cardBackgroundId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get roomIndex(): number {
|
public get roomIndex(): number {
|
||||||
@@ -67,4 +70,8 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent {
|
|||||||
public get overlayId(): number | null {
|
public get overlayId(): number | null {
|
||||||
return this._overlayId;
|
return this._overlayId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get cardBackgroundId(): number | null {
|
||||||
|
return this._cardBackgroundId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -97,9 +97,9 @@ export class RoomSession implements IRoomSession
|
|||||||
else GetCommunication().connection.send(new RoomUnitTypingStopComposer());
|
else GetCommunication().connection.send(new RoomUnitTypingStopComposer());
|
||||||
}
|
}
|
||||||
|
|
||||||
public sendBackgroundMessage(backgroundImage: number, backgroundStand: number, backgroundOverlay: number): void
|
public sendBackgroundMessage(backgroundImage: number, backgroundStand: number, backgroundOverlay: number, backgroundCard: number = 0): void
|
||||||
{
|
{
|
||||||
GetCommunication().connection.send(new RoomUnitBackgroundComposer(backgroundImage, backgroundStand, backgroundOverlay));
|
GetCommunication().connection.send(new RoomUnitBackgroundComposer(backgroundImage, backgroundStand, backgroundOverlay, backgroundCard));
|
||||||
}
|
}
|
||||||
|
|
||||||
public sendMottoMessage(motto: string): void
|
public sendMottoMessage(motto: string): void
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export class RoomUserData implements IRoomUserData
|
|||||||
private _background: number;
|
private _background: number;
|
||||||
private _stand: number;
|
private _stand: number;
|
||||||
private _overlay: number;
|
private _overlay: number;
|
||||||
|
private _cardBackground: number;
|
||||||
private _webID: number = 0;
|
private _webID: number = 0;
|
||||||
private _groupID: number = 0;
|
private _groupID: number = 0;
|
||||||
private _groupStatus: number = 0;
|
private _groupStatus: number = 0;
|
||||||
@@ -81,6 +82,16 @@ export class RoomUserData implements IRoomUserData
|
|||||||
this._overlay = k;
|
this._overlay = k;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get cardBackground(): number
|
||||||
|
{
|
||||||
|
return this._cardBackground;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set cardBackground(k: number)
|
||||||
|
{
|
||||||
|
this._cardBackground = k;
|
||||||
|
}
|
||||||
|
|
||||||
public get name(): string
|
public get name(): string
|
||||||
{
|
{
|
||||||
return this._name;
|
return this._name;
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export class UserDataManager implements IUserDataManager
|
|||||||
userData.custom = custom;
|
userData.custom = custom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateBackground(roomIndex: number, background: number, stand: number, overlay: number): void
|
public updateBackground(roomIndex: number, background: number, stand: number, overlay: number, cardBackground: number = 0): void
|
||||||
{
|
{
|
||||||
const userData = this.getUserDataByIndex(roomIndex);
|
const userData = this.getUserDataByIndex(roomIndex);
|
||||||
|
|
||||||
@@ -154,6 +154,7 @@ export class UserDataManager implements IUserDataManager
|
|||||||
userData.background = background;
|
userData.background = background;
|
||||||
userData.stand = stand;
|
userData.stand = stand;
|
||||||
userData.overlay = overlay;
|
userData.overlay = overlay;
|
||||||
|
userData.cardBackground = cardBackground;
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateAchievementScore(roomIndex: number, score: number): void
|
public updateAchievementScore(roomIndex: number, score: number): void
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ export class RoomUsersHandler extends BaseHandler
|
|||||||
userData.custom = user.custom;
|
userData.custom = user.custom;
|
||||||
userData.background = user.background;
|
userData.background = user.background;
|
||||||
userData.stand = user.stand;
|
userData.stand = user.stand;
|
||||||
userData.overlay = user.overlay;
|
userData.overlay = user.overlay;
|
||||||
|
userData.cardBackground = user.cardBackground;
|
||||||
userData.activityPoints = user.activityPoints;
|
userData.activityPoints = user.activityPoints;
|
||||||
userData.figure = user.figure;
|
userData.figure = user.figure;
|
||||||
userData.type = user.userType;
|
userData.type = user.userType;
|
||||||
@@ -106,9 +107,9 @@ export class RoomUsersHandler extends BaseHandler
|
|||||||
session.userDataManager.updateMotto(parser.unitId, parser.motto);
|
session.userDataManager.updateMotto(parser.unitId, parser.motto);
|
||||||
session.userDataManager.updateAchievementScore(parser.unitId, parser.achievementScore);
|
session.userDataManager.updateAchievementScore(parser.unitId, parser.achievementScore);
|
||||||
|
|
||||||
session.userDataManager.updateBackground(parser.unitId, parser.backgroundId, parser.standId, parser.overlayId);
|
session.userDataManager.updateBackground(parser.unitId, parser.backgroundId, parser.standId, parser.overlayId, parser.cardBackgroundId);
|
||||||
|
|
||||||
GetEventDispatcher().dispatchEvent(new RoomSessionUserFigureUpdateEvent(session, parser.unitId, parser.figure, parser.gender, parser.motto, parser.achievementScore, parser.backgroundId, parser.standId, parser.overlayId));
|
GetEventDispatcher().dispatchEvent(new RoomSessionUserFigureUpdateEvent(session, parser.unitId, parser.figure, parser.gender, parser.motto, parser.achievementScore, parser.backgroundId, parser.standId, parser.overlayId, parser.cardBackgroundId));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user