Skip to content

Commit

Permalink
Merge pull request #1814 from gereon77/minor-improvements
Browse files Browse the repository at this point in the history
Minor improvements
  • Loading branch information
gereon77 authored Jan 31, 2024
2 parents 8e080f9 + a7ea2ca commit f513085
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 25 deletions.
6 changes: 3 additions & 3 deletions agot-bg-game-server/src/client/HouseRowComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import HouseIconComponent from "./game-state-panel/utils/HouseIconComponent";
import ThematicDraftHouseCardsGameState from "../common/ingame-game-state/thematic-draft-house-cards-game-state/ThematicDraftHouseCardsGameState";
import { toast } from "react-toastify";
import getUserLinkOrLabel from "./utils/getIngameUserLinkOrLabel";
import CombatGameState from "../common/ingame-game-state/action-game-state/resolve-march-order-game-state/combat-game-state/CombatGameState";
import ChooseHouseCardGameState from "../common/ingame-game-state/action-game-state/resolve-march-order-game-state/combat-game-state/choose-house-card-game-state/ChooseHouseCardGameState";
import houseCardsBackImages from "./houseCardsBackImages";

interface HouseRowComponentProps {
Expand Down Expand Up @@ -349,8 +349,8 @@ export default class HouseRowComponent extends Component<HouseRowComponentProps>
}

renderPlayerHouseCards(): ReactNode {
const combat = this.ingame.hasChildGameState(CombatGameState) ? this.ingame.getChildGameState(CombatGameState) as CombatGameState : null;
const isCommandingVassalInCombat = combat?.isCommandingVassalInCombat(this.house) ?? false;
const chooseHouseCards = this.ingame.hasChildGameState(ChooseHouseCardGameState) ? this.ingame.getChildGameState(ChooseHouseCardGameState) as ChooseHouseCardGameState : null;
const isCommandingVassalInCombat = chooseHouseCards?.combatGameState.isCommandingVassalInCombat(this.house) ?? false;

return isCommandingVassalInCombat
? _.range(0, 3).map(i => <Col xs="auto" key={`vassal-combat_back_${this.house.id}_${i}`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ export default class IngameGameState extends GameState<
}

const refusedVotes = this.votes.values.filter(v => v.state == VoteState.REFUSED && v.type instanceof ExtendPlayerClocks);
if (this.game.turn != this.game.maxTurns && refusedVotes.length > 1) {
if (this.game.turn != this.game.maxTurns && refusedVotes.length > 2) {
return {result: false, reason: "max-vote-count-reached"};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class ExtendPlayerClocks extends VoteType {
}

getPositiveCountToPass(vote: Vote): number {
return vote.participatingHouses.length;
return vote.participatingHouses.length - 1;
}

executeAccepted(vote: Vote): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "./base.html" %}
{% load games_table %}
{% load custom_filters %}

{% block title %}
Games -
Expand All @@ -23,7 +22,7 @@
<div class="col-lg-11 mb-4">
<div class="card">
<div class="card-body">
<h4 class="card-title">Online Users <small class="ml-2">({{ request.online_now | length }})</small>
<h4 class="card-title">Online Users<small class="ml-2">({{ request.online_now | length }})</small>
<span
id="westerosi-time"
class="float-right badge badge-secondary"
Expand Down Expand Up @@ -120,7 +119,7 @@ <h4 class="card-title">Running Live Games</h4>
<h4 class="card-title">
<div class="row justify-content-between">
<div class="col">
<a href="/my_games">Your Games <small>({{ my_games|get_length }})</small></a>
<a href="/my_games">Your Games<small class="ml-2">({{ my_games|length }})</small></a>
</div>
{% if perms.agotboardgame_main.add_game %}
<div class="col d-flex justify-content-end">
Expand Down Expand Up @@ -160,7 +159,7 @@ <h4 class="card-title">
<h4 class="card-title">
<div class="row justify-content-between">
<div class="col">
All Games <small>({{ all_games|get_length }})</small>
All Games<small class="ml-2">({{ all_games|length }})</small>
</div>
{% if perms.agotboardgame_main.add_game %}
<div class="col d-flex justify-content-end">
Expand Down Expand Up @@ -199,7 +198,7 @@ <h4 class="card-title">
<div class="col-lg-11 mb-4">
<div class="card">
<div class="card-body">
<h4 class="card-title">Games without a move for 5 days <small>({{ inactive_games|get_length }})</small></h4>
<h4 class="card-title">Games without a move for 5 days<small class="ml-2">({{ inactive_games|length }})</small></h4>
<div style="max-height: 300px; overflow-y: auto">
{% games_table inactive_games user perms True %}
</div>
Expand All @@ -211,7 +210,7 @@ <h4 class="card-title">Games without a move for 5 days <small>({{ inactive_games
<div class="col-lg-11 mb-4">
<div class="card">
<div class="card-body">
<h4 class="card-title">Tournament Games without a move for 2 days <small>({{ inactive_tournament_games|get_length }})</small></h4>
<h4 class="card-title">Tournament Games without a move for 2 days<small class="ml-2">({{ inactive_tournament_games|length }})</small></h4>
<div style="max-height: 300px; overflow-y: auto">
{% games_table inactive_tournament_games user perms True %}
</div>
Expand All @@ -227,7 +226,7 @@ <h4 class="card-title">Tournament Games without a move for 2 days <small>({{ ina
data-toggle="tooltip"
title="These are games where the last move was more than 2 days ago and the player being waited on has not logged in for 8 days."
>
Games waiting for inactive players <small>({{ replacement_needed_games|get_length }})</small>
Games waiting for inactive players<small class="ml-2">({{ replacement_needed_games|length }})</small>
</h4>
<div style="max-height: 300px; overflow-y: auto">
{% games_table replacement_needed_games user perms True %}
Expand All @@ -241,7 +240,7 @@ <h4 class="card-title">Tournament Games without a move for 2 days <small>({{ ina
<div class="card">
<div class="card-body">
<h4 class="card-title">
Inactive Private Games <small>({{ inactive_private_games|get_length }})</small>
Inactive Private Games<small class="ml-2">({{ inactive_private_games|length }})</small>
</h4>
<div style="max-height: 300px; overflow-y: auto">
{% games_table inactive_private_games user perms %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "./base.html" %}
{% load games_table %}
{% load custom_filters %}

{% block title %}
Your Games -
Expand All @@ -22,7 +21,7 @@
<div class="col-lg-11 mb-4">
<div class="card">
<div class="card-body">
<h4 class="card-title">Online Users <small class="ml-2">({{ request.online_now | length }})</small>
<h4 class="card-title">Online Users<small class="ml-2">({{ request.online_now | length }})</small>
<span
id="westerosi-time"
class="float-right badge badge-secondary"
Expand Down Expand Up @@ -98,7 +97,7 @@ <h4 class="card-title">Online Users <small class="ml-2">({{ request.online_now |
<h4 class="card-title">
<div class="row justify-content-between">
<div class="col">
Your Games <small>({{ my_games|get_length }})</small>
Your Games<small class="ml-2">({{ my_games|length }})</small>
</div>
{% if perms.agotboardgame_main.add_game %}
<div class="col d-flex justify-content-end">
Expand Down Expand Up @@ -157,7 +156,7 @@ <h4 class="card-title">Running Live Games</h4>
<h4 class="card-title">
<div class="row justify-content-between">
<div class="col">
Your Created Games <small>({{ my_created_games|get_length }})</small>
Your Created Games<small class="ml-2">({{ my_created_games|length }})</small>
</div>
{% if perms.agotboardgame_main.add_game %}
<div class="col d-flex justify-content-end">
Expand Down

This file was deleted.

0 comments on commit f513085

Please sign in to comment.