Skip to content

Commit

Permalink
Added center text options, missing libs from pkgmeta
Browse files Browse the repository at this point in the history
  • Loading branch information
hypernormalisation committed Oct 7, 2022
1 parent d378717 commit 0f2f38d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 13 deletions.
7 changes: 5 additions & 2 deletions .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ externals:
Libs/AceGUI-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceGUI-3.0
Libs/AceGUI-3.0-SharedMediaWidgets: https://repos.wowace.com/wow/ace-gui-3-0-shared-media-widgets/trunk/AceGUI-3.0-SharedMediaWidgets
Libs/LibSharedMedia-3.0: https://repos.curseforge.com/wow/libsharedmedia-3-0/trunk/LibSharedMedia-3.0
Libs/LibRangeCheck-2.0: https://repos.wowace.com/wow/librangecheck-2-0/trunk
Libs/LibWindow-1.1: https://repos.curseforge.com/wow/libwindow-1-1/trunk

Libs/LibClassicSwingTimerAPI:
url: https://github.com/Ralgathor/LibClassicSwingTimerAPI
tag: main
tag: v1.4.0
Libs/LibCustomGlow-1.0:
url: https://github.com/Stanzilla/LibCustomGlow
tag: master
tag: 1.0.3

ignore:
- README.md
Expand Down
2 changes: 1 addition & 1 deletion SwedgeTimer.toc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

Libs\LibStub\LibStub.lua
Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml
Libs\LibWindow-1.1\LibWindow-1.1.lua
Libs\LibWindow-1.1\LibWindow-1.1\LibWindow-1.1.lua
Libs\LibSharedMedia-3.0\lib.xml
LibClassicSwingTimerAPI.lua
Libs\LibRangeCheck-2.0\LibRangeCheck-2.0\LibRangeCheck-2.0.lua
Expand Down
75 changes: 65 additions & 10 deletions option_table_presets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ST.outlines = {
ST.texts = {
attack_speed="Attack speed",
swing_timer="Swing timer",
range_finder="Range Finder",
}

ST.bar_border_modes = {
Expand Down Expand Up @@ -400,11 +401,6 @@ function ST:construct_text_settings_table()
order = 4.05,
name = "Controls what text to show on the left of the timer, and when to show it.",
},
-- lb01 = {
-- order=4.051,
-- type="header",
-- name="",
-- },
left_text_enabled = {
type = "toggle",
order = 4.06,
Expand Down Expand Up @@ -433,11 +429,6 @@ function ST:construct_text_settings_table()
set = "setter",
disabled = "left_text_disable",
},
-- left_text_position_header = {
-- type = "header",
-- order = 4.081,
-- name = "Left Text Position",
-- },
left_text_position_desc = {
type = "description",
order = 4.0811,
Expand All @@ -464,6 +455,70 @@ function ST:construct_text_settings_table()
set = "text_setter",
},

texts_center_header = {
order=4.0831,
type="header",
name="Center Text Control",
},
texts_center_desc = {
type = "description",
order = 4.0832,
name = "Controls what text to show on the center of the timer, and when to show it.",
},
center_text_enabled = {
type = "toggle",
order = 4.0833,
name = "Enabled",
desc = "Enables or disables the center timer text.",
get = "getter",
set = "setter",
},
center_text_key = {
type="select",
order = 4.0834,
values=ST.texts,
style="dropdown",
name = "",
desc = "What to show on the center of the timer.",
get = "getter",
set = "text_setter",
disabled = "center_text_disable",
},
center_text_hide_inactive = {
type = "toggle",
order = 4.0835,
name = "Hide when bar full",
desc = "Hides the text when the timer is full.",
get = "getter",
set = "setter",
disabled = "center_text_disable",
},
center_text_position_desc = {
type = "description",
order = 4.0836,
name = "Controls the center text's positional offsets as a percent of the timer size.",
},
center_text_x_percent_offset = {
type = "range",
order = 4.0837,
name = "x offset %",
desc = "The text's horizontal offset as a percentage of the timer width.",
min = -100 , max = 100, softMin = -30, softMax = 30,
step = 0.1,
get = "getter",
set = "text_setter",
},
center_text_y_percent_offset = {
type = "range",
order = 4.0838,
name = "y offset %",
desc = "The text's vertical offset as a percentage of the timer height.",
min = -250 , max = 250, softMin = -150, softMax = 150,
step = 0.1,
get = "getter",
set = "text_setter",
},

texts_right_header = {
order=4.095,
type="header",
Expand Down
9 changes: 9 additions & 0 deletions option_tables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@ function ST:set_opts_funcs()
end
end

-- Center text disabler
ST.opts_funcs[hand].center_text_disable = function()
if hand == "mainhand" or hand == "offhand" or hand == "ranged" then
return not ST:get_hand_table(hand).center_text_enabled
else
return not ST:get_hand_table("mainhand").center_text_enabled
end
end

-- Right text disabler
ST.opts_funcs[hand].right_text_disable = function()
if hand == "mainhand" or hand == "offhand" or hand == "ranged" then
Expand Down

0 comments on commit 0f2f38d

Please sign in to comment.