snorux / EurekaHelper

FFXIV - Eureka Tracker in a plugin with QoL features
Apache License 2.0
20 stars 13 forks source link

Copy to Clipboard not working correctly #1

Closed Infiziert90 closed 1 year ago

Infiziert90 commented 1 year ago

Hi,

Just tried out your plugin and found an issue with it.

The Copy to Clipboard function tries to use the client internal "< flag >" for shout chat, but the issue is that a flag isn't set until you tell the client that the flag is set.

So for this to work you could a) Use the dalamud function to set flag and open map b) Set the flag directly with ffxivclientstructs

snorux commented 1 year ago

Thank you for your feedback. Honestly this was the intended behavior whereby the player had to click the maplink before pasting it to chat, as I myself also find that troublesome, I will be looking into ways to improve it.

Infiziert90 commented 1 year ago

Mmmm,

The problem with that behavior is that you shout out your previous flag too

So someone could shout "POP (Lavender Beds X Y)"

Which I think makes it even weirder compared to your Plugin setting the right flag x3

snorux commented 1 year ago

I've added a feature whereby it automatically sets the flag whenever you click on the custom payload in chat. You can either copy to clipboard or send the shout message.

If you are able to compile, feel free to test it out, otherwise I will push this to testing soon

Infiziert90 commented 1 year ago

I would recommend not doing any calculations yourself, and just trust dalamud in doing them.

You can use

public void SetMapMarker(MapLinkPayload map) => GameGui.OpenMapWithMapLink(map);

Which will take your MapLinkPayload and automatically open the map with handling FlagMarker internally

Or:

instance->IsFlagMarkerSet = 0;
AgentMap.Instance()->SetFlagMapMarker(map.Map.TerritoryType.Row, map.Map.RowId, map.RawX / 1000.0f, map.RawY / 1000.0f);
instance->OpenMap(map.Map.RowId, map.Map.TerritoryType.Row, type: MapType.FlagMarker);

This will take the MapLinkPayload and use the internal coordinates, just divide them by 1000 as they are 654321 instead of 654.321

Ignore that, didn't see your second commit

snorux commented 1 year ago

The feature has been implemented in 0.0.0.3 and has been merged today. Will be closing this, feel free to reopen if any issues occur