Autojoin feature#57
Autojoin feature#57HuManKeat wants to merge 5 commits intoStratusNetwork:masterfrom HuManKeat:new-join-feature
Conversation
| 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.
You will join the match in {0} seconds. Left click the helmet to cancel!
| 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! No newline at end of file |
There was a problem hiding this comment.
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>(){}); | ||
|
|
| import tc.oc.pgm.match.MatchModule; | ||
| import tc.oc.pgm.match.MatchPlayer; | ||
| import tc.oc.pgm.match.MatchScope; | ||
|
|
| joiningPlayers.add(player); | ||
| } | ||
|
|
||
| // Public accessor methods |
| 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.
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.
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.
What about the leave button? Does it still work?
There was a problem hiding this comment.
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.
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.
Yes, but add a comment explaining that.
| if(this.tmm != null && !this.autoBalanced) { | ||
| this.autoBalanced = true; | ||
| this.tmm.balanceTeams(); | ||
| autoJoinMatchModule.enterAllPlayers(); |
There was a problem hiding this comment.
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.
"Automatically join a team when a match starts"
| 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.
Keep this in, I believe it is for ranked
update to cherrypick unneeded commits