Thread: Post Your UI

  1. #7601
    gunna pull some code from the UF i use, i wouldnt copy it word for word, but hopefully a general idea of what you need to do

    this here will format the time and give it the general look

    Code:
    local formatTime = function(s)
    	local day, hour, minute = 86400, 3600, 60
    	if s >= day then
    		return format("%dd", floor(s/day + 0.5)), s % day
    	elseif s >= hour then
    		return format("%dh", floor(s/hour + 0.5)), s % hour
    	elseif s >= minute then
    		return format("%dm", floor(s/minute + 0.5)), s % minute
    	elseif s >= minute / 12 then
    		return floor(s + 0.5), (s * 100 - floor(s * 100))/100
    	end
    	return format("%.1f", s), (s * 100 - floor(s * 100))/100
    end
    local setTimer = function (self, elapsed)
    	if self.timeLeft then
    		self.elapsed = (self.elapsed or 0) + elapsed
    		if self.elapsed >= 0.1 then
    			if not self.first then
    				self.timeLeft = self.timeLeft - self.elapsed
    			else
    				self.timeLeft = self.timeLeft - GetTime()
    				self.first = false
    			end
    			if self.timeLeft > 0 then
    				local time = formatTime(self.timeLeft)
    					self.time:SetText(time)
    				if self.timeLeft < 5 then
    					self.time:SetTextColor(1, 0.5, 0.5)
    				else
    					self.time:SetTextColor(.7, .7, .7)
    				end
    			else
    				self.time:Hide()
    				self:SetScript("OnUpdate", nil)
    			end
    			self.elapsed = 0
    		end
    	end
    end
    this is the post update of the icon when its draw, adds timers, desaturates (or it would if i set it to true :P ) and allows right clicking player buffs

    Code:
    local postUpdateIcon = function(element, unit, button, index)
    	local _, _, _, _, _, duration, expirationTime, unitCaster, _ = UnitAura(unit, index, button.filter)
    	
    	if duration and duration > 0 then
    		button.time:Show()
    		button.timeLeft = expirationTime	
    		button:SetScript("OnUpdate", setTimer)			
    	else
    		button.time:Hide()
    		button.timeLeft = math.huge
    		button:SetScript("OnUpdate", nil)
    	end
    	
    	-- Desaturate non-Player Debuffs
    	if(button.debuff) then
    		if(unit == "target") then	
    			if (unitCaster == "player" or unitCaster == "vehicle") then
    				button.icon:SetDesaturated(false)				
    			elseif(not UnitPlayerControlled(unit)) then -- If Unit is Player Controlled don"t desaturate debuffs
    				button:SetBackdropColor(0, 0, 0)
    				button.overlay:SetVertexColor(0.3, 0.3, 0.3)      
    				button.icon:SetDesaturated(false)  
    			end
    		end
    	end
    	button:SetScript('OnMouseUp', function(self, mouseButton)
    		if mouseButton == 'RightButton' then
    			CancelUnitBuff('player', index)
    	end end)
    	button.first = true
    end
    you wanna jam the postUpdateIcon function after postCreateIcon

    hope that helped!

  2. #7602
    Quote Originally Posted by Senit View Post
    I'm so close to finishing my UI, but I really need some help with my buffs, which I am scripting through oUF.


    I have a few (3) objectives here.

    Firstly, how can I change the font on the "count" text? (circled in green)
    Secondly, how can I sort them in order of time remaining?
    Lastly, and most importantly, how can I add a text to display time remaining?

    I'm sure some of you know how I can achieve these things; and thank you so much for your time and effort.
    I assume you have your heart set on configuring your buffs through oUF, but if you feel like giving in and taking the easy option; the AddOn Auraframes does everything that you're wanting.
    You'd just have to use Masque to make it match the rest of your UI.

  3. #7603
    Epic!
    10+ Year Old Account
    Join Date
    Jul 2010
    Location
    United Kingdom
    Posts
    1,661
    Quote Originally Posted by Pixil View Post
    And finally, go nag your step-sister for her password
    If only I could! I'd have to re-install WoW but I'll wait until I sub for MOP to fix addons and make something new

  4. #7604
    Quote Originally Posted by Senit View Post
    I'm so close to finishing my UI, but I really need some help with my buffs, which I am scripting through oUF.


    I have a few (3) objectives here.

    Firstly, how can I change the font on the "count" text? (circled in green)
    Secondly, how can I sort them in order of time remaining?
    Lastly, and most importantly, how can I add a text to display time remaining?

    I'm sure some of you know how I can achieve these things; and thank you so much for your time and effort.

    You might also look at Filger as a possible solution, though I'm also interested in doing the same as you with oUF.

    By the way, is that oUF_Simple2 that I see as the basis for your layout?

  5. #7605
    Deleted
    Quote Originally Posted by Pixil View Post
    I think the issue is more that there are lots of different sized fonts and lots of borders that don't match. And that GOD-AWFUL Porky text! (promise me you'll change that lol)
    Also, is the target of the target of the target really so important? :P
    And Sexymap. *cringe* I would always suggest replacing that with some nicer AddOn.
    However if you're fine with it, then why change it!?
    Hehe, I've already changed fonts + sexymap before I even saw this, thanks though Yea, I'll change some borders and fonts around, thanks for pointing it out!

  6. #7606
    Field Marshal Senit's Avatar
    10+ Year Old Account
    Join Date
    Jul 2012
    Location
    Darnassus
    Posts
    87
    Quote Originally Posted by Coldkil View Post
    1) I think that a simple button.count:SetFont(fontpath) should do the trick.
    2) you need to set up a method that parses durations and rearranges auras - it's not a simple thing to code (at least for me). for sure more expert guys are surely capable of doing it.
    3) for that i use omniCC - it does all the work for me.
    Thanks for the help, the :SetFont worked perfectly.

    Quote Originally Posted by SpaceDuck View Post
    gunna pull some code from the UF i use, i wouldnt copy it word for word, but hopefully a general idea of what you need to do

    this here will format the time and give it the general look


    this is the post update of the icon when its draw, adds timers, desaturates (or it would if i set it to true :P ) and allows right clicking player buffs


    you wanna jam the postUpdateIcon function after postCreateIcon

    hope that helped!
    I'm a total Lua newb. I implemented your code like this:
    Code:
    local formatTime = function(s)
    	local day, hour, minute = 86400, 3600, 60
    	if s >= day then
    		return format("%dd", floor(s/day + 0.5)), s % day
    	elseif s >= hour then
    		return format("%dh", floor(s/hour + 0.5)), s % hour
    	elseif s >= minute then
    		return format("%dm", floor(s/minute + 0.5)), s % minute
    	elseif s >= minute / 12 then
    		return floor(s + 0.5), (s * 100 - floor(s * 100))/100
    	end
    	return format("%.1f", s), (s * 100 - floor(s * 100))/100
    end
    local setTimer = function (self, elapsed)
    	if self.timeLeft then
    		self.elapsed = (self.elapsed or 0) + elapsed
    		if self.elapsed >= 0.1 then
    			if not self.first then
    				self.timeLeft = self.timeLeft - self.elapsed
    			else
    				self.timeLeft = self.timeLeft - GetTime()
    				self.first = false
    			end
    			if self.timeLeft > 0 then
    				local time = formatTime(self.timeLeft)
    					self.time:SetText(time)
    				if self.timeLeft < 5 then
    					self.time:SetTextColor(1, 0.5, 0.5)
    				else
    					self.time:SetTextColor(.7, .7, .7)
    				end
    			else
    				self.time:Hide()
    				self:SetScript("OnUpdate", nil)
    			end
    			self.elapsed = 0
    		end
    	end
    end
    lib.PostCreateIcon = function(self, button)
    	button.cd:SetReverse(true)
    	button.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
    	button.icon:SetDrawLayer("BACKGROUND")
    	--Count
    	button.count:ClearAllPoints()
    	button.count:SetFont(config.font, 8, "OUTLINEMONOCHROME")
    	button.count:SetJustifyH("RIGHT")
    	button.count:SetPoint("TOPRIGHT", button, "TOPRIGHT", 0, 0)
    	button.count:SetTextColor(1,1,1)
    	--Helper
    	local h = CreateFrame("Frame", nil, button)
    	h:SetFrameLevel(0)
    	h:SetPoint("TOPLEFT", -0, 0)
    	h:SetPoint("BOTTOMRIGHT", 0, -0)
    	lib.gen_backdrop(h)
    end
    local postUpdateIcon = function(element, unit, button, index)
    	local _, _, _, _, _, duration, expirationTime, unitCaster, _ = UnitAura(unit, index, button.filter)
    	
    	if duration and duration > 0 then
    		button.time:Show()
    		button.timeLeft = expirationTime	
    		button:SetScript("OnUpdate", setTimer)			
    	else
    		button.time:Hide()
    		button.timeLeft = math.huge
    		button:SetScript("OnUpdate", nil)
    	end
    	
    	-- Desaturate non-Player Debuffs
    	if(button.debuff) then
    		if(unit == "target") then	
    			if (unitCaster == "player" or unitCaster == "vehicle") then
    				button.icon:SetDesaturated(false)				
    			elseif(not UnitPlayerControlled(unit)) then -- If Unit is Player Controlled don"t desaturate debuffs
    				button:SetBackdropColor(0, 0, 0)
    				button.overlay:SetVertexColor(0.3, 0.3, 0.3)      
    				button.icon:SetDesaturated(false)  
    			end
    		end
    	end
    	button:SetScript('OnMouseUp', function(self, mouseButton)
    		if mouseButton == 'RightButton' then
    			CancelUnitBuff('player', index)
    	end end)
    	button.first = true
    end
    lib.playBuffs = function(f)
    	b = CreateFrame("Frame", nil, f)
    	b.size = 30
    	if f.mystyle == "target" then
    		b.num = 40
    	elseif f.mystyle == "player" then
    		b.num = 10
    		b.onlyShowPlayer = true
    	else
    		b.num = 5
    	end
    	b.spacing = 5
    	b.onlyShowPlayer = false
    	b:SetHeight((b.size+b.spacing)*4)
    	b:SetWidth(f.width)
    	b:SetPoint("BOTTOMLEFT", f, "TOPLEFT", 0, 500)
    	b.initialAnchor = "TOPRIGHT"
    	b["growth-x"] = "LEFT"
    	b["growth-y"] = "DOWN"
    	b.PostCreateIcon = lib.PostCreateIcon
    	f.Buffs = b
    
    	BuffFrame:UnregisterEvent("UNIT_AURA")
    	BuffFrame:Hide()
    	TemporaryEnchantFrame:Hide()
    end
    But it didn't seem to change anything. Mind if I ask what I'm missing? >.<

    Quote Originally Posted by Pixil View Post
    I assume you have your heart set on configuring your buffs through oUF, but if you feel like giving in and taking the easy option; the AddOn Auraframes does everything that you're wanting.
    You'd just have to use Masque to make it match the rest of your UI.
    Yeah, my main purpose with oUF was consolidating my code and getting rid of a lot of addons.
    Last edited by Senit; 2012-08-16 at 07:02 PM.
    Senit UI -- outdated. Update... soon... maybe...

  7. #7607
    you forgot to add b.postUpdateIcon = lib.postUpdateIcon in playBuffs function AFTER the b.PostCreateIcon = lib.PostCreateIcon

    but again this is code transplantation from an entirely different UF code structure :P so it may not work

  8. #7608
    Field Marshal Senit's Avatar
    10+ Year Old Account
    Join Date
    Jul 2012
    Location
    Darnassus
    Posts
    87
    Yeah, that didn't make any difference, but I'm too much of a Lua amateur to fix it.

    It seems like there should be a simple, "duration" equivalent to

    Code:
    	--Count
    	button.count:ClearAllPoints()
    	button.count:SetFont(config.font, 8, "OUTLINEMONOCHROME")
    	button.count:SetJustifyH("RIGHT")
    	button.count:SetPoint("TOPRIGHT", button, "TOPRIGHT", 0, 0)
    	button.count:SetTextColor(1,1,1)
    Is there?
    Senit UI -- outdated. Update... soon... maybe...

  9. #7609
    Mechagnome Ricen's Avatar
    10+ Year Old Account
    Join Date
    Apr 2010
    Location
    Graveyard
    Posts
    660
    All this oUF talk has made me want to make the switch. If I were to take oUF P3lim and edit it, is that the best way to learn?

    When a wild forum troll appears

  10. #7610
    Field Marshal Senit's Avatar
    10+ Year Old Account
    Join Date
    Jul 2012
    Location
    Darnassus
    Posts
    87
    Quote Originally Posted by Ricen View Post
    All this oUF talk has made me want to make the switch. If I were to take oUF P3lim and edit it, is that the best way to learn?
    Oh god... there is no best way to learn.
    Senit UI -- outdated. Update... soon... maybe...

  11. #7611
    Mechagnome Ricen's Avatar
    10+ Year Old Account
    Join Date
    Apr 2010
    Location
    Graveyard
    Posts
    660
    Quote Originally Posted by Senit View Post
    Oh god... there is no best way to learn.
    Oh its gonna be a big ol bitch. BIG ol bitch. But they look nice, im trying to get into KG panels at the same time, thats a blast lemme tell ya.

    When a wild forum troll appears

  12. #7612
    Quote Originally Posted by Senit View Post
    Oh god... there is no best way to learn.
    Depressingly, this. Start with someone else's layout and go from there. I'm editing Zork's oUF_Simple2 at the minute and the 'tutorial' thread on it over at wowinterface has helped a lot, but I'm still a total noob and have almost no idea what I'm doing. Trial and error has so far been the order of the day...

  13. #7613
    Quote Originally Posted by AjayxD View Post
    Just for Cowt.

    Made a few of the edits you suggested, i like grid where it is and dont pay any attention to bartender as its a placeholder until Mop pre patch comes live in 2 weeks so try and see past it if you can.

    http://i45.tinypic.com/28gqkb6.jpg
    http://i45.tinypic.com/x1j4hl.jpg
    May I ask for a list of the addons that you use? : X

  14. #7614
    Mechagnome Ricen's Avatar
    10+ Year Old Account
    Join Date
    Apr 2010
    Location
    Graveyard
    Posts
    660
    Quote Originally Posted by Gymertron View Post
    Depressingly, this. Start with someone else's layout and go from there. I'm editing Zork's oUF_Simple2 at the minute and the 'tutorial' thread on it over at wowinterface has helped a lot, but I'm still a total noob and have almost no idea what I'm doing. Trial and error has so far been the order of the day...
    Yeah, if you look at my sig, thats what I have been doing all day

    When a wild forum troll appears

  15. #7615
    My UI has changed, all around. I swear I'm addicted to changing it. I went from my own custom ones, but no matter what I keep coming back to things like qulight or ElvUI!

    In use now:
    Last edited by mmocba105e19de; 2012-08-17 at 06:03 PM.

    Signature Designer | PM Requests: OPEN | Realm: Eonar - US

  16. #7616
    Field Marshal Senit's Avatar
    10+ Year Old Account
    Join Date
    Jul 2012
    Location
    Darnassus
    Posts
    87
    Quote Originally Posted by Ricen View Post
    Yeah, if you look at my sig, thats what I have been doing all day
    Yeah... it sucks to start out.
    Senit UI -- outdated. Update... soon... maybe...

  17. #7617
    http://i.imgur.com/OOMn6.jpg - combat

    Feel the right side is a bit heavy. I like my white borders.

    My pet name is "Unit type" so I know whether I have a cat or a wolf or a turtle out.

    For some reason there is a tiny black bar underneath my Pet, Player, Target, and Boss1 unit frames I can't seem to get rid of with the current placement of the frames.

    I can't seem to center my Rangedisplay and my Serenity stuff, because their placement is placed by dragging.

    Opinions?

  18. #7618
    Quote Originally Posted by Jeremypwnz View Post
    http://i.imgur.com/OOMn6.jpg - combat

    Feel the right side is a bit heavy. I like my white borders.

    My pet name is "Unit type" so I know whether I have a cat or a wolf or a turtle out.

    For some reason there is a tiny black bar underneath my Pet, Player, Target, and Boss1 unit frames I can't seem to get rid of with the current placement of the frames.

    I can't seem to center my Rangedisplay and my Serenity stuff, because their placement is placed by dragging.

    Opinions?
    Download 'align'
    it places a grid on your screen to evenly place anything dragging!
    http://www.wowinterface.com/download...153-Align.html

    EDIT: By the way, I like your UI!
    Last edited by Dreadzy; 2012-08-17 at 12:37 AM.

    Signature Designer | PM Requests: OPEN | Realm: Eonar - US

  19. #7619
    I use align, still tough to get everything centered correctly.

  20. #7620
    I used to use the straight edge of my reputation bar to help line things up, such as action bars and unitframes :')

    I'm so resourceful!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •