View Single Post
09-29-18, 03:37 PM   #3
Lyak
A Cyclonian
Join Date: Jul 2018
Posts: 46
Originally Posted by Vrul View Post
Yes, and the ease of which is determined by how your db table is set up. Here is a generic example of how it could look:
Code:
-- vrul's code!
Hi vrul,

I really, really and really appreciate your time!

So, is the first getter function being the key point which gets called every single time when the selected unit changes?

If so, what would be the best way to deal with my db structure?

Lua Code:
  1. db = {
  2.     ["**"] = { -- Unit
  3.         point = {
  4.             p = "CENTER",
  5.             rT = "UIParent",
  6.             rP = "CENTER",
  7.             oX = 0,
  8.             oY = 0,
  9.         },
  10.         health = {
  11.             height = 21,
  12.             point = {
  13.                 p = "TOP",
  14.                 rT = "parent",
  15.                 rP = "TOP",
  16.                 oX = 0,
  17.                 oY = 0,
  18.             },
  19.             texture = nil,
  20.             tag = {
  21.                 point = {
  22.                     p = "CENTER",
  23.                     rT = "parent",
  24.                     rP = "CENTER",
  25.                     oX = 0,
  26.                     oY = 0,
  27.                 },
  28.             },
  29.         },
  30.         power = {
  31.             height = 21,
  32.             point = {
  33.                 p = "BOTTOM",
  34.                 rT = "parent",
  35.                 rP = "BOTTOM",
  36.                 oX = 0,
  37.                 oY = 0,
  38.             },
  39.             texture = nil,
  40.             tag = {
  41.                 point = {
  42.                     p = "CENTER",
  43.                     rT = "parent",
  44.                     rP = "CENTER",
  45.                     oX = 0,
  46.                     oY = 0,
  47.                 },
  48.             },
  49.         },
  50.     },
  51. };

Like you said it should be the matter of how simply the db is set-up, but I would like to maintain this structure, if possible.

Would the best chance be putting IF statements to see which 'point' the option is referring to?

Last edited by Lyak : 09-29-18 at 04:27 PM.
  Reply With Quote