Haselnussbomber / HaselTweaks

A collection of quality of life tweaks and more.
GNU Affero General Public License v3.0
73 stars 9 forks source link

Search the market #118

Closed Etupa closed 2 months ago

Etupa commented 2 months ago

Search the market tweak always copy paste English name of items, regardless of client selected language, making the tweak useless on non english client.

Haselnussbomber commented 2 months ago

It doesn't always copy in English. It depends on the language setting in Dalamud. But you're right that it's incorrect. It should depend on the clients language. I'll fix it!

Haselnussbomber commented 2 months ago

Fixed with v25.2.5. Thanks for reporting! πŸ™‚

Etupa commented 2 months ago

Wow you're so fast. Thanks for your hard work... 🫢😎

On Fri, Jul 19, 2024, 11:03 Haselnussbomber @.***> wrote:

Fixed with v25.2.5 https://github.com/Haselnussbomber/HaselTweaks/releases/tag/v25.2.5. Thanks for reporting! πŸ™‚

β€” Reply to this email directly, view it on GitHub https://github.com/Haselnussbomber/HaselTweaks/issues/118#issuecomment-2238709655, or unsubscribe https://github.com/notifications/unsubscribe-auth/AREY7EECPQGNOQMATRHR2DLZNDI6FAVCNFSM6AAAAABLD2L2VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZYG4YDSNRVGU . You are receiving this because you authored the thread.Message ID: @.***>

Etupa commented 2 months ago

Hi, me again,

Since I have the chance to ask a Dalamud plugin developer some questions, I hope you don't mind if I ask a couple. If you have the time to answer, that would be great, otherwise, no worries!

I'd like to start developing a plugin. My background is mostly in Python, PowerShell scripts, and JavaScript, and I've done the introductory Kotlin courses offered by Google while ago too. C# intimidates me a bitβ€”I have only create a crosshair for FPS games and found it quite challenging.

So, my question is, given my current skill level, is it feasible for me to develop a Dalamud plugin within a reasonable timeframe? Where would you recommend I start? Is using a software for reverse engineering essential?

To give you some context, here are the two ideas I have in mind:

  1. A /repeat slash command to replay the last emote, regardless of how it was triggered or the time elapsed.
  2. A simplified Emote menu (no text, blank space...), similar to Caraxi's World Visit Menu. This would involve modifying the native UI, which I understand can be quite tricky.

I'd love to hear your thoughts if you have the time to respond.

Thanks!

Etupa

Le ven. 19 juil. 2024 Γ  13:37, Bob Dylan @.***> a Γ©crit :

Wow you're so fast. Thanks for your hard work... 🫢😎

On Fri, Jul 19, 2024, 11:03 Haselnussbomber @.***> wrote:

Fixed with v25.2.5 https://github.com/Haselnussbomber/HaselTweaks/releases/tag/v25.2.5. Thanks for reporting! πŸ™‚

β€” Reply to this email directly, view it on GitHub https://github.com/Haselnussbomber/HaselTweaks/issues/118#issuecomment-2238709655, or unsubscribe https://github.com/notifications/unsubscribe-auth/AREY7EECPQGNOQMATRHR2DLZNDI6FAVCNFSM6AAAAABLD2L2VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZYG4YDSNRVGU . You are receiving this because you authored the thread.Message ID: @.***>

-- K.

Haselnussbomber commented 2 months ago

Honestly, it depends on how motivated you are. Everything I do is self-taught by looking at other peoples code and searching in the Dalamud Discord for solutions. I've worked on my plugin for over a year in silence before contributing to ClientStructs and getting in contact with other devs in the Discord. I'm just not a person who likes to ask for help, maybe because I'm a bit shy.

Anyway, there is an example plugin here https://github.com/goatcorp/SamplePlugin which gives you a good starting point for a Dalamud plugin project, I think.

Dalamud provides a couple services to make it easier to do certain things, like accessing Excel sheets (the games database) via the IDataManager. A list can be found here: https://dalamud.dev/api/apiX/Dalamud.Plugin.Services/

The best way to read/set values and call functions of the game though is by using ClientStructs. You can start using it in the SamplePlugin immediately, because it's shipped with Dalamud.

There is an EmoteHistoryModule which saves the last used emotes: https://github.com/aers/FFXIVClientStructs/blob/main/FFXIVClientStructs/FFXIV/Client/UI/Misc/EmoteHistoryModule.cs You won't have access to the internal _history field, but the code generator generates a History property for you to use. So something along the lines of

var emoteHistoryModule = EmoteHistoryModule.Instance();

foreach (var emoteId in emoteHistoryModule->History) {
  // do something with emoteId
}

And there is an AgentEmote which you can use to execute them: https://github.com/aers/FFXIVClientStructs/blob/main/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentEmote.cs (I've added this 3 days ago, so this only works on Dalamud staging for now, since there was no stable release including it yet.)

If something is not in ClientStructs then probably nobody has reverse-engineered it yet.

Modifying native windows can be a bit tricky too. I actually did it for the first time with my Bigger Item Dyeing Preview tweak, which I added 2 weeks ago: https://github.com/Haselnussbomber/HaselTweaks/blob/main/HaselTweaks/Tweaks/BiggerItemDyeingPreview.cs Dalamuds IAddonLifecycle service comes in handy, because it will call your function for certain events these windows have. In this case, after OnSetup has been run, my code is executed, where I modify the window. To know which nodes are available there is a useful Addon/UI inspector in Simple Tweaks by opening the dev tools with /tweaks Debug, or a (sadly) less developed Dalamud version of the same Addon inspector via /xldata ai.

All in all, expect a lot of crashes while dipping your toes into plugin development. While C# is a relatively easy language, working with pointers can go wrong. It's best to check if they aren't null, before dereferencing them (that's the -> operator).

I hope this helps a bit. I highly recommend joining the Dalamud Discord https://discord.gg/3NMcUV5 and getting the Developer role to unlock the #plugin-dev channel. There you can ask questions. Just don't ask anything about third-party plugins, like HaselTweaks, because rule 6 forbids to talk about third-party stuff.

Good luck! πŸ˜…

Etupa commented 2 months ago

Really appreciate the time you've taken to give such a generous answer.

I've already read your mail 3 times, I really think that's a very good starting point for I wanna try to do.

I will dive deeper into all this asap and hope to achieve an emote thingy somewhat usable in the next few weeks.

Thanks again πŸ‘ 😊

On Fri, Jul 19, 2024, 16:48 Haselnussbomber @.***> wrote:

Honestly, it depends on how motivated you are. Everything I do is self-taught by looking at other peoples code and searching in the Dalamud Discord for solutions. I've worked on my plugin for over a year in silence before contributing to ClientStructs and getting in contact with other devs in the Discord. I'm just not a person who likes to ask for help, maybe because I'm a bit shy.

Anyway, there is an example plugin here https://github.com/goatcorp/SamplePlugin which gives you a good starting point for a Dalamud plugin project, I think.

Dalamud provides a couple services to make it easier to do certain things, like accessing Excel sheets (the games database) via the IDataManager. A list can be found here: https://dalamud.dev/api/apiX/Dalamud.Plugin.Services/

The best way to read/set values and call functions of the game though is by using ClientStructs. You can start using it in the SamplePlugin immediately, because it's shipped with Dalamud.

There is an EmoteHistoryModule which saves the last used emotes:

https://github.com/aers/FFXIVClientStructs/blob/main/FFXIVClientStructs/FFXIV/Client/UI/Misc/EmoteHistoryModule.cs You won't have access to the internal _history field, but the code generator generates a History property for you to use. So something along the lines of

var emoteHistoryModule = EmoteHistoryModule.Instance(); foreach (var emoteId in emoteHistoryModule->History) { // do something with emoteId}

And there is an AgentEmote which you can use to execute them:

https://github.com/aers/FFXIVClientStructs/blob/main/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentEmote.cs (I've added this 3 days ago, so this only works on Dalamud staging for now, since there was no stable release including it yet.)

If something is not in ClientStructs then probably nobody has reverse-engineered it yet.

Modifying native windows can be a bit tricky too. I actually did it for the first time with my Bigger Item Dyeing Preview tweak, which I added 2 weeks ago: https://github.com/Haselnussbomber/HaselTweaks/blob/main/HaselTweaks/Tweaks/BiggerItemDyeingPreview.cs Dalamuds IAddonLifecycle service comes in handy, because it will call your function for certain events these windows have. In this case, after OnSetup has been run, my code is executed, where I modify the window. To know which nodes are available there is a useful Addon/UI inspector in Simple Tweaks by opening the dev tools with /tweaks Debug, or a (sadly) less developed Dalamud version of the same Addon inspector via /xldata ai.

All in all, expect a lot of crashes while dipping your toes into plugin development. While C# is a relatively easy language, but working with pointers can wrong. It's best to check if they aren't null, before dereferencing them (that's the -> operator).

I hope this helps a bit. I highly recommend joining the Dalamud Discord https://discord.gg/3NMcUV5 and getting the Developer role to unlock the

plugin-dev channel. There you can ask questions. Just don't ask anything

about third-party plugins, like HaselTweaks, because rule 6 forbids to talk about third-party stuff.

Good luck! πŸ˜…

β€” Reply to this email directly, view it on GitHub https://github.com/Haselnussbomber/HaselTweaks/issues/118#issuecomment-2239391028, or unsubscribe https://github.com/notifications/unsubscribe-auth/AREY7EG7XSTCWOXHSVF5H43ZNERL3AVCNFSM6AAAAABLD2L2VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZZGM4TCMBSHA . You are receiving this because you authored the thread.Message ID: @.***>

Etupa commented 1 month ago

It doesn't always copy in English. It depends on the language setting in Dalamud. But you're right that it's incorrect. It should depend on the clients language. I'll fix it!

issue is back :d . Have a nice day :3

Haselnussbomber commented 1 month ago

Yup, I forgot to pass the language to the sheets again (diff). Fixed with v25.2.12. Thanks!