Skip to content

Commit

Permalink
fix(house): read notes
Browse files Browse the repository at this point in the history
- cape tab gets cached now
- most delays were reduced
- better houseloader.free
  • Loading branch information
Torwent committed Dec 24, 2024
1 parent c93c610 commit 06689fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 14 additions & 6 deletions optional/handlers/house/house.simba
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ The core record used to handle navigating a POH.
Entrance: TRSObjectV2;

TeleportMode: EHouseTeleportMode;
CapeTab: ERSGameTab;
TeleportPlace: EHouseTeleportPlace;
HouseTeleportItem: TRSItem;
end;
Expand Down Expand Up @@ -326,6 +327,8 @@ begin
Self.Entrance.Finder.Colors += CTS2(6316135, 8, 0.28, 0.12);
Self.Entrance.Finder.Colors += CTS2(9379961, 30, 0.16, 1.76);

Self.CapeTab := ERSGameTab.UNKNOWN;

Self.IsSetup := True;
end;

Expand Down Expand Up @@ -551,7 +554,7 @@ var
begin
if Minimap.InPOH() then Exit(True);

if Map.Position().AnyInRange(Self.Entrance.Coordinates, 80) then
if Map.Position().AnyInRange(Self.Entrance.Coordinates, 60) then
begin
if not Self.Entrance.WalkSelectOption(['Home']) then Exit;
Exit(WaitUntil(Minimap.InPOH(), 300, 10000));
Expand Down Expand Up @@ -579,12 +582,16 @@ begin
Exit;
end;
EHouseTeleportMode.CAPE:
begin
if Self.CapeTab <> ERSGameTab.UNKNOWN then GameTabs.Open(Self.CapeTab);
if not CAPES.Interact(Self.HouseTeleportItem, 'Tele to POH') then Exit;
Self.CapeTab := GameTabs.GetCurrentTab();
end;
end;

Result := WaitUntil(
(loading := MainScreen.LoadingPOH()) or (outside := Map.Position().AnyInRange(Self.Entrance.Coordinates, 30)),
300, 4000
300, 3000
);

if outside then
Expand All @@ -594,14 +601,14 @@ begin
end;

if loading then
Result := WaitUntil(Minimap.InPOH(), 300, 10000);
Result := WaitUntil(Minimap.InPOH(), 300, 4000);

if not Result then
begin
if Map.Position().AnyInRange(Self.Entrance.Coordinates, 80) then
if Map.Position().AnyInRange(Self.Entrance.Coordinates, 60) then
begin
if not Self.Entrance.WalkSelectOption(['Home']) then Exit;
Exit(WaitUntil(Minimap.InPOH(), 300, 10000));
Exit(WaitUntil(Minimap.InPOH(), 300, 4000));
end;
end;
end;
Expand Down Expand Up @@ -1272,11 +1279,12 @@ var
begin
if Login.PlayerIndex <> House.Loader.LayoutIndex then
begin
WriteLn 'Refreshing layout.';
House.Loader.Free();
combobox := TPanel(sender).GetChild('decoration_combobox');
Self.POHDecorationUpdate(combobox);

combobox := TPanel(sender).GetChild('room_combobox');
combobox.SetItemIndex(Ord(House.Loader.ReadRoom(House.Loader.Selected.Matrix).Room));
Self.RoomUpdate(combobox);
end;
end;
Expand Down
2 changes: 2 additions & 0 deletions optional/handlers/house/housemap.simba
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ begin
end;

Self.Rooms := [];
Self.TeleportRooms := [];

Self.IsSetup := False;
end;

Expand Down

0 comments on commit 06689fb

Please sign in to comment.