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 5 commits into
base: dev
Choose a base branch
from
Open

[gearswap] Update export.lua #2346

wants to merge 5 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

@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()

@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.

cairthenn and others added 5 commits February 2, 2025 12:58
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
Removed stray `log()`
Tweaked argument parsing.
Finalized displayed message.
Fixed markdown
Added the newer options for the `export` command.
@lili-ffxi lili-ffxi force-pushed the lili-gs-export-update branch from 830737c to a4d05d0 Compare February 2, 2025 14:04
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.

4 participants