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

Add Operation to Subtract from Numbers #204

Closed
edwardrowe opened this issue Jun 3, 2019 · 0 comments
Closed

Add Operation to Subtract from Numbers #204

edwardrowe opened this issue Jun 3, 2019 · 0 comments
Labels
enhancement fixed in development The issue is fixed in the development branch

Comments

@edwardrowe
Copy link
Contributor

edwardrowe commented Jun 3, 2019

In Sparklite we had GameStrings that were numbered, and each had a corresponding numbered Dialog Node. Ex:

Game String: Pogo_Intro1, Pogo_Intro2, Pogo_Intro3
Dialogue Nodes: Pogo_Intro1 -> Pogo_Intro2 -> Pogo_Intro3

If I want to delete Intro1, I need to shift all the subsequent numbers up. This is a pain currently because the only way to do it in Mulligan is to "Remove Numbers" then "Count" again. Because of this, it's impossible to do in one operation, or else you'd end up with suffixes 1-4 instead of 1-2 and 1-2.

We could add an operation to subtract from numbers. It would use Regex to capture number sequences, and parse them to Ints. If it failed, they'd be ignored. Otherwise they'd be replaced by the same int minus some optional parameter.

This will require a new operation, a new operation drawer, and a new binding in the MulliganRenameWindow. It should also be tested.

Test Cases

  1. Strings have no numbers - no change
  2. Numbers Fail to parse - this shouldn't happen on files, but in theory could happen if the operation is used on raw strings for some reason. These should be ignored.
  3. Add 1 - adds one to all numbers
  4. Subtract 1 - subtracts one from all numbers
  5. Add 2 - adds two to all numbers
  6. Subtract 2 - subtracts two from all numbers

Verify it serializes and deserializes as a Preset and when opening and closing the window.

Suggested Naming for the Operation

Operation Name and Path:
Modify/Adjust Numbering

Inspector Configuration:
Add or Subtract: [int]

Relevant Files

@edwardrowe edwardrowe added enhancement good first issue A good issue to tackle for new contributors labels Jun 3, 2019
@edwardrowe edwardrowe added hacktoberfest and removed good first issue A good issue to tackle for new contributors hacktoberfest labels Oct 1, 2019
@edwardrowe edwardrowe added the fixed in development The issue is fixed in the development branch label Jan 6, 2020
edwardrowe added a commit that referenced this issue Mar 10, 2020
I also split out a couple functions that were easily generalized to be
used by all operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement fixed in development The issue is fixed in the development branch
Projects
None yet
Development

No branches or pull requests

1 participant