mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-25 17:59:34 +00:00
Proper typing for screen names
This commit is contained in:
parent
e82704b570
commit
0997a0d218
24 changed files with 197 additions and 100 deletions
BondageClub
Screens
Character
Appearance
BackgroundSelection
FriendList
InformationSheet
Login
Relog
Inventory/ItemDevices/WheelFortune
MiniGame
Online
ChatAdmin
ChatBlockItem
ChatRoom
ChatSearch
Room
Scripts
|
@ -37,9 +37,8 @@ var CharacterAppearanceColorPickerRefreshTimer = null;
|
|||
var CharacterAppearanceSelection = null;
|
||||
/** @type {(accept: boolean) => void} */
|
||||
var CharacterAppearanceResultCallback = undefined;
|
||||
var CharacterAppearanceReturnRoom = "MainHall";
|
||||
/** @type {ModuleType} */
|
||||
var CharacterAppearanceReturnModule = "Room";
|
||||
/** @type {ScreenSpecifier} */
|
||||
var CharacterAppearanceReturnScreen = ["Room", "MainHall"];
|
||||
var CharacterAppearanceWardrobeOffset = 0;
|
||||
var CharacterAppearanceWardrobeText = "";
|
||||
var CharacterAppearanceWardrobeName = "";
|
||||
|
@ -1772,11 +1771,11 @@ function CharacterAppearanceCopy(FromC, ToC) {
|
|||
*/
|
||||
function CharacterAppearanceLoadCharacter(C, resultCallback) {
|
||||
CharacterAppearanceSelection = C;
|
||||
CharacterAppearanceReturnModule = CurrentModule;
|
||||
CharacterAppearanceReturnRoom = CurrentScreen;
|
||||
|
||||
CharacterAppearanceReturnScreen = CommonGetScreen();
|
||||
if (!resultCallback) {
|
||||
CharacterAppearanceResultCallback = (_result) => {
|
||||
CommonSetScreen(CharacterAppearanceReturnModule, CharacterAppearanceReturnRoom);
|
||||
CommonSetScreen(...CharacterAppearanceReturnScreen);
|
||||
};
|
||||
} else {
|
||||
CharacterAppearanceResultCallback = resultCallback;
|
||||
|
|
|
@ -11,9 +11,8 @@ var BackgroundSelectionSize = 12;
|
|||
var BackgroundSelectionOffset = 0;
|
||||
/** @type {null | ((selection: string) => void)} */
|
||||
var BackgroundSelectionCallback = null;
|
||||
/** @type {"" | ModuleType} */
|
||||
var BackgroundSelectionPreviousModule = "";
|
||||
var BackgroundSelectionPreviousScreen = "";
|
||||
/** @type {ScreenSpecifier | null} */
|
||||
var BackgroundSelectionReturnScreen = null;
|
||||
/** @type {{ Name: string, Description: string, Low: string }[]} */
|
||||
var BackgroundSelectionAll = [];
|
||||
/** @type {{ Name: string, Description: string, Low: string }[]} */
|
||||
|
@ -30,8 +29,7 @@ function BackgroundSelectionMake(List, Idx, Callback) {
|
|||
BackgroundSelectionList = List;
|
||||
BackgroundSelectionIndex = Idx < List.length ? Idx : 0;
|
||||
BackgroundSelectionCallback = Callback;
|
||||
BackgroundSelectionPreviousModule = CurrentModule;
|
||||
BackgroundSelectionPreviousScreen = CurrentScreen;
|
||||
BackgroundSelectionReturnScreen = CommonGetScreen();
|
||||
CommonSetScreen("Character", "BackgroundSelection");
|
||||
}
|
||||
|
||||
|
@ -215,7 +213,7 @@ function BackgroundSelectionExit(SetBackground=false) {
|
|||
ElementRemove("TagDropDown");
|
||||
if (SetBackground && BackgroundSelectionCallback) BackgroundSelectionCallback(BackgroundSelectionSelect);
|
||||
BackgroundSelectionCallback = null;
|
||||
if (BackgroundSelectionPreviousModule) {
|
||||
CommonSetScreen(BackgroundSelectionPreviousModule, BackgroundSelectionPreviousScreen);
|
||||
if (BackgroundSelectionReturnScreen) {
|
||||
CommonSetScreen(...BackgroundSelectionReturnScreen);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ type FriendListMode = "OnlineFriends" | "Beeps" | "AllFriends";
|
|||
type FriendListSortingMode = 'None' | 'MemberName' | 'MemberNickname' | 'MemberNumber' | 'ChatRoomName' | 'RelationType';
|
||||
type FriendListSortingDirection = 'Asc' | 'Desc';
|
||||
|
||||
type FriendListReturn = { Screen: string, Module: ModuleType, IsInChatRoom?: boolean, hasScrolledChat?: boolean };
|
||||
type FriendListReturn<T extends ModuleType> = { Screen: ModuleScreens[T], Module: T, IsInChatRoom?: boolean, hasScrolledChat?: boolean };
|
||||
|
||||
type FriendRawData = {
|
||||
memberNumber?: number; /* undefined for NPCs */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
var FriendListBackground = "BrickWall";
|
||||
/** @type {number[]} */
|
||||
var FriendListConfirmDelete = [];
|
||||
/** @type {FriendListReturn | null} */
|
||||
/** @type {FriendListReturn<any> | null} */
|
||||
var FriendListReturn = null;
|
||||
/** @type {FriendListModes} */
|
||||
var FriendListMode = ["OnlineFriends", "Beeps", "AllFriends"];
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
var InformationSheetBackground = "Sheet";
|
||||
/** @type {null | Character | NPCCharacter} */
|
||||
var InformationSheetSelection = null;
|
||||
/** @type {"" | ModuleType} */
|
||||
var InformationSheetPreviousModule = "";
|
||||
var InformationSheetPreviousScreen = "";
|
||||
/** @type {ScreenSpecifier | null} */
|
||||
var InformationSheetReturnScreen = null;
|
||||
var InformationSheetSecondScreen = false;
|
||||
|
||||
/**
|
||||
|
@ -266,8 +265,8 @@ function InformationSheetClick() {
|
|||
*/
|
||||
function InformationSheetExit() {
|
||||
InformationSheetSecondScreen = false;
|
||||
if (InformationSheetPreviousModule) {
|
||||
CommonSetScreen(InformationSheetPreviousModule, InformationSheetPreviousScreen);
|
||||
if (InformationSheetReturnScreen) {
|
||||
CommonSetScreen(...InformationSheetReturnScreen);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,7 +277,6 @@ function InformationSheetExit() {
|
|||
*/
|
||||
function InformationSheetLoadCharacter(C) {
|
||||
InformationSheetSelection = C;
|
||||
InformationSheetPreviousModule = CurrentModule;
|
||||
InformationSheetPreviousScreen = CurrentScreen;
|
||||
InformationSheetReturnScreen = CommonGetScreen();
|
||||
CommonSetScreen("Character", "InformationSheet");
|
||||
}
|
||||
|
|
|
@ -7,10 +7,10 @@ var LoginThankYou = "";
|
|||
/* eslint-disable */
|
||||
var LoginThankYouList = [
|
||||
"Abysseia", "Aceffect14", "alarik", "ArashiSama", "BlueWinter", "bryce", "Canti",
|
||||
"Christian", "Christoffer", "Cm382714", "Dahmia", "Desch", "domenico", "Dragokahn",
|
||||
"dynilath", "Edwin", "Glurak", "Greendragon", "john", "Laurie", "linkjpm", "Lyall",
|
||||
"Marashu", "Michel", "Mindtie", "Misa", "Nightcore", "René", "Robin", "Samonas",
|
||||
"Schrödingers", "Setsu95", "Sticks", "Sunny", "Tam", "Tarram1010", "Teli", "Thkdt",
|
||||
"Christian", "Christoffer", "Cm382714", "Dahmia", "Desch", "domenico", "Dragokahn",
|
||||
"dynilath", "Edwin", "Glurak", "Greendragon", "john", "Laurie", "linkjpm", "Lyall",
|
||||
"Marashu", "Michel", "Mindtie", "Misa", "Nightcore", "René", "Robin", "Samonas",
|
||||
"Schrödingers", "Setsu95", "Sticks", "Sunny", "Tam", "Tarram1010", "Teli", "Thkdt",
|
||||
"TonyBoy", "Troubadix", "Troy", "Umbrapop28", "WhiteSniper", "XDWolfie", "Xepherio", "火芽"
|
||||
];
|
||||
|
||||
|
@ -928,7 +928,8 @@ function LoginResponse(C) {
|
|||
CommonSetScreen("Online", "ChatSearch");
|
||||
ServerSend("ChatRoomJoin", { Name: RelogData.ChatRoomName });
|
||||
} else {
|
||||
CommonSetScreen(RelogData.Module, RelogData.Screen);
|
||||
const screen = /** @type {ScreenSpecifier} */([RelogData.Module, RelogData.Screen]);
|
||||
CommonSetScreen(...screen);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
var RelogBackground = "";
|
||||
var RelogCanvas = document.createElement("canvas");
|
||||
/** @type {null | { Screen: string, Module: ModuleType, Character: Character, ChatRoomName: string | null}} */
|
||||
/** @type {null | RelogData} */
|
||||
var RelogData = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
/** @type {ExtendedItemScriptHookCallbacks.Load<NoArchItemData>} */
|
||||
function InventoryItemDevicesWheelFortuneLoadHook() {
|
||||
WheelFortuneEntryModule = CurrentModule;
|
||||
WheelFortuneEntryScreen = CurrentScreen;
|
||||
WheelFortuneReturnScreen = CommonGetScreen();
|
||||
WheelFortuneBackground = "MainHall";
|
||||
if (CurrentScreen == "ChatRoom") WheelFortuneBackground = ChatRoomBackground;
|
||||
WheelFortuneCharacter = CurrentCharacter;
|
||||
|
|
|
@ -748,7 +748,7 @@ function KinkyDungeonLoad() {
|
|||
* @returns {boolean} - If the player is in the arcade
|
||||
*/
|
||||
function KinkyDungeonDeviousDungeonAvailable() {
|
||||
return KinkyDungeonIsPlayer() && (DialogGamingPreviousRoom == "Arcade" || MiniGameReturnFunction == "ArcadeKinkyDungeonEnd") && !KDPatched;
|
||||
return KinkyDungeonIsPlayer() && (DialogGamingReturnScreen?.[1] == "Arcade" || MiniGameReturnFunction == "ArcadeKinkyDungeonEnd") && !KDPatched;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @returns {void}
|
||||
*/
|
||||
function KinkyDungeonMultiplayerUpdate(Delay) {
|
||||
if (KinkyDungeonIsPlayer() && ChatRoomCharacter && ChatRoomCharacter.length > 1 && DialogGamingPreviousRoom == "ChatRoom" && KinkyDungeonNextDataSendTime + Delay < CommonTime()) {
|
||||
if (KinkyDungeonIsPlayer() && ChatRoomCharacter && ChatRoomCharacter.length > 1 && DialogGamingReturnScreen?.[1] === "ChatRoom" && KinkyDungeonNextDataSendTime + Delay < CommonTime()) {
|
||||
let MN = [];
|
||||
|
||||
for (let C = 0; C < ChatRoomCharacter.length; C++) {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
"use strict";
|
||||
var WheelFortuneBackground = "Black";
|
||||
/** @type {"" | ModuleType} */
|
||||
var WheelFortuneEntryModule = "";
|
||||
var WheelFortuneEntryScreen = "";
|
||||
/** @type {ScreenSpecifier | null} */
|
||||
var WheelFortuneReturnScreen = null;
|
||||
/** @type {null | Character} */
|
||||
var WheelFortuneCharacter = null;
|
||||
var WheelFortuneRoleplay = false;
|
||||
|
@ -947,12 +946,12 @@ function WheelFortuneMouseUp() {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function WheelFortuneResult() {
|
||||
if (WheelFortuneEntryScreen == "ChatRoom") {
|
||||
if (WheelFortuneReturnScreen?.[1] === "ChatRoom") {
|
||||
let Msg = TextGet("Result" + (WheelFortuneRoleplay ? "Roleplay" : "")) + " " + TextGet("Option" + WheelFortuneValue);
|
||||
ServerSend("ChatRoomChat", { Content: Msg, Type: "Emote" });
|
||||
}
|
||||
if (WheelFortuneEntryModule) {
|
||||
CommonSetScreen(WheelFortuneEntryModule, WheelFortuneEntryScreen);
|
||||
if (WheelFortuneReturnScreen) {
|
||||
CommonSetScreen(...WheelFortuneReturnScreen);
|
||||
}
|
||||
if (!WheelFortuneRoleplay)
|
||||
for (let O of WheelFortuneOption)
|
||||
|
@ -966,7 +965,7 @@ function WheelFortuneResult() {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function WheelFortuneExit() {
|
||||
if (WheelFortuneVelocity == 0 && !WheelFortuneForced && WheelFortuneEntryModule) {
|
||||
CommonSetScreen(WheelFortuneEntryModule, WheelFortuneEntryScreen);
|
||||
if (WheelFortuneVelocity == 0 && !WheelFortuneForced && WheelFortuneReturnScreen) {
|
||||
CommonSetScreen(...WheelFortuneReturnScreen);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -316,7 +316,7 @@ function ChatAdminClick() {
|
|||
return;
|
||||
} else if (MouseIn(1300, 550, 275, 60)) {
|
||||
ChatBlockItemEditable = ChatAdminCanEdit();
|
||||
ChatBlockItemReturnData = { Screen: "ChatAdmin" };
|
||||
ChatBlockItemReturnScreen = CommonGetScreen();
|
||||
ChatBlockItemCategory = ChatAdminData.BlockCategory;
|
||||
CommonSetScreen("Online", "ChatBlockItem");
|
||||
return;
|
||||
|
|
|
@ -5,8 +5,8 @@ var ChatBlockItemList = ["ABDL", "SciFi", "Fantasy", "Leashing", "Photos", "Arou
|
|||
/** @type {ServerChatRoomBlockCategory[]} */
|
||||
var ChatBlockItemCategory = [];
|
||||
var ChatBlockItemEditable = true;
|
||||
/** @type { { Screen?: string; } } */
|
||||
var ChatBlockItemReturnData = {};
|
||||
/** @type {ScreenSpecifier | null} */
|
||||
var ChatBlockItemReturnScreen = null;
|
||||
|
||||
/**
|
||||
* Loads the chat room item blocking screen
|
||||
|
@ -51,6 +51,6 @@ function ChatBlockItemClick() {
|
|||
* @type {ScreenFunctions["Exit"]}
|
||||
*/
|
||||
function ChatBlockItemExit() {
|
||||
CommonSetScreen("Online", ChatBlockItemReturnData.Screen);
|
||||
CommonSetScreen(...ChatBlockItemReturnScreen);
|
||||
ChatBlockItemEditable = true;
|
||||
}
|
||||
|
|
|
@ -520,8 +520,7 @@ function ChatRoomCanStartWheelFortune() { return (CurrentCharacter != null) && I
|
|||
*/
|
||||
function ChatRoomStartWheelFortune() {
|
||||
if ((CurrentCharacter == null) || !InventoryIsWorn(CurrentCharacter, "WheelFortune", "ItemDevices")) return;
|
||||
WheelFortuneEntryModule = CurrentModule;
|
||||
WheelFortuneEntryScreen = CurrentScreen;
|
||||
WheelFortuneReturnScreen = CommonGetScreen();
|
||||
WheelFortuneBackground = ChatRoomData.Background;
|
||||
WheelFortuneCharacter = CurrentCharacter;
|
||||
DialogLeave();
|
||||
|
@ -1313,10 +1312,11 @@ function ChatRoomClearAllElements() {
|
|||
|
||||
/**
|
||||
* Starts the chatroom selection screen.
|
||||
* @template {ModuleType} T
|
||||
* @param {ServerChatRoomSpace} Space - Name of the chatroom space
|
||||
* @param {ServerChatRoomGame} Game - Name of the chatroom game to play
|
||||
* @param {string | null} LeaveRoom - Name of the room to go back to when exiting chatsearch.
|
||||
* @param {ModuleType | null} LeaveSpace - Name of the space to go back to when exiting chatsearch.
|
||||
* @param {ModuleScreens[T] | null} LeaveRoom - Name of the room to go back to when exiting chatsearch.
|
||||
* @param {T | null} LeaveSpace - Name of the space to go back to when exiting chatsearch.
|
||||
* @param {string} Background - Name of the background to use in chatsearch.
|
||||
* @param {BackgroundTag[]} BackgroundTagList - List of available backgrounds in the chatroom space.
|
||||
* @returns {void} - Nothing.
|
||||
|
@ -1324,15 +1324,12 @@ function ChatRoomClearAllElements() {
|
|||
function ChatRoomStart(Space, Game, LeaveRoom, LeaveSpace, Background, BackgroundTagList) {
|
||||
if (!LeaveRoom || !LeaveSpace) {
|
||||
if (Player.GenderSettings.AutoJoinSearch.Female || Player.GenderSettings.AutoJoinSearch.Male) {
|
||||
ChatSearchLeaveRoom = "MainHall";
|
||||
ChatSearchLeaveSpace = "Room";
|
||||
ChatSearchReturnScreen = ["Room", "MainHall"];
|
||||
} else {
|
||||
ChatSearchLeaveRoom = "ChatSelect";
|
||||
ChatSearchLeaveSpace = "Online";
|
||||
ChatSearchReturnScreen = ["Online", "ChatSelect"];
|
||||
}
|
||||
} else {
|
||||
ChatSearchLeaveRoom = LeaveRoom;
|
||||
ChatSearchLeaveSpace = LeaveSpace;
|
||||
ChatSearchReturnScreen = /** @type {ScreenSpecifier} */([LeaveSpace, LeaveRoom]);
|
||||
}
|
||||
|
||||
ChatRoomSpace = Space;
|
||||
|
@ -2561,7 +2558,7 @@ function ChatRoomMenuClick(event) {
|
|||
}
|
||||
case "GameOption":
|
||||
// The cut button can become the game option button if there's an online game going on
|
||||
CommonSetScreen("Online", "Game" + ChatRoomGame);
|
||||
CommonSetScreen("Online", /** @type {ModuleScreens["Online"]} */("Game" + ChatRoomGame));
|
||||
break;
|
||||
case "Kneel":
|
||||
ChatRoomToggleKneel();
|
||||
|
@ -5277,14 +5274,13 @@ function ChatRoomAllowItem(data) {
|
|||
* @param {Character} C
|
||||
*/
|
||||
function ChatRoomAppearanceLoadCharacter(C) {
|
||||
const module = CurrentModule;
|
||||
const screen = CurrentScreen;
|
||||
const screen = CommonGetScreen();
|
||||
const inChatRoom = ServerPlayerIsInChatRoom();
|
||||
if (inChatRoom) {
|
||||
ChatRoomStatusUpdate("Wardrobe");
|
||||
}
|
||||
CharacterAppearanceLoadCharacter(C, (ready) => {
|
||||
CommonSetScreen(module, screen);
|
||||
CommonSetScreen(...screen);
|
||||
if (inChatRoom) {
|
||||
ChatRoomShowElements();
|
||||
ChatRoomStatusUpdate(null);
|
||||
|
@ -5586,8 +5582,7 @@ function ChatRoomSetRule(data) {
|
|||
if (C.IsOwner())
|
||||
CharacterSetCurrent(C);
|
||||
if ((CurrentCharacter == null) || !CurrentCharacter.IsOwner() || !InventoryIsWorn(CurrentCharacter, "WheelFortune", "ItemDevices")) return;
|
||||
WheelFortuneEntryModule = CurrentModule;
|
||||
WheelFortuneEntryScreen = CurrentScreen;
|
||||
WheelFortuneReturnScreen = CommonGetScreen();
|
||||
WheelFortuneBackground = ChatRoomData.Background;
|
||||
WheelFortuneCharacter = CurrentCharacter;
|
||||
WheelFortuneForced = true;
|
||||
|
|
|
@ -1045,8 +1045,7 @@ const CommonCommands = [
|
|||
Tag: "wheel",
|
||||
Action: () => {
|
||||
if (!InventoryAvailable(Player, "WheelFortune", "ItemDevices")) return;
|
||||
WheelFortuneEntryModule = CurrentModule;
|
||||
WheelFortuneEntryScreen = CurrentScreen;
|
||||
WheelFortuneReturnScreen = CommonGetScreen();
|
||||
WheelFortuneBackground = ChatRoomData.Background;
|
||||
WheelFortuneCharacter = Player;
|
||||
CommonSetScreen("MiniGame", "WheelFortune");
|
||||
|
@ -1176,8 +1175,8 @@ const CommonCommands = [
|
|||
{
|
||||
Tag: "shop",
|
||||
Action: () => {
|
||||
/** @type {null | [module: ModuleType, screen: string]} */
|
||||
const screen = CurrentModule && CurrentScreen ? [CurrentModule, CurrentScreen] : null;
|
||||
/** @type {null | ScreenSpecifier} */
|
||||
const screen = CurrentModule && CurrentScreen ? CommonGetScreen() : null;
|
||||
/** @type {null | string} */
|
||||
let background = null;
|
||||
if (ServerPlayerIsInChatRoom()) {
|
||||
|
|
|
@ -36,9 +36,8 @@ var ChatSearchListParams = {
|
|||
/** Pre-calculated. Must be updated if you change the grid parameters */
|
||||
var ChatSearchRoomsPerPage = 21;
|
||||
var ChatSearchMessage = "";
|
||||
var ChatSearchLeaveRoom = "MainHall";
|
||||
/** @type {ModuleType} */
|
||||
var ChatSearchLeaveSpace = "Room";
|
||||
/** @type {ScreenSpecifier} */
|
||||
var ChatSearchReturnScreen = ["Room", "MainHall"];
|
||||
/** @type {null | Item[]} */
|
||||
var ChatSearchSafewordAppearance = null;
|
||||
/** @type {null | Partial<Record<AssetPoseCategory, AssetPoseName>>} */
|
||||
|
@ -55,7 +54,7 @@ var ChatSearchFilterHelpActive = false;
|
|||
/** @type {null | { Index: number, RoomLabel: string, MemberLabel: string, WordsLabel: string }} */
|
||||
var ChatSearchFilterUnhideConfirm = null;
|
||||
var ChatSearchRejoinIncrement = 1;
|
||||
/** @type {null | string} */
|
||||
/** @type {null | RoomName} */
|
||||
var ChatSearchReturnToScreen = null;
|
||||
/** @type {"" | ServerChatRoomLanguage} */
|
||||
var ChatSearchLanguage = "";
|
||||
|
@ -76,12 +75,12 @@ function ChatSearchLoad() {
|
|||
ChatRoomMapViewEditBackup = [];
|
||||
delete Player.MapData;
|
||||
if (ChatSearchReturnToScreen != null) {
|
||||
CommonSetScreen("Room", ChatSearchReturnToScreen);
|
||||
CommonSetScreen(.../** @type {ScreenSpecifier} */(["Room", ChatSearchReturnToScreen]));
|
||||
ChatSearchReturnToScreen = null;
|
||||
return;
|
||||
}
|
||||
CurrentDarkFactor = 0.5;
|
||||
if (ChatSearchLeaveRoom == "MainHall") {
|
||||
if (ChatSearchReturnScreen?.[1] === "MainHall") {
|
||||
ChatRoomGame = "";
|
||||
OnlineGameReset();
|
||||
}
|
||||
|
@ -456,7 +455,7 @@ function ChatSearchExit() {
|
|||
ChatSearchPreviousActivePose = { ...Player.ActivePoseMapping };
|
||||
ChatSearchLastSearchDataJSON = null;
|
||||
ElementRemove("InputSearch");
|
||||
CommonSetScreen(ChatSearchLeaveSpace, ChatSearchLeaveRoom);
|
||||
CommonSetScreen(...ChatSearchReturnScreen);
|
||||
DrawingGetTextSize.clearCache();
|
||||
}
|
||||
|
||||
|
@ -974,7 +973,7 @@ function ChatSearchAutoJoinRoom() {
|
|||
}
|
||||
|
||||
// This is a search triggered from a relog
|
||||
if (Player.ImmersionSettings && Player.ImmersionSettings.ReturnToChatRoom && Player.LastChatRoom && !PandoraPenitentiaryIsInmate(Player) && ((ChatSearchLeaveRoom !== "AsylumEntrance") || (AsylumGGTSGetLevel(Player) <= 0))) {
|
||||
if (Player.ImmersionSettings && Player.ImmersionSettings.ReturnToChatRoom && Player.LastChatRoom && !PandoraPenitentiaryIsInmate(Player) && ((ChatSearchReturnScreen?.[1] !== "AsylumEntrance") || (AsylumGGTSGetLevel(Player) <= 0))) {
|
||||
let roomFound = false;
|
||||
let roomIsFull = false;
|
||||
// Try joining our previous room
|
||||
|
|
|
@ -377,7 +377,7 @@ function MaidQuartersRemoveMaidUniform() {
|
|||
|
||||
/**
|
||||
* Starts a mini game or maid chore
|
||||
* @param {string} GameType - Name of the mini-game to launch
|
||||
* @param {ModuleScreens["MiniGame"]} GameType - Name of the mini-game to launch
|
||||
* @param {number} Difficulty - Difficulty Ration for the mini-game
|
||||
* @returns {void} - Nothing
|
||||
*/
|
||||
|
|
|
@ -409,7 +409,7 @@ function MainHallCycleTips() {
|
|||
|
||||
/**
|
||||
* Validates the player's move into a new room. Before entering the requested rooms, the player can be attacked by random kidnappers or intercepted by various NPC types
|
||||
* @param {string} RoomName - Name of the room the player is heading to
|
||||
* @param {RoomName | "Trouble"} RoomName - Name of the room the player is heading to
|
||||
* @returns {void} - Nothing
|
||||
*/
|
||||
function MainHallWalk(RoomName) {
|
||||
|
@ -444,7 +444,7 @@ function MainHallWalk(RoomName) {
|
|||
MainHallRandomEventOdds = MainHallRandomEventOdds + 2;
|
||||
if (ManagementIsClubSlave()) MainHallRandomEventOdds = MainHallRandomEventOdds + 4;
|
||||
if ((KidnapLeagueBountyLocation == RoomName) && (KidnapLeagueBounty != null) && (KidnapLeagueBountyVictory == null) && Player.CanInteract() && (ReputationGet("Kidnap") > 0)) KidnapLeagueBountyStart();
|
||||
else CommonSetScreen("Room", RoomName);
|
||||
else CommonSetScreen(.../** @type {ScreenSpecifier} */(["Room", RoomName]));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ const Shop2InitVars = CommonVariableContainer(
|
|||
|
||||
/**
|
||||
* The module- and screen-name of the previous screen (if any)
|
||||
* @type {null | [module: ModuleType, screen: string]}
|
||||
* @type {null | ScreenSpecifier}
|
||||
*/
|
||||
PreviousScreen: null,
|
||||
|
||||
|
@ -1165,7 +1165,7 @@ var Shop2 = {
|
|||
/**
|
||||
* Helper function for initializing the `Shop2` screen.
|
||||
* @param {null | string} background - The shops background image
|
||||
* @param {null | [module: ModuleType, screen: string]} screen - A 2-tuple containing the module and name of the previous screen
|
||||
* @param {null | ScreenSpecifier} screen - A 2-tuple containing the module and name of the previous screen
|
||||
* @param {null | readonly Asset[]} assets - A list of all assets that should appear in the shop
|
||||
*/
|
||||
Init(background=null, screen=null, assets=null) {
|
||||
|
|
|
@ -9,7 +9,7 @@ var Player;
|
|||
var KeyPress = "";
|
||||
/** @type {ModuleType} */
|
||||
var CurrentModule;
|
||||
/** @type {string} */
|
||||
/** @type {ModuleScreens[CurrentModule]} */
|
||||
var CurrentScreen;
|
||||
/** @type {ScreenFunctions} */
|
||||
var CurrentScreenFunctions;
|
||||
|
@ -415,13 +415,20 @@ function CommonCallFunctionByNameWarn(FunctionName/*, ...args */) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current screen
|
||||
* @returns {ScreenSpecifier}
|
||||
*/
|
||||
function CommonGetScreen() {
|
||||
return /** @type {ScreenSpecifier} */([CurrentModule, CurrentScreen]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the current screen and calls the loading script if needed
|
||||
* @param {ModuleType} NewModule - Module of the screen to display
|
||||
* @param {string} NewScreen - Screen to display
|
||||
* @param {ScreenSpecifier} spec
|
||||
* @returns {void} - Nothing
|
||||
*/
|
||||
function CommonSetScreen(NewModule, NewScreen) {
|
||||
function CommonSetScreen(...spec) {
|
||||
if (CurrentScreenFunctions && CurrentScreenFunctions.Unload) {
|
||||
CurrentScreenFunctions.Unload();
|
||||
}
|
||||
|
@ -430,6 +437,7 @@ function CommonSetScreen(NewModule, NewScreen) {
|
|||
}
|
||||
|
||||
|
||||
const [NewModule, NewScreen] = spec;
|
||||
// Check for required functions
|
||||
if (typeof window[`${NewScreen}Run`] !== "function") {
|
||||
throw Error(`Screen "${NewScreen}": Missing required Run function`);
|
||||
|
@ -1639,3 +1647,12 @@ var CommonKey = /** @type {const} */({
|
|||
}
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {RoomName} screen
|
||||
*/
|
||||
function CommonScreenName(screen) {
|
||||
const cache = TextAllScreenCache.get(`Screens/Room/MainHall/Text_MainHall.csv`);
|
||||
return cache.get(screen);
|
||||
}
|
||||
|
|
|
@ -131,9 +131,8 @@ var DialogSortOrder = /** @type {const} */({
|
|||
var DialogSelfMenuSelected = null;
|
||||
var DialogLeaveDueToItem = false; // This allows dynamic items to call DialogLeave() without crashing the game
|
||||
var DialogLentLockpicks = false;
|
||||
var DialogGamingPreviousRoom = "";
|
||||
/** @type {"" | ModuleType} */
|
||||
var DialogGamingPreviousModule = "";
|
||||
/** @type {ScreenSpecifier | null} */
|
||||
var DialogGamingReturnScreen = null;
|
||||
var DialogButtonDisabledTester = /Disabled(For\w+)?$/u;
|
||||
/**
|
||||
* The attempted action that's leading the player to struggle.
|
||||
|
@ -644,8 +643,7 @@ function DialogStartKinkyDungeon() {
|
|||
ServerSend("ChatRoomChat", { Content: "RequestFullKinkyDungeonData", Type: "Hidden", Target: CurrentCharacter.MemberNumber });
|
||||
}
|
||||
}
|
||||
DialogGamingPreviousRoom = CurrentScreen;
|
||||
DialogGamingPreviousModule = CurrentModule;
|
||||
DialogGamingReturnScreen = CommonGetScreen();
|
||||
MiniGameStart("KinkyDungeon", 0, "DialogEndKinkyDungeon");
|
||||
}
|
||||
}
|
||||
|
@ -656,8 +654,8 @@ function DialogStartKinkyDungeon() {
|
|||
* @returns {void}
|
||||
*/
|
||||
function DialogEndKinkyDungeon() {
|
||||
if (DialogGamingPreviousModule) {
|
||||
CommonSetScreen(DialogGamingPreviousModule, DialogGamingPreviousRoom);
|
||||
if (DialogGamingReturnScreen) {
|
||||
CommonSetScreen(...DialogGamingReturnScreen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ function MiniGameLoad() {
|
|||
|
||||
/**
|
||||
* Starts a given mini game at a set difficulty and keeps
|
||||
* @param {string} GameType - Name of the mini-game to launch
|
||||
* @param {ModuleScreens["MiniGame"]} GameType - Name of the mini-game to launch
|
||||
* @param {number|string} Difficulty - Difficulty Ration for the mini-game
|
||||
* @param {string} ReturnFunction - Callback name to execute once the mini-game is over
|
||||
* @returns {void} - Nothing
|
||||
|
|
|
@ -202,7 +202,8 @@ function ServerDisconnect(data, close = false) {
|
|||
RelogData = { Screen: "ChatSearch", Module: "Online", Character: null, ChatRoomName: ChatRoomData?.Name };
|
||||
ChatRoomData = null;
|
||||
} else {
|
||||
RelogData = { Screen: CurrentScreen, Module: CurrentModule, Character: CurrentCharacter, ChatRoomName: null };
|
||||
// Forcing cast here because CurrentModule & CurrentScreen can't meaningfully be type-linked
|
||||
RelogData = { Screen: /** @type {any} */(CurrentScreen), Module: CurrentModule, Character: CurrentCharacter, ChatRoomName: null };
|
||||
}
|
||||
|
||||
DialogLeave();
|
||||
|
@ -249,17 +250,17 @@ ServerPlayerChatRoom.register(
|
|||
{ screen: "ChatRoom" },
|
||||
{ screen: "ChatAdmin" },
|
||||
{ screen: "GameLARP" },
|
||||
{ screen: "Appearance", callback: () => CharacterAppearanceReturnRoom === "ChatRoom" },
|
||||
{ screen: "InformationSheet", callback: () => InformationSheetPreviousScreen === "ChatRoom" },
|
||||
{ screen: "Title", callback: () => InformationSheetPreviousScreen === "ChatRoom" },
|
||||
{ screen: "OnlineProfile", callback: () => InformationSheetPreviousScreen === "ChatRoom" },
|
||||
{ screen: "FriendList", callback: () => InformationSheetPreviousScreen === "ChatRoom" && (FriendListReturn == null || FriendListReturn.IsInChatRoom) },
|
||||
{ screen: "Preference", callback: () => InformationSheetPreviousScreen === "ChatRoom" },
|
||||
{ screen: "MiniGame", callback: () => DialogGamingPreviousRoom === "ChatRoom" },
|
||||
{ screen: "Appearance", callback: () => CharacterAppearanceReturnScreen?.[1] === "ChatRoom" },
|
||||
{ screen: "InformationSheet", callback: () => InformationSheetReturnScreen?.[1] === "ChatRoom" },
|
||||
{ screen: "Title", callback: () => InformationSheetReturnScreen?.[1] === "ChatRoom" },
|
||||
{ screen: "OnlineProfile", callback: () => InformationSheetReturnScreen?.[1] === "ChatRoom" },
|
||||
{ screen: "FriendList", callback: () => InformationSheetReturnScreen?.[1] === "ChatRoom" && (FriendListReturn == null || FriendListReturn.IsInChatRoom) },
|
||||
{ screen: "Preference", callback: () => InformationSheetReturnScreen?.[1] === "ChatRoom" },
|
||||
{ screen: "MiniGame", callback: () => DialogGamingReturnScreen?.[1] === "ChatRoom" },
|
||||
{ screen: "Crafting", callback: () => CraftingReturnToChatroom },
|
||||
{ screen: "Shop2", callback: () => Shop2InitVars.PreviousScreen?.[1] === "ChatRoom" },
|
||||
{ screen: "WheelFortune", callback: () => WheelFortuneEntryScreen === "ChatRoom" },
|
||||
{ screen: "WheelFortuneCustomize", callback: () => WheelFortuneEntryScreen === "ChatRoom" },
|
||||
{ screen: "WheelFortune", callback: () => WheelFortuneReturnScreen?.[1] === "ChatRoom" },
|
||||
{ screen: "WheelFortuneCustomize", callback: () => WheelFortuneReturnScreen?.[1] === "ChatRoom" },
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
96
BondageClub/Scripts/Typedef.d.ts
vendored
96
BondageClub/Scripts/Typedef.d.ts
vendored
|
@ -582,7 +582,101 @@ type TitleName =
|
|||
|
||||
type MagicSchoolHouse = "Maiestas" | "Vincula" | "Amplector" | "Corporis";
|
||||
|
||||
type ModuleType = "Character" | "Cutscene" | "MiniGame" | "Online" | "Room";
|
||||
type ModuleType = keyof ModuleScreens;
|
||||
|
||||
interface ModuleScreens {
|
||||
Character:
|
||||
| "Appearance"
|
||||
| "BackgroundSelection"
|
||||
| "Cheat"
|
||||
| "Creation"
|
||||
| "Disclaimer"
|
||||
| "FriendList"
|
||||
| "InformationSheet"
|
||||
| "ItemColor"
|
||||
| "Login"
|
||||
| "OnlineProfile"
|
||||
| "PasswordReset"
|
||||
| "Player"
|
||||
| "Preference"
|
||||
| "Relog"
|
||||
| "Title"
|
||||
| "Wardrobe"
|
||||
;
|
||||
Cutscene:
|
||||
| "NPCCollaring"
|
||||
| "NPCSlaveAuction"
|
||||
| "NPCWedding"
|
||||
| "PlayerCollaring"
|
||||
| "PlayerMistress"
|
||||
| "SarahIntro"
|
||||
;
|
||||
MiniGame:
|
||||
| "Chess" | "ChestLockpick"
|
||||
| "ClubCard" | "ClubCardBuilder"
|
||||
| "DojoStruggle"
|
||||
| "GetUp"
|
||||
| "HorseWalk"
|
||||
| "Kidnap"
|
||||
| "KinkyDungeon"
|
||||
| "Lockpick"
|
||||
| "MagicBattle" | "MagicPuzzle"
|
||||
| "MaidCleaning" | "MaidDrinks"
|
||||
| "PlayerAuction"
|
||||
| "PuppyWalker"
|
||||
| "RhythmGame"
|
||||
| "SlaveAuction"
|
||||
| "Tennis"
|
||||
| "Therapy"
|
||||
| "WheelFortune"
|
||||
;
|
||||
Online:
|
||||
| "AdvancedRule"
|
||||
| "ChatAdmin" | "ChatAdminRoomCustomization" | "ChatBlockItem"
|
||||
| "ChatRoom" | "ChatSearch" | "ChatSelect"
|
||||
| "ForbiddenWords"
|
||||
| "Game" | "GameClubCard" | "GameLARP" | "GameMagicBattle"
|
||||
| "NicknameManagement"
|
||||
| "WheelFortuneCustomize"
|
||||
;
|
||||
Room:
|
||||
| "Arcade"
|
||||
| "AsylumBedroom" | "AsylumEntrance" | "AsylumGGTS" | "AsylumMeeting" | "AsylumTherapy"
|
||||
| "Cafe" | "Cell" | "ClubCardLounge"
|
||||
| "CollegeCafeteria" | "CollegeChess" | "CollegeDetention" | "CollegeEntrance" | "CollegeTeacher" | "CollegeTennis" | "CollegeTheater"
|
||||
| "Crafting" | "DailyJob" | "Empty" | "Gambling"
|
||||
| "Infiltration" | "InfiltrationPerks"
|
||||
| "Introduction"
|
||||
| "KidnapLeague"
|
||||
| "LARP"
|
||||
| "Magic" | "MagicSchoolEscape" | "MagicSchoolLaboratory"
|
||||
| "MaidQuarters" | "MainHall" | "Management" | "MovieStudio" | "Nursery"
|
||||
| "Pandora" | "PandoraPrison"
|
||||
| "Photographic"
|
||||
| "Platform" | "PlatformIntro" | "PlatformDialog" | "PlatformProfile"
|
||||
| "Poker" | "Prison"
|
||||
| "Private" | "PrivateBed" | "PrivateRansom"
|
||||
| "Sarah"
|
||||
| "Shibari"
|
||||
| "Shop" | "Shop2"
|
||||
| "SlaveMarket" | "Stable"
|
||||
;
|
||||
}
|
||||
|
||||
type RoomName = ModuleScreens[ModuleType];
|
||||
|
||||
interface RelogDataBase<T extends ModuleType> {
|
||||
Screen: ModuleScreens[T],
|
||||
Module: T,
|
||||
Character: Character,
|
||||
ChatRoomName: string | null,
|
||||
};
|
||||
|
||||
type _RelogDataMap<T> = T extends ModuleType ? RelogDataBase<T> : never;
|
||||
type RelogData = _RelogDataMap<ModuleType>;
|
||||
|
||||
type _ScreenSpecifier<T extends ModuleType> = [module: T, screen: ModuleScreens[T]];
|
||||
type ScreenSpecifier = _ScreenSpecifier<"Character"> | _ScreenSpecifier<"Cutscene"> | _ScreenSpecifier<"MiniGame"> | _ScreenSpecifier<"Online"> | _ScreenSpecifier<"Room">;
|
||||
|
||||
type AssetCategory = "Medical" | "Extreme" | "Pony" | "SciFi" | "ABDL" | "Fantasy";
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue