mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-20 01:38:01 +00:00
small fix
This commit is contained in:
@@ -3,7 +3,7 @@ import './App.css';
|
||||
import Counters from './Components/Counters/Counters';
|
||||
import styled from 'styled-components';
|
||||
import { Player } from './Types/Player';
|
||||
import { initialPlayers } from './Data/initialPlayers';
|
||||
import { initialPlayers } from './Data/getInitialPlayers';
|
||||
|
||||
const MainWrapper = styled.div`
|
||||
width: 100vmax;
|
||||
|
||||
@@ -22,10 +22,10 @@ export const CenteredText = styled.div`
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 5vmin;
|
||||
font-size: 7vmin;
|
||||
font-weight: bold;
|
||||
text-shadow: -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff,
|
||||
1px 1px 0 #ffffff;
|
||||
-webkit-text-stroke: 2px #ffffff; /* Add a 2-pixel black stroke */
|
||||
-webkit-text-fill-color: #000000;
|
||||
color: #000000;
|
||||
user-select: none;
|
||||
-webkit-touch-callout: none;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Player } from '../../Types/Player';
|
||||
import * as S from './PlayerMenu.style';
|
||||
import { initialPlayers } from '../../Data/initialPlayers';
|
||||
import { initialPlayers } from '../../Data/getInitialPlayers';
|
||||
|
||||
type SettingsProps = {
|
||||
player: Player;
|
||||
@@ -40,14 +40,15 @@ const Settings = ({ player, opponents, onChange }: SettingsProps) => {
|
||||
opponents.forEach((opponent) => {
|
||||
// Only reset commander damage from the player that is being reset
|
||||
opponent.commanderDamage.forEach((commanderDamage) => {
|
||||
if (commanderDamage.source === player.key) {
|
||||
opponent.lifeTotal =
|
||||
opponent.lifeTotal +
|
||||
commanderDamage.damageTotal +
|
||||
commanderDamage.partnerDamageTotal;
|
||||
commanderDamage.damageTotal = 0;
|
||||
commanderDamage.partnerDamageTotal = 0;
|
||||
if (commanderDamage.source !== player.key) {
|
||||
return;
|
||||
}
|
||||
opponent.lifeTotal =
|
||||
opponent.lifeTotal +
|
||||
commanderDamage.damageTotal +
|
||||
commanderDamage.partnerDamageTotal;
|
||||
commanderDamage.damageTotal = 0;
|
||||
commanderDamage.partnerDamageTotal = 0;
|
||||
});
|
||||
onChange(opponent);
|
||||
});
|
||||
@@ -56,9 +57,7 @@ const Settings = ({ player, opponents, onChange }: SettingsProps) => {
|
||||
};
|
||||
|
||||
const handleNewGame = () => {
|
||||
//remove local storage
|
||||
localStorage.removeItem('players');
|
||||
//reload page
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user