Skip to content

Commit

Permalink
adding new setting
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgdevx committed Sep 3, 2024
1 parent 75973a9 commit 39e000c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 8 deletions.
2 changes: 1 addition & 1 deletion AutoBodyRes.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 110002
## Title: AutoBodyRes
## Version: 1.1.1
## Version: 1.1.2
## Author: RBGDEV
## Notes: Shows text if someone took your body or not after you died in a battleground, preventing you from being able to body res.
## OptionalDeps: Ace3, LibStub, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Auto Body Res

## [v1.1.2](https://github.com/rbgdevx/auto-body-res/releases/tag/v1.1.2) (2024-09-03)

- Adding new setting to turn off body res text

## [v1.1.1](https://github.com/rbgdevx/auto-body-res/releases/tag/v1.1.1) (2024-09-03)

- Fixing error
Expand Down
2 changes: 2 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local CreateFrame = CreateFrame
---@field lock boolean
---@field test boolean
---@field release boolean
---@field text boolean
---@field onlypvp boolean
---@field fontsize number
---@field font string
Expand Down Expand Up @@ -62,6 +63,7 @@ NS.DefaultDatabase = {
test = true,
release = true,
resurrect = true,
text = true,
onlypvp = true,
fontsize = 40,
font = "Friz Quadrata TT",
Expand Down
6 changes: 6 additions & 0 deletions interface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ function Interface:Start(frame, duration)

frame.textFrame:Show()

if NS.db.global.text then
frame.textFrame:SetAlpha(1)
else
frame.textFrame:SetAlpha(0)
end

if duration == 0 then
local str = sformat("%s", "CAN BODY RES NOW")
frame.text:SetText(str)
Expand Down
33 changes: 26 additions & 7 deletions options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,31 @@ NS.AceConfig = {
return NS.db.global.resurrect
end,
},
text = {
name = "Toggle body res timer text",
desc = "Toggles on/off the text that displays the time remaining to resurrect your body.",
type = "toggle",
width = "double",
order = 5,
set = function(_, val)
NS.db.global.text = val

if val then
NS.Interface.textFrame:SetAlpha(1)
else
NS.Interface.textFrame:SetAlpha(0)
end
end,
get = function(_)
return NS.db.global.text
end,
},
onlypvp = {
name = "Toggle on this addon only in battlegrounds",
desc = "Toggling this feature off will make it work outside of battlegrounds",
type = "toggle",
width = "double",
order = 5,
order = 6,
set = function(_, val)
NS.db.global.onlypvp = val

Expand All @@ -116,7 +135,7 @@ NS.AceConfig = {
type = "range",
name = "Font Size",
width = "double",
order = 6,
order = 7,
min = 1,
max = 500,
step = 1,
Expand All @@ -133,7 +152,7 @@ NS.AceConfig = {
type = "select",
name = "Font",
width = "double",
order = 7,
order = 8,
dialogControl = "LSM30_Font",
values = AceGUIWidgetLSMlists.font,
set = function(_, val)
Expand All @@ -149,7 +168,7 @@ NS.AceConfig = {
type = "color",
name = "Color",
width = "double",
order = 8,
order = 9,
hasAlpha = true,
set = function(_, val1, val2, val3, val4)
NS.db.global.color.r = val1
Expand Down Expand Up @@ -192,10 +211,10 @@ NS.AceConfig = {

function Options:SlashCommands(message)
if message == "toggle lock" then
if NS.db.global.general.lock == false then
NS.db.global.general.lock = true
if NS.db.global.lock == false then
NS.db.global.lock = true
else
NS.db.global.general.lock = false
NS.db.global.lock = false
end
else
LibStub("AceConfigDialog-3.0"):Open(AddonName)
Expand Down

0 comments on commit 39e000c

Please sign in to comment.