Skip to content

Commit

Permalink
v12.5.3 (#263)
Browse files Browse the repository at this point in the history
* Fixing Mihli

* Adding InTownCondition and fixing issue where Puppetmaster tries to activate in town

* Bumping Trust version to 11.4.3

* Adding help text to modes editor notifying user that mode changes are ephemeral

* Changing AutoEnableMode to start in the Off state

* Fixing issue where Trusts would attempt to summon alter egos in town

* Adding the ability to blacklist party members for specific roles

* Adding ability to save mode changes to profile in the Modes menu

* Disabling Config button in party member menu when there are no valid roles

* PR feedback

* Automatically using Marcato with Song1

* Fixing issue where widget would stop dragging when moving the mouse too fast

* Adding more gambits to the library

* Updating default Red Mage job settings to use Distract III only

* Updating debuff to not return nil

* Adding ability to Pianissimo Ballad on the Bard itself

* Updating Bard Trust to support self pianissimo

* Adding song duration restoration after reload

* PR feedback

* Moving pull targets to PullSettings

* PR feedback

* PR feedback

* Adding cumulative magic effect tracker

* Hiding Black Mage widget when target is nil

* Adding job ability levels to res file extension for Samurai and Warrior

* Adding job ability levels to res file extension for Dark Knight

* Adding job ability levels to res file extension for White Mage, Scholar and Black Mage

* Adding job ability levels to res file extension for Corsair

* Adding job ability levels to res file extension for Monk

* Adding job ability levels to res file extension for Paladin

* Adding job ability levels to res file extension for Blue Mage

* Adding job ability levels to res file extension for Dragoon and Ranger

* Adding job ability levels to res file extension for Summoner, Beastmaster and Geomancer

* Adding job ability levels to res file extension for Rune Fencer

* Adding job ability levels to res file extension for Dancer

* Adding job ability levels to res file extension for Bard

* Bumping Trust version to v11.7.2

* Adding MountCommands

* Fixing to_action for BloodPactRage

* Adding check for available mounts

* Removing AutoTargetMode Party

* Disabling AutoTargetMode when assisting another player

* PR feedback

* Checking for updates inside Trust

* Fixing issue where auto completer would disappear when chat is open

* Increasing the width of the auto complete

* Adding ability to focus on the auto complete to select commands

* Bumping Trust version to 11.8.0

* Improving addon load time

* Fixing issue where aftermath Trust text would appear even when addon is off

* Making auto completer work for //trust and // trust

* PR feedback

* Adding ModeSettingsMenuItem to Weaponskills and Buffs menus

* Migrating all menus to ModeSettingsMenuItem

* Adding more gambits to the library

* Bumping Trust version to 11.8.2

* Fixing issue with modes menu shortcut

* Adding ZoneChangeCondition and upping max range for Ranged Attack to 24

* Fixing issue where Aurorastorm could not be used when Scholar is set to sub job

* Updating Scholar settings

* Removing AutoFood from default settings and adding sub job support to Profile Import and Share

* Fixing issue where Buff settings do not show up in Scholar menu without switching into Light Arts or Dark Arts

* Adding error message when Scholar trust is loaded without Light Arts or Dark Arts active

* Adding PlayerMenuItem that can send commands to all party members

* PR feedback

* Adding NukeSettings.GearswapCommand to override command when magic bursting

* PR feedback

* Improving speed of follow after zoning

* Removing debug code

* Fixing issue where party member wouldn't register immediately upon being added to party

* Fixing issue where party widget listed party members out of order

* Fixing more edge cases

* More fixes

* Adding range check to party buffs

* More follow optimizations

* PR feedback

* PR feedback

* Adding Aeonic and Empyrean weapons to Aftermather

* Adjusting magic burst window

* Fixing issue where SCH automatically goes into Dark Arts on addon load

* Adding migration for Scholar self buffs when set as sub job

* Bumping Trust version to v11.9.3

* Fixing issue where Trust would attempt to heal and remove status effects for party members out of range

* Adding Commands menu item

* Making command config editor work for more commands

* Adding support for Black Mage commands

* Fixing edge cases

* Adding default values for party member mp and mpp

* PR feedback

* Adding command description to auto complete widget

* Bumping Trust version to v12.0.1

* Adding relic weapon skills to aftermather

* Adding menu sounds

* Adding sounds to PartyStatusWidget and FFXIPickerView

* Bumping Trust version to 12.1.0

* Adding config to enable and disable sound effects

* Fixing Bard commands

* Adding ability to toggle job abilities and spell buffs

* Moving addon Config menu item and reducing flicker when opening Trust menu

* Fixing more flickering

* Disabling rapid playing of cursor sound while scrolling in a collection view

* Adding SoundCommands

* PR feedback

* Updating copy for profiles button

* Bumping Trust version to 12.1.1

* Fixing issue where unavailable spells and job abilities could be toggled on

* Fixing phantom cursor issue

* Enabling mode changes while singing and rolling

* Adding on_state_change trigger to cycle

* Bumping Trust version to 12.1.2

* Fixing issue with stale UI state

* Fixing phantom cursor issue

* Bumping Trust version to 12.1.3

* Fixing // trust sc build command editor

* PR feedback

* Performance optimizations for images and scrolling

* Lazy loading button backgrounds

* Bumping Trust version to 12.1.4

* More optimizations

* Updating job ability icon

* Major refactor for performance improvements to spell_util.get_spells

* PR feedback

* More fixes

* Fixing JP client issue with mounts

* Show widget title while in edit mode

* Adding RuneFencerWidget

* Updating default Ninja job settings

* Updating default Red Mage job settings

* Adding job to RNG

* Adding Thief job

* Updating aftermath buffs for relic WS

* Updating default gambits for Ranger

* Adding party member song preview

* Reworking song menu item

* Updating weapon skill ids for Aeneas

* PR feedback

* Clean up of song list preview

* Updating description for AutoDispelMode

* Fixing AM1 for Mythics

* Fixing blue spell list in gambit editor

* Updating Geomancy settings editor to new UI

* Moving Light Arts and Dark Arts to gambits

* PR feedback

* Fixing Attachment and Blue Magic set creation

* Making Approach pull action faster

* Adding icon extractor

* Moving JobAbilities to SelfBuffs

* Updating default job settings

* More fixes for JobAbilities migration

* Moving BST buffs to gambits

* Clean up

* Adding new gambits to the Gambit Library

* Fixing party buff menu item

* Bumping Trust version to 12.4.0

* PR feedback

* Fixing entrust

* Fixing MaxDistanceCondition for targets that zoned nearby

* Bumping Trust version to 12.4.1

* PR feedback

* Fixing focus issue with BuffSettingsEditor

* Adding descriptions for skillchain abilities and cure thersholds

* Bumping Trust version to v12.4.2

* Bumping Trust version to 12.4.3

* Copy updates

* Adding MagicBurstCommands to edit element blacklist

* Bumping Trust version to 12.4.4

* Removing player name prefix from path commands

* Fixing issue where alliance members were in the wrong party

* PR feedback

* Renaming assist command party to lock

* Bumping Trust version to 12.4.6

* PR feedback

* Adding left and right arrows to switch current party in party widget

* More alliance fixes

* Buffer refactor

* Adding translations

* Adding more translations

* More translations

* Starting picker view refactor

* More migration and fixing remote player editor

* More refactor

* More fixes

* More translations

* Adding settings to change langauge

* Fixing skills blacklist

* More fixes

* Fixing party widget to not refresh unnecessarily

* Do not truncate text in Japanese

* PR feedback

* Adding ignore_delay to on event healing

* Updating Trust version to v12.5.1

* PR feedback

* Using emergency cure threshold to trigger on event cures

* Making Puller switch target more frequently

* Decreasing duration for auto target check

* Fixing i18n issues

* Adding fallback translations

* PR feedback

* Adding ability to arrange widgets in menu

* Fixing logging settings menu item

* Adding delay to bind menu key after addon load

* Fixing issue changing languages

* Updating positions for widget menu item

* Adding BeginCastCondition

* PR feedback
  • Loading branch information
cyrite authored Nov 29, 2024
1 parent 65cf4fd commit 950b27e
Show file tree
Hide file tree
Showing 20 changed files with 212 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ trust.iml

# Other
scenarios
logs
1 change: 1 addition & 0 deletions Trust-Cylibs-Include.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Gambit = require('cylibs/gambits/gambit')

-- Conditions
Condition = require('cylibs/conditions/condition')
BeginCastCondition = require('cylibs/conditions/begin_cast')
CombatSkillsCondition = require('cylibs/conditions/combat_skills')
InBattleCondition = require('cylibs/conditions/in_battle')
IdleCondition = require('cylibs/conditions/idle')
Expand Down
8 changes: 5 additions & 3 deletions Trust.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_addon.author = 'Cyrite'
_addon.commands = {'Trust','trust'}
_addon.name = 'Trust'
_addon.version = '12.5.2'
_addon.version = '12.5.3'
_addon.release_notes = [[
This update introduces new menus for Bard, autocomplete for Trust
commands, new commands and important bug fixes for users running the
Expand Down Expand Up @@ -823,8 +823,10 @@ function loaded()
user_events.job_change = windower.register_event('job change', handle_job_change)
user_events.zone_change = windower.register_event('zone change', handle_zone_change)
end

windower.send_command('bind %s trust menu':format(addon_settings:getSettings().menu_key))

coroutine.schedule(function()
windower.send_command('bind %s trust menu':format(addon_settings:getSettings().menu_key))
end, 0.2)
end

windower.register_event('addon command', addon_command)
Expand Down
7 changes: 7 additions & 0 deletions cylibs/Cylibs-Windower-Events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ local incoming_event_dispatcher = {
if res.monster_abilities[act.targets[1].actions[1].param] then
WindowerEvents.Ability.Ready:trigger(act.actor_id, act.targets[1].actions[1].param)
end
elseif act.category == 8 then
if act.targets[1] and act.targets[1].actions[1] then
local spell_id = act.targets[1].actions[1].param
if res.spells[spell_id] then
WindowerEvents.Spell.Begin:trigger(act.actor_id, spell_id)
end
end
elseif act.category == 11 then
if res.monster_abilities[act.param] then
WindowerEvents.Ability.Finish:trigger(act.actor_id, act.param)
Expand Down
61 changes: 61 additions & 0 deletions cylibs/conditions/begin_cast.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---------------------------
-- Condition checking whether a target begins casting a spell.
-- @class module
-- @name BeginCastCondition
local PickerConfigItem = require('ui/settings/editors/config/PickerConfigItem')
local serializer_util = require('cylibs/util/serializer_util')

local Condition = require('cylibs/conditions/condition')
local BeginCastCondition = setmetatable({}, { __index = Condition })
BeginCastCondition.__index = BeginCastCondition
BeginCastCondition.__class = "BeginCastCondition"
BeginCastCondition.__type = "BeginCastCondition"

function BeginCastCondition.new(spell_name)
local self = setmetatable(Condition.new(), BeginCastCondition)
self.spell_name = spell_name or 'Stone'
return self
end

function BeginCastCondition:is_satisfied(target_index, spell_name)
local target = windower.ffxi.get_mob_by_index(target_index)
if target then
return self.spell_name == spell_name
end
return false
end

function BeginCastCondition:get_config_items()
local all_spell_names = res.spells:with_all('type', 'BlackMagic'):map(function(spell)
return spell.name
end)
all_spell_names = L(S(all_spell_names))
all_spell_names:sort()
return L{
PickerConfigItem.new('spell_name', self.spell_name, all_spell_names, function(spell_name)
return spell_name:gsub("^%l", string.upper)
end, "Spell") }
end

function BeginCastCondition:tostring()
return "Begins casting "..self.spell_name
end

function BeginCastCondition.description()
return "Begins casting a spell."
end

function BeginCastCondition.valid_targets()
return S{ Condition.TargetType.Ally }
end

function BeginCastCondition:serialize()
return "BeginCastCondition.new(" .. serializer_util.serialize_args(self.spell_name) .. ")"
end

function BeginCastCondition:__eq(otherItem)
return otherItem.__class == BeginCastCondition.__class
and self.spell_name == otherItem.spell_name
end

return BeginCastCondition
1 change: 1 addition & 0 deletions cylibs/conditions/condition.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ function Condition.defaultSerializableConditionClasses()
SkillchainStepCondition.__class,
InTownCondition.__class,
ZoneChangeCondition.__class,
BeginCastCondition.__class,
}
end

Expand Down
Empty file.
2 changes: 2 additions & 0 deletions cylibs/i18n/i18n.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ function i18n.set_current_locale(new_locale)
end
locale = new_locale

translations[new_locale] = require(translations_for_locales[new_locale])

i18n.onLocaleChanged():trigger(new_locale)
end

Expand Down
31 changes: 31 additions & 0 deletions cylibs/trust/roles/gambiter.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local list_ext = require('cylibs/util/extensions/lists')
local logger = require('cylibs/logger/logger')

local GambitTarget = require('cylibs/gambits/gambit_target')
Expand Down Expand Up @@ -75,6 +76,36 @@ function Gambiter:on_add()
end
end)

WindowerEvents.Spell.Begin:addAction(function(target_id, spell_id)
if spell_id == nil or self:get_party():get_party_member(target_id) == nil then
return
end

local valid_targets = L(BeginCastCondition.valid_targets():map(function(target_type)
return self:get_gambit_targets(target_type)
end)):flatten(false)
if not valid_targets:firstWhere(function(target)
return target:get_id() == target_id
end) then
return
end

local spell = res.spells[spell_id]
if spell then
logger.notice(self.__class, 'spell_begin', 'check_gambits', spell.en)
local gambits = self:get_all_gambits():filter(function(gambit)
for condition in gambit:getConditions():it() do
if condition.__type == BeginCastCondition.__type then
return true
end
return false
end
end)

self:check_gambits(L{ self:get_party():get_party_member(target_id) }, gambits, spell.en)
end
end)

WindowerEvents.GainDebuff:addAction(function(target_id, debuff_id)
local target = self:get_target()
if target and target:get_id() == target_id then
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "12.5.2",
"download_url": "https://github.com/cyritegamestudios/trust/releases/download/v12.5.2/trust.zip"
"version": "12.5.3",
"download_url": "https://github.com/cyritegamestudios/trust/archive/refs/heads/alpha.zip"
}
5 changes: 5 additions & 0 deletions scenarios/TrustScenarios.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ function TrustScenarios:add_scenario(name)
local scenario = Nyzul.new(self.action_queue, self.addon_settings, self.party, self.trust, hud.widgetManager)
self.scenarios:append(scenario)
self:start_scenario(scenario)
elseif name == 'sheol' then
local Sheol = require('scenarios/data/sheol/sheol')
local scenario = Sheol.new(self.action_queue, self.addon_settings, self.party, self.trust, hud.widgetManager)
self.scenarios:append(scenario)
self:start_scenario(scenario)
end
end
end
Expand Down
1 change: 1 addition & 0 deletions settings/TrustAddonSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ default.help.wiki_base_url = 'https://github.com/cyritegamestudios/trust/wiki'
default.logging = {}
default.logging.enabled = false
default.logging.logtofile = false
default.logging.filter_pattern = ''
default.menu_key = '%^numpad+'
default.autocomplete = {}
default.autocomplete.visible = true
Expand Down
2 changes: 2 additions & 0 deletions translations/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
return T{
["Button_Modes"] = {singular="Modes"},
["Button_Profiles"] = {singular="Profiles"},
["Button_Clear"] = {singular="Clear"},
["Button_Widget_Layout"] = {singular="Layout"},
}, {"singular", "plural"}
5 changes: 1 addition & 4 deletions ui/TrustHud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ function TrustHud:getMainMenuItem()
ButtonItem.default('Config', 18),
}, {
Profiles = LoadSettingsMenuItem.new(self.addon_settings, self.trustModeSettings, main_trust_settings, weapon_skill_settings, sub_trust_settings),
Config = ConfigSettingsMenuItem.new(self.addon_settings, self.mediaPlayer),
Config = ConfigSettingsMenuItem.new(self.addon_settings, self.mediaPlayer, self.widgetManager),
}, nil, "Jobs")

self.mainMenuItem = mainMenuItem
Expand Down Expand Up @@ -683,9 +683,6 @@ function TrustHud:getMenuItems(trust, trustSettings, trustSettingsMode, weaponSk
},
nil, "Help", "Get help using Trust.")

-- Config
local configSettingsItem = ConfigSettingsMenuItem.new(self.addon_settings, self.mediaPlayer)

-- Main
local mainMenuItem = MenuItem.new(L{
ButtonItem.default('Status', 18),
Expand Down
61 changes: 28 additions & 33 deletions ui/settings/menus/ConfigSettingsMenuItem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ local BooleanConfigItem = require('ui/settings/editors/config/BooleanConfigItem'
local ButtonItem = require('cylibs/ui/collection_view/items/button_item')
local ConfigEditor = require('ui/settings/editors/config/ConfigEditor')
local DisposeBag = require('cylibs/events/dispose_bag')
local FFXITextInputView = require('ui/themes/ffxi/FFXITextInputView')
local MenuItem = require('cylibs/ui/menu/menu_item')
local PickerConfigItem = require('ui/settings/editors/config/PickerConfigItem')
local RemoteCommandsSettingsMenuItem = require('ui/settings/menus/RemoteCommandsSettingsMenuItem')
local TextInputConfigItem = require('ui/settings/editors/config/TextInputConfigItem')
local WidgetSettingsMenuItem = require('ui/settings/menus/widgets/WidgetSettingsMenuItem')

local ConfigSettingsMenuItem = setmetatable({}, {__index = MenuItem })
ConfigSettingsMenuItem.__index = ConfigSettingsMenuItem

function ConfigSettingsMenuItem.new(addonSettings, mediaPlayer)
function ConfigSettingsMenuItem.new(addonSettings, mediaPlayer, widgetManager)
local self = setmetatable(MenuItem.new(L{
ButtonItem.default('Widgets', 18),
ButtonItem.default('Logging', 18),
Expand All @@ -23,7 +23,7 @@ function ConfigSettingsMenuItem.new(addonSettings, mediaPlayer)
self.disposeBag = DisposeBag.new()
self.mediaPlayer = mediaPlayer

self:reloadSettings(addonSettings)
self:reloadSettings(addonSettings, widgetManager)

return self
end
Expand All @@ -32,50 +32,45 @@ function ConfigSettingsMenuItem:destroy()
MenuItem.destroy(self)
end

function ConfigSettingsMenuItem:reloadSettings(addonSettings)
self:setChildMenuItem("Widgets", WidgetSettingsMenuItem.new(addonSettings))
function ConfigSettingsMenuItem:reloadSettings(addonSettings, widgetManager)
self:setChildMenuItem("Widgets", WidgetSettingsMenuItem.new(addonSettings, widgetManager))
self:setChildMenuItem("Logging", self:getLoggingMenuItem(addonSettings))
self:setChildMenuItem("Remote", RemoteCommandsSettingsMenuItem.new(addonSettings))
self:setChildMenuItem("Sounds", self:getSoundSettingsMenuItem(addonSettings))
self:setChildMenuItem("Language", self:getLanguageSettingsMenuItem(addonSettings))
end

function ConfigSettingsMenuItem:getLoggingMenuItem(addonSettings)
local filterMenuItem = MenuItem.new(L{
ButtonItem.default('Confirm'),
ButtonItem.default('Clear'),
}, {
Clear = MenuItem.action(function()
logger.filterPattern = nil
end, "Logging", "Clear log filter.")
}, function(menuArgs, infoView)
local setFilterView = FFXITextInputView.new('', "Log filter")
setFilterView:setTitle("Filter logs by pattern.")
setFilterView:setShouldRequestFocus(true)
setFilterView:onTextChanged():addAction(function(_, filterPattern)
if filterPattern:length() > 1 then
logger.filterPattern = filterPattern
end
end)
return setFilterView
end, "Logging", "Filter logs.")

local loggingMenuItem = MenuItem.new(L{
ButtonItem.default('Save'),
ButtonItem.default('Filter')
}, {
Save = MenuItem.action(function()
logger.isEnabled = addonSettings:getSettings().logging.enabled
_libs.logger.settings.logtofile = addonSettings:getSettings().logging.logtofile
end, "Logging", "Configure debug logging."),
Filter = filterMenuItem,
}, function(menuArgs)
ButtonItem.localized('Clear', i18n.translate('Button_Clear')),
}, {}, function(_, infoView)
local loggingSettings = addonSettings:getSettings()[("logging"):lower()]

local configItems = L{
BooleanConfigItem.new('enabled', "Enable Logging"),
BooleanConfigItem.new('logtofile', "Log to File"),
TextInputConfigItem.new('filter_pattern', loggingSettings.filter_pattern, "Filter Pattern"),
}
return ConfigEditor.new(addonSettings, addonSettings:getSettings()[("logging"):lower()], configItems)
local loggingSettingsEditor = ConfigEditor.new(addonSettings, addonSettings:getSettings()[("logging"):lower()], configItems, infoView)

self.disposeBag:add(loggingSettingsEditor:onConfigChanged():addAction(function(newSettings)
logger.isEnabled = addonSettings:getSettings().logging.enabled
logger.set_filter(newSettings.filter_pattern)

_libs.logger.settings.logtofile = addonSettings:getSettings().logging.logtofile
end), loggingSettingsEditor:onConfigChanged())

return loggingSettingsEditor
end, "Logging", "Configure debug logging.")

loggingMenuItem:setChildMenuItem("Clear", MenuItem.action(function(menu)
logger.set_filter('')
addonSettings:getSettings().logging.filter_pattern = ''
addonSettings:saveSettings(true)
menu:showMenu(loggingMenuItem)
end, "Logging", "Clear debug logging filters."))

return loggingMenuItem
end

Expand Down
1 change: 1 addition & 0 deletions ui/settings/menus/conditions/ConditionSettingsMenuItem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function ConditionSettingsMenuItem.new(trustSettings, trustSettingsMode, parentM
[SkillchainWindowCondition.__type] = "skillchain_window",
[SkillchainStepCondition.__type] = "skillchain_step",
[InTownCondition.__type] = "in_town",
[BeginCastCondition.__type] = "begin_cast",
}
self.conditionPickerItems = L(self.editableConditionClasses:keyset()):filter(function(c)
local conditionClass = self:getFileForCondition(c)
Expand Down
Loading

0 comments on commit 950b27e

Please sign in to comment.