Skip to content

jq#20

Merged
HastagGuigui merged 5 commits intoshellrhythm:mainfrom
jquast:jq
Mar 31, 2023
Merged

jq#20
HastagGuigui merged 5 commits intoshellrhythm:mainfrom
jquast:jq

Conversation

@jquast
Copy link
Copy Markdown
Contributor

@jquast jquast commented Mar 31, 2023

  • bugfix: 'displayedValues' missing for keyboard layout, fixes crash if you tried to change it
  • bugfix: add missing "key" for text notes, fixes crash if you tried to duplicate one
    • also, removed print(term.clear) when editing notes, I don't think it is necessary, fixes screen flashing
  • add HJKL, variants of hjkl that bump the characters 3 or 2 characters in the x and y direction
  • add shift+up/down/left/right, moves faster for selecting notes or viewing timeline or editing a color
  • convert utf-16 requirements.txt to utf-8/ascii

Comment thread src/editor.py Outdated
"align": align,
"offset": [0,0]
"offset": [0,0],
"key": None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To be fair I think having an unused "key" property might be a bad idea (as it'd just add more data to a chart and end up never being used), maybe changing the code that handles duplicate might be a better idea

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've changed the "d" key to only duplicate notes

Comment thread src/editor.py
calculatedPos = Game.calculatePosition(screenPos, 5, 3, term.width-10, term.height-11)
if val == "h":
# erase hitbox
if val in "hjklHJKL":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oh, interesting! again, didn't know that was a thing

Comment thread src/editor.py
if val.name == "KEY_RIGHT" and self.colorPickerSelectedCol < 3:
self.colorPickerColor[self.colorPickerSelectedCol] += 1
if val.name in ("KEY_RIGHT", "KEY_SRIGHT") and self.colorPickerSelectedCol < 3:
self.colorPickerColor[self.colorPickerSelectedCol] += {'KEY_RIGHT': 1, 'KEY_SRIGHT': 10}[val.name]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oooh, didn't know that {}[] was a thing!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's a pattern of "keying" into a dictionary, instead of using if statements.

if a == "1":
    result = "2"
elif a == "2":
    result = "3"
else:
   result = "4"

can be changed to,

result = {"1": 2", "2": "3"}.get(a, "4")

Comment thread src/editor.py
print_at(calculatedPos[0]-1, calculatedPos[1]+0, f"{term.normal} ")
print_at(calculatedPos[0]-1, calculatedPos[1]+1, f"{term.normal} ")
note["screenpos"][0] = min(round(note["screenpos"][0] + 1/(defaultSize[0]-1), 3), 1)
# calculate new x/y position
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah previously that section was kinda badly written, thanks for rewriting it in a clearer way-

Comment thread requirements.txt
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

tbf i actually did that already but i didn't commit it just yet

Comment thread index.py
displayedValues = [locales[loc]("lang") for loc in locales]
self.menuOptions[3]["populatedValues"] = localeNames
self.menuOptions[3]["displayedValues"] = displayedValues
self.menuOptions[7]["displayedValues"] = layoutNames
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oops, thanks-

@HastagGuigui
Copy link
Copy Markdown
Member

ill implement the actual text duplicate afterwards, seems all good to me, thanks!

@HastagGuigui HastagGuigui merged commit 08d34e5 into shellrhythm:main Mar 31, 2023
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.

2 participants