View Single Post
01-28-18, 01:27 PM   #1
Jagwah
A Murloc Raider
Join Date: Apr 2017
Posts: 7
Where to start? - Boilerplate Help

Hi all,

I'll preface this by admitting that I'm very new to all of this; outside of editing the lua of existing addons, I don't have much experience and I'm pretty much learning as I go.

My first question is about documentation--I've not found much other than the in-line documentation in the oUF code and the boilerplate. Does anything along these lines exist?

I've had a go at spawning a player health bar; it's not throwing up any errors but isn't displaying either. I feel like I might have missed something really obvious, but after an hour of checking various bits I just can't work it out. Can anyone point me in the right direction?

EDIT: Having tested, my party frames have disappeared too.

Thanks in advance! I have oUF where it should be (unembedded) and have a single TOC entry pointing to a single LUA file (which I've pasted in its entirety below):

Lua Code:
  1. local _, ns = ...
  2.  
  3. local UnitSpecific = {
  4.   player = function(self) -- Player Specific Code
  5.   end,
  6.  
  7.   party = function(self)  -- Party Specific Code
  8.   end,
  9. }
  10.  
  11.  
  12. local Shared = function(self, unit) -- Shared Unit Code
  13.  
  14.   local Health = CreateFrame('StatusBar', nil, self) -- Create Health Bar
  15.   Health:SetSize(300, 20)
  16.   Health:SetPoint('TOPLEFT', UIParent, "TOPRIGHT", 0, 0)
  17.   Health:SetPoint('BOTTOMLEFT', UIParent, "BOTTOMRIGHT", 0, 0)
  18.  
  19.   local HealthBG = Health:CreateTexture(nil, 'BACKGROUND') -- Create Health Background
  20.   HealthBG:SetAllPoints(Health)
  21.   HealthBG:SetTexture(1, 1, 1, .5)
  22.  
  23.   Health.colorClass = true
  24.   Health.colorReaction = true
  25.  
  26.   HealthBG.multiplier = .5
  27.  
  28.   Health.bg = HealthBG
  29.   self.Health = Health
  30.  
  31.  
  32.   if(UnitSpecific[unit]) then
  33.       return UnitSpecific[unit](self)
  34.     end
  35.   end
  36.  
  37.  
  38. oUF:RegisterStyle("jUI", Shared) --Register Style with oUF
  39. oUF:Factory(function(self)
  40.  
  41.   self:SetActiveStyle("jUI")
  42.   self:Spawn("player"):SetPoint('CENTER')
  43.  
  44.   local party = self:SpawnHeader(nil, nil, 'raid,party,solo',
  45.     'showParty', true,
  46.     'showPlayer', true,
  47.     'yOffset', -20
  48.     )
  49.   party:SetPoint("TOPLEFT", 30, -30)
  50. end)

Last edited by Jagwah : 01-28-18 at 01:39 PM.
  Reply With Quote