Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Feb 24, 2024
2 parents 0d7c4e4 + 05995fe commit c0e4f25
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 49 deletions.
2 changes: 1 addition & 1 deletion class_configs/brd_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ local function generateSongList()
AddTankSongs()
AddMeleeDPSSongs()
else
RGMercsLogger.log_warning("Bard Mode not found! Adding DPS songs, but you should select a mode.")
RGMercsLogger.log_warn("Bard Mode not found! Adding DPS songs, but you should select a mode.")
AddMainGroupDPSSongs()
AddSelfDPSSongs()
AddRegenSongs()
Expand Down
17 changes: 5 additions & 12 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,15 @@ RGMercModules = require("utils.rgmercs_modules").load()
require('utils.rgmercs_datatypes')

-- ImGui Variables
local openGUI = true
local shouldDrawGUI = true
local notifyZoning = true
local curState = "Downtime"
local openGUI = true
local shouldDrawGUI = true
local notifyZoning = true
local curState = "Downtime"

-- Icon Rendering
local animItems = mq.FindTextureAnimation("A_DragItem")
local animBox = mq.FindTextureAnimation("A_RecessedBox")
local derpImg = mq.CreateTexture(mq.TLO.Lua.Dir() .. "/rgmercs/extras/derpdog_60.png")
local derpImg = mq.CreateTexture(mq.TLO.Lua.Dir() .. "/rgmercs/extras/derpdog_60.png")

-- Constants
local ICON_WIDTH = 40
local ICON_HEIGHT = 40
local COUNT_X_OFFSET = 39
local COUNT_Y_OFFSET = 23
local EQ_ICON_OFFSET = 500

-- UI --
local function renderModulesTabs()
Expand Down
4 changes: 2 additions & 2 deletions modules/class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ function Module:FindWorstHurtGroupMember(minHPs)

if healTarget and healTarget() and not healTarget.OtherZone() and not healTarget.Offline() then
if (healTarget.Class.ShortName() or "none"):lower() ~= "ber" then -- berzerkers have special handing
if healTarget.PctHPs() < worstPct then
if not healTarget.Dead() and healTarget.PctHPs() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s is the worst off.", healTarget.DisplayName())
worstPct = healTarget.PctHPs()
worstId = healTarget.ID()
Expand Down Expand Up @@ -455,7 +455,7 @@ function Module:FindWorstHurtXT(minHPs)

if healTarget and healTarget() and (healTarget.Type() or "none"):lower() == "pc" then
if healTarget.Class.ShortName():lower() ~= "ber" then -- berzerkers have special handing
if healTarget.PctHPs() < worstPct then
if not healTarget.Dead() and healTarget.PctHPs() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s is the worst off.", healTarget.DisplayName())
worstPct = healTarget.PctHPs()
worstId = healTarget.ID()
Expand Down
2 changes: 1 addition & 1 deletion modules/mez.lua
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ function Module:AEMezCheck()
if not aeMezSpell or not aeMezSpell() then return end

if not aeMezSpell.AERange() or aeMezSpell.AERange() == 0 then
RGMercsLogger.log_warning("\arWarning AE Mez Spell: %s has no AERange!", aeMezSpell.RankName.Name())
RGMercsLogger.log_warn("\arWarning AE Mez Spell: %s has no AERange!", aeMezSpell.RankName.Name())
end

-- Make sure the mobs of concern are within rang
Expand Down
14 changes: 7 additions & 7 deletions modules/movement.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function Module:ChaseOn(target)

RGMercsLogger.log_info("\ao Now Chasing \ag %s", chaseTarget.CleanName())
else
RGMercsLogger.log_warning("\ayWarning:\ax Not a valid chase target!")
RGMercsLogger.log_warn("\ayWarning:\ax Not a valid chase target!")
end
end

Expand All @@ -152,7 +152,7 @@ function Module:ChaseOff()
self.settings.ChaseOn = false
self.settings.ChaseTarget = nil
self:SaveSettings(false)
RGMercsLogger.log_warning("\ayNo longer chasing \at%s\ay.", self.settings.ChaseTarget or "None")
RGMercsLogger.log_warn("\ayNo longer chasing \at%s\ay.", self.settings.ChaseTarget or "None")
end

function Module:CampOn()
Expand Down Expand Up @@ -390,7 +390,7 @@ end

function Module:Go2GGH()
if not mq.TLO.Me.GuildID() or mq.TLO.Me.GuildID() == 0 then
RGMercsLogger.log_warning("\awNOTICE:\ax You're not in a guild!")
RGMercsLogger.log_warn("\awNOTICE:\ax You're not in a guild!")
return
end
self.TempSettings.Go2GGH = 1
Expand All @@ -402,7 +402,7 @@ end

function Module:GiveTime(combat_state)
if mq.TLO.Me.Hovering() and self.settings.ChaseOn then
RGMercsLogger.log_warning("\awNOTICE:\ax You're dead. I'm not chasing \am%s\ax anymore.",
RGMercsLogger.log_warn("\awNOTICE:\ax You're dead. I'm not chasing \am%s\ax anymore.",
self.settings.ChaseTarget)
self.settings.ChaseOn = false
self:SaveSettings()
Expand All @@ -413,7 +413,7 @@ function Module:GiveTime(combat_state)
if self.TempSettings.Go2GGH == 1 then
if not self.Constants.GGHZones:contains(mq.TLO.Zone.ShortName():lower()) then
if not RGMercUtils.UseOrigin() then
RGMercsLogger.log_warning("\awNOTICE:\ax Go2GGH Failed.")
RGMercsLogger.log_warn("\awNOTICE:\ax Go2GGH Failed.")
self.TempSettings.Go2GGH = 0
else
self.TempSettings.Go2GGH = 2
Expand Down Expand Up @@ -467,14 +467,14 @@ function Module:GiveTime(combat_state)

if self.settings.ChaseOn and not self.settings.ChaseTarget then
self.settings.ChaseOn = false
RGMercsLogger.log_warning("\awNOTICE:\ax \ayChase Target is invalid. Turning Chase Off!")
RGMercsLogger.log_warn("\awNOTICE:\ax \ayChase Target is invalid. Turning Chase Off!")
end

if self.settings.ChaseOn and self.settings.ChaseTarget then
local chaseSpawn = mq.TLO.Spawn("pc =" .. self.settings.ChaseTarget)

if not chaseSpawn or chaseSpawn.Dead() or not chaseSpawn.ID() then
RGMercsLogger.log_warning("\awNOTICE:\ax Chase Target \am%s\ax is dead or not found in zone - Pausing...",
RGMercsLogger.log_warn("\awNOTICE:\ax Chase Target \am%s\ax is dead or not found in zone - Pausing...",
self.settings.ChaseTarget)
return
end
Expand Down
2 changes: 1 addition & 1 deletion modules/pull.lua
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ function Module:NavToWaypoint(loc, ignoreAggro)
end

if mq.TLO.Navigation.Velocity() == 0 then
RGMercsLogger.log_warning("NavToWaypoint Velocity is 0 - Are we stuck?")
RGMercsLogger.log_warn("NavToWaypoint Velocity is 0 - Are we stuck?")
if mq.TLO.Navigation.Paused() then
RGMercUtils.DoCmd("/nav pause log=off")
end
Expand Down
2 changes: 1 addition & 1 deletion utils/rgmercs_binds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Bind.MainHandler = function(cmd, ...)
for _, r in pairs(results) do processed = processed or r end

if not processed then
RGMercsLogger.log_warning("\ayWarning:\ay '\at%s\ay' is not a valid command", cmd)
RGMercsLogger.log_warn("\ayWarning:\ay '\at%s\ay' is not a valid command", cmd)
end
end

Expand Down
30 changes: 8 additions & 22 deletions utils/rgmercs_logger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,15 @@ local function log(logLevel, output, ...)
printf('%s\aw:%s\aw(%s\aw)%s \ax%s', logLeaderStart, logLevels[logLevel].header, callerTracer, logLeaderEnd, output)
end


function actions.log_error(output, ...)
log('error', output, ...)
end

function actions.log_warning(output, ...)
log('warn', output, ...)
end

function actions.log_info(output, ...)
log('info', output, ...)
end

function actions.log_debug(output, ...)
log('debug', output, ...)
end

function actions.log_verbose(output, ...)
log('verbose', output, ...)
function actions.GenerateShortcuts()
for level, _ in pairs(logLevels) do
--- @diagnostic disable-next-line
actions["log_" .. level:lower()] = function(output, ...)
log(level, output, ...)
end
end
end

function actions.log_super_verbose(output, ...)
log('super_verbose', output, ...)
end
actions.GenerateShortcuts()

return actions
4 changes: 2 additions & 2 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function Utils.ClearTarget()
end

function Utils.HandleDeath()
RGMercsLogger.log_warning("You are sleeping with the fishes.")
RGMercsLogger.log_warn("You are sleeping with the fishes.")

Utils.ClearTarget()

Expand Down Expand Up @@ -2073,7 +2073,7 @@ function Utils.MercEngage()
end

function Utils.KillPCPet()
RGMercsLogger.log_warning("\arKilling your pet!")
RGMercsLogger.log_warn("\arKilling your pet!")
local problemPetOwner = mq.TLO.Spawn(string.format("id %d", mq.TLO.Me.XTarget(1).ID())).Master.CleanName()

Utils.DoCmd("/dexecute %s /pet leave", problemPetOwner)
Expand Down

0 comments on commit c0e4f25

Please sign in to comment.