Dominos

Dominos

19M Downloads

Enhanced Bar Snapping

Tuller opened this issue ยท 16 comments

commented

What is the enhancement in mind?

Requesting that bar "snapping" be a step more functional. At this time dominos does a wonderful job snapping to other bars as well as snapping to the center for bars placed adjacent to the screen edge. I am making this ticket in the hopes to have this feature enhanced to where the bars in config mode will also "snap" to the center even if you are placing a bar nowhere near the screen edge. This will make it easier to center things like the stance bar or any bars that need to be centered in the screen without building from the screen edge up or out.

How should it look and feel?

same as the default action minus the need to build from the screen edge.

Please provide any additional information below.

N/A

commented

Her's my idea... create "blank" bars that use the height/width functionality of the XP bar. These "blank" bars would allow users to build from anywhere. you'd just have to set where the bar is, and build from it. And the neat thing is that the blank bars would only exist in config mode. And being the strange lil person I am, I've already modified the XP bar into this for my own UI... I'll post a copy of the code in a second comment.

commented

local DREP = Dominos:NewModule('Spacer Frame')
local REP
function DREP:Load()
self.frame = REP:New()
self.frame:SetFrameStrata('LOW')
end
function DREP:Unload()
end
REP = Dominos:CreateClass('Frame', Dominos.Frame)
function REP:New()
local f = self.super.New(self, 'Spacer Frame')
f:Layout()
return f
end

function REP:GetDefaults()
return {
scale = 1,
point = 'CENTER',
x = 0,
y= 0,
width = 37,
height = 10,
}
end

--[[Layout]]--

function REP:Layout()
if not self.sets.framewidth then
self.sets.framewidth = 30
self.sets.frameheight = 30
end
width = (self.sets.framewidth)
height = (self.sets.frameheight)

    self:SetHeight(height)
    self:SetWidth(width)

end

--[[Layout Panel--]]
local function CreateWidthSlider(p)
local s = p:NewSlider("Width", 1, GetScreenWidth(), 1)
s.OnShow = function(self)
self:SetValue(self:GetParent().owner.sets.framewidth)
end
s.UpdateValue = function(self, value)
local f = self:GetParent().owner
f.sets.framewidth = value
f:Layout()
end
end
local function CreateHeightSlider(p)
local s = p:NewSlider("Height", 1, GetScreenHeight(), 1, OnShow)
s.OnShow = function(self)
self:SetValue(self:GetParent().owner.sets.frameheight)
end

s.UpdateValue = function(self, value)
    local f = self:GetParent().owner
    f.sets.frameheight = value
    f:Layout()
end

end
local function AddLayoutPanel(menu)
local p = menu:NewPanel(LibStub('AceLocale-3.0'):GetLocale('Dominos-Config').Layout)
CreateHeightSlider(p)
CreateWidthSlider(p)
p:NewScaleSlider()
end

--[[ Menu Code ]]--
function REP:CreateMenu()
local menu = Dominos:NewMenu(self.id)
AddLayoutPanel(menu)
self.menu = menu
end

commented

Interesting. I wonder if it would be possible to stick together a
bunch of elements within a group like this, then move it around your
UI. That is, fill a giant box with stuff, and then move the box
around.

Jason

On Apr 18, 2011, at 11:55 PM, Goranaws
[email protected]
wrote:

Her's my idea... create "blank" bars that use the height/width functionality of the XP bar. These "blank" bars would allow users to build from anywhere. you'd just have to set where the bar is, and build from it. And the neat thing is that the blank bars would only exist in config mode. And being the strange lil person I am, I've already modified the XP bar into this for my own UI... I'll post a copy of the code in a second comment.

Reply to this email directly or view it on GitHub:
https://github.com/Tuller/Dominos/issues/26#comment_1024963

commented

It would be entirely possible.

commented

I think another idea, unrelated to my first one, would be to just expand on the existing Bar snapping... The bars will snap to the center of each of the screen. Why not just "break" the screen into the four corners? So, if you have a Dominos frame halfway between the bottom edge of the screen and the center of the screen, it will still align with the bottom center of the screen without actually touching the bottom of the screen. Additionally, if the edge of a Dominos frame is near the bottom(or any side) center of the screen, the edge of that frame would snap to the center of the screen edge.

commented

I'm not sure what you mean by that. Dominos already does center on midpoints on screen edges.

commented

It does the midpoint on the edge of the screen, but doesn't align with the edge's midpoint when not actually touching the edge. I could draw up a visual aid... that might help explain what I mean more clearly...

commented

I was working on an Enhanced frame positioning concept for one of my other addons, and realize that the same Thing could be applied to Dominos. It isn't bar snapping, but I think it might be just as useful. I do have a working bit of code for Dominos, and I'm testing it out now. The idea is that you have two sliders, and a menu, one slider controls the "X" value for a frame's position, the other controls the "Y" value. The menu lets you select frame's anchor point. (point being one of the following: "Top", "TopLeft", "TopRight", "Bottom", "BottomLeft", "BottomRight", "Left", "Right", "Center")

commented

Its a good idea, but definitely an advanced feature, I think.

Side note: One thought I had a while ago (that I have as an open issue for thundercougarfalconbars), is to come up with a nudge interface, where arrows would pop up around a bar, and you could click them to adjust a bar's position in one direction or another (with bonus points if I figured out how to map it to arrow keys). This would quite possibly go along with a grid background as well.

commented

I'll see what I can do... :-) It shouldn't be too difficult to figure it all out.

commented

The following is a link to what I'd like to do to implement the Side note you mentioned: http://pastehtml.com/upload/create

It throws up some errors that I'm not sure about... I did test all of by adding it into existing code, but I'd rather not have to mess with already well functioning code to do it. Any idea how to work it out?

commented

Bad link :)

commented

I put the wrong one. here it is ==>> http://pastehtml.com/view/baujmjamy.txt

commented

Code's not working for me in its current state, I think some of the
hooks aren't quite right.

On Mon, Oct 17, 2011 at 12:52 PM, Goranaws
[email protected]
wrote:

I put the wrong one. here it is ==>> http://pastehtml.com/view/baujmjamy.txt

Reply to this email directly or view it on GitHub:
#26 (comment)

commented

I agree. I haven't been able to understand hooking very well. I can change the system to work without hooking, but that requires altering two other files in Dominos, and I'd like to avoid altering them.

commented