Skip to content

Commit

Permalink
Merge pull request #130 from Vysci/Font_Size_attempt_2
Browse files Browse the repository at this point in the history
Added Working Version of Font Size
  • Loading branch information
Vysci authored Sep 14, 2021
2 parents 0741e75 + f989753 commit bb366fd
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 7 deletions.
2 changes: 2 additions & 0 deletions LFGBulletinBoard/Chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ function GBB.SendMessage(ChannelName, Msg)
end

function GBB.AnnounceInit()
GroupBulletinBoardFrameSelectChannel:SetNormalFontObject(GBB.DB.FontSize)
GroupBulletinBoardFrameAnnounce:SetNormalFontObject(GBB.DB.FontSize)
GroupBulletinBoardFrameAnnounceMsg:SetTextColor(0.6,0.6,0.6)
GroupBulletinBoardFrameAnnounceMsg:SetText(GBB.L["msgRequestHere"])
GroupBulletinBoardFrameAnnounce:SetText(GBB.L["BtnPostMsg"])
Expand Down
7 changes: 5 additions & 2 deletions LFGBulletinBoard/GroupBulletinBoard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ function GBB.Init()
if not GBB.DB.Custom then GBB.DB.Custom={} end
if not GBB.DB.CustomLocales then GBB.DB.CustomLocales={} end
if not GBB.DB.CustomLocalesDungeon then GBB.DB.CustomLocalesDungeon={} end
if not GBB.DB.FontSize then GBB.DB.FontSize = GameFontNormal end
if not GBB.DB.DisplayLFG then GBB.DB.DisplayLFG = false end
GBB.DB.Server=nil -- old settings

if GBB.DB.OnDebug == nil then GBB.DB.OnDebug=false end
Expand Down Expand Up @@ -498,7 +500,7 @@ function GBB.Init()
},
},
})

-- Create options and initalize!
GBB.OptionsInit()

Expand All @@ -517,13 +519,15 @@ function GBB.Init()
)

GBB.FramePullDownChannel=CreateFrame("Frame", "GBB.PullDownMenu", UIParent, "UIDropDownMenuTemplate")
GroupBulletinBoardFrameTitle:SetFontObject(GBB.DB.FontSize)
if GBB.DB.AnnounceChannel == nil then
if GBB.L["lfg_channel"] ~= "" then
GBB.DB.AnnounceChannel = GBB.L["lfg_channel"]
else
_, GBB.DB.AnnounceChannel = GetChannelList()
end
end

GroupBulletinBoardFrameSelectChannel:SetText(GBB.DB.AnnounceChannel)

GBB.ResizeFrameList()
Expand Down Expand Up @@ -553,7 +557,6 @@ function GBB.Init()
GBB.PopupDynamic=GBB.Tool.CreatePopup(GBB.OptionsUpdate)

GBB.InitGroupList()

GBB.Tool.AddTab(GroupBulletinBoardFrame,GBB.L.TabRequest,GroupBulletinBoardFrame_ScrollFrame)
GBB.Tool.AddTab(GroupBulletinBoardFrame,GBB.L.TabGroup,GroupBulletinBoardFrame_GroupFrame)
GBB.Tool.SelectTab(GroupBulletinBoardFrame,1)
Expand Down
2 changes: 1 addition & 1 deletion LFGBulletinBoard/GroupList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function GBB.InitGroupList()


GroupBulletinBoardFrame_GroupFrame:SetFading(false);
GroupBulletinBoardFrame_GroupFrame:SetFontObject(GameFontNormal);
GroupBulletinBoardFrame_GroupFrame:SetFontObject(GBB.DB.FontSize);
GroupBulletinBoardFrame_GroupFrame:SetJustifyH("LEFT");
GroupBulletinBoardFrame_GroupFrame:SetHyperlinksEnabled(true);
GroupBulletinBoardFrame_GroupFrame:SetScript("OnHyperlinkClick",ClickHyperlink)
Expand Down
4 changes: 2 additions & 2 deletions LFGBulletinBoard/LFGBulletinBoard.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Interface: 20502
## Title: LFG Bulletin Board
## Notes: Sort LFG/LFM Messages
## Version: 2.59
## Version: 2.61
## Author: Vyscî-Whitemane
## DefaultState: enabled
## SavedVariables: GroupBulletinBoardDB
Expand All @@ -17,4 +17,4 @@ RequestList.lua
Options.lua
GroupList.Lua
GroupBulletinBoard.lua
GroupBulletinBoard.xml
GroupBulletinBoard.xml
55 changes: 55 additions & 0 deletions LFGBulletinBoard/LibGPIOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,61 @@ function Options.AddColorButton(DB,Var,Init,Text,width)
return but
end

function Options.AddDrop(DB,Var,Init,MenuItems)
local c=Options.Frames.count+1
Options.Frames.count=c
local ButtonName=Options.Prefix .."BUTTON_"..c
Options.Vars[ButtonName]=Var
Options.Vars[ButtonName.."_init"]=Init
Options.Vars[ButtonName.."_db"]=DB

if DB~=nil and Var~=nil then
if DB[Var] == nil then DB[Var]=Init end
end

Options.Btn[ButtonName] = CreateFrame("Frame", ButtonName , Options.CurrentPanel, "UIDropDownMenuTemplate")
if Options.inLine~=true or Options.LineRelativ ==nil then
Options.Btn[ButtonName]:SetPoint("TOPLEFT", Options.NextRelativ,"BOTTOMLEFT", Options.NextRelativX, Options.NextRelativY)
Options.NextRelativ=ButtonName
Options.LineRelativ=ButtonName
Options.NextRelativX=0
Options.NextRelativY=0
else
Options.Btn[ButtonName]:SetPoint("TOP", Options.LineRelativ,"TOP", 0, 0)
Options.Btn[ButtonName]:SetPoint("LEFT", Options.LineRelativ.."Text","RIGHT", 0, 0)
Options.LineRelativ=ButtonName
end

local dropdown_width = 0
local dd_title = Options.Btn[ButtonName]:CreateFontString(Options.Btn[ButtonName], 'OVERLAY', 'GameFontNormal')
for _, item in pairs(MenuItems) do -- Sets the dropdown width to the largest item string width.
dd_title:SetText(item)
local text_width = dd_title:GetStringWidth() + 20
if text_width > dropdown_width then
dropdown_width = text_width
end
end
UIDropDownMenu_SetWidth(Options.Btn[ButtonName], dropdown_width)
UIDropDownMenu_SetText(Options.Btn[ButtonName], DB[Var])

-- Create and bind the initialization function to the dropdown menu
UIDropDownMenu_Initialize(Options.Btn[ButtonName], function(self, level, menuList)
local info = UIDropDownMenu_CreateInfo()
for k, v in pairs(MenuItems) do
info.text = v
info.func = function(b)
UIDropDownMenu_SetText(Options.Btn[ButtonName], b.value)
DB[Var] = b.value
Init = b.value
end
UIDropDownMenu_AddButton(info)
end
end)

end





function Options.EditCheckBox(toEdit,DB,Var,Init,Text,width)
Expand Down
1 change: 1 addition & 0 deletions LFGBulletinBoard/Localization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ GBB.locales = {
["heroicAbr"]="H",
["normalAbr"]="N",
["raidAbr"]="R",
["msgFontSize"] = "Font Size (Requires /reload)",

-- option panel

Expand Down
4 changes: 4 additions & 0 deletions LFGBulletinBoard/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ function GBB.OptionsInit ()
GBB.Options.AddSpace()
CheckBox("ShowTotalTime",false)
CheckBox("OrderNewTop",true)
GBB.Options.AddSpace()
GBB.Options.AddText(GBB.L["msgFontSize"],-20)
GBB.Options.AddDrop(GBB.DB,"FontSize", "GameFontNormal", {"GameFontNormalSmall", "GameFontNormal", "GameFontNormalLarge"})

CheckBox("CombineSubDungeons",false)
GBB.Options.AddSpace()
CheckBox("NotifySound",false)
Expand Down
8 changes: 6 additions & 2 deletions LFGBulletinBoard/RequestList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ local function CreateHeader(yy,dungeon)
GBB.FramesEntries[dungeon]:SetPoint("RIGHT", _G[AnchorRight], "RIGHT", 0, 0)
_G[ItemFrameName.."_name"]:SetPoint("RIGHT",GBB.FramesEntries[dungeon], "RIGHT", 0,0)
local fname,h=_G[ItemFrameName.."_name"]:GetFont()

_G[ItemFrameName.."_name"]:SetHeight(h)
_G[ItemFrameName]:SetHeight(h+5)
_G[ItemFrameName.."_name"]:SetFontObject(GBB.DB.FontSize)

end

Expand Down Expand Up @@ -106,7 +106,7 @@ local function CreateHeader(yy,dungeon)
end

_G[ItemFrameName.."_name"]:SetText(colTXT..GBB.dungeonNames[dungeon].." |cFFAAAAAA"..GBB.LevelRange(dungeon).."|r")
_G[ItemFrameName.."_name"]:SetFontObject(GBB.DB.FontSize)
GBB.FramesEntries[dungeon]:SetPoint("TOPLEFT",_G[AnchorTop], "TOPLEFT", 0,-yy)
GBB.FramesEntries[dungeon]:Show()

Expand All @@ -123,10 +123,14 @@ local function CreateItem(yy,i,doCompact,req,forceHight)
if GBB.FramesEntries[i]==nil then
GBB.FramesEntries[i]=CreateFrame("Frame",ItemFrameName , GroupBulletinBoardFrame_ScrollChildFrame, "GroupBulletinBoard_TmpRequest")
GBB.FramesEntries[i]:SetPoint("RIGHT", _G[AnchorRight], "RIGHT", 0, 0)

_G[ItemFrameName.."_name"]:SetPoint("TOPLEFT")
_G[ItemFrameName.."_time"]:SetPoint("TOP",_G[ItemFrameName.."_name"], "TOP",0,0)

_G[ItemFrameName.."_message"]:SetNonSpaceWrap(false)
_G[ItemFrameName.."_message"]:SetFontObject(GBB.DB.FontSize)
_G[ItemFrameName.."_name"]:SetFontObject(GBB.DB.FontSize)
_G[ItemFrameName.."_time"]:SetFontObject(GBB.DB.FontSize)
if GBB.DontTrunicate then
GBB.ClearNeeded=true
end
Expand Down
8 changes: 8 additions & 0 deletions LFGBulletinBoard/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Group Bulletin Board

2.61
- Added option to adjust font size. 3 whole options, don't ask for more
- Fixed the thing that made the addon not working for everyone except me
- LFG bar defaulted to being off (its ugly af)

2.60
- I cant remember what happened here. I was drunk

2.59
- Fixed interference with other addons
- Make LFG bar optional (configured in setting)
Expand Down

0 comments on commit bb366fd

Please sign in to comment.