try a thing

This commit is contained in:
Anna 2022-09-10 10:14:12 -04:00
parent 27ef958ee6
commit 9d06ee7250
1 changed files with 12 additions and 6 deletions

View File

@ -73,12 +73,18 @@ internal class MessageList : ITab {
ImGui.SameLine();
if (ImGuiHelper.SmallIconButton(FontAwesomeIcon.MapMarkerAlt, $"{message.Id}") && territory != null) {
this.Plugin.GameGui.OpenMapWithMapLink(new MapLinkPayload(
territory.RowId,
territory.Map.Row,
(int) (message.X * 1_000),
(int) (message.Z * 1_000)
));
var map = this.Plugin.DataManager.GetExcelSheet<Map>()!
.Where(map => map.TerritoryType.Row == territory.RowId)
.Where(map => message.X >= map.OffsetX && message.Y >= map.OffsetY)
.MaxBy(map => Math.Max(map.OffsetX, map.OffsetY));
if (map != null) {
this.Plugin.GameGui.OpenMapWithMapLink(new MapLinkPayload(
territory.RowId,
map.RowId,
(int) (message.X * 1_000),
(int) (message.Z * 1_000)
));
}
}
if (message.IsHidden) {