Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Dec 16, 2022
2 parents 0a290d7 + 197d316 commit 55b22f3
Show file tree
Hide file tree
Showing 116 changed files with 351 additions and 254 deletions.
33 changes: 18 additions & 15 deletions .packager.ps1 → .compressor.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,41 @@ Set-Alias 7z "C:\PROGRA~1\7-Zip\7z.exe"

$name = (Get-Item .).Name

if (-Not (Test-Path (".\" + $name + ".toc"))) {
if (-Not (Test-Path (".\" + $name + "\" + $name + ".toc"))) {
Write-Host ".toc not found"

return Read-Host
}

if (Get-Content (".\" + $name + ".toc") | Where { $_ -match "(Version: +)([a-zA-Z0-9.-]+)" }) {
$version = $matches[2]
if (Get-Content (".\" + $name + "\" + $name + ".toc") | Where-Object { $_ -match "Version:\s*([a-zA-Z0-9.-]+)" }) {
$version = $matches[1]
} else {
Write-Host "Bad version format"

return Read-Host
}

$includedFiles = @(
".\init.lua",
".\LICENSE.txt",
".\ls_Toasts.toc",
".\assets\",
".\core\",
".\embeds\"
".\locales\",
".\skins\",
".\systems\"
$includedItems = @(
".\" + $name
)

$filesToRemove = @(
"*.doc*"
"*.editorconfig",
"*.git*",
"*.luacheck*",
"*.pkg*",
"*.ps1",
"*.yml"
)

if (Test-Path ".\temp\") {
Remove-Item ".\temp\" -Recurse -Force
}

New-Item -Path (".\temp\" + $name) -ItemType Directory | Out-Null
Copy-Item $includedFiles -Destination (".\temp\" + $name) -Recurse
New-Item -Path (".\temp\") -ItemType Directory | Out-Null
Copy-Item $includedItems -Destination (".\temp\") -Recurse
Remove-Item ".\temp" -Include $filesToRemove -Recurse -Force

Set-Location ".\temp\"

Expand Down
182 changes: 182 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
std = "none"
max_line_length = false
max_comment_line_length = 120
self = false

exclude_files = {
".luacheckrc",
"ls_Toasts/embeds/",
}

ignore = {
"111/LS.*", -- Setting an undefined global variable starting with LS
"111/SLASH_.*", -- Setting an undefined global variable starting with SLASH_
"112/LS.*", -- Mutating an undefined global variable starting with LS
"112/ls_Toasts", -- Mutating an undefined global variable ls_Toasts
"113/LS.*", -- Accessing an undefined global variable starting with LS
"113/ls_Toasts", -- Accessing an undefined global variable ls_Toasts
"122", -- Setting a read-only field of a global variable
"211/_G", -- Unused local variable _G
"211/C", -- Unused local variable C
"211/D", -- Unused local variable D
"211/E", -- Unused local variable E
"211/L", -- Unused local variable L
"211/P", -- Unused local variable P
"432", -- Shadowing an upvalue argument
}

globals = {
-- Lua
"getfenv",
"print",

-- FrameXML
"SlashCmdList",
}

read_globals = {
"AchievementFrame",
"AchievementFrame_LoadUI",
"AchievementFrame_SelectAchievement",
"AlertFrame",
"ArchaeologyFrame",
"ArcheologyDigsiteProgressBar",
"BattlePetTooltip",
"BattlePetToolTip_Show",
"BonusRollFrame",
"C_CurrencyInfo",
"C_Garrison",
"C_LegendaryCrafting",
"C_MountJournal",
"C_PetJournal",
"C_QuestLog",
"C_Scenario",
"C_TaskQuest",
"C_Timer",
"C_ToyBox",
"C_TradeSkillUI",
"C_TransmogCollection",
"COLLECTIONS_JOURNAL_TAB_INDEX_APPEARANCES",
"COLLECTIONS_JOURNAL_TAB_INDEX_MOUNTS",
"COLLECTIONS_JOURNAL_TAB_INDEX_PETS",
"COLLECTIONS_JOURNAL_TAB_INDEX_TOYS",
"CollectionsJournal",
"CollectionsJournal_LoadUI",
"CreateFrame",
"DressUpBattlePet",
"DressUpLink",
"DressUpMount",
"DressUpVisual",
"EncounterJournal",
"EncounterJournal_LoadUI",
"EncounterJournal_OpenToPowerID",
"Enum",
"FormatLargeNumber",
"FormatShortDate",
"GameTooltip",
"GameTooltip_AddBlankLineToTooltip",
"GameTooltip_AddColoredLine",
"GameTooltip_AddErrorLine",
"GameTooltip_AddNormalLine",
"GameTooltip_SetTitle",
"GameTooltip_ShowCompareItem",
"GarrisonFollowerOptions",
"GarrisonFollowerTooltip",
"GarrisonFollowerTooltipTemplate_SetGarrisonFollower",
"GarrisonFollowerTooltipTemplate_SetShipyardFollower",
"GarrisonShipyardFollowerTooltip",
"GetAchievementInfo",
"GetAddOnMetadata",
"GetArchaeologyRaceInfoByID",
"GetCVarBool",
"GetDetailedItemLevelInfo",
"GetInstanceInfo",
"GetItemInfo",
"GetItemInfoInstant",
"GetLFGCompletionReward",
"GetLFGCompletionRewardItem",
"GetLFGCompletionRewardItemLink",
"GetLFGDungeonInfo",
"GetLocale",
"GetMoney",
"GetMoneyString",
"GetNumQuestLogRewardCurrencies",
"GetQuestLogRewardCurrencyInfo",
"GetQuestLogRewardMoney",
"GetQuestLogRewardXP",
"GetSpellInfo",
"GetSpellRank",
"GREEN_FONT_COLOR",
"GroupLootContainer",
"GroupLootContainer_RemoveFrame",
"HaveQuestData",
"HaveQuestRewardData",
"HideUIPanel",
"HIGHLIGHT_FONT_COLOR",
"InCombatLockdown",
"INVSLOT_BACK",
"INVSLOT_CHEST",
"INVSLOT_FEET",
"INVSLOT_FINGER1",
"INVSLOT_FINGER2",
"INVSLOT_HAND",
"INVSLOT_HEAD",
"INVSLOT_LEGS",
"INVSLOT_MAINHAND",
"INVSLOT_NECK",
"INVSLOT_OFFHAND",
"INVSLOT_RANGED",
"INVSLOT_SHOULDER",
"INVSLOT_TRINKET1",
"INVSLOT_TRINKET2",
"INVSLOT_WAIST",
"INVSLOT_WRIST",
"IsLoggedIn",
"IsModifiedClick",
"IsShiftKeyDown",
"ITEM_QUALITY_COLORS",
"ITEM_QUALITY0_DESC",
"ITEM_QUALITY1_DESC",
"ITEM_QUALITY2_DESC",
"ITEM_QUALITY3_DESC",
"ITEM_QUALITY4_DESC",
"ITEM_QUALITY5_DESC",
"LE_SCENARIO_TYPE_LEGION_INVASION",
"LEGENDARY_ORANGE_COLOR",
"LFG_SUBTYPEID_HEROIC",
"LibStub",
"LIST_DELIMITER",
"LOOT_ITEM_CREATED_SELF",
"LOOT_ITEM_CREATED_SELF_MULTIPLE",
"LOOT_ITEM_PUSHED_SELF",
"LOOT_ITEM_PUSHED_SELF_MULTIPLE",
"LOOT_ITEM_SELF",
"LOOT_ITEM_SELF_MULTIPLE",
"LOOTUPGRADEFRAME_QUALITY_TEXTURES",
"MAX_PLAYER_LEVEL",
"MountJournal_SelectByMountID",
"OpenBag",
"PetJournal",
"PetJournal_SelectPet",
"PlaySound",
"ProfessionsFrame",
"ProfessionsFrame_LoadUI",
"SearchBagsForItem",
"SetCollectionsJournalShown",
"Settings",
"SettingsPanel",
"ShoppingTooltip1",
"ShoppingTooltip2",
"ShowUIPanel",
"SquareButton_SetIcon",
"ToyBox",
"ToyBox_FindPageForToyID",
"UIParent",
"UnitClass",
"UnitFactionGroup",
"UnitGUID",
"UnitLevel",
"WardrobeCollectionFrame",
"WardrobeCollectionFrame_OpenTransmogLink",
"WORLD_QUEST_QUALITY_COLORS",
}
28 changes: 28 additions & 0 deletions .luacheckrc_build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$luacheckrc = ".\.luacheckrc"

$out = ""
foreach ($line in Get-Content $luacheckrc) {
if ($line -match "read_globals") { break }

$out += $line + "`n"
}

Set-Content $luacheckrc -Value $out.TrimEnd()

$out = @()
luacheck . | ForEach-Object {
if ($_ -match "accessing undefined variable '(.+?)'") {
if ($out -notcontains $matches[1]) {
$out += $matches[1]
}
}
}

Add-Content $luacheckrc ""
Add-Content $luacheckrc ("read_globals = {")

foreach ($arg in $out | Sort-Object) {
Add-Content $luacheckrc ("`t`"" + $arg + "`",")
}

Add-Content $luacheckrc ("}")
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## Version 100002.02

- Fixed "10.0 Dragonrider PVP - Whirling Surge Dismounts" spam.
- Updated French translation. Translated by agstegiel@Curse and Braincell1980@Curse.
- Updated German translation. Translated by MrKimab@Curse.

## Version 100002.01

- Added 10.0.2 support.
Expand Down
12 changes: 0 additions & 12 deletions core/changelog.lua

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions core/anchor.lua → ls_Toasts/core/anchor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ local t_insert = _G.table.insert
local tonumber = _G.tonumber
local tostring = _G.tostring

--[[ luacheck: globals
CreateFrame GameTooltip IsShiftKeyDown SquareButton_SetIcon UIParent
]]

-- Mine
local anchors = {}
local activeAnchors = {}
Expand Down
12 changes: 12 additions & 0 deletions ls_Toasts/core/changelog.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local _, addonTable = ...
local E = addonTable.E

-- Lua
local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Fixed "10.0 Dragonrider PVP - Whirling Surge Dismounts" spam.
- Updated French translation. Translated by agstegiel@Curse and Braincell1980@Curse.
- Updated German translation. Translated by MrKimab@Curse.
]]
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions core/queue.lua → ls_Toasts/core/queue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ local t_insert = _G.table.insert
local t_remove = _G.table.remove
local t_sort = _G.table.sort

--[[ luacheck: globals
InCombatLockdown
]]

-- Mine
local activeToasts = {}
local queuedToasts = {}
Expand Down
3 changes: 0 additions & 3 deletions core/skin.lua → ls_Toasts/core/skin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ local s_format = _G.string.format
local type = _G.type
local unpack = _G.unpack

--[[ luacheck: globals
]]

-- Mine
local skins = {}
local skinList = {}
Expand Down
4 changes: 0 additions & 4 deletions core/system.lua → ls_Toasts/core/system.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ local next = _G.next
local s_format = _G.string.format
local type = _G.type

--[[ luacheck: globals
IsLoggedIn
]]

-- Mine
local systems = {}
local function dummy() end
Expand Down
3 changes: 0 additions & 3 deletions core/toast.lua → ls_Toasts/core/toast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ local t_wipe = _G.table.wipe
local type = _G.type
local unpack = _G.unpack

-- Blizz
local C_Timer = _G.C_Timer

-- Mine
local freeToasts = {}
local toasts = {}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions init.lua → ls_Toasts/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ local print = _G.print
local s_format = _G.string.format
local tonumber = _G.tonumber

--[[ luacheck: globals
AlertFrame CreateFrame GetAddOnMetadata InCombatLockdown InterfaceOptions_AddCategory
InterfaceOptionsFrame_Show InterfaceOptionsFramePanelContainer SlashCmdList
ITEM_QUALITY_COLORS ITEM_QUALITY1_DESC ITEM_QUALITY2_DESC ITEM_QUALITY3_DESC ITEM_QUALITY4_DESC
ITEM_QUALITY5_DESC LS_TOASTS_CFG LS_TOASTS_CFG_GLOBAL SLASH_LSTOASTS1 SLASH_LSTOASTS2
]]

-- Mine
E.VER = {}
E.VER.string = GetAddOnMetadata(addonName, "Version")
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 55b22f3

Please sign in to comment.