From 4b6c1f1965b1d6d4a9e52bd7c11b8a393b4f6c4f Mon Sep 17 00:00:00 2001 From: Holiest WoW Date: Sun, 20 Jul 2025 20:29:30 -0400 Subject: [PATCH 1/2] Replace local files with known working version. Fixed bugs and updated changelog for Cataclysm MoP pre-patch. Specifically, fixed Monk color error and nil value crash for extra rules --- Achievements/Heirlooms.lua | 4 +- CharacterStatusScreen.lua | 1 + DeathLog.lua | 13 +- Hardcore.lua | 222 ++-- Hardcore_Cata.toc => Hardcore.toc | 8 +- Hardcore_Classic.toc | 188 ---- .../widgets/AceGUIContainer-Deathlog.lua | 364 +++++++ .../widgets/AceGUIContainer-HardcoreFrame.lua | 326 ++++++ .../AceGUIContainer-HardcoreFrameEmpty.lua | 335 ++++++ ...ceGUIContainer-HardcoreFrameModernMenu.lua | 326 ++++++ .../AceGUIWidget-HardcoreClassTitleLabel.lua | 179 ++++ Libs/GreenWall/.gitattributes | 11 - Libs/GreenWall/.gitignore | 46 - Libs/GreenWall/.luacov | 57 - Libs/GreenWall/.pkgmeta | 5 - Libs/GreenWall/.travis.yml | 30 - Libs/GreenWall/API.lua | 8 - Libs/GreenWall/API.md | 159 --- Libs/GreenWall/CHANGELOG.md | 980 ------------------ Libs/GreenWall/CONFIGURATION_FORMAT.md | 147 --- Libs/GreenWall/Channel.lua | 55 +- Libs/GreenWall/Chat.lua | 28 +- Libs/GreenWall/Compat.lua | 18 +- Libs/GreenWall/Config.lua | 82 +- Libs/GreenWall/Constants.lua | 8 +- Libs/GreenWall/GUILD_QUICKSTART.md | 101 -- Libs/GreenWall/Globals.lua | 17 +- Libs/GreenWall/{LICENSE => GreenWall} | 14 +- Libs/GreenWall/GreenWall.lua | 38 +- Libs/GreenWall/GreenWall.toc | 29 - Libs/GreenWall/GreenWall.xml | 10 +- Libs/GreenWall/HoldDown.lua | 6 - Libs/GreenWall/Interface.lua | 9 +- Libs/GreenWall/Lib/Load.xml | 6 - Libs/GreenWall/{Lib => Libs}/Base64BCA.lua | 19 +- Libs/GreenWall/{Lib => Libs}/CRC16-CCITT.lua | 7 - Libs/GreenWall/{Lib => Libs}/LibStub.lua | 10 +- .../{Lib => Libs}/SemanticVersion.lua | 25 +- Libs/GreenWall/README.md | 411 -------- Libs/GreenWall/Settings.lua | 11 +- Libs/GreenWall/SystemEventHandler.lua | 9 +- Libs/GreenWall/Utility.lua | 19 +- MainMenu.lua | 24 +- embeds.xml | 4 - 44 files changed, 1806 insertions(+), 2563 deletions(-) rename Hardcore_Cata.toc => Hardcore.toc (98%) delete mode 100644 Hardcore_Classic.toc create mode 100644 Libs/AceGUI-3.0/widgets/AceGUIContainer-Deathlog.lua create mode 100644 Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrame.lua create mode 100644 Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrameEmpty.lua create mode 100644 Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrameModernMenu.lua create mode 100644 Libs/AceGUI-3.0/widgets/AceGUIWidget-HardcoreClassTitleLabel.lua delete mode 100644 Libs/GreenWall/.gitattributes delete mode 100644 Libs/GreenWall/.gitignore delete mode 100644 Libs/GreenWall/.luacov delete mode 100644 Libs/GreenWall/.pkgmeta delete mode 100644 Libs/GreenWall/.travis.yml delete mode 100644 Libs/GreenWall/API.md delete mode 100644 Libs/GreenWall/CHANGELOG.md delete mode 100644 Libs/GreenWall/CONFIGURATION_FORMAT.md delete mode 100644 Libs/GreenWall/GUILD_QUICKSTART.md rename Libs/GreenWall/{LICENSE => GreenWall} (86%) delete mode 100644 Libs/GreenWall/GreenWall.toc delete mode 100644 Libs/GreenWall/Lib/Load.xml rename Libs/GreenWall/{Lib => Libs}/Base64BCA.lua (99%) rename Libs/GreenWall/{Lib => Libs}/CRC16-CCITT.lua (99%) rename Libs/GreenWall/{Lib => Libs}/LibStub.lua (99%) rename Libs/GreenWall/{Lib => Libs}/SemanticVersion.lua (99%) delete mode 100644 Libs/GreenWall/README.md diff --git a/Achievements/Heirlooms.lua b/Achievements/Heirlooms.lua index 9852baf6..9f573896 100644 --- a/Achievements/Heirlooms.lua +++ b/Achievements/Heirlooms.lua @@ -110,8 +110,8 @@ function heirloom_rules:CheckHeirloomFailure() local messageString = UnitName("player") .. " has equipped an Heirloom and failed the challenge!" SendChatMessage(messageString, "GUILD") - startXGuildChatMsgRelay(messageString) - startXGuildDeathMsgRelay() + -- startXGuildChatMsgRelay(messageString) + -- startXGuildDeathMsgRelay() if CTL then CTL:SendAddonMessage("ALERT", COMM_NAME, commMessage, "GUILD") end diff --git a/CharacterStatusScreen.lua b/CharacterStatusScreen.lua index 5b1678f1..576b36e6 100644 --- a/CharacterStatusScreen.lua +++ b/CharacterStatusScreen.lua @@ -9,6 +9,7 @@ local CLASS_COLOR_BY_NAME = { ["PALADIN"] = "F48CBA", ["ROGUE"] = "FFF468", ["DEATHKNIGHT"] = "C41E3A", + ["MONK"] = "00FF96", ["GENERAL"] = "FFFFFF", } local AceGUI = LibStub("AceGUI-3.0") diff --git a/DeathLog.lua b/DeathLog.lua index c556a7b2..a8166e60 100644 --- a/DeathLog.lua +++ b/DeathLog.lua @@ -507,20 +507,13 @@ local function createEntry(checksum) -- Save in-guilds for next part of migration TODO if death_ping_lru_cache_tbl[checksum]["player_data"]["in_guild"] then return end - if hardcore_settings.alert_subset ~= nil and hardcore_settings.alert_subset == "greenwall_guilds_only" and death_ping_lru_cache_tbl[checksum]["player_data"]["guild"] and hc_peer_guilds[death_ping_lru_cache_tbl[checksum]["player_data"]["guild"]] then - alertIfValid(death_ping_lru_cache_tbl[checksum]["player_data"]) - return - end + if hardcore_settings.alert_subset ~= nil and hardcore_settings.alert_subset == "faction_wide" then alertIfValid(death_ping_lru_cache_tbl[checksum]["player_data"]) return end - -- Override if players are in greenwall - if death_ping_lru_cache_tbl[checksum]["player_data"]["guild"] and hc_peer_guilds[death_ping_lru_cache_tbl[checksum]["player_data"]["guild"]] then - alertIfValid(death_ping_lru_cache_tbl[checksum]["player_data"]) - return - end + end local function shouldCreateEntry(checksum) @@ -535,7 +528,7 @@ local function shouldCreateEntry(checksum) end end end - if hardcore_settings.death_log_types ~= nil and hardcore_settings.death_log_types == "greenwall_guilds_only" and death_ping_lru_cache_tbl[checksum]["player_data"] and death_ping_lru_cache_tbl[checksum]["player_data"]["guild"] and hc_peer_guilds[death_ping_lru_cache_tbl[checksum]["player_data"]["guild"]] then return true end + if death_ping_lru_cache_tbl[checksum]["in_guild"] then return true end return false diff --git a/Hardcore.lua b/Hardcore.lua index c7ac1f81..da7224e0 100644 --- a/Hardcore.lua +++ b/Hardcore.lua @@ -69,8 +69,6 @@ Hardcore_Settings = { sacrifice = {}, hardcore_player_name = "", use_alternative_menu = false, - ignore_xguild_chat = false, - ignore_xguild_alerts = false, global_custom_pronoun = false, mute_death_alert_sounds = false, reload_reminder_interval = 0, @@ -119,7 +117,6 @@ local speedrun_levels = { [50] = 1, [60] = 1, } -local last_received_xguild_chat = "" local debug = false local player_logged_out = false local dc_recovery_info = nil @@ -413,12 +410,12 @@ Hardcore.ALERT_STYLES = ALERT_STYLES Hardcore_Frame:ApplyBackdrop() -local function startXGuildChatMsgRelay(msg) - local commMessage = COMM_COMMANDS[12] .. COMM_COMMAND_DELIM .. msg - for _, v in pairs(hardcore_guild_member_dict) do - CTL:SendAddonMessage("ALERT", COMM_NAME, commMessage, "WHISPER", v) - end -end +-- local function startXGuildChatMsgRelay(msg) +-- local commMessage = COMM_COMMANDS[12] .. COMM_COMMAND_DELIM .. msg +-- for _, v in pairs(hardcore_guild_member_dict) do +-- CTL:SendAddonMessage("ALERT", COMM_NAME, commMessage, "WHISPER", v) +-- end +-- end function Hardcore:initSendSharedDLMsg(target_player) local publishFunc = function(encoded_msg) @@ -429,38 +426,38 @@ function Hardcore:initSendSharedDLMsg(target_player) HardcoreDeathlog_beginSendSharedMsg(publishFunc) end -local function startXGuildDeathMsgRelay() - local zone, mapID - if IsInInstance() then - zone = GetInstanceInfo() - else - mapID = C_Map.GetBestMapForUnit("player") - zone = C_Map.GetMapInfo(mapID).name - end - - if Last_Attack_Source == nil then - Last_Attack_Source = "unknown" - end - local class = UnitClass("player") - - -- player name, level, zone, attack_source, class - local commMessage = COMM_COMMANDS[10] - .. COMM_COMMAND_DELIM - .. UnitName("player") - .. "^" - .. UnitLevel("player") - .. "^" - .. zone - .. "^" - .. Last_Attack_Source - .. "^" - .. class - .. "^" +-- local function startXGuildDeathMsgRelay() +-- local zone, mapID +-- if IsInInstance() then +-- zone = GetInstanceInfo() +-- else +-- mapID = C_Map.GetBestMapForUnit("player") +-- zone = C_Map.GetMapInfo(mapID).name +-- end - for _, v in pairs(hardcore_guild_member_dict) do - CTL:SendAddonMessage("ALERT", COMM_NAME, commMessage, "WHISPER", v) - end -end +-- if Last_Attack_Source == nil then +-- Last_Attack_Source = "unknown" +-- end +-- local class = UnitClass("player") + +-- -- player name, level, zone, attack_source, class +-- local commMessage = COMM_COMMANDS[10] +-- .. COMM_COMMAND_DELIM +-- .. UnitName("player") +-- .. "^" +-- .. UnitLevel("player") +-- .. "^" +-- .. zone +-- .. "^" +-- .. Last_Attack_Source +-- .. "^" +-- .. class +-- .. "^" + +-- for _, v in pairs(hardcore_guild_member_dict) do +-- CTL:SendAddonMessage("ALERT", COMM_NAME, commMessage, "WHISPER", v) +-- end +-- end function FailureFunction(achievement_name) local max_level = 60 @@ -493,8 +490,8 @@ function FailureFunction(achievement_name) local messageString = UnitName("player") .. " has failed " .. _G.achievements[achievement_name].title SendChatMessage(messageString, "GUILD") - startXGuildChatMsgRelay(messageString) - startXGuildDeathMsgRelay() + -- startXGuildChatMsgRelay(messageString) + -- startXGuildDeathMsgRelay() if CTL then CTL:SendAddonMessage("ALERT", COMM_NAME, commMessage, "GUILD") end @@ -570,8 +567,6 @@ local settings_saved_variable_meta = { ["sacrifice"] = {}, ["hardcore_player_name"] = "", ["use_alternative_menu"] = false, - ["ignore_xguild_chat"] = false, - ["ignore_xguild_alerts"] = false, } --[[ Post-utility functions]] @@ -833,7 +828,6 @@ function Hardcore:PLAYER_LOGIN() Hardcore:HandleLegacyDeaths() Hardcore_Character.hardcore_player_name = Hardcore_Settings.hardcore_player_name or "" - _G.hardcore_disable_greenwall = Hardcore_Settings.ignore_xguild_chat -- Show the first menu screen. Requires short delay if UnitLevel("player") < 2 then C_Timer.After(1.0, function() @@ -1005,19 +999,20 @@ function Hardcore:PLAYER_LOGIN() ) end - if Hardcore_Character.party_mode ~= nil then - if _G.extra_rules[Hardcore_Character.party_mode] ~= nil then + if _G.extra_rules then + if _G.extra_rules[Hardcore_Character.party_mode] then _G.extra_rules[Hardcore_Character.party_mode]:Register( failure_function_executor, Hardcore_Character, Hardcore_Settings ) end - end - if _G["HardcoreBuildLabel"] == "WotLK" or _G["HardcoreBuildLabel"] == "Cata" then - -- Register Wrath-only rules relating to Heirlooms - _G.extra_rules["Heirlooms"]:Register(failure_function_executor, Hardcore_Character, Hardcore_Settings) + if _G["HardcoreBuildLabel"] == "WotLK" or _G["HardcoreBuildLabel"] == "Cata" then + if _G.extra_rules["Heirlooms"] then + _G.extra_rules["Heirlooms"]:Register(failure_function_executor, Hardcore_Character, Hardcore_Settings) + end + end end @@ -1412,9 +1407,9 @@ function Hardcore:PLAYER_DEAD() "Our brave " .. playerGreet .. ", " .. name .. " the " .. class .. " has fallen in battle against the Lich King atop Icecrown Citadel - but there may still be hope!" - -- Send broadcast text messages to guild and greenwall + -- Send broadcast text messages to guild SendChatMessage(messageString, "GUILD") - startXGuildChatMsgRelay(messageString) + -- startXGuildChatMsgRelay(messageString) Hardcore:Print(messageString) return -- do not perform standard death actions @@ -1437,9 +1432,9 @@ function Hardcore:PLAYER_DEAD() or GENDER_POSSESSIVE_PRONOUN[UnitSex("player")] local messageString = string.format(messageTemplate, name, zone, playerPronoun, zone) - -- Send broadcast text messages to guild and greenwall + -- Send broadcast text messages to guild SendChatMessage(messageString, "GUILD") - startXGuildChatMsgRelay(messageString) + -- startXGuildChatMsgRelay(messageString) Hardcore:Print(messageString) -- mark the next resurrection as authorized @@ -1484,7 +1479,7 @@ function Hardcore:PLAYER_DEAD() return end - -- Send broadcast alert messages to guild and greenwall + -- Send broadcast alert messages to guild local messageString = messageFormat:format(playerGreet, name, class, level, zone) if not (Last_Attack_Source == nil) then messageString = string.format("%s to a %s", messageString, Last_Attack_Source) @@ -1499,13 +1494,13 @@ function Hardcore:PLAYER_DEAD() messageString = string.format('%s. %s last words were "%s"', messageString, playerPronoun, recent_msg["text"]) end - -- Send broadcast text messages to guild and greenwall + -- Send broadcast text messages to guild selfDeathAlert(DeathLog_Last_Attack_Source) selfDeathAlertLastWords(recent_msg["text"]) SendChatMessage(messageString, "GUILD") - startXGuildChatMsgRelay(messageString) - startXGuildDeathMsgRelay() + -- startXGuildChatMsgRelay(messageString) + -- startXGuildDeathMsgRelay() Hardcore:Print(messageString) -- Send addon alert notice @@ -1573,9 +1568,9 @@ function Hardcore:PLAYER_UNGHOST() Hardcore:ShowAlertFrame(ALERT_STYLES.spirithealer, message) end - -- broadcast to guild and greenwall + -- broadcast to guild SendChatMessage(message, "GUILD", nil, nil) - startXGuildChatMsgRelay(message) + -- startXGuildChatMsgRelay(message) end function Hardcore:MAIL_SHOW() @@ -1619,7 +1614,7 @@ function Hardcore:PLAYER_LEVEL_UP(...) local messageFormat = "%s the %s has reached level %s!" local messageString = string.format(messageFormat, playerName, localizedClass, level) SendChatMessage(messageString, "GUILD", nil, nil) - startXGuildChatMsgRelay(messageString) + -- startXGuildChatMsgRelay(messageString) end -- Update the character's statistics @@ -2015,13 +2010,13 @@ function Hardcore:DisplayPlaytimeWarning(level) end -- player name, level, zone, attack_source, class -local function receiveXGuildChat(data, sender, command) - if last_received_xguild_chat and last_received_xguild_chat == data then - return - end - last_received_xguild_chat = data - -- Hardcore:FakeGuildMsg("< " .. sender .. "> " .. data) -end +-- local function receiveXGuildChat(data, sender, command) +-- if last_received_xguild_chat and last_received_xguild_chat == data then +-- return +-- end +-- last_received_xguild_chat = data +-- -- Hardcore:FakeGuildMsg("< " .. sender .. "> " .. data) +-- end -- player name, level, zone, attack_source, class local function receiveDeathMsg(data, sender, command) @@ -2126,20 +2121,7 @@ function Hardcore:CHAT_MSG_ADDON(prefix, datastr, scope, sender) return end end - if command == COMM_COMMANDS[11] then -- Received request for guild members - -- receiveDeathMsg(data, sender, command) -- Disable greenwall - return - end - if command == COMM_COMMANDS[12] then -- Send guild chat to other guilds - -- Disabled for the time being - -- local commMessage = COMM_COMMANDS[13] .. COMM_COMMAND_DELIM .. data - -- CTL:SendAddonMessage("ALERT", COMM_NAME, commMessage, "GUILD") - return - end - if command == COMM_COMMANDS[13] then -- Send guild chat from another guild to this guild - -- receiveXGuildChat(data, sender, command) -- Disable greenwall - return - end + if command == COMM_COMMANDS[7] then -- Received request for party change local name, _ = string.split("-", sender) local party_change_token_secret = string.split(COMM_FIELD_DELIM, data) @@ -3788,7 +3770,7 @@ local options = { desc = "Type of death alerts.", values = { guild_only = "guild only", - greenwall_guilds_only = "greenwall guilds only", + -- greenwall_guilds_only = "greenwall guilds only", faction_wide = "faction wide", }, get = function() @@ -3809,7 +3791,7 @@ local options = { values = { off = "off", guild_only = "guild only", - greenwall_guilds_only = "greenwall guilds only", + -- greenwall_guilds_only = "greenwall guilds only", faction_wide = "faction wide", }, get = function() @@ -4180,39 +4162,39 @@ local options = { }, }, }, - cross_guild_header = { - type = "group", - name = "Cross-Guild", - order = 16, - inline = true, - args = { - ignore_xguild_chat = { - width = "full", - type = "toggle", - name = "Ignore cross-guild chat [Requires reload]", - desc = "Ignore cross-guild chat [Requires reload]", - get = function() - return Hardcore_Settings.ignore_xguild_chat - end, - set = function() - Hardcore_Settings.ignore_xguild_chat = not Hardcore_Settings.ignore_xguild_chat - end, - order = 17, - }, - ignore_xguild_alerts = { - type = "toggle", - name = "Ignore cross-guild alerts", - desc = "Ignore cross-guild alerts", - get = function() - return Hardcore_Settings.ignore_xguild_alerts - end, - set = function() - Hardcore_Settings.ignore_xguild_alerts = not Hardcore_Settings.ignore_xguild_alerts - end, - order = 18, - }, - }, - }, + -- cross_guild_header = { + -- type = "group", + -- name = "Cross-Guild", + -- order = 16, + -- inline = true, + -- args = { + -- ignore_xguild_chat = { + -- width = "full", + -- type = "toggle", + -- name = "Ignore cross-guild chat [Requires reload]", + -- desc = "Ignore cross-guild chat [Requires reload]", + -- get = function() + -- return Hardcore_Settings.ignore_xguild_chat + -- end, + -- set = function() + -- Hardcore_Settings.ignore_xguild_chat = not Hardcore_Settings.ignore_xguild_chat + -- end, + -- order = 17, + -- }, + -- ignore_xguild_alerts = { + -- type = "toggle", + -- name = "Ignore cross-guild alerts", + -- desc = "Ignore cross-guild alerts", + -- get = function() + -- return Hardcore_Settings.ignore_xguild_alerts + -- end, + -- set = function() + -- Hardcore_Settings.ignore_xguild_alerts = not Hardcore_Settings.ignore_xguild_alerts + -- end, + -- order = 18, + -- }, + -- }, + -- }, apply_defaults = { type = "execute", name = "Defaults", @@ -4229,8 +4211,8 @@ local options = { Hardcore_Settings.achievement_alert_frame_y_offset = nil Hardcore_Settings.achievement_alert_frame_scale = nil Hardcore_Settings.show_minimap_mailbox_icon = false - Hardcore_Settings.ignore_xguild_alerts = false - Hardcore_Settings.ignore_xguild_chat = false + -- Hardcore_Settings.ignore_xguild_alerts = false + -- Hardcore_Settings.ignore_xguild_chat = false Hardcore_Settings.reload_reminder_show = true Hardcore_Settings.reload_reminder_interval = 0 Hardcore:ApplyAlertFrameSettings() diff --git a/Hardcore_Cata.toc b/Hardcore.toc similarity index 98% rename from Hardcore_Cata.toc rename to Hardcore.toc index 7a129029..ddcf2978 100644 --- a/Hardcore_Cata.toc +++ b/Hardcore.toc @@ -1,10 +1,10 @@ -## Interface: 40401 -## Title: Hardcore 0.11.55 +## Interface: 50500 +## Title: Hardcore 0.11.57b ## Notes: Supports Classic Hardcore ## Author: The Classic Hardcore team, Molikar (Sean Kennedy), Mark Rogaski as GreenWall author ## X-License: All Rights Reserved ## X-Category: Leveling,Guild -## Version: 0.11.55 +## Version: 0.11.57b ## DefaultState: enabled @@ -156,7 +156,6 @@ InspectStatusScreen.lua AchievementTab.lua FirstMenuScreen.lua ReloadReminder.lua -dungeon-db-cata.lua Dungeons.lua Survey.lua MainMenu.lua @@ -167,7 +166,6 @@ id_to_npc.lua npc_to_id.lua DeathLog.lua SlashCommands.lua -LevelToast.lua Hardcore.lua Libs/GreenWall/Constants.lua diff --git a/Hardcore_Classic.toc b/Hardcore_Classic.toc deleted file mode 100644 index 2f6f3794..00000000 --- a/Hardcore_Classic.toc +++ /dev/null @@ -1,188 +0,0 @@ -## Interface: 11505 -## Title: Hardcore 0.11.55 -## Notes: Supports Classic Hardcore -## Author: The Classic Hardcore team, Molikar (Sean Kennedy), Mark Rogaski as GreenWall author -## X-License: All Rights Reserved -## X-Category: Leveling,Guild -## Version: 0.11.55 - - -## DefaultState: enabled -## SavedVariables: Hardcore_Settings,GreenWallAccount, Backup_Character_Data -## SavedVariablesPerCharacter: WARNING,Hardcore_Character,GreenWall,GreenWallMeta,GreenWallLog - -embeds.xml - -Libs/ascii85/ascii85.lua -CustomLayouts.lua -utils.lua -Security.lua -Hardcore.xml - -#Tokens -DKToken.lua -PartyChangeToken.lua - -Achievements/AchievementG.lua - -Achievements/Solo.lua -Achievements/Duo.lua -Achievements/Trio.lua -#Begin achievement modules -Achievements/Arcanist.lua -Achievements/FireAndFrost.lua -Achievements/ShadowAndFlame.lua -Achievements/AnimalFriend.lua -Achievements/Berserker.lua -Achievements/Bloodbath.lua -Achievements/CloseCombat.lua -Achievements/Cyromancer.lua -Achievements/DruidOfTheClaw.lua -Achievements/Ephemeral.lua -Achievements/Felfire.lua -Achievements/Grounded.lua -Achievements/Hammertime.lua -Achievements/Homebound.lua -Achievements/Humanist.lua -Achievements/ICanSeeYou.lua -Achievements/ImpMaster.lua -Achievements/InsaneInTheMembrane.lua -Achievements/LoneWolf.lua -Achievements/MortalPet.lua -Achievements/Naturalist.lua -Achievements/NobodyGotTimeForThat.lua -Achievements/NoHealthPotions.lua -Achievements/NoHit.lua -Achievements/NotSoDeadly.lua -Achievements/NotSoTalented.lua -Achievements/NotTheBlessedRun.lua -Achievements/NoWayOut.lua -Achievements/Nudist.lua -Achievements/Pacifist.lua -Achievements/PartnerUp.lua -Achievements/Pyromancer.lua -Achievements/Scavenger.lua -#Achievements/Speedrunner.lua -Achievements/SelfMade.lua -Achievements/ShadowEmbrace.lua -Achievements/Shivved.lua -Achievements/Shocked.lua -Achievements/SolitaryStruggle.lua -Achievements/SwordAndBoard.lua -Achievements/TiedHands.lua -Achievements/Thunderstruck.lua -Achievements/TotemicMisery.lua -Achievements/TrueBeliever.lua -Achievements/TunnelVision.lua -Achievements/Unrestored.lua -Achievements/WhiteKnight.lua -Achievements/Vagrant.lua -Achievements/VoidServant.lua -Achievements/SelfMadeDuo.lua -Achievements/SelfMadeTrio.lua -#End achievement modules - -#Start passive achievements -Achievements/KingOfTheJungle.lua -#Achievements/ShyRotam.lua -Achievements/HighChiefWinterfall.lua -Achievements/OfForgottenMemories.lua -Achievements/Maltorious.lua -Achievements/PawnCapturesQueen.lua -Achievements/Deathclasp.lua -Achievements/AFinalBlow.lua -Achievements/SummoningThePrincess.lua -Achievements/AbsentMindedProspector.lua -Achievements/TheHuntCompleted.lua -Achievements/MageSummoner.lua -Achievements/EarthenArise.lua -Achievements/GetMeOutOfHere.lua -Achievements/RitesOfTheEarthmother.lua -Achievements/KimjaelIndeed.lua -Achievements/Counterattack.lua -Achievements/TidalCharmAcquired.lua -Achievements/MasterLeatherworker.lua -Achievements/MasterBlacksmith.lua -Achievements/MasterAlchemist.lua -Achievements/MasterEnchanter.lua -Achievements/MasterTailoring.lua -Achievements/MasterEngineering.lua -Achievements/MasterSkinner.lua -Achievements/MasterMiner.lua -Achievements/MasterHerbalism.lua -Achievements/MasterFishing.lua -Achievements/MasterCooking.lua -Achievements/MasterFirstAid.lua -Achievements/Parkour.lua -Achievements/Tainted.lua -Achievements/TheDungeonCrawler.lua -Achievements/SpeedrunnerTen.lua -Achievements/SpeedrunnerTwenty.lua -Achievements/SpeedrunnerThirty.lua -Achievements/SpeedrunnerForty.lua -Achievements/SpeedrunnerFifty.lua -Achievements/SpeedrunnerSixty.lua -#Achievements/SpeedrunnerFifteen.lua -Achievements/DarkHeart.lua -Achievements/AgainstLordShalzaru.lua -Achievements/TestOfEndurance.lua -Achievements/CuergosGold.lua -Achievements/TheStonesThatBindUs.lua -Achievements/GalensEscape.lua -Achievements/Morladim.lua -Achievements/TheForgottenHeirloom.lua -Achievements/Hogger.lua -Achievements/Fangore.lua -Achievements/DragonkinMenace.lua -Achievements/Kromgul.lua -Achievements/NothingButTheTruth.lua -Achievements/SealOfEarth.lua -Achievements/TremorsofEarth.lua -Achievements/Vagash.lua -Achievements/InDefenseOfTheKing.lua -Achievements/DefeatNekrosh.lua -Achievements/DruidOfTheClawQuest.lua -Achievements/TheCrownOfWill.lua -Achievements/BattleOfHillsbrad.lua -Achievements/TheWeaver.lua -Achievements/TheFamilyCrypt.lua -Achievements/HintsOfANewPlague.lua -Achievements/RecoverTheKey.lua -Achievements/StinkysEscape.lua -Achievements/BurningShadows.lua -#End passive achievements - -CharacterStatusScreen.lua -InspectStatusScreen.lua -AchievementTab.lua -FirstMenuScreen.lua -ReloadReminder.lua -dungeon-db-classic.lua -Dungeons.lua -Survey.lua -MainMenu.lua -TextureUtils.lua -TextureInfo.lua -AchievementAlertFrame.lua -id_to_npc_classic.lua -npc_to_id_classic.lua -DeathLog.lua -SlashCommands.lua -LevelToast.lua -Hardcore.lua - -Libs/GreenWall/Constants.lua -Libs/GreenWall/Globals.lua -Libs/GreenWall/Settings.lua -Libs/GreenWall/Utility.lua -Libs/GreenWall/HoldDown.lua -Libs/GreenWall/Config.lua -Libs/GreenWall/Compat.lua -Libs/GreenWall/Chat.lua -Libs/GreenWall/Channel.lua -Libs/GreenWall/SystemEventHandler.lua -Libs/GreenWall/API.lua -Libs/GreenWall/Interface.lua -Libs/GreenWall/GreenWall.lua - -Libs/GreenWall/GreenWall.xml diff --git a/Libs/AceGUI-3.0/widgets/AceGUIContainer-Deathlog.lua b/Libs/AceGUI-3.0/widgets/AceGUIContainer-Deathlog.lua new file mode 100644 index 00000000..4f9df897 --- /dev/null +++ b/Libs/AceGUI-3.0/widgets/AceGUIContainer-Deathlog.lua @@ -0,0 +1,364 @@ +--[[----------------------------------------------------------------------------- +Deathlog Container +-------------------------------------------------------------------------------]] +local Type, Version = "Deathlog", 30 +local AceGUI = LibStub and LibStub("AceGUI-3.0", true) +if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end + +-- Lua APIs +local pairs, assert, type = pairs, assert, type +local wipe = table.wipe + +-- WoW APIs +local PlaySound = PlaySound +local CreateFrame, UIParent = CreateFrame, UIParent + +--[[----------------------------------------------------------------------------- +Scripts +-------------------------------------------------------------------------------]] +local function Button_OnClick(frame) + PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT + frame.obj:Hide() +end + +local function Frame_OnShow(frame) + frame.obj:Fire("OnShow") +end + +local function Frame_OnClose(frame) + frame.obj:Fire("OnClose") +end + +local function Frame_OnMouseDown(frame) + AceGUI:ClearFocus() +end + +local function Title_OnMouseDown(frame) + AceGUI:ClearFocus() +end + +local function MoverSizer_OnMouseUp(mover) + local frame = mover:GetParent() + frame:StopMovingOrSizing() + local self = frame.obj + local status = self.status or self.localstatus + status.width = frame:GetWidth() + status.height = frame:GetHeight() + status.top = frame:GetTop() + status.left = frame:GetLeft() +end + +local function SizerSE_OnMouseDown(frame) + frame:GetParent():StartSizing("BOTTOMRIGHT") + AceGUI:ClearFocus() +end + +local function SizerS_OnMouseDown(frame) + frame:GetParent():StartSizing("BOTTOM") + AceGUI:ClearFocus() +end + +local function SizerE_OnMouseDown(frame) + frame:GetParent():StartSizing("RIGHT") + AceGUI:ClearFocus() +end + +local function StatusBar_OnEnter(frame) + frame.obj:Fire("OnEnterStatusBar") +end + +local function StatusBar_OnLeave(frame) + frame.obj:Fire("OnLeaveStatusBar") +end + +--[[----------------------------------------------------------------------------- +Methods +-------------------------------------------------------------------------------]] +local methods = { + ["OnAcquire"] = function(self) + self.frame:SetParent(UIParent) + self.frame:SetFrameStrata("FULLSCREEN_DIALOG") + self.frame:SetFrameLevel(100) -- Lots of room to draw under it + self:SetTitle() + self:SetSubTitle() + self:SetStatusText() + self:ApplyStatus() + self:Show() + self:EnableResize(true) + end, + + ["OnRelease"] = function(self) + self.status = nil + wipe(self.localstatus) + end, + + ["OnWidthSet"] = function(self, width) + local content = self.content + local contentwidth = width - 34 + if contentwidth < 0 then + contentwidth = 0 + end + content:SetWidth(contentwidth) + content.width = contentwidth + self.titlebg:SetWidth(contentwidth - 35) + end, + + ["OnHeightSet"] = function(self, height) + local content = self.content + local contentheight = height + if contentheight < 0 then + contentheight = 0 + end + content:SetHeight(contentheight) + content.height = contentheight + end, + + ["SetTitle"] = function(self, title) + self.titletext:SetText(title) + -- self.titlebg:SetWidth(contentwidth) + end, + + ["SetSubTitle"] = function (self, subtitle_data) + local column_offset = 17 + if subtitle_data == nil then return end + for _,v in ipairs(subtitle_data) do + self.subtitletext_tbl[v[1]]:SetText(v[1]) + self.subtitletext_tbl[v[1]]:SetPoint("LEFT", self.frame, "TOPLEFT", column_offset, -26) + column_offset = column_offset + v[2] + end + end, + + ["SetStatusText"] = function(self, text) + self.statustext:SetText(text) + end, + + ["Hide"] = function(self) + self.frame:Hide() + end, + + ["Minimize"] = function(self) + self.frame:Hide() + is_minimized = true + end, + + ["IsMinimized"] = function(self) + return is_minimized + end, + + ["Maximize"] = function(self) + self.frame:Show() + is_minimized = false + end, + + ["Show"] = function(self) + self.frame:Show() + end, + + ["EnableResize"] = function(self, state) + local func = state and "Show" or "Hide" + self.sizer_se[func](self.sizer_se) + self.sizer_s[func](self.sizer_s) + self.sizer_e[func](self.sizer_e) + end, + + -- called to set an external table to store status in + ["SetStatusTable"] = function(self, status) + assert(type(status) == "table") + self.status = status + self:ApplyStatus() + end, + + ["ApplyStatus"] = function(self) + local status = self.status or self.localstatus + local frame = self.frame + self:SetWidth(status.width or 700) + self:SetHeight(status.height or 500) + frame:ClearAllPoints() + if status.top and status.left then + frame:SetPoint("TOP", UIParent, "BOTTOM", 0, status.top) + frame:SetPoint("LEFT", UIParent, "LEFT", status.left, 0) + else + frame:SetPoint("CENTER") + end + end +} + +--[[----------------------------------------------------------------------------- +Constructor +-------------------------------------------------------------------------------]] +local FrameBackdrop = { + bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", + edgeFile = "Interface\\CHATFRAME\\ChatFrameBorder", + tile = false, tileSize = 32, edgeSize = 32, + insets = { left = 8, right = 8, top = 8, bottom = 8 } +} + +local PaneBackdrop = { + bgFile = "Interface\\ChatFrame\\ChatFrameBackground", + edgeFile = "Interface\\Glues\\COMMON\\TextPanel-Border", + tile = true, tileSize = 16, edgeSize = 16, + insets = { left = 3, right = 3, top = 5, bottom = 3 } +} + +local function Constructor() + local frame = CreateFrame("Frame", nil, UIParent, "BackdropTemplate") + frame:Hide() + + frame:EnableMouse(true) + frame:SetMovable(true) + frame:SetResizable(true) + frame:SetFrameStrata("FULLSCREEN_DIALOG") + frame:SetFrameLevel(100) -- Lots of room to draw under it + frame:SetBackdrop(PaneBackdrop) + frame:SetBackdropColor(0, 0, 0, .6) + frame:SetBackdropBorderColor(1,1,1,1) + frame:SetSize(250,150) + + if frame.SetResizeBounds then -- WoW 10.0 + frame:SetResizeBounds(400, 200) + else + frame:SetMinResize(150, 100) + end + frame:SetToplevel(true) + frame:SetScript("OnShow", Frame_OnShow) + frame:SetScript("OnHide", Frame_OnClose) + frame:SetScript("OnMouseDown", Frame_OnMouseDown) + + local closebutton = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") + closebutton:SetScript("OnClick", Button_OnClick) + closebutton:SetPoint("BOTTOMRIGHT", -27, 17) + closebutton:SetHeight(0) + closebutton:SetWidth(100) + closebutton:SetText(CLOSE) + closebutton:Hide() + + + local statusbg = CreateFrame("Button", nil, frame, "BackdropTemplate") + statusbg:SetPoint("BOTTOMLEFT", 15, 15) + statusbg:SetPoint("BOTTOMRIGHT", -132, 15) + statusbg:SetHeight(0) + statusbg:SetBackdrop(PaneBackdrop) + statusbg:SetBackdropColor(0.1,0.1,0.1) + statusbg:SetBackdropBorderColor(0.4,0.4,0.4) + statusbg:SetScript("OnEnter", StatusBar_OnEnter) + statusbg:SetScript("OnLeave", StatusBar_OnLeave) + statusbg:Hide() + + local statustext = statusbg:CreateFontString(nil, "OVERLAY", "GameFontNormal") + statustext:SetPoint("TOPLEFT", 7, -2) + statustext:SetPoint("BOTTOMRIGHT", -7, 2) + statustext:SetHeight(0) + statustext:SetJustifyH("LEFT") + statustext:SetText("") + statustext:Hide() + + local titlebg = frame:CreateTexture(nil, "OVERLAY") + titlebg:SetTexture("Interface\\ClassTrainerFrame\\UI-ClassTrainer-DetailHeaderLeft") + titlebg:SetTexCoord(0, 1, 0, 1) + titlebg:SetPoint("TOP", 0, 12) + titlebg:SetWidth(100) + titlebg:SetHeight(40) + titlebg:Hide() + + local title = CreateFrame("Frame", nil, frame) + title:EnableMouse(true) + title:SetScript("OnMouseDown", Title_OnMouseDown) + title:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + title:SetAllPoints(titlebg) + + local titletext = title:CreateFontString(nil, "OVERLAY", "GameFontNormal") + titletext:SetFont("Fonts\\FRIZQT__.TTF", 13, "") + titletext:SetPoint("LEFT", frame, "TOPLEFT", 25, -10) + + local column_types = {"Name", "Guild", "Lvl", "F's", "Race", "Class"} + local subtitletext_tbl = {} + for _,v in ipairs(column_types) do + subtitletext_tbl[v] = title:CreateFontString(nil, "OVERLAY", "GameFontNormal") + subtitletext_tbl[v]:SetPoint("LEFT", frame, "TOPLEFT", 17, -26) + subtitletext_tbl[v]:SetFont("Fonts\\FRIZQT__.TTF", 12, "") + subtitletext_tbl[v]:SetTextColor(.5,.5,.5); + end + + local titlebg_l = frame:CreateTexture(nil, "OVERLAY") + titlebg_l:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg_l:SetTexCoord(0.21, 0.31, 0, 0.63) + titlebg_l:SetPoint("RIGHT", titlebg, "LEFT") + titlebg_l:SetWidth(30) + titlebg_l:SetHeight(40) + titlebg_l:Hide() + + local titlebg_r = frame:CreateTexture(nil, "OVERLAY") + titlebg_r:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg_r:SetTexCoord(0.67, 0.77, 0, 0.63) + titlebg_r:SetPoint("LEFT", titlebg, "RIGHT") + titlebg_r:SetWidth(30) + titlebg_r:SetHeight(40) + titlebg_r:Hide() + + local sizer_se = CreateFrame("Frame", nil, frame) + sizer_se:SetPoint("BOTTOMRIGHT") + sizer_se:SetWidth(25) + sizer_se:SetHeight(25) + sizer_se:EnableMouse() + sizer_se:SetScript("OnMouseDown",SizerSE_OnMouseDown) + sizer_se:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + local line1 = sizer_se:CreateTexture(nil, "BACKGROUND") + line1:SetWidth(14) + line1:SetHeight(14) + line1:SetPoint("BOTTOMRIGHT", -8, 8) + line1:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border + local x = 0.1 * 14/17 + line1:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) + + local line2 = sizer_se:CreateTexture(nil, "BACKGROUND") + line2:SetWidth(8) + line2:SetHeight(8) + line2:SetPoint("BOTTOMRIGHT", -8, 8) + line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border + x = 0.1 * 8/17 + line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) + + local sizer_s = CreateFrame("Frame", nil, frame) + sizer_s:SetPoint("BOTTOMRIGHT", -25, 0) + sizer_s:SetPoint("BOTTOMLEFT") + sizer_s:SetHeight(25) + sizer_s:EnableMouse(true) + sizer_s:SetScript("OnMouseDown", SizerS_OnMouseDown) + sizer_s:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + local sizer_e = CreateFrame("Frame", nil, frame) + sizer_e:SetPoint("BOTTOMRIGHT", 0, 25) + sizer_e:SetPoint("TOPRIGHT") + sizer_e:SetWidth(25) + sizer_e:EnableMouse(true) + sizer_e:SetScript("OnMouseDown", SizerE_OnMouseDown) + sizer_e:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + --Container Support + local content = CreateFrame("Frame", nil, frame) + content:SetPoint("TOPLEFT", 3, -33) + content:SetPoint("BOTTOMRIGHT", 15, 6) + + local widget = { + localstatus = {}, + titletext = titletext, + subtitletext_tbl = subtitletext_tbl, + statustext = statustext, + titlebg = titlebg, + sizer_se = sizer_se, + sizer_s = sizer_s, + sizer_e = sizer_e, + content = content, + frame = frame, + type = Type + } + for method, func in pairs(methods) do + widget[method] = func + end + closebutton.obj, statusbg.obj = widget, widget + + return AceGUI:RegisterAsContainer(widget) +end + +AceGUI:RegisterWidgetType(Type, Constructor, Version) diff --git a/Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrame.lua b/Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrame.lua new file mode 100644 index 00000000..de1bb9a6 --- /dev/null +++ b/Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrame.lua @@ -0,0 +1,326 @@ +--[[----------------------------------------------------------------------------- +Frame Container +-------------------------------------------------------------------------------]] +local Type, Version = "HardcoreFrame", 28 +local AceGUI = LibStub and LibStub("AceGUI-3.0", true) +if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end + +-- Lua APIs +local pairs, assert, type = pairs, assert, type +local wipe = table.wipe + +-- WoW APIs +local PlaySound = PlaySound +local CreateFrame, UIParent = CreateFrame, UIParent + +-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded +-- List them here for Mikk's FindGlobals script +-- GLOBALS: CLOSE + +--[[----------------------------------------------------------------------------- +Scripts +-------------------------------------------------------------------------------]] +local function Button_OnClick(frame) + PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT + frame.obj:Hide() +end + +local function Frame_OnShow(frame) + frame.obj:Fire("OnShow") +end + +local function Frame_OnClose(frame) + frame.obj:Fire("OnClose") +end + +local function Frame_OnMouseDown(frame) + AceGUI:ClearFocus() +end + +local function Title_OnMouseDown(frame) + frame:GetParent():StartMoving() + AceGUI:ClearFocus() +end + +local function MoverSizer_OnMouseUp(mover) + local frame = mover:GetParent() + frame:StopMovingOrSizing() + local self = frame.obj + local status = self.status or self.localstatus + status.width = frame:GetWidth() + status.height = frame:GetHeight() + status.top = frame:GetTop() + status.left = frame:GetLeft() +end + +local function SizerSE_OnMouseDown(frame) + frame:GetParent():StartSizing("BOTTOMRIGHT") + AceGUI:ClearFocus() +end + +local function SizerS_OnMouseDown(frame) + frame:GetParent():StartSizing("BOTTOM") + AceGUI:ClearFocus() +end + +local function SizerE_OnMouseDown(frame) + frame:GetParent():StartSizing("RIGHT") + AceGUI:ClearFocus() +end + +local function StatusBar_OnEnter(frame) + frame.obj:Fire("OnEnterStatusBar") +end + +local function StatusBar_OnLeave(frame) + frame.obj:Fire("OnLeaveStatusBar") +end + +--[[----------------------------------------------------------------------------- +Methods +-------------------------------------------------------------------------------]] +local methods = { + ["OnAcquire"] = function(self) + self.frame:SetParent(UIParent) + self.frame:SetFrameStrata("FULLSCREEN_DIALOG") + self.frame:SetFrameLevel(100) -- Lots of room to draw under it + self:SetTitle() + self:SetStatusText() + self:ApplyStatus() + self:Show() + self:EnableResize(true) + end, + + ["OnRelease"] = function(self) + self.status = nil + wipe(self.localstatus) + end, + + ["OnWidthSet"] = function(self, width) + local content = self.content + local contentwidth = width - 34 + if contentwidth < 0 then + contentwidth = 0 + end + content:SetWidth(contentwidth) + content.width = contentwidth + end, + + ["OnHeightSet"] = function(self, height) + local content = self.content + local contentheight = height - 57 + if contentheight < 0 then + contentheight = 0 + end + content:SetHeight(contentheight) + content.height = contentheight + end, + + ["SetTitle"] = function(self, title) + self.titletext:SetText(title) + self.titlebg:SetWidth((self.titletext:GetWidth() or 0) + 10) + end, + + ["SetStatusText"] = function(self, text) + self.statustext:SetText(text) + end, + + ["Hide"] = function(self) + self.frame:Hide() + end, + + ["Show"] = function(self) + self.frame:Show() + end, + + ["EnableResize"] = function(self, state) + local func = state and "Show" or "Hide" + self.sizer_se[func](self.sizer_se) + self.sizer_s[func](self.sizer_s) + self.sizer_e[func](self.sizer_e) + end, + + -- called to set an external table to store status in + ["SetStatusTable"] = function(self, status) + assert(type(status) == "table") + self.status = status + self:ApplyStatus() + end, + + ["ApplyStatus"] = function(self) + local status = self.status or self.localstatus + local frame = self.frame + self:SetWidth(status.width or 700) + self:SetHeight(status.height or 500) + frame:ClearAllPoints() + if status.top and status.left then + frame:SetPoint("TOP", UIParent, "BOTTOM", 0, status.top) + frame:SetPoint("LEFT", UIParent, "LEFT", status.left, 0) + else + frame:SetPoint("CENTER") + end + end +} + +--[[----------------------------------------------------------------------------- +Constructor +-------------------------------------------------------------------------------]] +local FrameBackdrop = { + bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", + edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", + tile = true, tileSize = 32, edgeSize = 32, + insets = { left = 8, right = 8, top = 8, bottom = 8 } +} + +local PaneBackdrop = { + bgFile = "Interface\\ChatFrame\\ChatFrameBackground", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 16, edgeSize = 16, + insets = { left = 3, right = 3, top = 5, bottom = 3 } +} + +local function Constructor() + local frame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil) + frame:Hide() + + frame:EnableMouse(true) + frame:SetMovable(true) + frame:SetResizable(true) + frame:SetFrameStrata("FULLSCREEN_DIALOG") + frame:SetFrameLevel(100) -- Lots of room to draw under it + frame:SetBackdrop(FrameBackdrop) + frame:SetBackdropColor(0, 0, 0, 1) + if frame.SetResizeBounds then + frame:SetResizeBounds(400, 200) + end + if frame.SetMinResize then + frame:SetMinResize(400, 200) + end + frame:SetToplevel(true) + frame:SetScript("OnShow", Frame_OnShow) + frame:SetScript("OnHide", Frame_OnClose) + frame:SetScript("OnMouseDown", Frame_OnMouseDown) + + local closebutton = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") + closebutton:SetScript("OnClick", Button_OnClick) + closebutton:SetPoint("BOTTOMRIGHT", -27, 17) + closebutton:SetHeight(20) + closebutton:SetWidth(150) + closebutton:SetText("Begin Adventure") + + local statusbg = CreateFrame("Button", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil) + statusbg:SetPoint("BOTTOMLEFT", 15, 15) + statusbg:SetPoint("BOTTOMRIGHT", -132, 15) + statusbg:SetHeight(24) + statusbg:SetBackdrop(PaneBackdrop) + statusbg:SetBackdropColor(0.1,0.1,0.1) + statusbg:SetBackdropBorderColor(0.4,0.4,0.4) + statusbg:SetScript("OnEnter", StatusBar_OnEnter) + statusbg:SetScript("OnLeave", StatusBar_OnLeave) + statusbg:Hide() + + local statustext = statusbg:CreateFontString(nil, "OVERLAY", "GameFontNormal") + statustext:SetPoint("TOPLEFT", 7, -2) + statustext:SetPoint("BOTTOMRIGHT", -7, 2) + statustext:SetHeight(20) + statustext:SetJustifyH("LEFT") + statustext:SetText("") + + local titlebg = frame:CreateTexture(nil, "OVERLAY") + titlebg:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg:SetTexCoord(0.31, 0.67, 0, 0.63) + titlebg:SetPoint("TOP", 0, 18) + titlebg:SetWidth(100) + titlebg:SetHeight(60) + + local title = CreateFrame("Frame", nil, frame) + title:EnableMouse(true) + title:SetScript("OnMouseDown", Title_OnMouseDown) + title:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + title:SetAllPoints(titlebg) + + local titletext = title:CreateFontString(nil, "OVERLAY", "GameFontNormal") + titletext:SetFont("Interface\\Addons\\Hardcore\\Media\\BreatheFire.ttf", 20) + titletext:SetPoint("TOP", titlebg, "TOP", 0, -20) + + + local titlebg_l = frame:CreateTexture(nil, "OVERLAY") + titlebg_l:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg_l:SetTexCoord(0.21, 0.31, 0, 0.63) + titlebg_l:SetPoint("RIGHT", titlebg, "LEFT") + titlebg_l:SetWidth(30) + titlebg_l:SetHeight(60) + + local titlebg_r = frame:CreateTexture(nil, "OVERLAY") + titlebg_r:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg_r:SetTexCoord(0.67, 0.77, 0, 0.63) + titlebg_r:SetPoint("LEFT", titlebg, "RIGHT") + titlebg_r:SetWidth(30) + titlebg_r:SetHeight(60) + + local sizer_se = CreateFrame("Frame", nil, frame) + sizer_se:SetPoint("BOTTOMRIGHT") + sizer_se:SetWidth(25) + sizer_se:SetHeight(25) + sizer_se:EnableMouse() + sizer_se:SetScript("OnMouseDown",SizerSE_OnMouseDown) + sizer_se:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + local line1 = sizer_se:CreateTexture(nil, "BACKGROUND") + line1:SetWidth(14) + line1:SetHeight(14) + line1:SetPoint("BOTTOMRIGHT", -8, 8) + line1:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border + local x = 0.1 * 14/17 + line1:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) + + local line2 = sizer_se:CreateTexture(nil, "BACKGROUND") + line2:SetWidth(8) + line2:SetHeight(8) + line2:SetPoint("BOTTOMRIGHT", -8, 8) + line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border + local x = 0.1 * 8/17 + line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) + + local sizer_s = CreateFrame("Frame", nil, frame) + sizer_s:SetPoint("BOTTOMRIGHT", -25, 0) + sizer_s:SetPoint("BOTTOMLEFT") + sizer_s:SetHeight(25) + sizer_s:EnableMouse(true) + sizer_s:SetScript("OnMouseDown", SizerS_OnMouseDown) + sizer_s:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + local sizer_e = CreateFrame("Frame", nil, frame) + sizer_e:SetPoint("BOTTOMRIGHT", 0, 25) + sizer_e:SetPoint("TOPRIGHT") + sizer_e:SetWidth(25) + sizer_e:EnableMouse(true) + sizer_e:SetScript("OnMouseDown", SizerE_OnMouseDown) + sizer_e:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + --Container Support + local content = CreateFrame("Frame", nil, frame) + content:SetPoint("TOPLEFT", 17, -27) + content:SetPoint("BOTTOMRIGHT", -17, 40) + + local widget = { + localstatus = {}, + titletext = titletext, + statustext = statustext, + titlebg = titlebg, + sizer_se = sizer_se, + sizer_s = sizer_s, + sizer_e = sizer_e, + content = content, + frame = frame, + type = Type + } + for method, func in pairs(methods) do + widget[method] = func + end + closebutton.obj, statusbg.obj = widget, widget + + return AceGUI:RegisterAsContainer(widget) +end + +AceGUI:RegisterWidgetType(Type, Constructor, Version) diff --git a/Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrameEmpty.lua b/Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrameEmpty.lua new file mode 100644 index 00000000..6f31bd20 --- /dev/null +++ b/Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrameEmpty.lua @@ -0,0 +1,335 @@ +--[[----------------------------------------------------------------------------- +Frame Container +-------------------------------------------------------------------------------]] +local Type, Version = "HardcoreFrameEmpty", 28 +local AceGUI = LibStub and LibStub("AceGUI-3.0", true) +if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end + +-- Lua APIs +local pairs, assert, type = pairs, assert, type +local wipe = table.wipe + +-- WoW APIs +local PlaySound = PlaySound +local CreateFrame, UIParent = CreateFrame, UIParent + +-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded +-- List them here for Mikk's FindGlobals script +-- GLOBALS: CLOSE + +--[[----------------------------------------------------------------------------- +Scripts +-------------------------------------------------------------------------------]] +local function Button_OnClick(frame) + PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT + frame.obj:Hide() +end + +local function Frame_OnShow(frame) + frame.obj:Fire("OnShow") +end + +local function Frame_OnClose(frame) + frame.obj:Fire("OnClose") +end + +local function Frame_OnMouseDown(frame) + AceGUI:ClearFocus() +end + +local function Title_OnMouseDown(frame) + frame:GetParent():StartMoving() + AceGUI:ClearFocus() +end + +local function MoverSizer_OnMouseUp(mover) + local frame = mover:GetParent() + frame:StopMovingOrSizing() + local self = frame.obj + local status = self.status or self.localstatus + status.width = frame:GetWidth() + status.height = frame:GetHeight() + status.top = frame:GetTop() + status.left = frame:GetLeft() +end + +local function SizerSE_OnMouseDown(frame) + frame:GetParent():StartSizing("BOTTOMRIGHT") + AceGUI:ClearFocus() +end + +local function SizerS_OnMouseDown(frame) + frame:GetParent():StartSizing("BOTTOM") + AceGUI:ClearFocus() +end + +local function SizerE_OnMouseDown(frame) + frame:GetParent():StartSizing("RIGHT") + AceGUI:ClearFocus() +end + +local function StatusBar_OnEnter(frame) + frame.obj:Fire("OnEnterStatusBar") +end + +local function StatusBar_OnLeave(frame) + frame.obj:Fire("OnLeaveStatusBar") +end + +--[[----------------------------------------------------------------------------- +Methods +-------------------------------------------------------------------------------]] +local methods = { + ["OnAcquire"] = function(self) + self.frame:SetParent(UIParent) + self.frame:SetFrameStrata("FULLSCREEN_DIALOG") + self.frame:SetFrameLevel(100) -- Lots of room to draw under it + self:SetTitle() + self:SetStatusText() + self:ApplyStatus() + self:Show() + self:EnableResize(true) + end, + + ["OnRelease"] = function(self) + self.status = nil + wipe(self.localstatus) + end, + + ["OnWidthSet"] = function(self, width) + local content = self.content + local contentwidth = width - 34 + if contentwidth < 0 then + contentwidth = 0 + end + content:SetWidth(contentwidth) + content.width = contentwidth + end, + + ["OnHeightSet"] = function(self, height) + local content = self.content + local contentheight = height - 57 + if contentheight < 0 then + contentheight = 0 + end + content:SetHeight(contentheight) + content.height = contentheight + end, + + ["SetTitle"] = function(self, title) + self.titletext:SetText(title) + self.titlebg:SetWidth((self.titletext:GetWidth() or 0) + 10) + end, + + ["SetStatusText"] = function(self, text) + self.statustext:SetText(text) + end, + + ["Hide"] = function(self) + self.frame:Hide() + end, + + ["Show"] = function(self) + self.frame:Show() + end, + + ["EnableResize"] = function(self, state) + local func = state and "Show" or "Hide" + self.sizer_se[func](self.sizer_se) + self.sizer_s[func](self.sizer_s) + self.sizer_e[func](self.sizer_e) + end, + + -- called to set an external table to store status in + ["SetStatusTable"] = function(self, status) + assert(type(status) == "table") + self.status = status + self:ApplyStatus() + end, + + ["ApplyStatus"] = function(self) + local status = self.status or self.localstatus + local frame = self.frame + self:SetWidth(status.width or 700) + self:SetHeight(status.height or 500) + frame:ClearAllPoints() + if status.top and status.left then + frame:SetPoint("TOP", UIParent, "BOTTOM", 0, status.top) + frame:SetPoint("LEFT", UIParent, "LEFT", status.left, 0) + else + frame:SetPoint("CENTER") + end + end +} + +--[[----------------------------------------------------------------------------- +Constructor +-------------------------------------------------------------------------------]] +local FrameBackdrop = { + bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", + edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", + tile = true, tileSize = 32, edgeSize = 32, + insets = { left = 8, right = 8, top = 8, bottom = 8 } +} + +local PaneBackdrop = { + bgFile = "Interface\\ChatFrame\\ChatFrameBackground", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 16, edgeSize = 16, + insets = { left = 3, right = 3, top = 5, bottom = 3 } +} + +local function Constructor() + local frame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil) + frame:Hide() + + frame:EnableMouse(true) + frame:SetMovable(true) + frame:SetResizable(true) + frame:SetFrameStrata("FULLSCREEN_DIALOG") + frame:SetFrameLevel(100) -- Lots of room to draw under it + -- frame:SetBackdrop(FrameBackdrop) + frame:SetBackdropColor(0, 0, 0, 0) + if frame.SetResizeBounds then + frame:SetResizeBounds(400, 200) + end + if frame.SetMinResize then + frame:SetMinResize(400, 200) + end + frame:SetToplevel(true) + frame:SetScript("OnShow", Frame_OnShow) + frame:SetScript("OnHide", Frame_OnClose) + frame:SetScript("OnMouseDown", Frame_OnMouseDown) + + local closebutton = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") + closebutton:SetScript("OnClick", Button_OnClick) + closebutton:SetPoint("BOTTOMRIGHT", -27, 17) + closebutton:SetHeight(20) + closebutton:SetWidth(150) + closebutton:SetText("Begin Adventure") + closebutton:Hide() + + local statusbg = CreateFrame("Button", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil) + statusbg:SetPoint("BOTTOMLEFT", 15, 15) + statusbg:SetPoint("BOTTOMRIGHT", -132, 15) + statusbg:SetHeight(24) + -- statusbg:SetBackdrop(PaneBackdrop) + statusbg:SetBackdropColor(0.1,0.1,0.1) + statusbg:SetBackdropBorderColor(0.4,0.4,0.4) + statusbg:SetScript("OnEnter", StatusBar_OnEnter) + statusbg:SetScript("OnLeave", StatusBar_OnLeave) + statusbg:Hide() + + local statustext = statusbg:CreateFontString(nil, "OVERLAY", "GameFontNormal") + statustext:SetPoint("TOPLEFT", 7, -2) + statustext:SetPoint("BOTTOMRIGHT", -7, 2) + statustext:SetHeight(20) + statustext:SetJustifyH("LEFT") + statustext:SetText("") + + local titlebg = frame:CreateTexture(nil, "OVERLAY") + titlebg:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg:SetTexCoord(0.31, 0.67, 0, 0.63) + titlebg:SetPoint("TOP", 0, 18) + titlebg:SetWidth(100) + titlebg:SetHeight(60) + titlebg:Hide() + + local title = CreateFrame("Frame", nil, frame) + title:EnableMouse(true) + title:SetScript("OnMouseDown", Title_OnMouseDown) + title:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + -- title:SetAllPoints(titlebg) + + local titletext = title:CreateFontString(nil, "OVERLAY", "GameFontNormal") + titletext:SetFont("Interface\\Addons\\Hardcore\\Media\\BreatheFire.ttf", 20) + titletext:SetPoint("TOP", titlebg, "TOP", 0, -20) + + + local titlebg_l = frame:CreateTexture(nil, "OVERLAY") + titlebg_l:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg_l:SetTexCoord(0.21, 0.31, 0, 0.63) + titlebg_l:SetPoint("RIGHT", titlebg, "LEFT") + titlebg_l:SetWidth(30) + titlebg_l:SetHeight(60) + titlebg_l:Hide() + + local titlebg_r = frame:CreateTexture(nil, "OVERLAY") + titlebg_r:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg_r:SetTexCoord(0.67, 0.77, 0, 0.63) + titlebg_r:SetPoint("LEFT", titlebg, "RIGHT") + titlebg_r:SetWidth(30) + titlebg_r:SetHeight(60) + titlebg_r:Hide() + + local sizer_se = CreateFrame("Frame", nil, frame) + sizer_se:SetPoint("BOTTOMRIGHT") + sizer_se:SetWidth(25) + sizer_se:SetHeight(25) + sizer_se:EnableMouse() + sizer_se:SetScript("OnMouseDown",SizerSE_OnMouseDown) + sizer_se:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + sizer_se:Hide() + + local line1 = sizer_se:CreateTexture(nil, "BACKGROUND") + line1:SetWidth(14) + line1:SetHeight(14) + line1:SetPoint("BOTTOMRIGHT", -8, 8) + line1:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border + local x = 0.1 * 14/17 + line1:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) + line1:Hide() + + local line2 = sizer_se:CreateTexture(nil, "BACKGROUND") + line2:SetWidth(8) + line2:SetHeight(8) + line2:SetPoint("BOTTOMRIGHT", -8, 8) + line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border + local x = 0.1 * 8/17 + line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) + line2:Hide() + + local sizer_s = CreateFrame("Frame", nil, frame) + sizer_s:SetPoint("BOTTOMRIGHT", -25, 0) + sizer_s:SetPoint("BOTTOMLEFT") + sizer_s:SetHeight(25) + sizer_s:EnableMouse(true) + sizer_s:SetScript("OnMouseDown", SizerS_OnMouseDown) + sizer_s:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + local sizer_e = CreateFrame("Frame", nil, frame) + sizer_e:SetPoint("BOTTOMRIGHT", 0, 25) + sizer_e:SetPoint("TOPRIGHT") + sizer_e:SetWidth(25) + sizer_e:EnableMouse(true) + sizer_e:SetScript("OnMouseDown", SizerE_OnMouseDown) + sizer_e:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + --Container Support + local content = CreateFrame("Frame", nil, frame) + content:SetPoint("TOPLEFT", 17, -27) + content:SetPoint("BOTTOMRIGHT", -17, 40) + + local widget = { + localstatus = {}, + titletext = titletext, + statustext = statustext, + titlebg = titlebg, + sizer_se = sizer_se, + sizer_s = sizer_s, + sizer_e = sizer_e, + content = content, + frame = frame, + type = Type + } + for method, func in pairs(methods) do + widget[method] = func + end + closebutton.obj, statusbg.obj = widget, widget + + + title:Hide() + return AceGUI:RegisterAsContainer(widget) +end + +AceGUI:RegisterWidgetType(Type, Constructor, Version) diff --git a/Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrameModernMenu.lua b/Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrameModernMenu.lua new file mode 100644 index 00000000..2ed9901c --- /dev/null +++ b/Libs/AceGUI-3.0/widgets/AceGUIContainer-HardcoreFrameModernMenu.lua @@ -0,0 +1,326 @@ +--[[----------------------------------------------------------------------------- +Frame Container +-------------------------------------------------------------------------------]] +local Type, Version = "HardcoreFrameModernMenu", 28 +local AceGUI = LibStub and LibStub("AceGUI-3.0", true) +if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end + +-- Lua APIs +local pairs, assert, type = pairs, assert, type +local wipe = table.wipe + +-- WoW APIs +local PlaySound = PlaySound +local CreateFrame, UIParent = CreateFrame, UIParent + +-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded +-- List them here for Mikk's FindGlobals script +-- GLOBALS: CLOSE + +--[[----------------------------------------------------------------------------- +Scripts +-------------------------------------------------------------------------------]] +local function Button_OnClick(frame) + PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT + frame.obj:Hide() +end + +local function Frame_OnShow(frame) + frame.obj:Fire("OnShow") +end + +local function Frame_OnClose(frame) + frame.obj:Fire("OnClose") +end + +local function Frame_OnMouseDown(frame) + AceGUI:ClearFocus() +end + +local function Title_OnMouseDown(frame) + frame:GetParent():StartMoving() + AceGUI:ClearFocus() +end + +local function MoverSizer_OnMouseUp(mover) + local frame = mover:GetParent() + frame:StopMovingOrSizing() + local self = frame.obj + local status = self.status or self.localstatus + status.width = frame:GetWidth() + status.height = frame:GetHeight() + status.top = frame:GetTop() + status.left = frame:GetLeft() +end + +local function SizerSE_OnMouseDown(frame) + frame:GetParent():StartSizing("BOTTOMRIGHT") + AceGUI:ClearFocus() +end + +local function SizerS_OnMouseDown(frame) + frame:GetParent():StartSizing("BOTTOM") + AceGUI:ClearFocus() +end + +local function SizerE_OnMouseDown(frame) + frame:GetParent():StartSizing("RIGHT") + AceGUI:ClearFocus() +end + +local function StatusBar_OnEnter(frame) + frame.obj:Fire("OnEnterStatusBar") +end + +local function StatusBar_OnLeave(frame) + frame.obj:Fire("OnLeaveStatusBar") +end + +--[[----------------------------------------------------------------------------- +Methods +-------------------------------------------------------------------------------]] +local methods = { + ["OnAcquire"] = function(self) + self.frame:SetParent(UIParent) + self.frame:SetFrameStrata("FULLSCREEN_DIALOG") + self.frame:SetFrameLevel(100) -- Lots of room to draw under it + self:SetTitle() + self:SetStatusText() + self:ApplyStatus() + self:Show() + self:EnableResize(true) + end, + + ["OnRelease"] = function(self) + self.status = nil + wipe(self.localstatus) + end, + + ["OnWidthSet"] = function(self, width) + local content = self.content + local contentwidth = width - 34 + if contentwidth < 0 then + contentwidth = 0 + end + content:SetWidth(contentwidth) + content.width = contentwidth + end, + + ["OnHeightSet"] = function(self, height) + local content = self.content + local contentheight = height - 57 + if contentheight < 0 then + contentheight = 0 + end + content:SetHeight(contentheight) + content.height = contentheight + end, + + ["SetTitle"] = function(self, title) + self.titletext:SetText(title) + self.titlebg:SetWidth((self.titletext:GetWidth() or 0) + 10) + end, + + ["SetStatusText"] = function(self, text) + self.statustext:SetText(text) + end, + + ["Hide"] = function(self) + self.frame:Hide() + end, + + ["Show"] = function(self) + self.frame:Show() + end, + + ["EnableResize"] = function(self, state) + local func = state and "Show" or "Hide" + self.sizer_se[func](self.sizer_se) + self.sizer_s[func](self.sizer_s) + self.sizer_e[func](self.sizer_e) + end, + + -- called to set an external table to store status in + ["SetStatusTable"] = function(self, status) + assert(type(status) == "table") + self.status = status + self:ApplyStatus() + end, + + ["ApplyStatus"] = function(self) + local status = self.status or self.localstatus + local frame = self.frame + self:SetWidth(status.width or 700) + self:SetHeight(status.height or 500) + frame:ClearAllPoints() + if status.top and status.left then + frame:SetPoint("TOP", UIParent, "BOTTOM", 0, status.top) + frame:SetPoint("LEFT", UIParent, "LEFT", status.left, 0) + else + frame:SetPoint("CENTER") + end + end +} + +--[[----------------------------------------------------------------------------- +Constructor +-------------------------------------------------------------------------------]] +local FrameBackdrop = { + bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", + edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", + tile = true, tileSize = 32, edgeSize = 32, + insets = { left = 8, right = 8, top = 8, bottom = 8 } +} + +local PaneBackdrop = { + bgFile = "Interface\\ChatFrame\\ChatFrameBackground", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 16, edgeSize = 16, + insets = { left = 3, right = 3, top = 5, bottom = 3 } +} + +local function Constructor() + local frame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil) + frame:Hide() + + frame:EnableMouse(true) + frame:SetMovable(true) + frame:SetResizable(true) + frame:SetFrameStrata("FULLSCREEN_DIALOG") + frame:SetFrameLevel(100) -- Lots of room to draw under it + frame:SetBackdrop(FrameBackdrop) + frame:SetBackdropColor(0, 0, 0, 1) + if frame.SetResizeBounds then + frame:SetResizeBounds(400, 200) + end + if frame.SetMinResize then + frame:SetMinResize(400, 200) + end + frame:SetToplevel(true) + frame:SetScript("OnShow", Frame_OnShow) + frame:SetScript("OnHide", Frame_OnClose) + frame:SetScript("OnMouseDown", Frame_OnMouseDown) + + local closebutton = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") + closebutton:SetScript("OnClick", Button_OnClick) + closebutton:SetPoint("BOTTOMRIGHT", -9, 562) + closebutton:SetHeight(30) + closebutton:SetWidth(30) + closebutton:SetText("X") + + local statusbg = CreateFrame("Button", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil) + statusbg:SetPoint("BOTTOMLEFT", 15, 15) + statusbg:SetPoint("BOTTOMRIGHT", -132, 15) + statusbg:SetHeight(24) + statusbg:SetBackdrop(PaneBackdrop) + statusbg:SetBackdropColor(0.1,0.1,0.1) + statusbg:SetBackdropBorderColor(0.4,0.4,0.4) + statusbg:SetScript("OnEnter", StatusBar_OnEnter) + statusbg:SetScript("OnLeave", StatusBar_OnLeave) + statusbg:Hide() + + local statustext = statusbg:CreateFontString(nil, "OVERLAY", "GameFontNormal") + statustext:SetPoint("TOPLEFT", 7, -2) + statustext:SetPoint("BOTTOMRIGHT", -7, 2) + statustext:SetHeight(20) + statustext:SetJustifyH("LEFT") + statustext:SetText("") + + local titlebg = frame:CreateTexture(nil, "OVERLAY") + titlebg:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg:SetTexCoord(0.31, 0.67, 0, 0.63) + titlebg:SetPoint("TOP", 0, 18) + titlebg:SetWidth(100) + titlebg:SetHeight(60) + + local title = CreateFrame("Frame", nil, frame) + title:EnableMouse(true) + title:SetScript("OnMouseDown", Title_OnMouseDown) + title:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + title:SetAllPoints(titlebg) + + local titletext = title:CreateFontString(nil, "OVERLAY", "GameFontNormal") + titletext:SetFont("Interface\\Addons\\Hardcore\\Media\\BreatheFire.ttf", 20) + titletext:SetPoint("TOP", titlebg, "TOP", 0, -20) + + + local titlebg_l = frame:CreateTexture(nil, "OVERLAY") + titlebg_l:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg_l:SetTexCoord(0.21, 0.31, 0, 0.63) + titlebg_l:SetPoint("RIGHT", titlebg, "LEFT") + titlebg_l:SetWidth(30) + titlebg_l:SetHeight(60) + + local titlebg_r = frame:CreateTexture(nil, "OVERLAY") + titlebg_r:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header + titlebg_r:SetTexCoord(0.67, 0.77, 0, 0.63) + titlebg_r:SetPoint("LEFT", titlebg, "RIGHT") + titlebg_r:SetWidth(30) + titlebg_r:SetHeight(60) + + local sizer_se = CreateFrame("Frame", nil, frame) + sizer_se:SetPoint("BOTTOMRIGHT") + sizer_se:SetWidth(25) + sizer_se:SetHeight(25) + sizer_se:EnableMouse() + sizer_se:SetScript("OnMouseDown",SizerSE_OnMouseDown) + sizer_se:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + local line1 = sizer_se:CreateTexture(nil, "BACKGROUND") + line1:SetWidth(14) + line1:SetHeight(14) + line1:SetPoint("BOTTOMRIGHT", -8, 8) + line1:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border + local x = 0.1 * 14/17 + line1:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) + + local line2 = sizer_se:CreateTexture(nil, "BACKGROUND") + line2:SetWidth(8) + line2:SetHeight(8) + line2:SetPoint("BOTTOMRIGHT", -8, 8) + line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border + local x = 0.1 * 8/17 + line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) + + local sizer_s = CreateFrame("Frame", nil, frame) + sizer_s:SetPoint("BOTTOMRIGHT", -25, 0) + sizer_s:SetPoint("BOTTOMLEFT") + sizer_s:SetHeight(25) + sizer_s:EnableMouse(true) + sizer_s:SetScript("OnMouseDown", SizerS_OnMouseDown) + sizer_s:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + local sizer_e = CreateFrame("Frame", nil, frame) + sizer_e:SetPoint("BOTTOMRIGHT", 0, 25) + sizer_e:SetPoint("TOPRIGHT") + sizer_e:SetWidth(25) + sizer_e:EnableMouse(true) + sizer_e:SetScript("OnMouseDown", SizerE_OnMouseDown) + sizer_e:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + + --Container Support + local content = CreateFrame("Frame", nil, frame) + content:SetPoint("TOPLEFT", 17, -27) + content:SetPoint("BOTTOMRIGHT", -17, 40) + + local widget = { + localstatus = {}, + titletext = titletext, + statustext = statustext, + titlebg = titlebg, + sizer_se = sizer_se, + sizer_s = sizer_s, + sizer_e = sizer_e, + content = content, + frame = frame, + type = Type + } + for method, func in pairs(methods) do + widget[method] = func + end + closebutton.obj, statusbg.obj = widget, widget + + return AceGUI:RegisterAsContainer(widget) +end + +AceGUI:RegisterWidgetType(Type, Constructor, Version) diff --git a/Libs/AceGUI-3.0/widgets/AceGUIWidget-HardcoreClassTitleLabel.lua b/Libs/AceGUI-3.0/widgets/AceGUIWidget-HardcoreClassTitleLabel.lua new file mode 100644 index 00000000..a846615d --- /dev/null +++ b/Libs/AceGUI-3.0/widgets/AceGUIWidget-HardcoreClassTitleLabel.lua @@ -0,0 +1,179 @@ +--[[----------------------------------------------------------------------------- +Label Widget +Displays text and optionally an icon. +-------------------------------------------------------------------------------]] +local Type, Version = "HardcoreClassTitleLabel", 27 +local AceGUI = LibStub and LibStub("AceGUI-3.0", true) +if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end + +-- Lua APIs +local max, select, pairs = math.max, select, pairs + +-- WoW APIs +local CreateFrame, UIParent = CreateFrame, UIParent + +-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded +-- List them here for Mikk's FindGlobals script +-- GLOBALS: GameFontHighlightSmall + +--[[----------------------------------------------------------------------------- +Support functions +-------------------------------------------------------------------------------]] + +local function UpdateImageAnchor(self) + if self.resizing then return end + local frame = self.frame + local width = frame.width or frame:GetWidth() or 0 + local image = self.image + local label = self.label + local height + + label:ClearAllPoints() + image:ClearAllPoints() + + if self.imageshown then + local imagewidth = image:GetWidth() + if (width - imagewidth) < 200 or (label:GetText() or "") == "" then + -- image goes on top centered when less than 200 width for the text, or if there is no text + image:SetPoint("TOP") + label:SetPoint("TOP", image, "BOTTOM") + label:SetPoint("LEFT") + label:SetWidth(width) + height = image:GetHeight() + label:GetStringHeight() + else + -- image on the left + image:SetPoint("TOPLEFT") + if image:GetHeight() > label:GetStringHeight() then + label:SetPoint("LEFT", image, "RIGHT", 4, 0) + else + label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0) + end + label:SetWidth(width - imagewidth - 4) + height = max(image:GetHeight(), label:GetStringHeight()) + end + else + -- no image shown + label:SetPoint("TOPLEFT") + label:SetWidth(width) + height = label:GetStringHeight() + end + + -- avoid zero-height labels, since they can used as spacers + if not height or height == 0 then + height = 1 + end + + self.resizing = true + frame:SetHeight(height) + frame.height = height + self.resizing = nil +end + +--[[----------------------------------------------------------------------------- +Methods +-------------------------------------------------------------------------------]] +local methods = { + ["OnAcquire"] = function(self) + -- set the flag to stop constant size updates + self.resizing = true + -- height is set dynamically by the text and image size + self:SetWidth(200) + self:SetText() + self:SetImage(nil) + self:SetImageSize(16, 16) + self:SetColor() + self:SetFontObject() + self:SetJustifyH("CENTER") + self:SetJustifyV("TOP") + + -- reset the flag + self.resizing = nil + -- run the update explicitly + UpdateImageAnchor(self) + end, + + -- ["OnRelease"] = nil, + + ["OnWidthSet"] = function(self, width) + UpdateImageAnchor(self) + end, + + ["SetText"] = function(self, text) + self.label:SetText(text) + UpdateImageAnchor(self) + end, + + ["SetColor"] = function(self, r, g, b) + if not (r and g and b) then + r, g, b = 1, 1, 1 + end + self.label:SetVertexColor(r, g, b) + end, + + ["SetImage"] = function(self, path, ...) + local image = self.image + image:SetTexture(path) + + if image:GetTexture() then + self.imageshown = true + local n = select("#", ...) + if n == 4 or n == 8 then + image:SetTexCoord(...) + else + image:SetTexCoord(0, 1, 0, 1) + end + else + self.imageshown = nil + end + UpdateImageAnchor(self) + end, + + ["SetFont"] = function(self, font, height, flags) + self.label:SetFont(font, height, flags) + UpdateImageAnchor(self) + end, + + ["SetFontObject"] = function(self, font) + self:SetFont((font or GameFontHighlightSmall):GetFont()) + end, + + ["SetImageSize"] = function(self, width, height) + self.image:SetWidth(width) + self.image:SetHeight(height) + UpdateImageAnchor(self) + end, + + ["SetJustifyH"] = function(self, justifyH) + self.label:SetJustifyH(justifyH) + end, + + ["SetJustifyV"] = function(self, justifyV) + self.label:SetJustifyV(justifyV) + end, +} + +--[[----------------------------------------------------------------------------- +Constructor +-------------------------------------------------------------------------------]] +local function Constructor() + local frame = CreateFrame("Frame", nil, UIParent) + frame:Hide() + + local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlightSmall") + local image = frame:CreateTexture(nil, "BACKGROUND") + + -- create widget + local widget = { + label = label, + image = image, + frame = frame, + type = Type + } + for method, func in pairs(methods) do + widget[method] = func + end + + return AceGUI:RegisterAsWidget(widget) +end + +AceGUI:RegisterWidgetType(Type, Constructor, Version) diff --git a/Libs/GreenWall/.gitattributes b/Libs/GreenWall/.gitattributes deleted file mode 100644 index 4aa5f053..00000000 --- a/Libs/GreenWall/.gitattributes +++ /dev/null @@ -1,11 +0,0 @@ -# Set the default behavior, in case people don't have core.autocrlf set. -* text=auto - -# Explicitly declare text files you want to always be normalized and converted -# to native line endings on checkout. -*.lua text -*.toc text -*.xml text -*.md text -*.html text -*.css text diff --git a/Libs/GreenWall/.gitignore b/Libs/GreenWall/.gitignore deleted file mode 100644 index 765917ac..00000000 --- a/Libs/GreenWall/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# Compiled Lua sources -luac.out - -# luarocks build files -*.src.rock -*.zip -*.tar.gz - -# Object files -*.o -*.os -*.ko -*.obj -*.elf - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo -*.def -*.exp - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# IDE -.project -.buildpath -.settings/ -.idea/ diff --git a/Libs/GreenWall/.luacov b/Libs/GreenWall/.luacov deleted file mode 100644 index 5facf736..00000000 --- a/Libs/GreenWall/.luacov +++ /dev/null @@ -1,57 +0,0 @@ ---- Global configuration file. Copy, customize and store in your --- project folder as '.luacov' for project specific configuration. --- If some options are missing, their default values from this file --- will be used. --- @class module --- @name luacov.defaults -return { - - -- default filename to load for config options if not provided - -- only has effect in 'luacov.defaults.lua' - ["configfile"] = ".luacov", - - -- filename to store stats collected - ["statsfile"] = "luacov.stats.out", - - -- filename to store report - ["reportfile"] = "luacov.report.out", - - -- luacov.stats file updating frequency. - -- The lower this value - the more frequenty results will be written out to luacov.stats - -- You may want to reduce this value for short lived scripts (to for example 2) to avoid losing coverage data. - ["savestepsize"] = 100, - - -- Run reporter on completion? (won't work for ticks) - runreport = true, - - -- Delete stats file after reporting? - deletestats = false, - - -- Process Lua code loaded from raw strings - -- (that is, when the 'source' field in the debug info - -- does not start with '@') - codefromstrings = false, - - -- Patterns for files to include when reporting - -- all will be included if nothing is listed - -- (exclude overrules include, do not include - -- the .lua extension, path separator is always '/') - ["include"] = {}, - - -- Patterns for files to exclude when reporting - -- all will be included if nothing is listed - -- (exclude overrules include, do not include - -- the .lua extension, path separator is always '/') - ["exclude"] = { - "luacov$", - "luacov/reporter$", - "luacov/defaults$", - "luacov/runner$", - "luacov/stats$", - "luacov/tick$", - "lua_install/", - "tests/" - }, - - -} \ No newline at end of file diff --git a/Libs/GreenWall/.pkgmeta b/Libs/GreenWall/.pkgmeta deleted file mode 100644 index b336e95c..00000000 --- a/Libs/GreenWall/.pkgmeta +++ /dev/null @@ -1,5 +0,0 @@ -package-as: GreenWall -manual-changelog: CHANGELOG.md -license-output: LICENSE -ignore: - - tests diff --git a/Libs/GreenWall/.travis.yml b/Libs/GreenWall/.travis.yml deleted file mode 100644 index 30c4566a..00000000 --- a/Libs/GreenWall/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: python -sudo: false - -env: - - LUA="lua=5.1" LUA_PATH="tests/?;tests/?.lua;;" - -before_install: - - pip install hererocks - - hererocks lua_install -r^ --$LUA - - export PATH=$PATH:$PWD/lua_install/bin - -install: - - luarocks install bitlib - - luarocks install luaunit - - luarocks install luacov - - luarocks install luacov-coveralls - -script: - - lua -lluacov tests/TestAPI.lua -v - - lua -lluacov tests/TestUtility.lua -v - - lua -lluacov tests/TestSettings.lua -v - - lua -lluacov tests/TestSystemEventHandler.lua -v - -after_success: - - luacov-coveralls - -notifications: - email: - on_success: change - on_failure: always diff --git a/Libs/GreenWall/API.lua b/Libs/GreenWall/API.lua index 38675358..277fdd28 100644 --- a/Libs/GreenWall/API.lua +++ b/Libs/GreenWall/API.lua @@ -1,19 +1,14 @@ --[[----------------------------------------------------------------------- - The MIT License (MIT) - Copyright (c) 2010-2020 Mark Rogaski - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,13 +16,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --]]----------------------------------------------------------------------- --[[----------------------------------------------------------------------- - An API for guild chat bridging as a transport - --]]----------------------------------------------------------------------- -- diff --git a/Libs/GreenWall/API.md b/Libs/GreenWall/API.md deleted file mode 100644 index 94ca3762..00000000 --- a/Libs/GreenWall/API.md +++ /dev/null @@ -1,159 +0,0 @@ - - -# GreenWall API Reference - -## Purpose - -Initially, it was hoped that GreenWall could be extended to bridge -standard add-on messages. However, the WoW API doesn't have a function -similar to `ChatFrame_MessageEventHandler` that could be used -for add-on messages. - -So this simple messaging API is provided for third-party add-on developers -who would like to be able to use the bridged communication on a guild -confederation. - -A simple example, which demonstrates the use of the API, is [GWSonar](https://github.com/AIE-Guild/GWSonar). - - -## Safety First - -Before any API functions are called, there are tests that should be -run to verify the environment. - -### Individual API checks - -#### Check that GreenWall is loaded - -```lua -if C_AddOns.IsAddOnLoaded('GreenWall') then - ... -end -``` - -#### Check that the API is supported - -```lua -if GreenWallAPI ~= nil then - ... -end -``` - -#### Check the API version - -```lua - -if GreenWallAPI >= 1 then - ... -end -``` - -### Unified API check - -This combines all of the tests into one function. - -```lua -function apiAvailable() - function testAPI() - -- Raises and exception of GreenWall is loaded or is pre-1.7. - assert(C_AddOns.IsAddOnLoaded('GreenWall')) - return GreenWallAPI.version - end - - -- Catch any exceptions - local found, version = pcall(testAPI) - - return found and version >= 1 -end -``` - - -## Sending a Message - -To send a message to other instances of the add-on, use the following function. - -```lua -GreenWallAPI.SendMessage(addon, message) -``` - -Arguments: - -- addon - The addon name, should the one used for the name of the TOC file. -- message - The message to send. Accepts 8-bit data. - - -## Receiving a Message - -The receiving of messages is handled with callbacks. - -### 1. Create the callback - -```lua -local function handler(addon, sender, message, echo, guild) -``` - -Arguments: - -- addon - The name of the addon sending the message. -- sender - The player sending the message. -- message - The text of the message. -- echo - Set to true if the message was sent by the player. -- guild - Set to true if the message originated in the player's co-guild. - -### 2. Add the handler to the dispatch table - -```lua -local id = GreenWallAPI.AddMessageHandler(handler, addon, priority) -``` - -Arguments: - -- handler - The callback function. -- addon - The name of the addon that you want to receive messages from (the same one used for the name of the TOC file). If the value '*' is supplied, messages from all addons will be handled. -- priority - A signed integer indicating relative priority, lower value is handled first. The default is 0. - -Returns: - -- The ID that can be used to remove the handler. - -## Dispatch Table - -In addition to the `GreenWallAPI.AddMessageHandler` function to add a handler, -the following functions are available to manage the dispatch table. - -### Remove a handler - -```lua -local found = GreenWallAPI.RemoveMessageHandler(id) -``` - -Arguments: - -- handler_id - The ID of the handler function. - -### Clear one or more handlers - -```lua -GreenWallAPI.ClearMessageHandlers(addon) -``` - -Arguments: - -- addon - (Optional) A tag defining the name of the add-on messages will be - received from. The `*` character can be used to match all add-ons. If this - value is `nil`, all entries will be cleared. - -> Note: A `*` value passed as add-on is not a wildcard in this context, it will only matched instances where the handler was installed with `*` as the add-on. - -### Get channel information - -Query the hidden channels used by Greenwall. - -```lua -GreenWallAPI.GetChannelNumbers() -``` - -Returns: - -- An array of integer values for the channels in use. - diff --git a/Libs/GreenWall/CHANGELOG.md b/Libs/GreenWall/CHANGELOG.md deleted file mode 100644 index 13b578f8..00000000 --- a/Libs/GreenWall/CHANGELOG.md +++ /dev/null @@ -1,980 +0,0 @@ -# Change Log - -This project uses [Semantic Versioning](http://semver.org/). - -## 1.11.16 -- 2024-10-24 - -- Really updated the TOC for WoW 11.0.5. - -## 1.11.15 -- 2024-10-24 - -- Updated the TOC for WoW 11.0.5. - -## 1.11.14 -- 2024-08-13 - -### Fixed - -- Replaced deprecated GetAddOnMetadata and IsAddOnLoaded with C_AddOns namespaced functions. - -## 1.11.13 -- 2024-07-31 - -### Fixed - -- Removed reference to undefined variable. - -## 1.11.12 -- 2024-07-30 - -### Fixed - -- Fix for Greenwall settings not displaying in Options>AddOns Tab and the related 'InterfaceOptions_AddCategory' (a nil - value) error. - -### Updated - -- Updated the TOC for WoW 11.0.0. - -## 1.11.11 -- 2023-11-11 - -### Updated - -- Updated the TOC for WoW 10.2.0. - -## 1.11.10 -- 2023-05-06 - -### Updated - -- Updated the TOC for WoW 10.1.0. - -## 1.11.9 -- 2023-02-17 - -### Updated - -- Updated the TOC for WoW 10.0.5. - -## 1.11.8 -- 2022-10-26 - -### Updated - -- Updated the TOC for WoW 10.0.0. - -### Removed - -- Removed an unsupported anchor positioning element. - -## 1.11.7 -- 2022-06-20 - -### Updated - -- Updated the TOC for WoW 9.2.5. - -## 1.11.6 -- 2021-09-03 - -### Updated - -- Updated the TOC for WoW 9.1.0. - -## 1.11.5 -- 2021-03-14 - -### Updated - -- Updated the TOC for WoW 9.0.5. - -## 1.11.4 -- 2020-12-23 - -### Updated - -- Updated the README to point to the current connected realm documentation. - -## 1.11.3 -- 2020-12-19 - -### Changed - -- Updated the TOC for WoW 9.0.2. - -## 1.11.2 -- 2020-10-13 - -### Fixed - -- Replaced usage of deprecated GuildRoster() with C_GuildInfo.GuildRoster(). - -## 1.11.1 -- 2020-08-09 - -### Fixed - -- Added a conditional check for successfully parsed addon version for minimum - version enforcement. This is a tactical fix to address the semantic version parsing. - -## 1.11.0 -- 2020-04-27 - -### Removed - -- Removed replication of achievements, promotions, demotions, and loot - announcements between co-guilds. The `SendChatMessage` function was made - partially protected in 8.2.5, and events that are not triggered by hardware - events cannot use the function. -- Removed unnecessary local co-guild use of the addon communication channel. - -### Added - -- `GreenWallAPI.GetChannelNumbers` function to query the custom chat channels in - use by GreenWall - -### Changed - -- Updated the TOC for WoW 8.3.0. -- Refactored CHAT_MSG_SYSTEM handling to use an abstract factory and added - full unit testing for the polymorphic classes. - -### Fixed - -- Updated debug message call stack parsing for 8.3. - -## 1.10.1 -- 2019-09-24 - -### Updated - -- Updated the TOC for WoW 8.2.5. - -### Added - -- Added unit test coverage reporting through Coveralls. - -## 1.10.0 -- 2019-09-05 - -### Changed - -- Moved to customer branch approach for WoW Classic releases. - -### Removed - -- Removed transitional code for handling PLAYER_ENTERING_WORLD. - -## 1.9.15 -- 2019-08-27 - -### Changed - -- Cleaned up project to support CurseForge automatic packaging. - -## 1.9.14 -- 2019-08-22 - -### Added - -- Added compatibility support for Incognito. - -## 1.9.13 -- 2019-07-02 - -### Updated - -- Updated the TOC for WoW 8.2. - -### Removed - -- Removed Gitter badge from documentation. - -## 1.9.12 -- 2019-01-10 - -### Fixed - -- Added missing message alteration for Name2Chat. - -## 1.9.11 -- 2019-01-06 - -### Fixed - -- Added ID tagging support for Identity-2 and Name2Chat under the WoW 8.1.0 changes. -- Changed legendary loot notifications from second-person to third-person. - -## 1.9.10 -- 2019-01-04 - -### Fixed - -- Fixed GreenWall_ParseText message filtering to filter blank messages. - -### Added - -- Added warning for any transmission of a blank message on a channel. - -### Changed - -- Removed unused CRC import. - -## 1.9.9 -- 2018-12-13 - -### Fixed - -- Added chat interception workaround for guild chat changes in BFA 8.1. - -_Thank you to Ashayo for the patch._ - -## 1.9.8 -- 2018-08-23 - -### Changed - -- Refactored system message pattern matching. - -## 1.9.7 -- 2018-08-11 - -### Fixed - -- Removed a debug statement that was raising format errors. - -_Thank you to Legracen from AIE for helping with the fault isolation._ - -### Changed - -- Refactored gw.Debug to test the debug level before formatting the message. - -## 1.9.6 -- 2018-08-10 - -### Fixed - -- Restored context menu availability for speakers in other co-guilds. - -## 1.9.5 -- 2018-07-19 - -### Fixed - -- Checks for ElvUI compatibility now recognize ElvUI user profiles. - -_Thank you, again, to Simpy from the ElvUI team._ - -## 1.9.4 -- 2018-07-19 - -### Fixed - -- Applied workaround for chat channel sender regression introduced in 8.0.1. - -### Removed - -- Removed pre-8.0 call to bare SendLocal. - -## 1.9.3 -- 2018-07-17 - -### Updated - -- Updated the TOC for WoW 8.0. - -## 1.9.2 -- 2018-06-11 - -### Fixed - -- Updated compatibility mode for ElvUI 10.74 changes to chat. -- Removed combat log from chat window scanning. - -_Thank you to Simpy from the ElvUI team for the fixes._ - -## 1.9.1 -- 2018-04-28 - -### Fixed - -- SendAddonMessage is now called in the C_ChatInfo namespace for 8.0.x. - -### Changed - -- Moved WoW build information to gw.build global. - -## 1.9.0 -- 2018-01-08 - -### Added - -- Added support for shared, account-level settings per character. Each character can either use the account - settings or a character-specific configuration. If an existing GreenWall configuration exists for the character - character mode will be the default, otherwise account mode is the default. -- Added confederation announcements of legendary items looted. -- Moved configuration handling to a proxy class to allow a single point - of access for all configuration data. -- Added Travis CI build testing with luaunit for unit tests. -- Added a dedication in memoriam to Roger K White (aka Ralff), we will always miss you. - -### Fixed - -- Corrected item string matching for legendary loot toasts. - -### Changed - -- Pointed documentation to new CurseForge URL. - -### Updated - -- Rewrote the project README. - -### Removed - -- Removed luadoc HTML output. -- HTML copies of other documentation. - -## 1.8.5 -- 2017-08-29 - -### Fixed - -- Applied a workaround for 7.3.0 where GuildControlSetRank() was made - protected. Checking for rank access is now determined by reading the - officer note of the GM. - -## 1.8.4 -- 2017-08-29 - -### Updated - -- Updated the TOC for WoW 7.3. - -## 1.8.3 -- 2017-04-16 - -### Updated - -- Updated the TOC for WoW 7.2. - -## 1.8.2 -- 2017-01-12 - -### Added - -- The version command now give WoW version information. - -## 1.8.1 -- 2016-10-25 - -### Fixed - -- Corrected configuration whitespace grooming. - -### Changed - -- Updated TOC for WoW 7.1. - -## 1.8.0 -- 2016-09-20 - -### Fixed - -- Added whitespace trimming to configuration parser. - -### Changed - -- Compatibility messages are now raised as debugging output. - -## 1.7.3 -- 2016-08-03 - -### Fixed - -- Corrected global name parsing to account for UTF-8. -- Updated API documentation. - -## 1.7.2 -- 2016-07-20 - -### Fixed - -- Workaround for delayed bridge channel join caused by missing - CHAT_MSG_CHANNEL_NOTICE events. - -## 1.7.1 -- 2016-07-20 - -### Changed - -- Updated TOC for WoW 7.0.3. - -## 1.7.0 -- 2016-01-01 - -### Fixed - -- Improved message validation during adaptation layer decoding. -- Fixed message handling logic. - -### Changed - -- Updated color of addon messages in chat. - -### Added - -- Confederation bridging API for third-party add-ons. -- Automatic Prat-3.0 compatibility mode. - -### Removed - -- Removed version number from options screen title. - -## 1.6.6 -- 2015-12-16 - -### Fixed - -- A check is now done for officer status before sending a gratuitous officer - announcement. -- Added officer note data validation before parsing. - -### Added - -- Automatic ElvUI compatibility mode. Thank you, Blazeflack. -- Added Markdown change log. -- Added channel-specific hold downs for join failures. - -## 1.6.5 -- 2015-06-24 - -### Changed - -- Updated TOC for WoW 6.2. - -## 1.6.4 -- 2015-03-07 - -### Changed - -- Refactored the user option validation. -- Modified the GwHoldDown object. Renamed `GwHoldDown:set()` to - `GwHoldDown:start()` and created a new 'GwHoldDown:set()' mutator to - change the interval. -- Moved the Semantic Versioning parser to a LibStub library. - -### Added - -- Added a user option (joindelay) to control the channel join hold-down. - -## 1.6.3 -- 2015-03-04 - -### Changed - -- Restored original channel hold-down timer value of 30 seconds. - -## 1.6.2 -- 2015-03-01 - -### Changed - -- Removed lazy sweeper case in the event loop and replaced it with a callback - for handling hold-down expiry. -- Reduced channel hold-down to 10 seconds. - -## 1.6.1 -- 2015-02-28 - -### Fixed - -- Added conditional to check achievements flag on receipt of achievement spam. - -### Added - -- Added guild ID to debugging output on message receipt. - -## 1.6.0 -- 2015-02-24 - -### Changed - -- Comprehensive refactor to allow new features in 2.0. -- Refactored configuration parser. -- Split GreenWall_Core.lua into multiple files. -- Removed excess semicolons ... Lua is not Perl. - -### Added - -- Added GwConfig object to contain configuration. -- Added GwChannel objects for channel management, implementing transport and - adaptation layers for communication. -- Added GwHoldDown and GwHoldDownCache objects. -- Added LibStub libraries for SHA256, Salsa20, CRC16-CCITT, and Base64. - -## 1.5.4 -- 2014-12-12 - -### Fixed - -- Corrected comparisons of character names to account for capitalization - normalization in the API. - -### Changed - -- Updated luadoc. - -## 1.5.3 -- 2014-11-11 - -### Fixed - -- Added comember cache updates for channel join/leave events. This stops - flapping roster announcements for characters in peer co-guilds. - -## 1.5.2 -- 2014-10-31 - -### Fixed - -- Fixed the General chat delay lockout. -- Improved the tests for officer status. - -## 1.5.1 -- 2014-10-15 - -### Fixed - -- Fixed regular expression for realm name in GwGlobalName. - -## 1.5.0 -- 2015-10-14 - -### Fixed - -- Updated for fully qualified names. - -### Changed - -- Switched to MIT license. -- Minor changes to debug messages. - -### Added - -- Added support for guilds on connected realms. - -## 1.4.1 -- 2014-08-10 - -### Fixed - -- Corrected the processing of the reload request. - -## 1.4.0 -- 2014-03-22 - -### Changed - -- Update documentation for Interface Options. -- Cleaned up debugging levels. - -### Added - -- Added Interface Options panel for GreenWall options. - -## 1.3.6 -- 2014-02-18 - -### Fixed - -- Fixed sender identification under WoW 5.4.7. - -### Added - -- Added realm name to gwPlayerName. - -## 1.3.5 -- 2014-0120 - -### Added - -- Added missing roster notification functionality. - -## 1.3.4 -- 2013-11-17 - -### Changed - -- Changed officer note format and updated parsing. - -## 1.3.3 -- 2013-09-10 - -### Changed - -- Updated TOC for WoW 5.4.0. - -## 1.3.2 -- 2013-08-07 - -### Fixed - -- Fixed message integrity checking for duplicated messages. -- Fixed messages generated on guild join, leave, or kick. -- Corrected formatting of documentation. - -## 1.3.1 -- 2013-08-06 - -### Changed - -- Project moved to [GitHub](https://github.com/AIE-Guild/GreenWall). -- All text documentation has been converted to Markdown and HTML. -- All URLs have been updated in the TOC. - -### Added - -- Guild configuration format documentation has been added. - -## 1.3.0 -- 2013-06-09 - -### Fixed - -- Fixed handling of a kick from a guild. -- Fixed variable names for input validation in GwStringHash(). - -### Changed - -- Simplified the unpacking of inter-guild messages. - -### Added - -- Added support for a newer, compact configuration format. - -## 1.2.7 -- 2013-02-27 - -### Changed - -- Updated TOC for WoW 5.2.0. - -## 1.2.6 -- 2012-12-04 - -### Changed - -- Updated TOC for WoW 5.1.0. - -## 1.2.5 -- 2012-09-01 - -### Fixed - -- Localized _ to avoid the taint issues with glyphs in 5.0.4. - -## 1.2.4 -- 2012-08-29 - -### Changed - -- Updated TOC for WoW 5.0.4. - -## 1.2.3 -- 2012-08-25 - -### Changed - -- Replaced the 32-bit string hash used to obfuscate channel names in the - debugging output with a standard CRC-16-CCITT implementation to avoid - overflow issues with `string.format()` in MoP. -- Made some changes to the debugging code to improve visibility into message - passing and replication. - -### Added - -- Added extra debugging information for current guild information. -- Added value checking for missing coguild ID in GwSendConfederationMsg(). - -## 1.2.2 -- 2012-11-12 - -### Fixed - -- Fixed officer chat bridging for the guild leader. - -## 1.2.1 -- 2011-11-29 - -### Changed - -- Updated TOC for WoW version 4.3. - -### Added - -- Added link to LemonKing's add-on in the documentation. -- Documented prequisites. - -## 1.2.0 -- 2011-11-26 - -### Fixed - -- Fixed unnecessary channel resets due to configuration reload. -- Fixed behavior during UI reload. -- Corrected join/leave handling. -- Corrected case statement for handling chat events. - -### Changed - -- Switched to [Semantic Versioning](http://semver.org/). -- Separated guild info parsing from the `GwRefreshComms()` function. -- Factored out some ugly flags. -- Cleaned up CLI configuration. -- Cleaned up debugging output. -- Cleaned up guild info handling. -- Parameterized all channel control functions. -- Masked all channel names and passwords in debugging output. - -### Added - -- Added officer chat support. -- Added message queuing. -- Added a GwIsOfficer() check to the officer chat configuration phase to - avoid pointless work. -- Added broadcast message type. -- Added broadcasts of guild join and leave events. -- Added broadcasts of promote and demote messages. -- Added hold-down for reconfiguration. -- Added broadcast receiver code. -- Added string hash to determine changes in text fields. -- Added error checking for officer note parsing failure. -- Added README.txt and GUILD_QUICKSTART.txt. - -### Removed - -- Removed channel protection code. -- Removed SHA1 library. - -## 1.1.07 -- 2011-06-28 - -### Changed - -- Updated TOC for WoW version 4.2. - -## 1.1.06 -- 2011-03-21 - -### Changed - -- Babel now disabled by default. - -## 1.1.05 -- 2011-03-21 - -### Changed - -- Moved scan of chat windows to chat message event handlers. -- Sorted clauses in the main event switch for legibility. - -### Added - -- Added `GwReplicateMessage()` function. -- Added RegisterAddonMessagePrefix call for 4.1 changes. -- Added Babel. - -## 1.1.04 -- 2011-01-15 - -### Changed - -- Minor updates for Curse packager. -- Cleaned up status display code. - -### Added - -- Added BSD-derived license. - -## 1.1.03 -- 2011-01-14 - -### Changed - -- Moved `GuildRoster` call to PLAYER_LOGIN handler. -- Limited conditions under which reinitialization occurred on - PLAYER_GUILD_UPDATE. -- Renamed `gwPlayerGuild` to `gwGuildName`. -- Cleaned up prep/refresh/join flow for connecting to the common channel. - -### Added - -- Added a delay mechanism to prevent hijacking of general channel. -- Added connection statistics gathering. -- Added LuaDoc data for functions and procedures. - -## 1.1.02 -- 2010-12-11 - -### Fixed - -- Fixed missing assignment of channel number on join. - -### Changed - -- Redacted sensitive data in the status output. - -### Added - -- Added hold-downs for join and configuration messages. -- Added a configuration flag to enable replication of achievement messages. -- Added frame identifier to Tx debug messages. -- Added help text with command listing. - -### Removed - -- Removed tabs from the source code! -- Removed event registration for channel leave events. -- Removed squelch message on reload flood. - -## 1.1.01 -- 2010-12-06 - -### Fixed - -- Fixed status output when no channel has been configured. - -### Added - -- Added co-guild tagging. - -## 1.1.00 -- 2010-12-05 - -### Added - -- Added announcement flag check for logout announcements. - -### Removed - -- Removed unused moderation release code. - -## 1.0.18 -- 2010-12-04 - -### Added - -- Added options line to configuration. - -## 1.0.17 -- 2010-12-04 - -### Fixed - -- Fixed SavedVariables processing. - -## 1.0.16 -- 2010-12-04 - -### Fixed - -- Removed moderator handling and switched to better handling of owner status. - -## 1.0.15 -- 2010-12-03 - -### Fixed - -- Removed faulty `tContains()` for `gwPeerTable` checks to stop - prolific kicking. - -## 1.0.14 -- 2010-12-03 - -### Fixed - -- Fixed missing argument to `GetGuildInfo()`. - -## 1.0.13 -- 2010-12-03 - -### Changed - -- Updated guild change/update handling. - -## 1.0.12 -- 2010-12-03 - -### Fixed - -- Fixed /who and channel join event processing. - -## 1.0.11 -- 2010-12-03 - -### Fixed - -- Limited handling of channel owner/moderator changes to the common channel. - -### Changed - -- Simplified and improved `GwIsConnected()`. - -### Added - -- Added a nil result check for the system message regex. -- Added gratuitous container officer response on channel join. -- Suspend confederation messages until container ID is known. -- Limit scope of the channel debugging. - -### Removed - -- Removed proactive channel leave before a join. - -## 1.0.10 -- 2010-11-22 - -### Changed - -- Rewrote guild lookups. - -### Added - -- Added extra slash commands. - -## 1.0.09 -- 2010-11-21 - -### Fixed - -- Missing negation in channel defense code. - -## 1.0.08 -- 2010-11-21 - -### Fixed - -- Corrected guild join handling. - -### Added - -- Added more debugging code. - -### Removed - -- Removed channel bans. - -## 1.0.07 -- 2010-11-17 - -### Fixed - -- Typos in variable names. - -## 1.0.06 -- 2010-11-13 - -### Added - -- Added online/offline notices. - -## 1.0.05 -- 2010-11-13 - -### Fixed - -- Fixed the placement and use of `GwLeaveChannel()`. - -### Changed - -- Changed container messaging system to generalize the request message type. - -## 1.0.04 -- 2010-11-13 - -### Fixed - -- Fixed container recognition in configuration processing. - -### Added - -- Added debugging output to slash command handling. - -## 1.0.03 -- 2010-11-12 - -### Changed - -- Changed configuration to support common configurations across co-guilds. -- Refactored configuration parsing. -- Cleaned up slash command handling. - -### Added - -- Added variable field to the saved variables. - -## 1.0.02 -- 2010-11-12 - -### Added - -- Added container IDs to channel messages to avoid duplicates within the - same co-guild. - -## 1.0.01 -- 2010-11-12 - -### Added - -- Brought back GUILD_ROSTER_UPDATE to get around the guild info loading delay. - -## 1.0.00 -- 2010-11-11 - -### Changed - -- Cleaned up debugging statements. - -### Added - -- Added moderator/owner status handling. -- Added kick/ban handling for interlopers. -- Added channel leave if player leaves the guild. -- Finished defensive ownership/moderation handling. -- Added handling for guild achievements. -- Added forced reload. - -### Removed - --Removed GUILD_ROSTER_UPDATE event handling. - -## 0.9.02 -- 2010-11-06 - -### Fixed - -- Fixed parsing of peer entries in configuration. - -### Changed - -- Expanded debugging code. - -### Removed - -- Removed slash command code, left stub. - -## 0.9.01 -- 2010-11-06 - -### Changed - -- Abstracted several functions. - -### Added - -- Added peer configuration entries. - -## 0.9.00 -- 2010-11-01 - -Initial commit. diff --git a/Libs/GreenWall/CONFIGURATION_FORMAT.md b/Libs/GreenWall/CONFIGURATION_FORMAT.md deleted file mode 100644 index dcf560af..00000000 --- a/Libs/GreenWall/CONFIGURATION_FORMAT.md +++ /dev/null @@ -1,147 +0,0 @@ - -Guild Configuration Format -========================== - - -This page documents the ugly details of GreenWall's configuration. Unless you have a large confederation and need to minimize the size of your configuration or you are trying to do something fancy, you probably want to read the Guild Quickstart guide (GUILD_QUICKSTART.md) instead. - -All configuration for general guild chat is stored in the "Guild Information" field in the "Guild" window (`J`). The block of configuration text will be read by GreenWall on the member machines. The benefit of this approach is that a member can join and use GreenWall without having to perform any special configuration. - - -Directive Format ----------------- - -All configuration directives use the following format. - - GWx:arglist - -Versions older than 1.3 use the following format. The older format is still supported after 1.3 for backwards compatibility. - - GW:x:arglist - -The `x` is substituted with a specific opcode and the `arglist` portion is a -colon separated list of arguments. - - -Required Directives -------------------- - -### Common Channel ### - -This specifies the custom chat channel to use for all general confederation bridging. - -Op Code: c - -Arguments: -- Channel Name -- Channel Password - -Example: - - GWc:topSekrit:E88l2S8qXq5m - - -### Peer Co-Guild ### - -You must specify one of these directives for each co-guild in the confederation, **including the co-guild you are configuring**. - -Op Code: p - -Arguments: -- Guild Name: The full name of the co-guild. This must match the name of the guild exactly, with the exception of *substitution variables*. -- Guild Tag (optional): A terse, unique identifier that will be shown if the member enables tagging. If this argument is not given the full co-guild name will be used. - -**The peer co-guild directives must be identical between all co-guild configurations after all variable substitution has been applied.** - -Example: - - GWp:Alea Iacta Est Fortuna:fortuna - - -Optional Directives -------------------- - -### Officer Channel ### - -This specifies the custom chat channel to use for officer chat confederation bridging. - -Op Code: a - -Arguments: -- Channel Name -- Channel Password - -Example: - - GWa:secretSquirrels:y7Gl5058j68f - - -### Substitution Variable ### - -This specifies a variable that will can be used in the *peer co-guild* directives to reduce the size of the configuration. - -Op Code: s - -Arguments: -- Value: A string that occurrences of the variable will be substituted with. -- Name: A single-character, case-sensitive name for the variable. - -If specified, any occurrence of a `$` character followed by the variable name will be substituted with the configured value. Since the `$` character is not allowed in the name of a guild, there is no escape sequence for the character. - -**The parser is single-pass, so the variable definition must precede the use of the variable in the configuration.** - -Example: - - GWs:Alea Iacta Est:n - GWp:$n Verendus:verendus - GWp:$n Salus:salus - - -### Minimum Version ### - -The minimum version of GreenWall that the guild management wishes to allow members to use. - -Op Code: *v* - -Arguments: -- Version: The minimum version allowed. - -Example: - - GWv:1.3.0 - - -### Channel Defense ### - -This option specifies the type of channel defense hat should be employed. - -**This feature is currently unimplemented.** - -Op Code: d - -Arguments: -- Mechanism: - - k = Kick unauthorized participants. - - kb = Kick and ban unauthorized participants. - -If left unspecified, no channel defense will be employed. - -Example: - - GWd:k - - -Deprecated Directives ---------------------- - -### Option ### - -This is the old format for specifying configuration options. - -Op Code: o - -Arguments: -- Key/Value Pair: A key and value in the format `key=value`. - -The value associated with the key `mv` will be interpreted as the *minimum version* and value associated with the key `cd` will be interpreted as the *channel defense* setting. - diff --git a/Libs/GreenWall/Channel.lua b/Libs/GreenWall/Channel.lua index cae0b8c6..dd010ecf 100644 --- a/Libs/GreenWall/Channel.lua +++ b/Libs/GreenWall/Channel.lua @@ -1,19 +1,14 @@ --[[----------------------------------------------------------------------- - The MIT License (MIT) - Copyright (c) 2010-2020 Mark Rogaski - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,13 +16,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --]]----------------------------------------------------------------------- --[[----------------------------------------------------------------------- - Imported Libraries - --]]----------------------------------------------------------------------- local crc = LibStub:GetLibrary("Hash:CRC:16ccitt-1.0") @@ -35,13 +27,12 @@ local base64 = LibStub:GetLibrary("Encoding:Hash:Base64BCA-1.0") --[[----------------------------------------------------------------------- - Class Variables - --]]----------------------------------------------------------------------- GwChannel = {} GwChannel.__index = GwChannel +hardcore_guild_member_dict = {} -- Tracks the most recent message received by someone on --- GwChannel constructor function. @@ -76,9 +67,7 @@ end --[[----------------------------------------------------------------------- - Channel Management Methods - --]]----------------------------------------------------------------------- --- Configure the channel. @@ -231,9 +220,7 @@ end --[[----------------------------------------------------------------------- - Informational Methods - --]]----------------------------------------------------------------------- --- Dump the channel status. @@ -248,9 +235,7 @@ end --[[----------------------------------------------------------------------- - Transmit Methods - --]]----------------------------------------------------------------------- --- Sends an encoded message on the shared channel. @@ -291,7 +276,14 @@ end function GwChannel:tl_send(type, message) local opcode if type == GW_MTYPE_CHAT then - opcode = 'C' + if hc_gw_lfgm_mode and hc_gw_lfgm_mode == true then + if (not message:match("lfg") and not message:match("lfm") and not message:match("LFG") and not message:match("LFM") and not message:match("lf ") and not message:match("LF ") and not message:match("LF%d") and not message:match("lf%d")) then + return + end + message = UnitLevel("player") .. "-" .. message + end + + opcode = 'C' elseif type == GW_MTYPE_BROADCAST then opcode = 'B' elseif type == GW_MTYPE_NOTICE then @@ -302,6 +294,8 @@ function GwChannel:tl_send(type, message) opcode = 'M' elseif type == GW_MTYPE_EXTERNAL then opcode = 'E' + elseif type == GW_MTYPE_HC_ANNOUNCEMENT then + opcode = 'H' else gw.Debug(GW_LOG_ERROR, 'unknown message type: %d', type) return @@ -313,6 +307,21 @@ function GwChannel:tl_send(type, message) -- Send the message self:tl_enqueue(segment) self:tl_flush() + + -- Format the message segment + if (Hardcore_Settings.rank_type and Hardcore_Settings.rank_type == "officer") then + local segment = strsub(strjoin('#', "L", gw.config.guild_id, '', ""), 1, GW_MAX_MESSAGE_LENGTH) + -- Send the message + self:tl_enqueue(segment) + self:tl_flush() + end + + if hc_gw_lfgm_mode and hc_gw_lfgm_mode == true then + local segment = strsub(strjoin('#', "W", gw.config.guild_id, '', ""), 1, GW_MAX_MESSAGE_LENGTH) + -- Send the message + self:tl_enqueue(segment) + self:tl_flush() + end end --- Add a segment to the channel transmit queue. @@ -368,9 +377,7 @@ end --[[----------------------------------------------------------------------- - Receive Methods - --]]----------------------------------------------------------------------- --- Handler for data received on a channel. @@ -390,7 +397,13 @@ function GwChannel:receive(f, ...) gw.APIDispatcher(addon, sender, guild_id, api_message) end end + elseif mtype == GW_MTYPE_HC_ANNOUNCEMENT then + local sender_short = string.split("-", sender) + message = "<" .. sender_short .. "> " .. message + Hardcore:Notify(message) elseif sender ~= gw.player and guild_id ~= gw.config.guild_id then + local sender_short = string.split("-", sender) + hardcore_guild_member_dict[guild_id] = sender_short -- Process the chat message if it from another co-guild. gw.Debug(GW_LOG_NOTICE, 'channel=%d, type=%d, sender=%s, guild=%s, message=%q', self.number, mtype, sender, guild_id, message) @@ -471,6 +484,10 @@ function GwChannel:tl_receive(...) type = GW_MTYPE_ADDON elseif opcode == 'E' then type = GW_MTYPE_EXTERNAL + elseif opcode == 'H' then + type = GW_MTYPE_HC_ANNOUNCEMENT + elseif opcode == 'W' then + type = GW_MTYPE_HC_WHISPER else gw.Debug(GW_LOG_WARNING, 'unknown segment opcode: %s', opcode) end diff --git a/Libs/GreenWall/Chat.lua b/Libs/GreenWall/Chat.lua index 84a85ef4..2b9d6231 100644 --- a/Libs/GreenWall/Chat.lua +++ b/Libs/GreenWall/Chat.lua @@ -1,19 +1,14 @@ --[[----------------------------------------------------------------------- - The MIT License (MIT) - Copyright (c) 2010-2020 Mark Rogaski - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,7 +16,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --]] ----------------------------------------------------------------------- local semver = LibStub:GetLibrary("SemanticVersion-1.0") @@ -111,6 +105,27 @@ function gw.ReplicateMessage(event, message, guild_id, arglist) if _G[frame] then gw.Debug(GW_LOG_DEBUG, 'frame=%s, event=%s, sender=%s, message=%q', frame, event, sender, message) + + for banned_tag, _ in pairs(gw_banned_tags) do + if message:match("<"..banned_tag..">") then + return + end + end + + if hc_gw_lfgm_mode and hc_gw_lfgm_mode == true then + if (not message:match("lfg") and not message:match("lfm") and not message:match("LFG") and not message:match("LFM") and not message:match("lf ") and not message:match("LF ") and not message:match("LF%d") and not message:match("lf%d")) then + return + end + local _level, filtered_message = strsplit("-", message, 2) + local _level = string.match(message, " (%d+)-") + if _level and filtered_message and tonumber(_level) then + if math.abs(tonumber(_level) - UnitLevel("player")) > 10 then + return + end + message = filtered_message + end + end + gw.ChatFrame_MessageEventHandler(_G[frame], 'CHAT_MSG_' .. event, message, sender, language, '', target, flags, 0, 0, '', 0, line, guid) end @@ -121,4 +136,3 @@ function gw.ReplicateMessage(event, message, guild_id, arglist) end end - diff --git a/Libs/GreenWall/Compat.lua b/Libs/GreenWall/Compat.lua index b4087024..f99e1be8 100644 --- a/Libs/GreenWall/Compat.lua +++ b/Libs/GreenWall/Compat.lua @@ -1,19 +1,14 @@ --[[----------------------------------------------------------------------- - The MIT License (MIT) - Copyright (c) 2010-2020 Mark Rogaski - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,13 +16,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --]]----------------------------------------------------------------------- --[[----------------------------------------------------------------------- - Workarounds for compatibility with other addons - --]]----------------------------------------------------------------------- -- @@ -39,22 +31,22 @@ gw.ChatFrame_MessageEventHandler = ChatFrame_MessageEventHandler -- Apply workarounds -- function gw.EnableCompatibility() - if C_AddOns.IsAddOnLoaded('Identity-2') or C_AddOns.IsAddOnLoaded('Identity') then + if IsAddOnLoaded('Identity-2') or IsAddOnLoaded('Identity') then -- Use Identity-2 for adding a chat identifier. gw.compatibility.identity = true gw.Debug(GW_LOG_NOTICE, 'Identity-2 compatibility enabled.') end - if C_AddOns.IsAddOnLoaded('Name2Chat') then + if IsAddOnLoaded('Name2Chat') then -- Use Name2Chat for adding a chat identifier. gw.compatibility.name2chat = true gw.Debug(GW_LOG_NOTICE, 'Name2Chat compatibility enabled.') end - if C_AddOns.IsAddOnLoaded('Incognito') then + if IsAddOnLoaded('Incognito') then -- Use Incognito for adding a chat identifier. gw.compatibility.incognito = true gw.Debug(GW_LOG_NOTICE, 'Incognito compatibility enabled.') end - if C_AddOns.IsAddOnLoaded('ElvUI') then + if IsAddOnLoaded('ElvUI') then -- Use ElvUI's event handler for sending messages to the chat windows local status, enabled = pcall(function() return ElvUI[1].private.chat.enable @@ -67,7 +59,7 @@ function gw.EnableCompatibility() end gw.Debug(GW_LOG_NOTICE, 'ElvUI compatibility enabled.') end - elseif C_AddOns.IsAddOnLoaded('Prat-3.0') then + elseif IsAddOnLoaded('Prat-3.0') then -- Use Prat's event handler for sending messages to the chat windows gw.compatibility.prat = true gw.ChatFrame_MessageEventHandler = function(...) diff --git a/Libs/GreenWall/Config.lua b/Libs/GreenWall/Config.lua index 0ede9e94..37c9e911 100644 --- a/Libs/GreenWall/Config.lua +++ b/Libs/GreenWall/Config.lua @@ -1,19 +1,14 @@ --[[----------------------------------------------------------------------- - The MIT License (MIT) - Copyright (c) 2010-2020 Mark Rogaski - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,29 +16,20 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---]]----------------------------------------------------------------------- - +--]] ----------------------------------------------------------------------- --[[----------------------------------------------------------------------- - Imported Libraries - ---]]----------------------------------------------------------------------- - +--]] ----------------------------------------------------------------------- local crc = LibStub:GetLibrary("Hash:CRC:16ccitt-1.0") local semver = LibStub:GetLibrary("SemanticVersion-1.0") - --[[----------------------------------------------------------------------- - Class Variables - ---]]----------------------------------------------------------------------- +--]] ----------------------------------------------------------------------- GwConfig = {} GwConfig.__index = GwConfig - --- GwConfig constructor function. -- @return An initialized GwConfig instance. function GwConfig:new() @@ -54,6 +40,12 @@ function GwConfig:new() return self end +gw_banned_tags = {} +hc_self_block_flag = false -- Used to denote that this guild should not send death notifications +hc_gw_lfgm_mode = false -- Used to denote that this guild should only send and receive lfg/m messages +hc_peer_guilds = {} + +hc_mute_inguild = 0 --- Initialize a GwConfig object with the default parameters. -- @return The initialized GwConfig instance. @@ -66,26 +58,24 @@ function GwConfig:initialize_param() return self end - --- Initialize a GwConfig object with the default state. -- @return The initialized GwConfig instance. function GwConfig:initialize_state() self.channel = { - guild = GwChannel:new(), - officer = GwChannel:new(), + guild = GwChannel:new(), + officer = GwChannel:new() } self.timer = { channel = GwHoldDown:new(gw.settings:get('joindelay')), - config = GwHoldDown:new(GW_TIMEOUT_CONFIG_HOLD), - reload = GwHoldDown:new(GW_TIMEOUT_RELOAD_HOLD), + config = GwHoldDown:new(GW_TIMEOUT_CONFIG_HOLD), + reload = GwHoldDown:new(GW_TIMEOUT_RELOAD_HOLD) } - self.comember_cache = GwHoldDownCache:new(GW_CACHE_COMEMBER_HOLD, - GW_CACHE_COMEMBER_SOFT_MAX, GW_CACHE_COMEMBER_HARD_MAX) + self.comember_cache = GwHoldDownCache:new(GW_CACHE_COMEMBER_HOLD, GW_CACHE_COMEMBER_SOFT_MAX, + GW_CACHE_COMEMBER_HARD_MAX) return self end - --- Dump configuration attributes. function GwConfig:dump(keep) local function dump_tier(t, level) @@ -129,19 +119,20 @@ function GwConfig:dump_status() end end - --- Parse the guild information page to gather configuration information. -- @return True if successful, false otherwise. function GwConfig:load() local function substitute(cstr, xlat) - local estr, count = string.gsub(cstr, '%$(%a)', function(s) return xlat[s] end) + local estr, count = string.gsub(cstr, '%$(%a)', function(s) + return xlat[s] + end) if count > 0 then gw.Debug(GW_LOG_DEBUG, "expanded '%s' to '%s'", cstr, estr) end return estr end - - local xlat = {} -- Translation table for string substitution. + + local xlat = {} -- Translation table for string substitution. -- Abort if current configuration is valid if self.valid then @@ -159,7 +150,7 @@ function GwConfig:load() end -- Abort if configuration is not yet available - local info = GetGuildInfoText() -- Guild information text. + local info = GetGuildInfoText() -- Guild information text. if info == '' then gw.Debug(GW_LOG_WARNING, 'guild configuration not available.') return false @@ -167,8 +158,6 @@ function GwConfig:load() gw.Debug(GW_LOG_INFO, 'parsing guild configuration.') - - -- Soft reset of configuration self:initialize_param() for k, channel in pairs(self.channel) do @@ -197,10 +186,10 @@ function GwConfig:load() if buffer ~= nil then self.cversion = 1 - + -- Groom configuration entries. local field = {} - for i, v in ipairs({ strsplit(':', buffer) }) do + for i, v in ipairs({strsplit(':', buffer)}) do field[i] = strtrim(v) end @@ -215,6 +204,7 @@ function GwConfig:load() elseif field[1] == 'p' then -- Peer guild local peer_name = gw.GlobalName(substitute(field[2], xlat)) + hc_peer_guilds[peer_name] = 1 local peer_id = substitute(field[3], xlat) if gw.iCmp(guild_name, peer_name) then self.guild_id = peer_id @@ -223,6 +213,16 @@ function GwConfig:load() self.peer[peer_id] = peer_name gw.Debug(GW_LOG_DEBUG, 'peer=%s (%s)', peer_name, peer_id); end + elseif field[1] == 'b' then + gw_banned_tags[field[2]] = 1 + elseif field[1] == 'd' then -- defense + hc_self_block_flag = true + elseif field[1] == 'r' then -- restricted mode; lfgm and death alerts only + hc_gw_lfgm_mode = true + elseif field[1] == 'i' then + if field[2] then + hc_mute_inguild = tonumber(field[2]) + end elseif field[1] == 's' then local key = field[3] local val = field[2] @@ -240,7 +240,7 @@ function GwConfig:load() end elseif field[1] == 'o' then -- Deprecated option list - local optlist = { strsplit(',', gsub(field[2], '%s+', '')) } + local optlist = {strsplit(',', gsub(field[2], '%s+', ''))} for i, opt in ipairs(optlist) do local key, val = strsplit('=', opt) key = strlower(key) @@ -283,7 +283,8 @@ function GwConfig:load() local cur = semver(gw.version) if min and cur then if cur < min then - gw.Error('Guild configuration specifies a minimum version of %s (%s currently installed).', tostring(min), tostring(cur)) + gw.Error('Guild configuration specifies a minimum version of %s (%s currently installed).', tostring(min), + tostring(cur)) end end @@ -303,17 +304,15 @@ function GwConfig:load() end - --- Initiate a reload of the configuration. -- @return True is refresh submitted, false otherwise. function GwConfig:reload() self.valid = false - C_GuildInfo.GuildRoster() + GuildRoster() gw.Debug(GW_LOG_INFO, 'roster update requested.') return true end - --- Initiate a refresh of the configuration. -- This is a reload protected by a hold-down timer. -- @return True is refresh submitted, false otherwise. @@ -326,7 +325,6 @@ function GwConfig:refresh() end end - --- Initiate a reset and reload of the configuration. -- This is a disruptive reset of the configuration and state. -- @return True is refresh submitted, false otherwise. @@ -338,7 +336,6 @@ function GwConfig:reset() return self:reload() end - --- Check a guild for peer status. -- @param guild The name of the guild to check. -- @return True if the target guild is a peer co-guild, false otherwise. @@ -351,7 +348,6 @@ function GwConfig:is_peer(guild) return false end - --- Refresh the channel state. function GwConfig:refresh_channels() if self.timer.channel:hold() then @@ -367,7 +363,6 @@ function GwConfig:refresh_channels() end end - --- Check a guild for membership within the confederation. -- @param guild The name of the guild to check. -- @return True if the target guild is in the confederation, false otherwise. @@ -378,4 +373,3 @@ function GwConfig:is_container(guild) return self:is_peer(guild) end end - diff --git a/Libs/GreenWall/Constants.lua b/Libs/GreenWall/Constants.lua index 698e8e76..91989c0b 100644 --- a/Libs/GreenWall/Constants.lua +++ b/Libs/GreenWall/Constants.lua @@ -1,19 +1,14 @@ --[[----------------------------------------------------------------------- - The MIT License (MIT) - Copyright (c) 2010-2020 Mark Rogaski - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,7 +16,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --]]----------------------------------------------------------------------- @@ -71,6 +65,8 @@ GW_MTYPE_RESPONSE = 5 GW_MTYPE_NOTICE = 6 GW_MTYPE_ADDON = 7 GW_MTYPE_EXTERNAL = 8 +GW_MTYPE_HC_ANNOUNCEMENT= 9 +GW_MTYPE_HC_WHISPER = 10 -- diff --git a/Libs/GreenWall/GUILD_QUICKSTART.md b/Libs/GreenWall/GUILD_QUICKSTART.md deleted file mode 100644 index bf5895a6..00000000 --- a/Libs/GreenWall/GUILD_QUICKSTART.md +++ /dev/null @@ -1,101 +0,0 @@ - -Guild Quickstart for GreenWall -============================== - - -Contents --------- - -1. Definitions -2. Bridging Guild Chat - - Required Configuration - - Optional Configuration - - Example -3. Bridging Officer Chat - - Configuration - - Example - - -Definitions ------------ - -Bridging -> Replication of chat events within one guild into the guild and officer chat channels of another guild. - -Confederation -> A large WoW guild that is partitioned into smaller guilds to comply with Blizzard's guild size limit. - -Container Guild or Co-Guild -> One of the component members of a guild confederation. - -Officer -> A member of any of the co-guilds within a confederation who can view officer notes for members. - - -Bridging Guild Chat -------------------- - -All configuration for general guild chat is stored in the "Guild Information" field in the "Guild" window (`J`). The block of configuration text will be read by GreenWall on the member machines. The benefit of this approach is that a member can join and use GreenWall without having to perform any special configuration. - -All configuration directives use the following format. - - GWx:arglist - -The *x* is substituted with a specific opcode and the *arglist* portion is a colon separated list of arguments. - -### Required Configuration ### - -#### Common Channel #### - - GWc:channel_name:password - -This specifies the custom chat channel to use for all general confederation bridging. - - -#### Peer Co-Guild #### - - GWp:guild_name:tag - -You must specify one of these directives for each co-guild in the confederation, **including the co-guild you are configuring**. - -Additionally, the "guild_name" must be match the name of the guild exactly and the tag (a short nickname that will be shown if the member enables tagging) must be the same in all of the configurations across the co-guilds. - - -### Optional Configuration ### - -#### Minimum Version #### - - GWv:x.y.z - -This disables the GreenWall client if the member is running a version prior to version x.y.z. - - -### Example ### - - GWc:topSekritChan:pencil - GWv:1.6.0 - GWp:Darkmoon Clan:DMC - GWp:Baseball Dandies:BBD - GWp:Nightlife:NL - - -Bridging Officer Chat ---------------------- - -### Configuration ### - -There is only a single configuration directive for officer chat. It is stored in the officer note of the guild leader. - - GWa:channel_name:password - -This specifies the custom chat channel to use for bridging of the officer chat among co-guilds. - -By default, officer chat bridging is disabled in the client. To participate across co-guilds, an officer will need to issue the following command and make sure that officer chat is enabled in one of the chat windows. - - /greenwall ochat on - - -### Example ### - - GWa:secretSquirrels:rosebud - diff --git a/Libs/GreenWall/Globals.lua b/Libs/GreenWall/Globals.lua index 012902d8..ef23cce6 100644 --- a/Libs/GreenWall/Globals.lua +++ b/Libs/GreenWall/Globals.lua @@ -1,19 +1,14 @@ --[[----------------------------------------------------------------------- - The MIT License (MIT) - Copyright (c) 2010-2020 Mark Rogaski - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,13 +16,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --]] ----------------------------------------------------------------------- --[[----------------------------------------------------------------------- - Global Variables - --]] ----------------------------------------------------------------------- -- @@ -39,7 +31,7 @@ gw = { api_table = {}, compatibility = { identity = false, name2chat = false, incognito = false, elvui = false, prat = false, }, } -gw.version = C_AddOns.GetAddOnMetadata('GreenWall', 'Version') +gw.version = GetAddOnMetadata('Hardcore', 'Version') gw.realm = GetRealmName() gw.player = UnitName('player') .. '-' .. gw.realm:gsub("%s+", "") gw.guild_status = '' @@ -53,13 +45,9 @@ gw.build = { } gw.usage = [[ - Usage: - - /greenwall or /gw - + /hardcore_greenwall or /hc_gw Commands: - help -- Print this message. version @@ -88,6 +76,5 @@ gw.usage = [[ -- Toggle output logging to the GreenWall.lua file. logsize -- Specify the maximum number of log entries to keep. - ]] diff --git a/Libs/GreenWall/LICENSE b/Libs/GreenWall/GreenWall similarity index 86% rename from Libs/GreenWall/LICENSE rename to Libs/GreenWall/GreenWall index b72766e1..70299256 100644 --- a/Libs/GreenWall/LICENSE +++ b/Libs/GreenWall/GreenWall @@ -1,7 +1,6 @@ +The MIT License -The MIT License (MIT) - -Copyright (c) 2010-2024 Mark Rogaski +Copyright (c) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -10,14 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Libs/GreenWall/GreenWall.lua b/Libs/GreenWall/GreenWall.lua index 29a751ff..d2b70957 100644 --- a/Libs/GreenWall/GreenWall.lua +++ b/Libs/GreenWall/GreenWall.lua @@ -1,19 +1,14 @@ --[[ ----------------------------------------------------------------------- - The MIT License (MIT) - Copyright (c) 2010-2020 Mark Rogaski - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,13 +16,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --]] ----------------------------------------------------------------------- --[[ ----------------------------------------------------------------------- - Imported Libraries - --]] ----------------------------------------------------------------------- local semver = LibStub:GetLibrary("SemanticVersion-1.0") @@ -40,9 +32,7 @@ local _ --[[ ----------------------------------------------------------------------- - Slash Command Handler - --]] ----------------------------------------------------------------------- --- Update or display the value of a user settings variable. @@ -129,7 +119,7 @@ local function GwSlashCmd(message, editbox) elseif command == 'version' then - gw.Write('GreenWall version %s.', gw.version) + gw.Write('Hardcore: GreenWall version %s.', gw.version) gw.Write('World of Warcraft version %s, build %s (%s), interface %s.', gw.build['version'], gw.build['number'], gw.build['date'], gw.build['interface']) @@ -141,17 +131,15 @@ end --[[ ----------------------------------------------------------------------- - Initialization - --]] ----------------------------------------------------------------------- function GreenWall_OnLoad(self) -- -- Set up slash commands -- - SLASH_GREENWALL1 = '/greenwall' - SLASH_GREENWALL2 = '/gw' + SLASH_GREENWALL1 = '/hardcore_greenwall' + SLASH_GREENWALL2 = '/hc_gw' SlashCmdList['GREENWALL'] = GwSlashCmd -- @@ -174,7 +162,7 @@ function GreenWall_OnLoad(self) -- -- Add a tab to the Interface Options panel. -- - self.name = 'GreenWall' + self.name = 'Hardcore: GreenWall' self.refresh = function(self) GreenWallInterfaceFrame_OnShow(self) end @@ -187,21 +175,15 @@ function GreenWall_OnLoad(self) self.default = function(self) GreenWallInterfaceFrame_SetDefaults(self) end - if InterfaceOptions_AddCategory then - InterfaceOptions_AddCategory(self) - else - local category = Settings.RegisterCanvasLayoutCategory(self, self.name) - Settings.RegisterAddOnCategory(category) - end + InterfaceOptions_AddCategory(self) end --[[ ----------------------------------------------------------------------- - Hooks - --]] ----------------------------------------------------------------------- function GreenWall_ParseText(chat, send) + if _G.hardcore_disable_greenwall then return end if (send == 1) then local chatType = chat:GetAttribute('chatType') local message = chat:GetText() @@ -234,18 +216,17 @@ end hooksecurefunc("ChatEdit_ParseText", GreenWall_ParseText) --[[ ----------------------------------------------------------------------- - Frame Event Functions - --]] ----------------------------------------------------------------------- function GreenWall_OnEvent(self, event, ...) gw.Debug(GW_LOG_DEBUG, 'event occurred; event=%s', event) + if _G.hardcore_disable_greenwall then return end -- -- Addon loading check -- - if event == 'ADDON_LOADED' and select(1, ...) == 'GreenWall' then + if event == 'ADDON_LOADED' and select(1, ...) == 'Hardcore' then -- -- Initialize the saved variables @@ -411,7 +392,6 @@ end --[[ ----------------------------------------------------------------------- - END - --]] ----------------------------------------------------------------------- + diff --git a/Libs/GreenWall/GreenWall.toc b/Libs/GreenWall/GreenWall.toc deleted file mode 100644 index 22adbdf1..00000000 --- a/Libs/GreenWall/GreenWall.toc +++ /dev/null @@ -1,29 +0,0 @@ -## Interface: 110005 -## Title: GreenWall -## Notes: Common communication channel as a replacement for guild chat in guild confederations. -## Author: Mark Rogaski -## Version: 1.11.16 -## URL: https://github.com/AIE-Guild/GreenWall -## URL: https://www.curseforge.com/wow/addons/greenwall -## DefaultState: enabled -## SavedVariables: GreenWallAccount -## SavedVariablesPerCharacter: GreenWall,GreenWallMeta,GreenWallLog -## X-Category: Guild -## X-Date: 2024-10-24 - -Lib\Load.xml -Constants.lua -Globals.lua -Settings.lua -Utility.lua -HoldDown.lua -Config.lua -Compat.lua -Chat.lua -Channel.lua -SystemEventHandler.lua -API.lua -Interface.lua -GreenWall.lua -GreenWall.xml - diff --git a/Libs/GreenWall/GreenWall.xml b/Libs/GreenWall/GreenWall.xml index aed02efd..0d94fd3f 100644 --- a/Libs/GreenWall/GreenWall.xml +++ b/Libs/GreenWall/GreenWall.xml @@ -1,19 +1,14 @@ - @@ -113,7 +107,7 @@ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd"> - + diff --git a/Libs/GreenWall/HoldDown.lua b/Libs/GreenWall/HoldDown.lua index 02778146..9c8df3f5 100644 --- a/Libs/GreenWall/HoldDown.lua +++ b/Libs/GreenWall/HoldDown.lua @@ -1,19 +1,14 @@ --[[----------------------------------------------------------------------- - The MIT License (MIT) - Copyright (c) 2010-2020 Mark Rogaski - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,7 +16,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --]]----------------------------------------------------------------------- GwHoldDown = {} diff --git a/Libs/GreenWall/Interface.lua b/Libs/GreenWall/Interface.lua index 2e96dc89..f50913c7 100644 --- a/Libs/GreenWall/Interface.lua +++ b/Libs/GreenWall/Interface.lua @@ -1,19 +1,14 @@ --[[ ----------------------------------------------------------------------- - The MIT License (MIT) - Copyright (c) 2010-2020 Mark Rogaski - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,14 +16,11 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --]] ----------------------------------------------------------------------- --[[ ----------------------------------------------------------------------- - UI Handlers - --]] ----------------------------------------------------------------------- function GreenWallInterfaceFrame_LoadOptions(self, mode) @@ -105,3 +97,4 @@ function GreenWallInterfaceFrameOptionJoinDelay_OnValueChanged(self, value) end getglobal(self:GetName() .. "Text"):SetText(value) end + diff --git a/Libs/GreenWall/Lib/Load.xml b/Libs/GreenWall/Lib/Load.xml deleted file mode 100644 index 00721e1a..00000000 --- a/Libs/GreenWall/Lib/Load.xml +++ /dev/null @@ -1,6 +0,0 @@ - -