Skip to content

Commit

Permalink
Remove Teleporter Dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
MidoriKami committed Nov 17, 2024
1 parent e1170a3 commit 1ed0a06
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 48 deletions.
41 changes: 0 additions & 41 deletions Mappy/Classes/Teleporter.cs

This file was deleted.

29 changes: 27 additions & 2 deletions Mappy/Extensions/MapMarkerInfoExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
using Dalamud.Interface;
using Dalamud.Memory;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using Lumina.Excel.Sheets;
using Mappy.Classes;
using Map = Lumina.Excel.Sheets.Map;
using MarkerInfo = Mappy.Classes.MarkerInfo;

namespace Mappy.Extensions;

Expand All @@ -30,8 +33,30 @@ public static unsafe void Draw(this MapMarkerInfo marker, Vector2 offset, float
PrimaryText = GetMarkerPrimaryTooltip(marker, tooltipText),
OnLeftClicked = marker.DataType switch {
1 when !DrawHelpers.IsDisallowedIcon(marker.MapMarker.IconId) => () => System.IntegrationsController.OpenMap(marker.DataKey),
3 => () => System.Teleporter.Teleport(Service.DataManager.GetExcelSheet<Aetheryte>().GetRow(marker.DataKey)), // Gonna assume that can't be null, because it's a row index that comes from the active gamestate.
4 when GetAetheryteForAethernet(marker.DataKey) is not null => () => System.Teleporter.Teleport(GetAetheryteForAethernet(marker.DataKey)!.Value),
3 => () => {
var aetheryte = Service.DataManager.GetExcelSheet<Aetheryte>().GetRow(marker.DataKey);
Telepo.Instance()->Teleport(marker.DataKey, 0);
Service.ChatGui.Print(new XivChatEntry {
Message = new SeStringBuilder()
.AddUiForeground("[Mappy] ", 45)
.AddUiForeground("[Teleport] ", 62)
.AddText("Teleporting to ")
.AddUiForeground(aetheryte.PlaceName.Value.Name.ExtractText(), 576)
.Build(),
});
}, // Gonna assume that can't be null, because it's a row index that comes from the active gamestate.
4 when GetAetheryteForAethernet(marker.DataKey) is not null => () => {
var aetheryte = Service.DataManager.GetExcelSheet<Aetheryte>().GetRow(marker.DataKey);
Telepo.Instance()->Teleport(marker.DataKey, 0);
Service.ChatGui.Print(new XivChatEntry {
Message = new SeStringBuilder()
.AddUiForeground("[Mappy] ", 45)
.AddUiForeground("[Teleport] ", 62)
.AddText("Teleporting to ")
.AddUiForeground(aetheryte.PlaceName.Value.Name.ExtractText(), 576)
.Build(),
});
},
_ => null,
},
SecondaryText = marker.DataType switch {
Expand Down
3 changes: 0 additions & 3 deletions Mappy/MappyPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using KamiLib.CommandManager;
using KamiLib.Window;
using Mappy.Classes;
using Mappy.Controllers;
using Mappy.Data;
using Mappy.Windows;
Expand All @@ -16,8 +15,6 @@ public MappyPlugin(IDalamudPluginInterface pluginInterface) {
System.SystemConfig = SystemConfig.Load();
System.IconConfig = IconConfig.Load();

System.Teleporter = new Teleporter();

System.CommandManager = new CommandManager(Service.PluginInterface, "mappy");

System.MapRenderer = new MapRenderer.MapRenderer();
Expand Down
2 changes: 0 additions & 2 deletions Mappy/System.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using KamiLib.CommandManager;
using KamiLib.Window;
using Mappy.Classes;
using Mappy.Classes.Caches;
using Mappy.Controllers;
using Mappy.Data;
Expand All @@ -26,7 +25,6 @@ public static class System {
new FateModule(),
];

public static Teleporter Teleporter { get; set; }
public static TooltipCache TooltipCache { get; set; } = new();
public static CardRewardCache CardRewardCache { get; set; } = new();
public static GatheringPointNameCache GatheringPointNameCache { get; set; } = new();
Expand Down

0 comments on commit 1ed0a06

Please sign in to comment.