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,8 @@
|
||||
export const GetWiredTimeLocale = (value: number) =>
|
||||
{
|
||||
const time = Math.floor((value / 2));
|
||||
|
||||
if(!(value % 2)) return time.toString();
|
||||
|
||||
return (time + 0.5).toString();
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
export class WiredActionLayoutCode
|
||||
{
|
||||
public static TOGGLE_FURNI_STATE: number = 0;
|
||||
public static RESET: number = 1;
|
||||
public static SET_FURNI_STATE: number = 3;
|
||||
public static MOVE_FURNI: number = 4;
|
||||
public static GIVE_SCORE: number = 6;
|
||||
public static CHAT: number = 7;
|
||||
public static TELEPORT: number = 8;
|
||||
public static JOIN_TEAM: number = 9;
|
||||
public static LEAVE_TEAM: number = 10;
|
||||
public static CHASE: number = 11;
|
||||
public static FLEE: number = 12;
|
||||
public static MOVE_AND_ROTATE_FURNI: number = 13;
|
||||
public static GIVE_SCORE_TO_PREDEFINED_TEAM: number = 14;
|
||||
public static TOGGLE_TO_RANDOM_STATE: number = 15;
|
||||
public static MOVE_FURNI_TO: number = 16;
|
||||
public static GIVE_REWARD: number = 17;
|
||||
public static CALL_ANOTHER_STACK: number = 18;
|
||||
public static KICK_FROM_ROOM: number = 19;
|
||||
public static MUTE_USER: number = 20;
|
||||
public static BOT_TELEPORT: number = 21;
|
||||
public static BOT_MOVE: number = 22;
|
||||
public static BOT_TALK: number = 23;
|
||||
public static BOT_GIVE_HAND_ITEM: number = 24;
|
||||
public static BOT_FOLLOW_AVATAR: number = 25;
|
||||
public static BOT_CHANGE_FIGURE: number = 26;
|
||||
public static BOT_TALK_DIRECT_TO_AVTR: number = 27;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
export class WiredConditionlayout
|
||||
{
|
||||
public static STATES_MATCH: number = 0;
|
||||
public static FURNIS_HAVE_AVATARS: number = 1;
|
||||
public static ACTOR_IS_ON_FURNI: number = 2;
|
||||
public static TIME_ELAPSED_MORE: number = 3;
|
||||
public static TIME_ELAPSED_LESS: number = 4;
|
||||
public static USER_COUNT_IN: number = 5;
|
||||
public static ACTOR_IS_IN_TEAM: number = 6;
|
||||
public static HAS_STACKED_FURNIS: number = 7;
|
||||
public static STUFF_TYPE_MATCHES: number = 8;
|
||||
public static STUFFS_IN_FORMATION: number = 9;
|
||||
public static ACTOR_IS_GROUP_MEMBER: number = 10;
|
||||
public static ACTOR_IS_WEARING_BADGE: number = 11;
|
||||
public static ACTOR_IS_WEARING_EFFECT: number = 12;
|
||||
public static NOT_STATES_MATCH: number = 13;
|
||||
public static FURNI_NOT_HAVE_HABBO: number = 14;
|
||||
public static NOT_ACTOR_ON_FURNI: number = 15;
|
||||
public static NOT_USER_COUNT_IN: number = 16;
|
||||
public static NOT_ACTOR_IN_TEAM: number = 17;
|
||||
public static NOT_HAS_STACKED_FURNIS: number = 18;
|
||||
public static NOT_FURNI_IS_OF_TYPE: number = 19;
|
||||
public static NOT_STUFFS_IN_FORMATION: number = 20;
|
||||
public static NOT_ACTOR_IN_GROUP: number = 21;
|
||||
public static NOT_ACTOR_WEARS_BADGE: number = 22;
|
||||
public static NOT_ACTOR_WEARING_EFFECT: number = 23;
|
||||
public static DATE_RANGE_ACTIVE: number = 24;
|
||||
public static ACTOR_HAS_HANDITEM: number = 25;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const WiredDateToString = (date: Date) => `${ date.getFullYear() }/${ ('0' + (date.getMonth() + 1)).slice(-2) }/${ ('0' + date.getDate()).slice(-2) } ${ ('0' + date.getHours()).slice(-2) }:${ ('0' + date.getMinutes()).slice(-2) }`;
|
||||
@@ -0,0 +1,7 @@
|
||||
export class WiredFurniType
|
||||
{
|
||||
public static STUFF_SELECTION_OPTION_NONE: number = 0;
|
||||
public static STUFF_SELECTION_OPTION_BY_ID: number = 1;
|
||||
public static STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE: number = 2;
|
||||
public static STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT: number = 3;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import { GetRoomEngine, IRoomObject, IRoomObjectSpriteVisualization, RoomObjectCategory, WiredFilter } from '@nitrots/nitro-renderer';
|
||||
|
||||
export class WiredSelectionVisualizer
|
||||
{
|
||||
private static _selectionShader: WiredFilter = new WiredFilter({
|
||||
lineColor: [ 1, 1, 1 ],
|
||||
color: [ 0.6, 0.6, 0.6 ]
|
||||
});
|
||||
|
||||
public static show(furniId: number): void
|
||||
{
|
||||
WiredSelectionVisualizer.applySelectionShader(WiredSelectionVisualizer.getRoomObject(furniId));
|
||||
}
|
||||
|
||||
public static hide(furniId: number): void
|
||||
{
|
||||
WiredSelectionVisualizer.clearSelectionShader(WiredSelectionVisualizer.getRoomObject(furniId));
|
||||
}
|
||||
|
||||
public static clearSelectionShaderFromFurni(furniIds: number[]): void
|
||||
{
|
||||
for(const furniId of furniIds)
|
||||
{
|
||||
WiredSelectionVisualizer.clearSelectionShader(WiredSelectionVisualizer.getRoomObject(furniId));
|
||||
}
|
||||
}
|
||||
|
||||
public static applySelectionShaderToFurni(furniIds: number[]): void
|
||||
{
|
||||
for(const furniId of furniIds)
|
||||
{
|
||||
WiredSelectionVisualizer.applySelectionShader(WiredSelectionVisualizer.getRoomObject(furniId));
|
||||
}
|
||||
}
|
||||
|
||||
private static getRoomObject(objectId: number): IRoomObject
|
||||
{
|
||||
const roomEngine = GetRoomEngine();
|
||||
|
||||
return roomEngine.getRoomObject(roomEngine.activeRoomId, objectId, RoomObjectCategory.FLOOR);
|
||||
}
|
||||
|
||||
private static applySelectionShader(roomObject: IRoomObject): void
|
||||
{
|
||||
if(!roomObject) return;
|
||||
|
||||
const visualization = (roomObject.visualization as IRoomObjectSpriteVisualization);
|
||||
|
||||
if(!visualization) return;
|
||||
|
||||
for(const sprite of visualization.sprites)
|
||||
{
|
||||
if(sprite.blendMode === 'add') continue;
|
||||
|
||||
if(!sprite.filters) sprite.filters = [];
|
||||
|
||||
sprite.filters.push(WiredSelectionVisualizer._selectionShader);
|
||||
|
||||
sprite.increaseUpdateCounter();
|
||||
}
|
||||
}
|
||||
|
||||
private static clearSelectionShader(roomObject: IRoomObject): void
|
||||
{
|
||||
if(!roomObject) return;
|
||||
|
||||
const visualization = (roomObject.visualization as IRoomObjectSpriteVisualization);
|
||||
|
||||
if(!visualization) return;
|
||||
|
||||
for(const sprite of visualization.sprites)
|
||||
{
|
||||
if(!sprite.filters) continue;
|
||||
|
||||
const index = sprite.filters.indexOf(WiredSelectionVisualizer._selectionShader);
|
||||
|
||||
if(index >= 0)
|
||||
{
|
||||
sprite.filters.splice(index, 1);
|
||||
|
||||
sprite.increaseUpdateCounter();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const WIRED_STRING_DELIMETER: string = '\t';
|
||||
@@ -0,0 +1,17 @@
|
||||
export class WiredTriggerLayout
|
||||
{
|
||||
public static AVATAR_SAYS_SOMETHING: number = 0;
|
||||
public static AVATAR_WALKS_ON_FURNI: number = 1;
|
||||
public static AVATAR_WALKS_OFF_FURNI: number = 2;
|
||||
public static EXECUTE_ONCE: number = 3;
|
||||
public static TOGGLE_FURNI: number = 4;
|
||||
public static EXECUTE_PERIODICALLY: number = 6;
|
||||
public static AVATAR_ENTERS_ROOM: number = 7;
|
||||
public static GAME_STARTS: number = 8;
|
||||
public static GAME_ENDS: number = 9;
|
||||
public static SCORE_ACHIEVED: number = 10;
|
||||
public static COLLISION: number = 11;
|
||||
public static EXECUTE_PERIODICALLY_LONG: number = 12;
|
||||
public static BOT_REACHED_STUFF: number = 13;
|
||||
public static BOT_REACHED_AVATAR: number = 14;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export * from './GetWiredTimeLocale';
|
||||
export * from './WiredActionLayoutCode';
|
||||
export * from './WiredConditionLayoutCode';
|
||||
export * from './WiredDateToString';
|
||||
export * from './WiredFurniType';
|
||||
export * from './WiredSelectionVisualizer';
|
||||
export * from './WiredStringDelimeter';
|
||||
export * from './WiredTriggerLayoutCode';
|
||||
Reference in New Issue
Block a user