img02 / HuntHelper

FFXIV Hunt Tracker / Map Radar, A-Train Recording, S Rank Utilities. Dalamud Plugin.
MIT License
12 stars 19 forks source link

add ipc function for importing train data #39

Closed dit-zy closed 1 year ago

dit-zy commented 1 year ago

with the existing ipc functions, we can export the train list for my scout plugin to use to generate tracker links. well, the conductors who use those links wanted a way to get the train data from those links back into hunt helper. we have a plugin to import the marks from a tracker website, but this ipc function i'm adding in this PR will allow for importing that data back into hunt helper's train recorder, so that conductors can use hunt helper's wonderful train features for running their trains ^w^.

i wrote the function to use the existing import popup, since that has so many handy features. all this function does differently is load the train list from existing objects, rather than an import code.

img02 commented 1 year ago

I've refactored it a bit, please see my comments where I explain my changes:

https://github.com/dit-zy/HuntHelper/blob/ee16540e29cc67b2355b05d387edc92cd4a59bfb/HuntHelper/Managers/IpcSystem.cs#L64

https://github.com/dit-zy/HuntHelper/blob/ee16540e29cc67b2355b05d387edc92cd4a59bfb/HuntHelper/Gui/HuntTrainUI.cs#L329

I didn't see the import (or should it be called export for you?) in your plugin so I just jerry-rigged it to cgGetTrainList then cgImportTrainList and it seems to be working,

image

Of course I'd like to test it properly with a couple of links once you have everything set up.

Then we can finalise this and remove the comments, etc.

dit-zy commented 1 year ago

i just took a look and i like your changes! putting the boolean in TrainManager so we don't need to pull HuntTrainUI into the ipc system, is way cleaner :D

and yes, my plugin doesn't have this, i just rigged something up like you did, to test it. but i'm currently working on a proper change to coordinate importer, which is the plugin that will use this new ipc function. i'll post a link to that branch once i have it ready, probably later today or tomorrow ^w^

img02 commented 1 year ago

Thought about it, and it really did seem like a personal preference thing so I added a setting to change the behaviour.

Now if enabled, it will open the UI when importing from IPC.

dit-zy commented 1 year ago

my goodness, the pain of working with lumina ;-;

but it finally works! (note: in this use case i deliberately set all marks to dead: false and lastSeen: now)

image

feel free to give the plugin a try. use this branch of coordinate importer. open it with /ci and then paste in the following and click the up arrow button to send it to hunt helper:

(Maybe: Storsie) Labyrinthos ( 17  , 9.6 ) 
(Maybe: Hulder) Labyrinthos ( 32.3  , 25.9 ) 
(Maybe: Yilan) Thavnair ( 26.8  , 20.9 )  (Instance ONE)
(Maybe: Sugriva) Thavnair ( 20.5  , 31.3 )  (Instance ONE)
(Maybe: Yilan) Thavnair ( 26.8  , 20.9 )  (Instance TWO)
(Maybe: Sugriva) Thavnair ( 18.4  , 23.6 )  (Instance TWO)
(Maybe: Yilan) Thavnair ( 14.3  , 12.2 )  (Instance THREE)
(Maybe: Sugriva) Thavnair ( 26.8  , 20.9 )  (Instance THREE)
(Maybe: Minerva) Garlemald ( 11.8  , 17.2 ) 
(Maybe: Aegeiros) Garlemald ( 23.4  , 25.8 ) 
(Maybe: Mousse Princess) Mare Lamentorum ( 18.6  , 21.7 ) 
(Maybe: Lunatender Queen) Mare Lamentorum ( 30  , 30 ) 
(Maybe: Petalodus) Elpis ( 21.3  , 13.3 ) 
(Maybe: Gurangatch) Elpis ( 18  , 30.2 ) 
(Maybe: Fan Ail) Ultima Thule ( 13.3  , 10.4 ) 
(Maybe: Arch-Eta) Ultima Thule ( 16.4  , 26 )