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

keybind: Add /bind keybinding command #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

keybind: Add /bind keybinding command #47

wants to merge 2 commits into from

Conversation

dracc
Copy link
Owner

@dracc dracc commented Feb 27, 2019

Closes #15

Still untested.
I've tested this a bit, found a couple of bugs, fixed those and am now happy with the function of the script.

scripts/module/keybinder.nut Outdated Show resolved Hide resolved
scripts/module/keybinder.nut Outdated Show resolved Hide resolved
scripts/module/keybinder.nut Outdated Show resolved Hide resolved
firstSpace = input.len()-1;
} else {
ret[1] = input.slice(firstSpace+1);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't this return ["foo", null] for "foo" with "bar" separator? Why not ["foo", ""] to keep away edge cases?

Copy link
Owner Author

Choose a reason for hiding this comment

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

You are right. My trail of thought was that the used functions return null when unsuccessful and it felt to me like the most intuitive way to go would be to continue with that tradition.

@dracc dracc changed the title keybind: Add /b keybinding command keybind: Add /bind keybinding command Mar 1, 2019
Copy link
Owner Author

@dracc dracc left a comment

Choose a reason for hiding this comment

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

Client side version untested.
Edit: I've given it a go, taken care of some bugs and now it works as expected.

scripts/module/keybinder.nut Outdated Show resolved Hide resolved
scripts/module/keybinder.nut Outdated Show resolved Hide resolved
scripts/module/keybinder.nut Outdated Show resolved Hide resolved
@dracc
Copy link
Owner Author

dracc commented Mar 3, 2019

I'd say that this is ready for merge as soon as I've squashed the commits.

Store a table server- and client-side per session
Send commands from client keybind over socket to server
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.

Create bind script
2 participants