Skip to content

Commit

Permalink
Update link type names
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Jun 2, 2023
1 parent 6813b31 commit f2745dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/bit-systems/link-hover-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ async function handleLinkClick(world: HubsWorld, button: EntityID) {
// move to waypoint w/o writing to history
window.history.replaceState(null, "", window.location.href.split("#")[0] + url.hash);
break;
case LinkType.LOCAL_ROOM:
case LinkType.ROOM:
const waypoint = url.hash && url.hash.substring(1);
// move to new room without page load or entry flow
const hubId = hubIdFromUrl(url);
changeHub(hubId, true, waypoint);
break;
case LinkType.EXTERNAL_ROOM:
case LinkType.ROOM_URL:
await exitImmersive();
location.href = src;
break;
Expand Down Expand Up @@ -107,8 +107,8 @@ function updateButtonText(world: HubsWorld, menu: EntityID, button: EntityID) {
case LinkType.WAYPOINT:
label = "go to";
break;
case LinkType.LOCAL_ROOM:
case LinkType.EXTERNAL_ROOM:
case LinkType.ROOM:
case LinkType.ROOM_URL:
label = "visit room";
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/bit-systems/link-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export function linkSystem(world: HubsWorld) {
if (url.hash && APP.hub!.hub_id === hubId) {
Link.type[eid] = LinkType.WAYPOINT;
} else if (await isLocalHubsUrl(src)) {
Link.type[eid] = LinkType.LOCAL_ROOM;
Link.type[eid] = LinkType.ROOM;
} else {
Link.type[eid] = LinkType.EXTERNAL_ROOM;
Link.type[eid] = LinkType.ROOM_URL;
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/inflators/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export enum LinkType {
LINK = 0,
AVATAR = 1,
SCENE = 2,
LOCAL_ROOM = 3,
EXTERNAL_ROOM = 4,
ROOM = 3,
ROOM_URL = 4,
WAYPOINT = 5
}

Expand Down

0 comments on commit f2745dc

Please sign in to comment.