diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..026b998 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release AddOn + +on: + push: + tags: + - '**' + +env: + CF_API_KEY: ${{ secrets.CF_API_KEY }} + WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }} + GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - uses: BigWigsMods/packager@master + with: + args: -g 1.13.5 + + - uses: BigWigsMods/packager@master diff --git a/SimpleDing.lua b/SimpleDing.lua index 09f3f66..ed563a1 100644 --- a/SimpleDing.lua +++ b/SimpleDing.lua @@ -15,7 +15,7 @@ local args = {} S.player = { name = UnitName("player"), level = UnitLevel("player"), - maxlevel = MAX_PLAYER_LEVEL_TABLE[GetExpansionLevel()], + maxlevel = GetMaxLevelForPlayerExpansion(), } local player = S.player @@ -93,6 +93,20 @@ local function LevelText(isPreview) return ReplaceArgs(msg, args) end +local requiresHw = { + SAY = true, + YELL = true, + CHANNEL = true, +} + +local function CanSendChatMessage(chatType) + local _, instanceType = IsInInstance() + if instanceType == "none" and requiresHw[chatType or "SAY"] then + return false + end + return true +end + local defaults = { db_version = 2, -- update this on savedvars changes ChatSay = true, @@ -112,7 +126,7 @@ local options = { args = { ChatSay = { type = "toggle", order = 1, - width = "full", desc = "Announces to /say. If disabled, shows a message in the center of your screen instead", + width = "full", desc = "Announces to |cff71D5FF/say|r. Otherwise shows a message in the center of your screen", name = "|TInterface\\ChatFrame\\UI-ChatIcon-Chat-Up:16:16|t "..SAY, }, ChatGuild = { @@ -197,7 +211,7 @@ function f:TIME_PLAYED_MSG(...) S.LevelTime = curTPM2 + (S.totalTPM - totalTPM2) local text = LevelText() - if db.ChatSay then + if db.ChatSay and CanSendChatMessage() then SendChatMessage(text) else RaidNotice_AddMessage(RaidWarningFrame, text, {r=1, g=1, b=0}) diff --git a/SimpleDing.toc b/SimpleDing.toc index eca6fcd..34cc95d 100644 --- a/SimpleDing.toc +++ b/SimpleDing.toc @@ -1,8 +1,8 @@ #@retail@ -## Interface: 80200 +## Interface: 90001 #@end-retail@ #@non-retail@ -# ## Interface: 11302 +# ## Interface: 11305 #@end-non-retail@ ## Version: @project-version@ ## Title: SimpleDing