Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gearswap] Update export.lua #2346

Open
wants to merge 1,537 commits into
base: dev
Choose a base branch
from
Open

[gearswap] Update export.lua #2346

wants to merge 1,537 commits into from

Conversation

lili-ffxi
Copy link
Contributor

Removed some code duplication and reordered some other code.

Added a new copy/clipboard flag, which makes GS export the table to clipboard instead of to a file.

INPUT NEEDED:
I also added two new flags, noaugments and onlyaugmented which respectively do:

  • noaugments/noaugs exports the set without recording the augments on each item. Useful if you mostly have single-path items so you don't get a spam of augments={'Path: A'} and such; or if you already have augmented items saved.
  • onlyaugmented/onlyaugs only exports items that have augments and ignores entirely non-augmented items. Useful if you need to make variables for your augmented gear, or in combination with the wearable flag to export all augmented items that your current job can equip, to make a new gearswap file, etc.

The issue I have is that I would like gearswap to print out a notice when provided one of these flags, but I can't come up with good ones myself 😄 input appreciated

RubenatorX and others added 30 commits April 9, 2022 12:19
Update to properly handle more valid commands
FindAll -- Allow for start/end pattern matching
…arsing

GearSwap: Expand party packet parsing
Don't know why she was commented out in the first place
[gearswap] Fix buff duration calculation in packet_parsing.lua
Added items to slips libs for the 10 May, 2022 FFXI Update.
[Slips lib] Update for May 2022
Trusts: Fix for player party member out-of-zone
z16 and others added 21 commits February 11, 2024 07:24
…e-filter

Libs/Resources: Amended behavior when filtering resources by an attribute
* Lib/Strings: Added encoding aware iteration

* Libs/Strings: Refactored string.it

* Lib/Strings: Fixes/cleanups
Bugfix in the new iterator
Updating new items for the slips lib
Adding Esoteric Athame and Eyre Cap to Storage slips 22
* Update send.lua

Adjust string processing to reinstate double quotes removed by the command processor.

* Update send.lua

* Update send.lua

Spaces after commas.

* Update send.lua

Fixed an oversight around the `<tid>` functionality.

* Update send.lua

Added toggle command for the debug functionality.

* Update send.lua

* Update send.lua

Rename dbg to debug
* Update send.lua

Extensive code revision
Added two new targets: @party and @zone

* Update send.lua

All commas are now properly married to a space each

* Update send.lua

Removed all trailing spaces
* Update send.lua

Initial refactoring by Arcon

* Update send.lua

Tentative fix for a couple quirks caused by splitting the `target` arg off `...`

* Update send.lua

Added obligatory `<on|off>` argument to `@debug`
Moved debug prints around for simplicity
Fixed bugs:
- a stray `:upper()` had survived the refactoring
- a `@job` target that was different from the sender main job would be lost in the void and not passed on

* Update send.lua
Removed some code duplication and reordered some other code.

Added a new `copy`/`clipboard` flag, which makes GS export the table to clipboard instead of to a file.

INPUT NEEDED:
I also added two new flags, `noaugments` and `onlyaugmented` which respectively do:
- `noaugments`/`noaugs` exports the set without recording the augments on each item (useful if you mostly have single-path items so you don't get a spam of `Path: A` and such; or if you already have augmented items saved)
- `onlyaugmented`/`onlyaugs` *only* exports items that have augments and ignores entirely non-augmented items (useful if you need to make variables for your augmented gear, or in combination with the `wearable` flag to export all augmented items that your current job can equip, to make a new gearswap file, etc)

The issue I have is that I would like gearswap to print out a notice when provided one of these flags, but I can't come up with good ones myself 😄 input appreciated
@lili-ffxi lili-ffxi requested review from z16 and Byrth April 5, 2024 19:23
function export_set(options)
local item_list = T{}
local targinv,all_items,minify,all_sets,use_job_in_filename,use_subjob_in_filename,overwrite_existing,named_file
local targinv,all_items,wearable,all_sets,noaugments,onlyaugmented,minify,clipboard
local use_job_in_filename,use_subjob_in_filename,overwrite_existing,named_file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is not your doing, but I would put these all on separate lines and initialize them with default values (false for most of them).

function export_set(options)
local item_list = T{}
local targinv,all_items,minify,all_sets,use_job_in_filename,use_subjob_in_filename,overwrite_existing,named_file
local targinv,all_items,wearable,all_sets,noaugments,onlyaugmented,minify,clipboard
local use_job_in_filename,use_subjob_in_filename,overwrite_existing,named_file
if #options > 0 then
for _,v in ipairs(options) do
if S{'inventory','inv','i'}:contains(v:lower()) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v is lowercased all the time. Define it once at the top and use that:

local option = v:lower()

Removed stray `log()`
Tweaked argument parsing.
Finalized displayed message.
Fixed markdown
Added the newer options for the `export` command.
Version bump
@lili-ffxi lili-ffxi changed the title Update export.lua [gearswap] Update export.lua Aug 21, 2024
@lili-ffxi
Copy link
Contributor Author

Still working on this, hopefully I can submit the new code soonTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.