isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
106 lines • 5.35 kB
TypeScript
import type { DisplayFlag } from "isaac-typescript-definitions";
/**
* Helper function to add a `DisplayFlag` to a particular room's minimap display flags (e.g. whether
* it is visible and so on).
*
* This function automatically accounts for if MinimapAPI is being used.
*
* @param roomGridIndex Set to undefined to use the current room index.
* @param displayFlag The `DisplayFlag` to set. (See the `DisplayFlag` enum.)
* @param updateVisibility Optional. Whether to call the `Level.UpdateVisibility` method in order to
* make the changes immediately visible. Default is true.
*/
export declare function addRoomDisplayFlag(roomGridIndex: int | undefined, displayFlag: DisplayFlag, updateVisibility?: boolean): void;
/**
* Helper function to set the value of `DisplayFlag` for every room on the floor to 0.
*
* This function automatically accounts for if MinimapAPI is being used.
*
* This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
* the changes will be immediately visible.
*/
export declare function clearFloorDisplayFlags(): void;
/**
* Helper function to set the value of `DisplayFlag` for a room 0.
*
* This function automatically accounts for if MinimapAPI is being used.
*
* This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
* the changes will be immediately visible.
*
* Note that if you clear the display flags of a room but then the player travels to the room (or an
* adjacent room), the room will appear on the minimap again. If you want to permanently hide the
* room even in this circumstance, use the `hideRoomOnMinimap` helper function instead.
*/
export declare function clearRoomDisplayFlags(roomGridIndex: int): void;
/**
* Helper function to get the minimap `DisplayFlag` value for every room on the floor. Returns a map
* that is indexed by the room's safe grid index.
*
* This function automatically accounts for if MinimapAPI is being used.
*
* @param minimapAPI Optional. If MinimapAPI should be used, if present. Default is true.
*/
export declare function getFloorDisplayFlags(minimapAPI?: boolean): ReadonlyMap<int, BitFlags<DisplayFlag>>;
/**
* Helper function to get a particular room's minimap display flags (e.g. whether it is visible and
* so on).
*
* This function automatically accounts for if MinimapAPI is being used.
*
* @param roomGridIndex Optional. Default is the current room index.
* @param minimapAPI Optional. If MinimapAPI should be used, if present. Default is true.
*/
export declare function getRoomDisplayFlags(roomGridIndex?: int, minimapAPI?: boolean): BitFlags<DisplayFlag>;
/**
* Helper function to hide a specific room on the minimap.
*
* If you want the room to be permanently hidden, you must to call this function on every new room.
* This is because if the player enters into the room or walks into an adjacent room, the room will
* reappear on the minimap.
*
* This function automatically accounts for if MinimapAPI is being used.
*/
export declare function hideRoomOnMinimap(roomGridIndex: int): void;
/**
* Helper function to check if a given room is visible on the minimap.
*
* @param roomGridIndexOrRoomDescriptor The room to check.
* @param minimapAPI Optional. Whether MinimapAPI should be used, if present. Default is true.
*/
export declare function isRoomVisible(roomGridIndexOrRoomDescriptor: int | RoomDescriptor, minimapAPI?: boolean): boolean;
/**
* Helper function to set the minimap `DisplayFlag` value for every room on the floor at once.
*
* This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
* the changes will be immediately visible.
*
* This function automatically accounts for if MinimapAPI is being used.
*/
export declare function setAllDisplayFlags(displayFlags: BitFlags<DisplayFlag>): void;
/**
* Helper function to set the minimap `DisplayFlag` value for multiple rooms at once.
*
* This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
* the changes will be immediately visible.
*
* This function automatically accounts for if MinimapAPI is being used.
*
* @param displayFlagsMap A map of the display flags that is indexed by the room's safe grid index.
*/
export declare function setFloorDisplayFlags(displayFlagsMap: ReadonlyMap<int, BitFlags<DisplayFlag>>): void;
/**
* Helper function to set a particular room's minimap display flags (e.g. whether it is visible and
* so on).
*
* This function automatically accounts for if MinimapAPI is being used.
*
* @param roomGridIndex Set to undefined to use the current room index.
* @param displayFlags The bit flags value to set. (See the `DisplayFlag` enum.)
* @param updateVisibility Optional. Whether to call the `Level.UpdateVisibility` method in order to
* make the changes immediately visible. Default is true. Set this to false
* if you are doing a bunch of display flag setting and then manually call
* the `Level.UpdateVisibility` method after you are done.
*/
export declare function setRoomDisplayFlags(roomGridIndex: int | undefined, displayFlags: BitFlags<DisplayFlag>, updateVisibility?: boolean): void;
//# sourceMappingURL=minimap.d.ts.map