-
Notifications
You must be signed in to change notification settings - Fork 14
Autojoin feature #57
base: master
Are you sure you want to change the base?
Autojoin feature #57
Conversation
@@ -352,3 +352,5 @@ stats.ui.cores = Cores Leaked: | |||
stats.ui.monuments = Monuments Destroyed: | |||
stats.ui.teamkills = TK: | |||
|
|||
autojoin.starting = Match is starting in {0} seconds! Left click the hat to cancel autojoin! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will join the match in {0} seconds. Left click the helmet to cancel!
@@ -352,3 +352,5 @@ stats.ui.cores = Cores Leaked: | |||
stats.ui.monuments = Monuments Destroyed: | |||
stats.ui.teamkills = TK: | |||
|
|||
autojoin.starting = Match is starting in {0} seconds! Left click the hat to cancel autojoin! | |||
autojoin.cancelled = You have cancelled autojoin! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will now observe the match. Right click the helmet if you want to join again!
protected void configure() { | ||
new SettingBinder(publicBinder()).addBinding().toInstance(AutoJoinSetting.get()); | ||
install(new MatchModuleFixtureManifest<AutoJoinMatchModule>(){}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra new line
import tc.oc.pgm.match.MatchModule; | ||
import tc.oc.pgm.match.MatchPlayer; | ||
import tc.oc.pgm.match.MatchScope; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra new line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the extra new line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
joiningPlayers.add(player); | ||
} | ||
|
||
// Public accessor methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this comment
public class AutoJoinSetting { | ||
private static final Setting INSTANCE = new SettingBuilder() | ||
.name("AutoJoin").alias("aj") | ||
.summary("Toggles the AutoJoin feature") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little more specific than that please.
.name("AutoJoin").alias("aj") | ||
.summary("Toggles the AutoJoin feature") | ||
.type(new BooleanType()) | ||
.defaultValue(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, auto join is off? Then what's the point?
// If there is nothing to pick, just join immediately | ||
jmm.requestJoin(player, JoinRequest.user()); | ||
} | ||
} else if(hand.getType() == Button.LEAVE.material) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the leave button? Does it still work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i simply refactored it and commented it out below
jmm.requestJoin(player, JoinRequest.user()); | ||
} | ||
|
||
//} else if(hand.getType() == Button.LEAVE.material) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you going to leave this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty sure that the button doesn't do anything, so i'll leave this here at the moment until we find some use for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but add a comment explaining that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
if(remaining.getSeconds() >= 1 && remaining.getSeconds() <= 3) { | ||
// Auto-balance runs at match start as well, but try to run it a few seconds in advance | ||
if(this.tmm != null && !this.autoBalanced) { | ||
this.autoBalanced = true; | ||
this.tmm.balanceTeams(); | ||
autoJoinMatchModule.enterAllPlayers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you join players before balancing?
public class AutoJoinSetting { | ||
private static final Setting INSTANCE = new SettingBuilder() | ||
.name("AutoJoin").alias("aj") | ||
.summary("Toggles the ability to be automatically emplaced into the match") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Automatically join a team when a match starts"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
jmm.requestJoin(player, JoinRequest.user()); | ||
} | ||
// Removed until this has some use - currently does nothing | ||
//} else if(hand.getType() == Button.LEAVE.material) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this in, I believe it is for ranked
update to cherrypick unneeded commits