Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Makes the NTSL traffic console no longer save on pressing ENTER, replaces x.len with length(x) in the scripting module#22796

Merged
JamieD1 merged 2 commits intoyogstation13:masterfrom
Gboster-0:NTSL-my-beloved
Nov 10, 2024
Merged

Makes the NTSL traffic console no longer save on pressing ENTER, replaces x.len with length(x) in the scripting module#22796
JamieD1 merged 2 commits intoyogstation13:masterfrom
Gboster-0:NTSL-my-beloved

Conversation

@Gboster-0
Copy link
Contributor

Document the changes in your pull request

  • This PR makes a special class extending from TextArea that does not save when pressing ENTER for NTSL
  • Replaces X.len with length(X)

Why is this good for the game?

This PR makes a special class extending from TextArea that does not save when pressing ENTER for NTSL

  • This makes it so you will no longer get your text position thingy moved to the very last line of your code if you are holding down ENTER, alongside possibly reducing lag that'd come from pressing it.
  • Being jumped to the last line when holding down enter can be very annoying at times, so imo its gud.

Replaces X.len with length(X)

  • Apparently getting the var with length() is faster

Testing

Tested locally, maybe i'll add a video here later.

Changelog

🆑
tweak: Made the NTSL console's script input area no longer save when pressing ENTER
/:cl:

@Yogbot-13 Yogbot-13 added Javascript This PR contains javascript code. Tweak This PR contains changes to the game. labels Nov 8, 2024
@github-actions github-actions bot added the tgui This PR affects TGUI label Nov 8, 2024
Yogbot-13 added a commit that referenced this pull request Nov 8, 2024
@JohnFulpWillard
Copy link
Contributor

Apparently getting the var with length() is faster

I've seen it argued both ways, the difference is so small that it might as well not exist. The difference between them is that if it's not a list length will return 0 while Len will runtime, length is still better

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Javascript This PR contains javascript code. tgui This PR affects TGUI Tweak This PR contains changes to the game.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants