Skip to content

Commit

Permalink
v10.6.1 (#180)
Browse files Browse the repository at this point in the history
* Fixing sleeper and adding more monster abilities to ready and finish ability condition

* Bumping Trust version to 10.0.1

* Fixing issue with equipping automaton attachments

* Adding additional delay after removing attachments

* Adding manifest.json

* Bumping Trust version to 10.0.3

* Adding the Trust MSI

* Updating MSI

* Bumping Trust version to 10.0.5

* Bumping manifest version

* Update README.md

* Adding new C# installer

* Update README.md

* Update README.md

* Create README.md

* Adding README and TrustInstaller zip file

* Adding README

* Update README.md

* Updating the TrustInstaller.zip

* Updating TrustInstaller.zip

* Updating the TrustInstaller

* Bumping Trust Version to 10.0.9

* Adding support for Entrust + Indicolure in Gambit picker

* Adding check for extra song instrument while singing dummy songs

* Fixing singer view selection

* Update README.md

* Adding Bard song diagnostics

* Adding tags field to Gambit

* Adding support for no sub job

* Disabling sub job menu item when no sub job is present

* Bumping Trust version to 10.1.0

* PR feedback

* Adding Reactions menu item

* Updating default Red Mage trust settings

* Updating default widget positions

* Fixing false positive in Bard trust diagnostics

* PR feedback

* WIP of speed singing

* Getting rid of extra multiplier on Marcato duration

* Adding StepTracker and HasDazeCondition

* Adding Command Gambit ability

* Adding // trust sc mintp command

* Adding elemental resistances

* Collapsing debuffs section of target widget when there are no debuffs

* Target widget cleanup

* Clean up

* Moving turn to face mob out of action queue

* Adding new actions

* Adding GridLayout

* Showing and disabling spells and job abilities which are unavailable on sub job

* Adding more resistance data to monster families

* Adding shortcuts for menus and widgets

* Adding shortcut for gambits

* Adding shortcut for skillchains menu

* Fixing nil issue

* Fixing nil exception in SongTracker

* Fixing regression with Gambits

* Adding missing __eq function to RunTo and RunAway

* Disabling singing while moving

* Updating default Bard trust settings and fixing song editor to respect current mode

* Fixing nil issue with ConfigEditor

* Fixing more focus issues

* Bumping Trust version to 10.2.0

* PR feedback

* Updating deafult alter egos and pull targets

* Adding more pull targets

* Updating default widget positions

* Updating release notes

* Updating manifest

* Update create_release.yml

* Updating TrustInstaller

* Updating manifest.json

* Update README.md

* Update README.md

* Updating manifest.json

* Fixing singer regressions

* Disabling keyboard shortcuts while chat is open

* Adding rolls viwe

* Adding Geomancy view

* Fixing edge case with Shooter

* Adding separate queue for equipping automaton attachments

* Disabling AutoPetMode while equipping attachments

* Fixing issue where ManeuverMode would be overriden by settings

* Overhauled AutomatonSettingsMenuItem and added abilty to customize maneuvers

* Updating help text for maneuver menu.

* Updating ManeuverMode help text

* Removing res.items dependency on PUP job file

* PR feedback

* Adding TODO

* Fixing regression in SongSettingsMenuItem

* Bumping Trust version to 10.2.1

* Fixing merge issue in manifest.json

* Adding PetStatusWidget

* Adding AutomatonStatusWidget

* Updating PetMode on AutomatonStatusWidget when changing attachments

* Removing debug error

* Bumping Trust version to 10.2.2

* Updating AutomatonStatusWidget text formatting

* Fixing scrolling content offset with section header views

* Adding pet ability in AutomatonStatusWidget

* Updating default position for pet status widget

* Updating default attachment set for LightTank

* Re-enabling AutoFaceMobMode while singing because turn to face mob is no longer in action queue

* Fixing copy on GambitSettingsMenuItem reset button

* Adding Default and Gambits for Rune Fencer

* Adding PathWidget

* Adding TargetNameCondition

* Fixing nil exception in PathRecorder

* Fixing nil exception in PathRecorder

* Adding new IPC messages

* Fixing self targeting weapon skills and nil exception with job abilities

* Updating release notes for 10.3.0

* PR feedback

* Bumping Trust version to 10.3.1

* Adding autocomplete for Trust commands

* Resetting content offset of autocomplete when menu disappears

* Removing ActionBatchingMode

* Adding MigrationManager and migration to move Bard job settings under SongSettings key

* Updating default Bard job settings file

* Adding menu to pick pianissimo songs

* Refactoring commands into GeneralCommands and MenuCommands and adding settings.xml flag to disable autocomplete

* Showing command description in info bar

* PR feedback

* Fixing missing handle_stop issue

* Fixing issue where no pianissimo song is initially selected

* Adding pianissimo songs to SongSettingsEditor

* Updating description for AutoClarionCallMode

* Fixing issue reordering Pianissimo songs

* Adding Soul Voice as a conflicting buff for Marcato

* Updating release notes

* PR feedback

* Adding menu for editing the remote commands whitelist

* Update migration_v1.lua

* Fixing issue where Bard settings migration ran on all jobs

* PR feedback

* Fixing merge issue

* PR feedback

* Fixing issue where EarthSpirit would not be dismissed

* Fixing issue where BloodPactSettings default ability would not appear selected

* Adding Puller role if neither main nor sub job Trust can pull

* Clean up

* Fixing spell, job ability and weapon skill actions for JP players

* Fixing strategem actions for JP players

* PR feedback

* PR feedback

* Updating release notes

* Adding CombatSkillsCondition and updating Hasso to only be used with 2-handed weapons

* Fixing issue where pull distance can't be edited in the UI

* Bumping Trust version to 10.4.5

* Updating default Samurai job settings file

* Adding MagicBurstTrustCommands and NukeTrustCommands

* Adding NukeCommands

* Fixing issue where Scholar menu does not refresh when changing arts

* Bumping Trust version to 10.4.6

* Adding nil check in party mob update packet

* Updating release notes

* Adding MultiPickerConfigItem

* PR feedback

* Edge cases for Truster

* Fixing nil error

* Remove sleep debuff when attacking a monster

* Fixing issue with casting spell on dead enemy

* Adding JobCondition to match multiple jobs

* Fixing PLD Gambits

* Updating default Gambits for Dancer

* Adding Apururu to cylibs/res/trusts.lua

* Bumping Trust version to 10.4.8

* Filtering out Gambit ability targets if job has no abilities for that target type

* Fixing typo in EnemiesNearbyCondition

* Updating manifest.json

* Bumping Trust version to 10.4.9

* Fixing TargetNameCondition

* Bumping Trust version to 10.5.0

* PR feedback

* Adding Phalanx and Phalanx II to blacklist for Buff.new

* Adding more spells to Buff blacklist

* Updating default job settings for Red Mage

* Adding Reset button to Self and Party buff settings

* Updating default Red Mage job settings file

* Adding // trust set and // trust cycle commands to auto complete

* Converting TrustInfoBar to a MarqueeCollectionViewCell

* Cleanup

* Hiding status removal Blacklist for Red Mage

* Truncating skillchains

* Adding AutoCampMode

* Bumping Trust version to 10.5.2

* PR feedback

* Updating HealerSettingsMenuItem to use new ModeConfigEditor

* Adding friendly descriptions for AutoHealMode, AutoStatusRemovalMode and AutoDetectAuraMode

* Migrating modes menus to ModeConfigEditor

* Updating description for AutoGambitMode

* Fixing issue where GambitSettingsEditor reset when getting focus

* Showing full gambit description in info bar

* Bumping Trust version to 10.5.3

* PR feedback

* Updating is_moving

* Updating manifest.json

* Fixing typo

* Filtering out Gambits where ability is nil

* Updating SkillchainPropertyCondition to use MultiPickerConfigItem

* Updating manifest.json

* Adding replacements for AzureSets

* Fixing issue with Call Wyvern Gambit

* Fixing Nukes Config editor

* Updating // trust pull camp to work when main job doesn't have puller role

* PR feedback

* Nil fixes

* Fixing issue where setting storm II would evaluate to storm I

* Adding option to mirror AutoEngageMode and CombatMode when assisting

* Showing Pulling menu item in main job settings menu even if main job does not have puller role

* Bumping Trust version to 10.5.9

* PR feedback

* Updating get_spirit_for_day and adding avatar widget

* Bumping Trust version to 10.6.0

* Fixing remote commands and pull commands
  • Loading branch information
cyrite committed Sep 4, 2024
1 parent 480754f commit 1062f9d
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 25 deletions.
6 changes: 3 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 = '10.5.9'
_addon.version = '10.6.1'
_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 @@ -484,7 +484,7 @@ function check_version()
addon_settings:getSettings().version = _addon.version
addon_settings:saveSettings()

local Frame = require('cylibs/ui/views/frame')
--[[local Frame = require('cylibs/ui/views/frame')
local updateView = TrustMessageView.new("Version ".._addon.version, "What's new", _addon.release_notes, "Click here for full release notes.", Frame.new(0, 0, 500, 675))
Expand All @@ -496,7 +496,7 @@ function check_version()
hud:getViewStack():dismiss()
end)
hud:getViewStack():present(updateView)
hud:getViewStack():present(updateView)]]
end
end

Expand Down
23 changes: 3 additions & 20 deletions TrustRemoteCommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ local native_commands_whitelist = S{
'pcmd leader',
}

function TrustRemoteCommands.new(whitelist, commands)
function TrustRemoteCommands.new(whitelist, handle_addon_command)
local self = setmetatable({
whitelist = whitelist;
commands = commands;
handle_addon_command = handle_addon_command;
action_events = {}
}, TrustRemoteCommands)

Expand All @@ -27,7 +27,7 @@ function TrustRemoteCommands:on_init()
if not gm and self.whitelist:contains(sender) then
local args = string.split(message, ' ')
if args[1] == 'trust' then
self:handle_command(sender, args:slice(2))
windower.send_command('input // '..message)
elseif native_commands_whitelist:contains(message) then
self:handle_native_command(sender, message)
end
Expand All @@ -49,23 +49,6 @@ function TrustRemoteCommands:destroy()
end
end

function TrustRemoteCommands:handle_command(sender, args)
local cmd = args[1]
if cmd then
local params = ''
for _,v in ipairs(args) do
params = params..' '..tostring(v)
end
if self.commands:contains(cmd) or L{'cycle', 'set', 'assist', 'follow'}:contains(cmd) then
windower.send_command('input // trust '..params)

addon_message(209, 'Executing remote command from '..sender..': trust'..params)
else
error('Unknown remote command from '..sender..': trust'..params)
end
end
end

function TrustRemoteCommands:handle_native_command(sender, command)
if L{ 'pcmd add', 'pcmd kick', 'pcmd leader'}:contains(command) then
command = command .. " " .. sender
Expand Down
15 changes: 15 additions & 0 deletions commands/PullCommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,19 @@ function PullTrustCommands:handle_camp(_)
return success, message
end

-- // trust pull [auto, party, all]
function PullTrustCommands:handle_toggle_mode(mode_var_name, on_value, off_value)
local success = true
local message

local mode_var = get_state(mode_var_name)
if mode_var.value == on_value then
handle_set(mode_var_name, off_value)
else
handle_set(mode_var_name, on_value)
end

return success, message
end

return PullTrustCommands
14 changes: 14 additions & 0 deletions cylibs/entity/jobs/SMN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ end
-- Returns the name of the spirit pact that aligns with the current day.
-- @treturn string Localized name of the spirit pact (e.g. Earth Spirit)
function Summoner:get_spirit_for_current_day()
local day_to_spirit = T{
Firesday = 'Fire Spirit',
Earthsday = 'Earth Spirit',
Watersday = 'Water Spirit',
Windsday = 'Air Spirit',
Iceday = 'Ice Spirit',
Lightningday = 'Thunder Spirit',
Lightsday = 'Light Spirit',
Darksday = 'Dark Spirit'
}
local spirit_name = day_to_spirit[res.days[windower.ffxi.get_info().day].en]
if spell_util.knows_spell(res.spells:with('en', spirit_name).id) then
return spirit_name
end
return 'Earth Spirit'
end

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": "10.5.9",
"download_url": "https://github.com/cyritegamestudios/trust/releases/download/v10.5.9/trust.zip"
"version": "10.6.0",
"download_url": "https://github.com/cyritegamestudios/trust/archive/refs/heads/alpha.zip"
}
6 changes: 6 additions & 0 deletions ui/TrustHud.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local AlterEgoSettingsMenuItem = require('ui/settings/menus/AlterEgoSettingsMenuItem')
local AutomatonSettingsMenuItem = require('ui/settings/menus/attachments/AutomatonSettingsMenuItem')
local AvatarStatusWidget = require('ui/widgets/AvatarStatusWidget')
local BackgroundView = require('cylibs/ui/views/background/background_view')
local BlueMagicSettingsMenuItem = require('ui/settings/menus/bluemagic/BlueMagicSettingsMenuItem')
local BooleanConfigItem = require('ui/settings/editors/config/BooleanConfigItem')
Expand Down Expand Up @@ -238,6 +239,11 @@ function TrustHud:createWidgets(addon_settings, addon_enabled, action_queue, par
self.widgetManager:addWidget(petStatusWidget, "pet")
end

if player.main_job_name_short == 'SMN' then
local petStatusWidget = AvatarStatusWidget.new(Frame.new(0, 0, 125, 57), addon_settings, party:get_player(), self, main_trust_settings, state.MainTrustSettingsMode)
self.widgetManager:addWidget(petStatusWidget, "pet")
end

--local settingsWidget = SettingsWidget.new(Frame.new(0, 0, 125, 40), addon_settings, state.TrustMode, state.MainTrustSettingsMode)
--self.widgetManager:addWidget(settingsWidget, "settings")
end
Expand Down
200 changes: 200 additions & 0 deletions ui/widgets/AvatarStatusWidget.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
local Avatar = require('cylibs/entity/avatar')
local CollectionViewDataSource = require('cylibs/ui/collection_view/collection_view_data_source')
local Color = require('cylibs/ui/views/color')
local DisposeBag = require('cylibs/events/dispose_bag')
local IndexPath = require('cylibs/ui/collection_view/index_path')
local Padding = require('cylibs/ui/style/padding')
local TextCollectionViewCell = require('cylibs/ui/collection_view/cells/text_collection_view_cell')
local TextItem = require('cylibs/ui/collection_view/items/text_item')
local TextStyle = require('cylibs/ui/style/text_style')
local Timer = require('cylibs/util/timers/timer')
local VerticalFlowLayout = require('cylibs/ui/collection_view/layouts/vertical_flow_layout')
local Widget = require('ui/widgets/Widget')

local AvatarStatusWidget = setmetatable({}, {__index = Widget })
AvatarStatusWidget.__index = AvatarStatusWidget


AvatarStatusWidget.TextSmall = TextStyle.new(
Color.clear,
Color.clear,
"Arial",
9,
Color.white,
Color.lightGrey,
0,
0,
Color.clear,
false,
Color.yellow,
true
)
AvatarStatusWidget.TextSmall3 = TextStyle.new(
Color.clear,
Color.clear,
"Arial",
8,
Color.white,
Color.lightGrey,
0,
0,
Color.clear,
false,
Color.yellow,
false
)
AvatarStatusWidget.Subheadline = TextStyle.new(
Color.clear,
Color.clear,
"Arial",
8,
Color.white,
Color.lightGrey,
0,
0.5,
Color.black,
true,
Color.red
)

function AvatarStatusWidget.new(frame, addonSettings, player, trustHud, trustSettings, trustSettingsMode)
local dataSource = CollectionViewDataSource.new(function(item, indexPath)
if indexPath.section == 1 then
local cell = TextCollectionViewCell.new(item)
local itemSize = 13
cell:setItemSize(itemSize)
cell:setUserInteractionEnabled(indexPath.row == 3)
return cell
end
end)

local self = setmetatable(Widget.new(frame, "Pet", addonSettings, dataSource, VerticalFlowLayout.new(0, Padding.new(6, 4, 0, 0), 3), 10, true), AvatarStatusWidget)

self.addonSettings = addonSettings
self.id = player:get_id()
self.actionDisposeBag = DisposeBag.new()

self:getDataSource():addItem(TextItem.new("HP", AvatarStatusWidget.TextSmall), IndexPath.new(1, 1))
self:getDataSource():addItem(TextItem.new("TP", AvatarStatusWidget.TextSmall), IndexPath.new(1, 2))
self:getDataSource():addItem(TextItem.new(state.AutoAvatarMode.value, AvatarStatusWidget.TextSmall3), IndexPath.new(1, 3))
self:getDataSource():addItem(TextItem.new('Idle', AvatarStatusWidget.Subheadline), IndexPath.new(1, 4))

self:getDisposeBag():add(player:on_pet_change():addAction(
function (_, pet_id, pet_name)
self:updateAvatar(pet_id, pet_name)
end), player:on_pet_change())

self:getDisposeBag():add(WindowerEvents.PetUpdate:addAction(function(owner_id, pet_id, pet_index, pet_name, pet_hpp, pet_mpp, pet_tp)
if owner_id == self.id then
if pet_name and pet_id and windower.ffxi.get_mob_by_id(pet_id) then
self.isInitialized = true
self:setHpp(pet_hpp)
if pet_tp then
self:setTp(pet_tp)
end
self:setVisible(true)
else
self:setVisible(false)
end
self:layoutIfNeeded()
end
end), WindowerEvents.PetUpdate)

self:getDisposeBag():add(WindowerEvents.ZoneRequest:addAction(function(player_id, _, _, _)
if player_id == self.id then
self:setVisible(false)
self:layoutIfNeeded()
end
end), WindowerEvents.ZoneRequest)

self:getDisposeBag():add(self:getDelegate():didSelectItemAtIndexPath():addAction(function(indexPath)
self:getDelegate():deselectItemAtIndexPath(indexPath)

handle_cycle('AutoAvatarMode')

self:getDataSource():updateItem(TextItem.new(state.AutoAvatarMode.value, AvatarStatusWidget.TextSmall3), IndexPath.new(1, 3))

self:layoutIfNeeded()

--trustHud:openMenu(AutomatonSettingsMenuItem.new(trustSettings, trustSettingsMode))
end), self:getDelegate():didSelectItemAtIndexPath())

self:setAction('Idle')
self:setTp(0)

if pet_util.has_pet() then
self:updateAvatar(pet_util.get_pet().id, pet_util.get_pet().name)
end

self:setVisible(false)
self:setShouldRequestFocus(false)

self:setNeedsLayout()
self:layoutIfNeeded()

self:getDisposeBag():addAny(L{ self.actionDisposeBag })

return self
end

function AvatarStatusWidget:destroy()
Widget.destroy(self)
end

function AvatarStatusWidget:getSettings(addonSettings)
return addonSettings:getSettings().pet_widget
end

function AvatarStatusWidget:setVisible(visible)
if windower.ffxi.get_mob_by_target('pet') == nil or not self.isInitialized then
visible = false
end

if visible then
self:getDataSource():updateItem(TextItem.new(state.AutoAvatarMode.value, AvatarStatusWidget.TextSmall3), IndexPath.new(1, 3))
end

Widget.setVisible(self, visible)
end

function AvatarStatusWidget:updateAvatar(petId, petName)
if self.avatar then
self.avatar:destroy()
self.avatar = nil
end

if petId then
self.avatar = Avatar.new(petId, self.action_queue)
self.avatar:monitor()

--[[self:getDisposeBag():add(self.avatar:on_job_ability_finish():addAction(function(_, abilityName)
self.actionDisposeBag:destroy()
self:setAction(abilityName)
self.actionTimer = Timer.scheduledTimer(3, 3)
self.actionDisposeBag:add(self.actionTimer:onTimeChange():addAction(function(_)
self:setAction('Idle')
end), self.actionTimer:onTimeChange())
self.actionTimer:start()
self.actionDisposeBag:addAny(L{ self.actionTimer })
end), self.avatar:on_job_ability_finish())]]
end
end

function AvatarStatusWidget:setHpp(hpp)
self:getDataSource():updateItem(TextItem.new("HP "..hpp.."%", AvatarStatusWidget.TextSmall), IndexPath.new(1, 1))
end

function AvatarStatusWidget:setTp(tp)
self:getDataSource():updateItem(TextItem.new("TP "..tp, AvatarStatusWidget.TextSmall), IndexPath.new(1, 2))
end

function AvatarStatusWidget:setAction(abilityName)
self:getDataSource():updateItem(TextItem.new(abilityName, AvatarStatusWidget.Subheadline), IndexPath.new(1, 4))
end

return AvatarStatusWidget

0 comments on commit 1062f9d

Please sign in to comment.