Skip to content

Commit

Permalink
Include wingman as an option during match creation and season templat…
Browse files Browse the repository at this point in the history
…es. (#173)
  • Loading branch information
PhlexPlexico committed Jun 26, 2023
1 parent 49f82e1 commit 2237cc6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 9 deletions.
19 changes: 18 additions & 1 deletion src/components/NewMatchForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@
ref="teamTwo"
/>
<v-divider />
<v-row class="justify-center">
<v-col cols="2">
<v-switch
v-model="newMatchData.wingman"
:label="$t('CreateMatch.Wingman')"
ref="wingman"
/>
</v-col>
</v-row>
<v-divider />
<v-row class="justify-center">
<v-col cols="12">
<strong>{{ $t("CreateMatch.FormSeriesType") }}</strong>
Expand Down Expand Up @@ -374,7 +384,8 @@ export default {
veto_first: "team1",
spectators: [],
side_type: "standard",
map_sides: []
map_sides: [],
wingman: false
},
selectedTeams: [],
newDialog: false,
Expand Down Expand Up @@ -445,11 +456,16 @@ export default {
seasonCvars.map_sides.length < 1
? []
: seasonCvars.map_sides.trim().split(" ");
this.newMatchData.wingman =
seasonCvars.wingman == null || seasonCvars.wingman == 0
? false
: true;
//Delete all used get prepare custom CVARs.
delete seasonCvars.min_players_to_ready;
delete seasonCvars.min_spectators_to_ready;
delete seasonCvars.players_per_team;
delete seasonCvars.maps_to_win;
delete seasonCvars.wingman;
delete seasonCvars.skip_veto;
delete seasonCvars.map_pool;
delete seasonCvars.side_type;
Expand Down Expand Up @@ -549,6 +565,7 @@ export default {
match_cvars: newCvar,
veto_first: this.newMatchData.veto_first,
skip_veto: this.newMatchData.skip_veto,
wingman: this.newMatchData.wingman,
spectator_auths: this.newMatchData.spectators,
min_players_to_ready: parseInt(
this.newMatchData.min_players_to_ready
Expand Down
21 changes: 17 additions & 4 deletions src/components/SeasonsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@
</v-menu>
</v-col>
</v-row>
<v-row class="justify-center">
<v-col cols="2">
<v-switch
v-model="seasonDefaults.wingman"
:label="$t('CreateMatch.Wingman')"
ref="wingman"
/>
</v-col>
</v-row>
<v-row class="justify-center">
<v-col cols="12" class="text-center text-h6">
{{ $t("CreateMatch.FormSeriesType") }}
Expand Down Expand Up @@ -479,7 +488,8 @@ export default {
map_pool: [],
spectators: [],
side_type: "standard",
map_sides: []
map_sides: [],
wingman: false
},
datemenu: false,
formTitle: this.$t("Seasons.NewFormTitle"),
Expand Down Expand Up @@ -527,7 +537,8 @@ export default {
map_pool: [],
spectators: [],
side_type: "standard",
map_sides: []
map_sides: [],
wingman: false
};
this.$refs.newSeasonForm.resetValidation();
});
Expand Down Expand Up @@ -685,7 +696,8 @@ export default {
map_pool: [],
spectators: [],
side_type: "standard",
map_sides: []
map_sides: [],
wingman: false
};
this.$refs.newSeasonForm.resetValidation();
});
Expand All @@ -711,6 +723,7 @@ export default {
obj !== "players_per_team" &&
obj !== "maps_to_win" &&
obj !== "skip_veto" &&
obj !== "wingman" &&
obj !== "map_pool" &&
obj !== "spectators" &&
obj !== "side_type" &&
Expand All @@ -724,7 +737,7 @@ export default {
this.seasonDefaults[obj] = seasonCvars[obj].split(" ");
else if (obj === "maps_to_win")
this.seasonDefaults[obj] = parseInt(seasonCvars[obj]);
else if (obj === "skip_veto") {
else if (obj === "skip_veto" || obj === "wingman") {
seasonCvars[obj] = seasonCvars[obj] == 0 ? false : true;
this.seasonDefaults[obj] = seasonCvars[obj];
} else if (obj === "map_sides") {
Expand Down
6 changes: 5 additions & 1 deletion src/components/VetoTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
<b v-if="item.pick_or_veto === 'pick'">
{{ $t("Veto.VetoPick") }}
</b>
<div v-else-if="item.pick_or_veto === 'ban' || item.pick_or_veto === 'veto'">
<div
v-else-if="
item.pick_or_veto === 'ban' || item.pick_or_veto === 'veto'
"
>
{{ $t("Veto.VetoBan") }}
</div>
</template>
Expand Down
9 changes: 6 additions & 3 deletions src/translations/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
"MapSides": "Map Side For Map {map}",
"MapSidesTeam1CT": "Team 1 Starts CT",
"MapSidesTeam2CT": "Team 2 Starts CT",
"MapSidesKnife": "Teams Knife For Sides"
"MapSidesKnife": "Teams Knife For Sides",
"Wingman": "Wingman Match?"
},
"PlayerStats": {
"Kills": "Kills",
Expand Down Expand Up @@ -478,7 +479,8 @@
"MapSides": "Côté de la map pour la carte {map}",
"MapSidesTeam1CT": "Equipe 1 démarre en CT",
"MapSidesTeam2CT": "Equipe 2 démarre en CT",
"MapSidesKnife": "Coté décidé par un round au couteau"
"MapSidesKnife": "Coté décidé par un round au couteau",
"Wingman": "Match d'ailier ?"
},
"PlayerStats": {
"Kills": "Kills",
Expand Down Expand Up @@ -840,7 +842,8 @@
"SkipVeto": "ゲーム内拒否権をスキップ?",
"KnifeDefault": "デフォルト",
"KnifeNever": "ネバーナイフ",
"KnifeAlways": "常にナイフ"
"KnifeAlways": "常にナイフ",
"Wingman": "ウィングマン・マッチ?"
},
"PlayerStats": {
"Kills": "キルズ",
Expand Down

0 comments on commit 2237cc6

Please sign in to comment.