Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
GreynArtestre committed Dec 23, 2023
2 parents 8c50661 + 51a7b64 commit badc7d6
Show file tree
Hide file tree
Showing 7 changed files with 641 additions and 14 deletions.
534 changes: 534 additions & 0 deletions class_configs/brd_class_config.lua

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions class_configs/shd_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,7 @@ return {
['Burn'] = 1,
},
},
['Config'] = {
['DefaultConfig'] = {
['Mode'] = 'Tank',
},


}
15 changes: 7 additions & 8 deletions class_configs/wiz_class_config.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
return {
['Modes'] = {
-- Shouldn't these be [1] = 'ModeName', ?
['Ice'] = 1,
['TLP'] = 1,
['NoOne'] = 1,
['Magic'] = 1,
},
['ItemSets'] = {
['Epic'] = {
Expand Down Expand Up @@ -552,7 +557,6 @@ return {
},

['Rotations'] = {

-- FIRE
['FIRE'] = {
['WIZ_DPS_MODEFIRE'] = 1,
Expand Down Expand Up @@ -591,12 +595,7 @@ return {

},

['Config'] = {
['Mode'] = {
[1] = 'MODEICE',
[2] = 'MODETLP',
[3] = 'MODENOONE',
[4] = 'MODEMAGIC',
},
['DefaultConfig'] = {
['Mode'] = 'Ice',
},
}
10 changes: 8 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ local function RGMercsGUI()
if shouldDrawGUI then
local pressed
ImGui.PushStyleColor(ImGuiCol.Text, 1.0, 1.0, 1.0, 1)
ImGui.Text("RGMercs running for " .. RGMercConfig.CurLoadedChar)
ImGui.Text(string.format("RGMercs running for %s (%s)", RGMercConfig.CurLoadedChar,
RGMercConfig.CurLoadedClass))

if ImGui.BeginTabBar("RGMercsTabs") then
ImGui.SetItemDefaultFocus()
Expand Down Expand Up @@ -118,7 +119,12 @@ local function Main()
RGMercConfig:LoadSettings()
end

RGMercModules:execAll("GiveTime")
local state = "Downtime"
if mq.TLO.XAssist.XTFullHaterCount() > 0 then
state = "Combat"
end

RGMercModules:execAll("GiveTime", state)
end

-- Global Messaging callback
Expand Down
85 changes: 85 additions & 0 deletions modules/shd.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
-- Sample Basic Class Module
local mq = require('mq')
local RGMercsLogger = require("rgmercs.utils.rgmercs_logger")
local RGMercUtils = require("rgmercs.utils.rgmercs_utils")
local shdClassConfig = require("rgmercs.class_configs.shd_class_config")
local Module = { _version = '0.1a', name = "ShadowKnight", author = 'Derple' }
Module.__index = Module

local function getConfigFileName()
local server = mq.TLO.EverQuest.Server()
server = server:gsub(" ", "")
return mq.configDir ..
'/rgmercs/PCConfigs/' .. Module.name .. "_" .. server .. "_" .. RGMercConfig.CurLoadedChar .. '.lua'
end

function Module:SaveSettings(doBroadcast)
mq.pickle(getConfigFileName(), self.settings)

if doBroadcast then
RGMercUtils.BroadcastUpdate(self.name, "SaveSettings")
end
end

function Module:LoadSettings()
RGMercsLogger.log("Basic Combat Module Loading Settings for: %s.", RGMercConfig.CurLoadedChar)
local settings_pickle_path = getConfigFileName()

local config, err = loadfile(settings_pickle_path)
if err or not config then
RGMercsLogger.log_error("\ay[Basic]: Unable to load global settings file(%s), creating a new one!",
settings_pickle_path)
self.settings = shdClassConfig.DefaultConfig
self:SaveSettings(true)
else
self.settings = config()
end
end

function Module.New()
-- Only load this module for SKs
if RGMercConfig.CurLoadedClass ~= "SHD" then return nil end

RGMercsLogger.log("ShadowKnight Combat Module Loaded.")
local newModule = setmetatable({ settings = {}, CombatState = "None" }, Module)

newModule:LoadSettings()

return newModule
end

local function renderSetting(k, v)
if type(v) == "table" then
ImGui.Text(k)
ImGui.Indent()
for ki, kv in pairs(v) do
renderSetting(ki, kv)
end
ImGui.Unindent()
else
ImGui.Text("%s => %s", k, v)
end
end

function Module:Render()
ImGui.Text("ShadowKnight Combat Modules")

if ImGui.CollapsingHeader("Current Settings") then
for k, v in pairs(self.settings) do
renderSetting(k, v)
end
end

ImGui.Text(string.format("Combat State: %s", self.CombatState))
end

function Module:GiveTime(combat_state)
-- Main Module logic goes here.
self.CombatState = combat_state
end

function Module:Shutdown()
RGMercsLogger.log("ShadowKnight Combat Module UnLoaded.")
end

return Module
4 changes: 4 additions & 0 deletions utils/rgmercs_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Config.__index = Config
Config.settings_pickle_path = mq.configDir .. '/rgmercs/' .. 'rgmercs.lua'
Config.settings = {}
Config.CurLoadedChar = mq.TLO.Me.CleanName()
Config.CurLoadedClass = mq.TLO.Me.Class.ShortName()

function Config:SaveSettings(doBroadcast)
mq.pickle(self.settings_pickle_path, self.settings)
Expand All @@ -17,6 +18,9 @@ function Config:SaveSettings(doBroadcast)
end

function Config:LoadSettings()
Config.CurLoadedChar = mq.TLO.Me.CleanName()
Config.CurLoadedClass = mq.TLO.Me.Class.ShortName()

RGMercsLogger.log("\ayLoading Main Settings for %s!", self.CurLoadedChar)

local config, err = loadfile(self.settings_pickle_path)
Expand Down
3 changes: 2 additions & 1 deletion utils/rgmercs_modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Modules.__index = Modules
function Modules.load()
local newModules = setmetatable({
modules = {
Basic = require("modules.basic").New()
Basic = require("modules.basic").New(),
SHD = require("modules.shd").New(),
}
}, Modules)

Expand Down

0 comments on commit badc7d6

Please sign in to comment.