mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 23:16:21 +00:00
Merge branch 'main' into improve-mod-tools-ui
This commit is contained in:
@@ -11,6 +11,7 @@ export interface IRoomData
|
||||
tags: string[];
|
||||
tradeState: number;
|
||||
allowWalkthrough: boolean;
|
||||
allowUnderpass: boolean;
|
||||
lockState: number;
|
||||
password: string;
|
||||
allowPets: boolean;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { GetRoomSessionManager } from '@nitrots/nitro-renderer';
|
||||
import { GetRoomSessionManager, NitroLogger } from '@nitrots/nitro-renderer';
|
||||
import { GetRoomSession } from './GetRoomSession';
|
||||
import { GoToDesktop } from './GoToDesktop';
|
||||
|
||||
@@ -6,6 +6,8 @@ export const VisitDesktop = () =>
|
||||
{
|
||||
if(!GetRoomSession()) return;
|
||||
|
||||
NitroLogger.log('[VisitDesktop] Called (isReconnecting=' + GetRoomSessionManager().isReconnecting + ')');
|
||||
|
||||
GoToDesktop();
|
||||
GetRoomSessionManager().removeSession(-1);
|
||||
};
|
||||
|
||||
@@ -32,4 +32,9 @@ export class WiredActionLayoutCode
|
||||
public static USERS_AREA_SELECTOR: number = 31;
|
||||
public static USERS_NEIGHBORHOOD_SELECTOR: number = 32;
|
||||
public static SEND_SIGNAL: number = 33;
|
||||
public static FREEZE: number = 34;
|
||||
public static UNFREEZE: number = 35;
|
||||
public static FURNI_TO_USER: number = 36;
|
||||
public static USER_TO_FURNI: number = 37;
|
||||
public static FURNI_TO_FURNI: number = 38;
|
||||
}
|
||||
|
||||
@@ -26,4 +26,15 @@ export class WiredConditionlayout
|
||||
public static NOT_ACTOR_WEARING_EFFECT: number = 23;
|
||||
public static DATE_RANGE_ACTIVE: number = 24;
|
||||
public static ACTOR_HAS_HANDITEM: number = 25;
|
||||
public static COUNTER_TIME_MATCHES: number = 27;
|
||||
public static USER_PERFORMS_ACTION: number = 28;
|
||||
public static HAS_ALTITUDE: number = 29;
|
||||
public static NOT_USER_PERFORMS_ACTION: number = 30;
|
||||
public static NOT_ACTOR_HAS_HANDITEM: number = 31;
|
||||
public static TRIGGERER_MATCH: number = 32;
|
||||
public static NOT_TRIGGERER_MATCH: number = 33;
|
||||
public static TEAM_HAS_SCORE: number = 34;
|
||||
public static TEAM_HAS_RANK: number = 35;
|
||||
public static MATCH_TIME: number = 36;
|
||||
public static MATCH_DATE: number = 37;
|
||||
}
|
||||
|
||||
@@ -3,25 +3,42 @@ import { GetRoomEngine, IRoomObject, IRoomObjectSpriteVisualization, RoomObjectC
|
||||
export class WiredSelectionVisualizer
|
||||
{
|
||||
private static _selectionShader: WiredFilter = new WiredFilter({
|
||||
lineColor: [ 1, 1, 1 ],
|
||||
color: [ 0.6, 0.6, 0.6 ]
|
||||
lineColor: [ 0.45, 0.95, 0.55 ],
|
||||
color: [ 0.18, 0.78, 0.30 ]
|
||||
});
|
||||
private static _secondarySelectionShader: WiredFilter = new WiredFilter({
|
||||
lineColor: [ 0.45, 0.78, 1 ],
|
||||
color: [ 0.20, 0.52, 0.95 ]
|
||||
});
|
||||
|
||||
public static show(furniId: number): void
|
||||
{
|
||||
WiredSelectionVisualizer.applySelectionShader(WiredSelectionVisualizer.getRoomObject(furniId));
|
||||
WiredSelectionVisualizer.applySelectionShader(WiredSelectionVisualizer.getRoomObject(furniId), WiredSelectionVisualizer._selectionShader);
|
||||
}
|
||||
|
||||
public static hide(furniId: number): void
|
||||
{
|
||||
WiredSelectionVisualizer.clearSelectionShader(WiredSelectionVisualizer.getRoomObject(furniId));
|
||||
const roomObject = WiredSelectionVisualizer.getRoomObject(furniId);
|
||||
|
||||
WiredSelectionVisualizer.clearSelectionShader(roomObject, WiredSelectionVisualizer._selectionShader);
|
||||
WiredSelectionVisualizer.clearSelectionShader(roomObject, WiredSelectionVisualizer._secondarySelectionShader);
|
||||
}
|
||||
|
||||
public static showSecondary(furniId: number): void
|
||||
{
|
||||
WiredSelectionVisualizer.applySelectionShader(WiredSelectionVisualizer.getRoomObject(furniId), WiredSelectionVisualizer._secondarySelectionShader);
|
||||
}
|
||||
|
||||
public static hideSecondary(furniId: number): void
|
||||
{
|
||||
WiredSelectionVisualizer.clearSelectionShader(WiredSelectionVisualizer.getRoomObject(furniId), WiredSelectionVisualizer._secondarySelectionShader);
|
||||
}
|
||||
|
||||
public static clearSelectionShaderFromFurni(furniIds: number[]): void
|
||||
{
|
||||
for(const furniId of furniIds)
|
||||
{
|
||||
WiredSelectionVisualizer.clearSelectionShader(WiredSelectionVisualizer.getRoomObject(furniId));
|
||||
WiredSelectionVisualizer.clearSelectionShader(WiredSelectionVisualizer.getRoomObject(furniId), WiredSelectionVisualizer._selectionShader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +46,39 @@ export class WiredSelectionVisualizer
|
||||
{
|
||||
for(const furniId of furniIds)
|
||||
{
|
||||
WiredSelectionVisualizer.applySelectionShader(WiredSelectionVisualizer.getRoomObject(furniId));
|
||||
WiredSelectionVisualizer.applySelectionShader(WiredSelectionVisualizer.getRoomObject(furniId), WiredSelectionVisualizer._selectionShader);
|
||||
}
|
||||
}
|
||||
|
||||
public static clearSecondarySelectionShaderFromFurni(furniIds: number[]): void
|
||||
{
|
||||
for(const furniId of furniIds)
|
||||
{
|
||||
WiredSelectionVisualizer.clearSelectionShader(WiredSelectionVisualizer.getRoomObject(furniId), WiredSelectionVisualizer._secondarySelectionShader);
|
||||
}
|
||||
}
|
||||
|
||||
public static applySecondarySelectionShaderToFurni(furniIds: number[]): void
|
||||
{
|
||||
for(const furniId of furniIds)
|
||||
{
|
||||
WiredSelectionVisualizer.applySelectionShader(WiredSelectionVisualizer.getRoomObject(furniId), WiredSelectionVisualizer._secondarySelectionShader);
|
||||
}
|
||||
}
|
||||
|
||||
public static clearAllSelectionShaders(): void
|
||||
{
|
||||
const roomEngine = GetRoomEngine();
|
||||
const roomId = roomEngine.activeRoomId;
|
||||
|
||||
if(roomId < 0) return;
|
||||
|
||||
const roomObjects = roomEngine.getRoomObjects(roomId, RoomObjectCategory.FLOOR);
|
||||
|
||||
for(const roomObject of roomObjects)
|
||||
{
|
||||
WiredSelectionVisualizer.clearSelectionShader(roomObject, WiredSelectionVisualizer._selectionShader);
|
||||
WiredSelectionVisualizer.clearSelectionShader(roomObject, WiredSelectionVisualizer._secondarySelectionShader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +89,7 @@ export class WiredSelectionVisualizer
|
||||
return roomEngine.getRoomObject(roomEngine.activeRoomId, objectId, RoomObjectCategory.FLOOR);
|
||||
}
|
||||
|
||||
private static applySelectionShader(roomObject: IRoomObject): void
|
||||
private static applySelectionShader(roomObject: IRoomObject, filter: WiredFilter): void
|
||||
{
|
||||
if(!roomObject) return;
|
||||
|
||||
@@ -54,13 +103,15 @@ export class WiredSelectionVisualizer
|
||||
|
||||
if(!sprite.filters) sprite.filters = [];
|
||||
|
||||
sprite.filters.push(WiredSelectionVisualizer._selectionShader);
|
||||
if(sprite.filters.includes(filter)) continue;
|
||||
|
||||
sprite.filters.push(filter);
|
||||
|
||||
sprite.increaseUpdateCounter();
|
||||
}
|
||||
}
|
||||
|
||||
private static clearSelectionShader(roomObject: IRoomObject): void
|
||||
private static clearSelectionShader(roomObject: IRoomObject, filter: WiredFilter): void
|
||||
{
|
||||
if(!roomObject) return;
|
||||
|
||||
@@ -72,7 +123,7 @@ export class WiredSelectionVisualizer
|
||||
{
|
||||
if(!sprite.filters) continue;
|
||||
|
||||
const index = sprite.filters.indexOf(WiredSelectionVisualizer._selectionShader);
|
||||
const index = sprite.filters.indexOf(filter);
|
||||
|
||||
if(index >= 0)
|
||||
{
|
||||
|
||||
@@ -15,4 +15,10 @@ export class WiredTriggerLayout
|
||||
public static BOT_REACHED_STUFF: number = 13;
|
||||
public static BOT_REACHED_AVATAR: number = 14;
|
||||
public static RECEIVE_SIGNAL: number = 15;
|
||||
public static AVATAR_LEAVES_ROOM: number = 16;
|
||||
public static EXECUTE_PERIODICALLY_SHORT: number = 17;
|
||||
public static CLICK_FURNI: number = 18;
|
||||
public static CLICK_TILE: number = 19;
|
||||
public static CLICK_USER: number = 20;
|
||||
public static USER_PERFORMS_ACTION: number = 21;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user