WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   split statusbars (https://www.wowinterface.com/forums/showthread.php?t=56030)

Ammako 02-13-18 09:27 AM

Shadow Priest has Shadow Word: Death, that can only be used on targets under 20% health. If you count that as an execute.

Coldkil 02-14-18 01:05 PM

Ok, i' working to a layout now - but first i'm finxing all the plugins i had before and that seem to be working for the most part.

I have moved away from pixel fonts and pixelperfection because it was cousing me headaches a lot with the hgih reso, so i opted for a clear font and a thin shadowy border to keep style minimal but sleekier and less painful to deal with.

however, i ahve troubles with tooltips. Everything is fine but these two cases. Anyone can lend a hand? Thanks.

-here the price is still in arial


-these are the "compare" frames when you hover on gear.

Ammako 02-14-18 01:34 PM

This may be of relevancy to you:
https://www.townlong-yak.com/framexm...yFrame.lua#524

Haven't messed with it but maybe it'll help. Might not actually be related though.

As for compare frame, it uses GameTooltipTextSmall (except for the "Currently equipped" text at the top, and the item name + quality text.)
Might have to dig a bit deeper for those.
But if you look in GameTooltipTemplate.xml, you can see what fonts are used in tooltips. You could in theory just replace those fonts directly, but this would affect the rest of the UI wherever that font is used (for example, GameFontNormal. Though that may be your desired outcome, regardless.)

Also looks like money frame on tooltips might use GameFontHighlight? unless I'm interpreting it wrong.

I think this is the one for item compare:
https://www.townlong-yak.com/framexm...mplate.xml#257

lightspark 02-14-18 02:27 PM

It's different because price tag isn't a real tooltip text, it's a frame that's added to a tooltip.

I'll never understand why they opted for such a weird solution.

As for item compare tooltips, those are ShoppingTooltip1 and ShoppingTooltip2.

Coldkil 02-15-18 02:44 AM

Ok, i think i'll need to rewrite or at least cleanup the tooltip code. it's kinda a mess currently.

Anyway, so far so good. I'd like to make a bar addon that reuses the default Blizzard skin but removing the micromenu - i have already working code for a mouseover micromenu, i'd also like to just reuse the standard buttons.

Honestly, i always disliked the standard UI because it was basically "in the way". But since i have a higehr resolution monitor, this issue disappeared and i'm just working to make things compact but keeping the original vibe to it.

EDIT: i ended by changing the UI fonts altogether. In the tooltips that are SO MANY of them it's painful, but since i want to align everything then i would have done it nontheless. Just better at this point to make a font changer addon and add eventual new ones there.

as fo the project going, i did a "new" thing - it's nice to reuse Blizzard art to make something sleeker. This is just testing what i had and what i could do. Should be able to make a proper thing in a short time if i focus on it.

Coldkil 02-18-18 02:35 AM

triple post, but i didn't wnat to open another thread for this.

I'm doing the actionbars and everything was fie until one point - now i have the first and second actionbar that have the same spells replicated. Obviously there's something wrong.

Here's what's happening (and it started after a while and not immediately)


code here:
--- main bar
Code:

  -- reusing Blizzard buttons and move in the right place. whole 12 button bar

  --create the frame to hold the buttons
  local bar = CreateFrame("Frame","cBar1",UIParent, "SecureHandlerStateTemplate")
  bar:SetPoint("BOTTOMRIGHT",Minimap,"BOTTOMLEFT",-12,3)
  bar:SetFrameLevel(2)
  bar:SetSize(246,36)

  -- cycle through the buttons
  for i=1, 12 do
    local button = _G["ActionButton"..i]
        button:SetParent(bar)
    button:SetSize(36,36)
    button:ClearAllPoints()
    if i == 1 then
          button:SetPoint("BOTTOMLEFT", bar, "BOTTOMLEFT")
        elseif i == 7 then 
          button:SetPoint("BOTTOMLEFT", _G["ActionButton1"], "TOPLEFT", 0, 6)
    else
      local previous = _G["ActionButton"..i-1]
          button:SetPoint("LEFT", previous, "RIGHT", 6, 0)
    end
  end

  --show/hide the frame on a given state driver
  RegisterStateDriver(MainMenuBarArtFrame, "visibility", "[petbattle][overridebar][vehicleui] hide; show")
 
  -- vehicle exit button
  local veb = CreateFrame("BUTTON", nil, bar, "SecureHandlerClickTemplate")
  veb:SetParent(bar)
  veb:SetPoint("RIGHT", bar, "LEFT", -5, 0)
  veb:SetSize(28, 28)
  veb:RegisterForClicks("AnyUp")
  veb:SetNormalTexture("Interface\\Vehicles\\UI-Vehicles-Button-Exit-Up")
  veb:SetPushedTexture("Interface\\Vehicles\\UI-Vehicles-Button-Exit-Down")
  veb:SetHighlightTexture("Interface\\Vehicles\\UI-Vehicles-Button-Exit-Down")
  veb:SetScript("OnClick", function(self) VehicleExit() end)
  RegisterStateDriver(veb, "visibility", "[target=vehicle,exists] show;hide")

-- second bar:
Code:

  -- second bar on mouseover above the main bar

  --create the frame to hold the buttons, plus mouseover script
  local bar = CreateFrame("Frame","cBar2",UIParent, "SecureHandlerStateTemplate")
  bar:SetPoint("TOPRIGHT",Minimap,"TOPLEFT",-2,4)
  bar:SetFrameLevel(2)
  bar:SetSize(264, 94)
  bar:SetBackdrop({
        edgeFile = "Interface\\AddOns\\cMedia\\border",
        edgeSize = 4,
        insets = {left = 4,right = 4,top = 4,bottom = 4}
  })
  bar:SetBackdropBorderColor(0,0,0)
  --bar:SetAlpha(0)
  --bar:SetScript("OnEnter", function() bar:SetAlpha(1) end)
  --bar:SetScript("OnLeave", function() bar:SetAlpha(0) end)
 
  -- texture to match main bar
  texture = bar:CreateTexture("cBar2Top")
  texture:SetTexture("Interface\\MainMenuBar\\UI-MainMenuBar-Dwarf",1)
  texture:SetTexCoord(0, 1.0, 0.58203125, 0.75)
  texture:SetPoint("TOPLEFT", bar, "TOPLEFT", 4,-4)
  texture:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -4, 47)
  texture2 = bar:CreateTexture("cBar2Bottom")
  texture2:SetTexture("Interface\\MainMenuBar\\UI-MainMenuBar-Dwarf",1)
  texture2:SetTexCoord(0, 1.0, 0.58203125, 0.75)
  texture2:SetPoint("TOPLEFT", bar, "TOPLEFT", 4,-46)
  texture2:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -4, 4)


  for i= 1, 12 do
    local button = _G["MultiBarBottomLeftButton"..i]
        button:SetParent(bar)
    button:SetSize(36,36)
    button:ClearAllPoints()
    if i == 1 then
                button:SetPoint("BOTTOMLEFT", bar, "BOTTOMLEFT", 7, 7)
        elseif i == 7 then 
                button:SetPoint("BOTTOMLEFT", _G["MultiBarBottomLeftButton1"], "TOPLEFT", 0, 6)
        else
                local previous = _G["MultiBarBottomLeftButton"..i-1]
                button:SetPoint("LEFT", previous, "RIGHT", 6, 0)
        end
        --mouseover scripts
        --button:SetScript("OnEnter",function() bar:SetAlpha(1) end)
        --button:SetScript("Onleave",function() bar:SetAlpha(0) end)
  end
 
  --show/hide the frame on a given state driver
  RegisterStateDriver(MultiBarBottomLeft, "visibility", "[petbattle][overridebar][vehicleui] hide; show")


Seerah 02-18-18 12:51 PM

I haven't worked with action bar code, but this happens when you have the main bar paged to the bar that you are using for the 2nd one.

jeffy162 02-18-18 01:23 PM

Why not look at Dominos to see how Tuller "fixed" that. I know there [b]USED[\B] to be a problem like that with Dominos.

lightspark 02-19-18 12:39 AM

You have to set "actionpage" attribute on your bars, otherwise it defaults to 1.

Coldkil 02-19-18 03:04 AM

Quote:

Originally Posted by lightspark (Post 326966)
You have to set "actionpage" attribute on your bars, otherwise it defaults to 1.

Wow, is it a new thing? I just took my old 6.0 addon and scrapped from it everything apart the button repositioning basically.
Anyway it looks simple enough to fix - every bar will use a static page and that's it.

Also, tip on how to "cut" a texture via SetTextCoords? I'm using it for the current ones, but i'd like to try with 8 button bars, as 24 total buttons is kinda on the small side, and some room may be useful for classe with more keybindings.

Thanks again everyone.

Here's a better quality image of how it's coming out - datatext panel works also as chat editbox, i'm having some crap with positioning the chat frames (especially combatlog) but nothing too difficult.


lightspark 02-19-18 06:09 AM

Quote:

Originally Posted by Coldkil (Post 326967)
Anyway it looks simple enough to fix - every bar will use a static page and that's it.

Well, main action bar isn't static, its page changes depending on your stance/form/etc.

Quote:

Originally Posted by Coldkil (Post 326967)
Also, tip on how to "cut" a texture via SetTextCoords?



Let's say you have a 256x128 texture, and you want to use a 32x32 piece that's offset from the top left corner by 8px.

This piece's coords will be: 8 / 256, (8 + 32) / 256, 8 / 128, (8 + 32) / 128. It's pretty straight froward.

I use PS, so I run this ghetto JS script I wrote years ago:
Code:

var doc = app.activeDocument;

function hasSelection() {
    try {
        return (doc.selection.bounds) ? true : false;
    } catch (e) {
        return false;
    }
}

if (hasSelection()) {
    var win = new Window("dialog {\
        alignChildren: 'fill',\
        preferredSize: [256, 32],\
        margins: 6,\
        text: 'Selection Coords',\
        ed: EditText {\
            active: true,\
        },\
    }");
    win.ed.text =
        doc.selection.bounds[0].value + " / " + doc.width.value + ", " +
        doc.selection.bounds[2].value + " / " + doc.width.value + ", " +
        doc.selection.bounds[1].value + " / " + doc.height.value + ", " +
        doc.selection.bounds[3].value + " / " + doc.height.value;
    win.center();
    win.show();
}

Just create a new action that runs this script.


Coldkil 02-19-18 06:58 AM

Quote:

Originally Posted by lightspark (Post 326969)
-snip-

Many thanks again, now it's way clearer. For the bars i'm using the default textures and i just copied original Blizzard xml, the actual texture for the bar is a single one with all the textures packed in one, and everything was a value between 0 and 1 iirc, that's why it didn't make much sense to me :D

As for the actionbar pages, the main one is already set up by default to use pages 7 and beyond for stances, so i shouldn't touch it. On the other side the additional bars use pages from 2 to 6, so i just need to set the ones i use to these pages. Until i'm missing something - i'm reading the original files to get the idea of what actually happens in game and try to reuse as much code as possible to have more future-proof addons.

EDIT: yeah, as expected fixing the second bar was easy. But the first bar is fixed to page one, so changing stance makes everything go bonkers. Well, at least now i have buttons working, will check how to make the page shift as the attribute is per single button and not action bar apparently.

JDoubleU00 02-19-18 11:11 AM

That is an interesting design. Will the chat be to the right of the minimap?


Quote:

Originally Posted by Coldkil (Post 326967)
Wow, is it a new thing? I just took my old 6.0 addon and scrapped from it everything apart the button repositioning basically.
Anyway it looks simple enough to fix - every bar will use a static page and that's it.

Also, tip on how to "cut" a texture via SetTextCoords? I'm using it for the current ones, but i'd like to try with 8 button bars, as 24 total buttons is kinda on the small side, and some room may be useful for classe with more keybindings.

Thanks again everyone.

Here's a better quality image of how it's coming out - datatext panel works also as chat editbox, i'm having some crap with positioning the chat frames (especially combatlog) but nothing too difficult.



Coldkil 02-19-18 11:39 AM

Yes, this is the current status, had some trouble with the combat log positioning. Will make bars 8 buttons large, and the top ones will be on mouseover without the textures actually (i use them right now as a grid to align everything). Chat will be slightly larger too to keep the symmetry.



All times are GMT -6. The time now is 11:47 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI