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 multiple prefix support and adds ; as a prefix. #1841

Merged
merged 14 commits into from
Jan 27, 2025

Conversation

SuperCater
Copy link
Contributor

This simply adds the ability for commands to take multiple prefixes, I added ; and : as the default prefixes. This removes the need for #1829

Known "issues":

  1. The first prefix is the one that shows up in autocomplete, the others are ignored and won't show up.
  2. You can no longer change prefixes in the user panel

POF

@WalkerOfBacon
Copy link
Contributor

Can this still allow you to add a single prefix if needed?

@SuperCater
Copy link
Contributor Author

dont merge yet found an issue i need to quickly fix

@WalkerOfBacon
Copy link
Contributor

Can this still allow you to add a single prefix if needed?

As a string*

@SuperCater
Copy link
Contributor Author

Can this still allow you to add a single prefix if needed?

Yep still supports taking a string as the Prefix for backwards compatibility

@SuperCater
Copy link
Contributor Author

dont merge yet found an issue i need to quickly fix

"foxed" it

@SuperCater
Copy link
Contributor Author

okay yeah dont merge this im stupid and found a couple of issues i need to fix 👍

@WalkerOfBacon
Copy link
Contributor

draft!!

@SuperCater SuperCater marked this pull request as draft January 26, 2025 19:15
@SuperCater
Copy link
Contributor Author

Okay made it so server.Settings.Prefix will return the first prefix if using the concat operator, this should fix a couple issues with it.

@SuperCater
Copy link
Contributor Author

Alright all commands have been updated to work with the new system, will check out the plugins and cores now

@WalkerOfBacon
Copy link
Contributor

there should also be an urgent message regarding these changes also

@SuperCater
Copy link
Contributor Author

there should also be an urgent message regarding these changes also

Who should it notify? Moderators+ ?

@SuperCater
Copy link
Contributor Author

btw i used some metatable magic so that it shouldn't break old plugins

I made it so __tostring and __concat return the first prefix in the table, only thing that will break is if you use the length operator or directly reference it

@WalkerOfBacon
Copy link
Contributor

Who should it notify? Moderators+ ?

Creator+

@SuperCater
Copy link
Contributor Author

Who should it notify? Moderators+ ?

Creator+

@Dimenpsyonal do you think we should do this?

@SuperCater SuperCater marked this pull request as ready for review January 26, 2025 19:52
@Dimenpsyonal
Copy link
Member

btw i used some metatable magic so that it shouldn't break old plugins

I made it so __tostring and __concat return the first prefix in the table, only thing that will break is if you use the length operator or directly reference it

How do you people even come up with stuff like this

@SuperCater
Copy link
Contributor Author

Alright I'm pretty sure i've fixed everything, only thing i haven't checked are all the UI modules and frankly im far too lazy to, i tested it most of the important things matter and any remaining bugs shouldn't be too hard to fix if they do pop up

@Dimenpsyonal
Copy link
Member

Lint failed

@SuperCater
Copy link
Contributor Author

btw i used some metatable magic so that it shouldn't break old plugins
I made it so __tostring and __concat return the first prefix in the table, only thing that will break is if you use the length operator or directly reference it

How do you people even come up with stuff like this

wasn't too difficult, added this line of code in the server load process

		if type(server.Settings.Prefix) == "table" then
			setmetatable(server.Settings.Prefix, {
				__concat = function(self, value)
					return self[1]
				end,
				__tostring = function(self)
					return self[1]
				end,

			})
		end

@Dimenpsyonal
Copy link
Member

Fascinating

@PurpleCreativity
Copy link
Contributor

Alright I'm pretty sure i've fixed everything, only thing i haven't checked are all the UI modules and frankly im far too lazy to, i tested it most of the important things matter and any remaining bugs shouldn't be too hard to fix if they do pop up

famous last words
2025-01-26-20-55-12880

@SuperCater
Copy link
Contributor Author

SuperCater commented Jan 26, 2025

Alright I'm pretty sure i've fixed everything, only thing i haven't checked are all the UI modules and frankly im far too lazy to, i tested it most of the important things matter and any remaining bugs shouldn't be too hard to fix if they do pop up

famous last words 2025-01-26-20-55-12880

no doubt there are more issues present since this changes the type of a core setting but they should be obvious and pop up as people use commands.

@SuperCater
Copy link
Contributor Author

I'm going to look into making it so you can change the prefix ingame

@SuperCater
Copy link
Contributor Author

okay i dont think you could ever change prefix in game for some reason

@WalkerOfBacon
Copy link
Contributor

okay i dont think you could ever change prefix in game for some reason

Apparently you were never able to individually

@PurpleCreativity
Copy link
Contributor

you shouldn't be able to unless we're talking per-player

@Dimenpsyonal Dimenpsyonal merged commit 4225863 into Epix-Incorporated:master Jan 27, 2025
2 checks passed
@SuperCater
Copy link
Contributor Author

just realized im stupid and pasted something wrong one sec 😭

@SuperCater
Copy link
Contributor Author

balls

@SuperCater
Copy link
Contributor Author

ill open another PR real quick to fix the stupid issue

@Dimenpsyonal
Copy link
Member

GOTTEM

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