Skip to content

Commit 2367c2d

Browse files
Added Arms to spec-dependent enable/disable for warriors
1 parent eab6f4a commit 2367c2d

File tree

4 files changed

+29
-20
lines changed

4 files changed

+29
-20
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## [2.0.8] -- 2023-05-09
44

5+
### Added
6+
- Warriors now have the option to disable the swing timer when in Arms or Protection spec.
7+
58
### Fixed
69
- Fixed a bug where indeterminate ordering of evet callbacks was makinng the weapon checks for offhand and ranged lag behind
710
equipment changes. This will fix a bug for warriors where ElvUI being loaded causes equipping a shield to break the offhand timer.

config_presets.lua

+1
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ ST.WARRIOR.defaults = {
399399
bloodsurge_glow_line_length = 12,
400400

401401
hide_in_tank_spec = false,
402+
hide_in_arms_spec = false,
402403

403404
-- Bar options
404405
['**'] = ST.bar_defaults,

main.lua

+13-17
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,13 @@ function ST:show_bar(hand)
164164
self:hide_bar(hand)
165165
end
166166
elseif self.player_class == "WARRIOR" then
167-
if not (db_class.hide_in_tank_spec and self.has_devastate) then
167+
if db_class.hide_in_tank_spec and self.has_devastate then
168+
self:hide_bar(hand)
169+
elseif db_class.hide_in_arms_spec and self.has_bladestorm then
170+
self:hide_bar(hand)
171+
else
168172
self:get_bar_frame(hand):Show()
169173
self:get_hiding_anchor_frame(hand):Show()
170-
else
171-
self:hide_bar(hand)
172174
end
173175
else
174176
self:get_bar_frame(hand):Show()
@@ -806,9 +808,10 @@ function ST:get_druid_talent_info()
806808
end
807809

808810
function ST:get_warrior_talent_info()
809-
-- Function to determine if the player is in tank spec,
810-
-- i.e. has Devastate talented.
811+
-- Functions to get talents for specs that the user may want to hide
812+
-- the swing timer in.
811813
self.has_devastate = select(5, GetTalentInfo(3, 20)) == 1
814+
self.has_bladestorm = select(5, GetTalentInfo(1, 27)) == 1
812815
end
813816

814817
------------------------------------------------------------------------------------
@@ -1051,25 +1054,13 @@ function ST:register_slashcommands()
10511054
end
10521055

10531056
function ST:test1()
1054-
-- local db = self:get_class_table()
1055-
-- if db.bars_locked then
1056-
-- self:Print("Unlocking bar frames")
1057-
-- db.bars_locked = false
1058-
-- self:unlock_frames()
1059-
-- else
1060-
-- self:Print("Locking bar frames")
1061-
-- db.bars_locked = true
1062-
-- self:lock_frames()
1063-
-- end
10641057
end
10651058

10661059
function ST:open_menu()
10671060
local ACD = LibStub("AceConfigDialog-3.0")
10681061
ACD:Open(addon_name.."_Options")
10691062
end
10701063

1071-
if st.debug then st.utils.print_msg('-- Parsed main1.lua module correctly') end
1072-
10731064
--=========================================================================================
10741065
-- Funcs to apply per-class settings
10751066
--=========================================================================================
@@ -1086,3 +1077,8 @@ function ST:class_on_current_spell_cast_changed(is_cancelled)
10861077
self[c].on_current_spell_cast_changed(self, is_cancelled)
10871078
end
10881079
end
1080+
1081+
--=========================================================================================
1082+
-- For debug and lua syntax errors
1083+
--=========================================================================================
1084+
if st.debug then st.utils.print_msg('-- Parsed main1.lua module correctly') end

option_tables.lua

+12-3
Original file line numberDiff line numberDiff line change
@@ -653,17 +653,26 @@ function ST.class_opts_funcs.WARRIOR(self)
653653
tank_vid_header = {
654654
type = "header",
655655
order = 0.8,
656-
name = "Hide when in tank spec"
656+
name = "Spec-dependent enable/disable"
657657
},
658658
hide_in_tank_spec = {
659659
type = "toggle",
660660
order = 0.81,
661-
name = "Enable",
662-
desc = "When enabled, the timer will hide when the Warrior is in a tanking spec ("..
661+
name = "Hide when Protection",
662+
desc = "When enabled, the timer will hide when the Warrior is in Protection spec ("..
663663
"determined when Devastate is talented).",
664664
get = "getter",
665665
set = "setter",
666666
},
667+
hide_in_arms_spec = {
668+
type = "toggle",
669+
order = 0.82,
670+
name = "Hide when Arms",
671+
desc = "When enabled, the timer will hide when the Warrior is in Arms spec ("..
672+
"determined when Bladestorm is talented).",
673+
get = "getter",
674+
set = "setter",
675+
},
667676
class_header = {
668677
type = "header",
669678
order = 1.0,

0 commit comments

Comments
 (0)