Drahsid / ResizableHUD

A plugin for Dalamud with FFXIV which lets you move and resize vanilla HUD units with far greater control than the game gives.
8 stars 0 forks source link

Various bugs and questions #3

Closed Varstahl closed 1 year ago

Varstahl commented 1 year ago

Hello, I'm your worst nightmare today. While using this to fix my OCD (great job by the way, I can finally sleep easy), I found some assorted bugs you might already be aware of, that I'm reporting them just in case, and I got a few questions to boot.

Bug report

  1. If you open and close via /prhud everything works as intended, unless you open with the command and close it with the ×, in which case the first /prhud will actually try to close the dialog, but since it's already closed it will do nothing.
  2. It seems there's some uninitialisations missing. Upon disabling and re-enabling the addon, the commands won't register and will point to the previous instance:
    18:08:46.762 | INF [LOCALPLUGIN] Unloading ResizableHUD.dll
    18:08:47.767 | INF [LOCALPLUGIN] Finished unloading ResizableHUD.dll
    18:09:06.674 | INF [LOCALPLUGIN] Loading ResizableHUD.dll
    18:09:06.699 | ERR Command "/prhud" is already registered.
    18:09:06.699 | ERR Command "/prhudadd" is already registered.
    18:09:06.699 | ERR Command "/prhudrem" is already registered.
    18:09:06.699 | ERR Command "/prhudscale" is already registered.
    18:09:06.699 | ERR Command "/prhudpos" is already registered.
    18:09:06.699 | INF [LOCALPLUGIN] Finished loading ResizableHUD.dll
    18:09:28.784 | ERR Error while dispatching command "/prhud" (Argument: "")
    System.NullReferenceException: Object reference not set to an instance of an object.
      at ResizableHUD.Commands.ToggleConfig()
      at Dalamud.Game.Command.CommandManager.DispatchCommand(String command, String argument, CommandInfo info) in 
    C:\goatsoft\companysecrets\dalamud\Game\Command\CommandManager.cs:line 117

    This is only fixed via complete restart of the game.

  3. In the UI there seems to be some indenting issue, as for each expanded component, the next is its child: image

Questions

  1. Is it normal that the coordinates start from the top left? Since the (0, 0) in the UI starts in the middle, I was expecting them to be relative to the central axis to make it easier to position things symmetrically, but that wasn't the case
  2. Is it possible to get stats about the bounding box of the element, in absolute/relative mode? For example if I'm trying to align two items it might be easier to just have something saying "element's size is X×Y pixels wide", instead of taking a screenshot and figuring it out in another app counting the pixels
  3. Assuming 1 & 2 are possible, is it possible to have a coordinate selection that takes the center as a reference point instead of the top left corner, at least in the UI? That could help in aligning stuff across axis simmetrically
  4. Instead of resetting the coordinates, can they be just converted when switching to/from relative mode?

Obviously none of these are requests, and as I've said before I still don't know enough how to do them or I'd do them myself and open a PR (I still might eventually, if I learn how to build this stuff :P)

Thanks again for everything, and I hope this feedback is not too much, feel free to disregard at will :D

Drahsid commented 1 year ago

Hey, thanks for the report.

I'll address the issues first:

  1. You will need to just reopen the config. I wrote it with a toggle but the window system doesn't use this, it's just a logic error on my part that I will fix sometime.
  2. I didn't notice this, but will be sure to fix it in the future.
  3. This doesn't happen on my end, I'll look into making it more consistent.

As for your questions:

  1. Yes, it initializes the nodes to (0, 0). The game positions HUD addons relative to their top left (that's what their position values represent.)
  2. This is probably possible, since Dalamud's addon inspector does this to draw a bounding box. I haven't done the research required to implement this yet.
  3. Yes, if we have information about the bounding box, then anchoring a faux position value to the center of the rect is just some simple math.
  4. Yes, this can probably be done with a minor update.

I haven't done too much development on this, since my main purpose for it was to make my target cast bar huge. That being said, most of this stuff is the sort of thing I thought about when initially implementing the plugin, and will probably add in the future.

Drahsid commented 1 year ago

I fixed the bugs you outlined in this issue. You should be able to update and get the new version. If you'd like, I can keep this issue open since your suggestions have not been fulfilled.

Varstahl commented 1 year ago

You will need to just reopen the config

Yup, I was doing that already, that's why I thought of a non updating boolean

I haven't done too much development on this, since my main purpose for it was to make my target cast bar huge. That being said, most of this stuff is the sort of thing I thought about when initially implementing the plugin, and will probably add in the future.

It's still a neat piece of plugin, I might be able to help in the future, provided I get my feet wet with the architecture

I fixed the bugs you outlined in this issue. You should be able to update and get the new version. If you'd like, I can keep this issue open since your suggestions have not been fulfilled.

As you wish, you've already been too kind, I really didn't expect them to be fixed this quickly especially since it was technically working. Feel free to keep it open or close it if it's out of scope :)

Drahsid commented 1 year ago

The missing features outlined in this issue have been implemented in the latest commit, so I am closing the issue. If you are using the plugin from my repo, you can update it now.