Fixed an issue where a faction could be joined twice.

This commit is contained in:
Olivier Gagnon 2021-08-15 14:31:38 -04:00
parent 41871de26c
commit 056f0213dd
8 changed files with 12 additions and 11 deletions

@ -1,5 +1,6 @@
@import "mixins"; @import "mixins";
@import "theme"; @import "theme";
@import "styles";
/** /**
* Styling for all buttons * Styling for all buttons
@ -16,6 +17,7 @@ button {
.a-link-button, .a-link-button,
.std-button { .std-button {
@extend .noselect;
text-decoration: none; text-decoration: none;
background-color: #555; background-color: #555;
color: #fff; color: #fff;
@ -23,11 +25,6 @@ button {
margin: 5px; margin: 5px;
border: 1px solid #333; border: 1px solid #333;
-moz-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
&:hover { &:hover {
background-color: #666; background-color: #666;
} }
@ -68,6 +65,7 @@ button {
.a-link-button-bought, .a-link-button-bought,
.std-button-bought { .std-button-bought {
@extend .noselect;
text-decoration: none; text-decoration: none;
background-color: #0a0; background-color: #0a0;
color: #fff; color: #fff;

@ -1,5 +1,6 @@
@import "mixins"; @import "mixins";
@import "theme"; @import "theme";
@import "styles";
/* Pop-up boxes */ /* Pop-up boxes */
.popup-box-container { .popup-box-container {
@ -88,6 +89,7 @@
.dialog-box-close-button { .dialog-box-close-button {
@include borderRadius(12px); @include borderRadius(12px);
@include boxShadow(1px 1px 3px #000); @include boxShadow(1px 1px 3px #000);
@extend .noselect;
float: right; float: right;
color: #aaa; color: #aaa;

@ -46,6 +46,7 @@ export function inviteToFaction(faction) {
} }
export function joinFaction(faction) { export function joinFaction(faction) {
if(faction.isMember) return;
faction.isMember = true; faction.isMember = true;
Player.factions.push(faction.name); Player.factions.push(faction.name);
const factionInfo = faction.getInfo(); const factionInfo = faction.getInfo();

@ -100,7 +100,7 @@ export function WireCuttingGame(props: IMinigameProps): React.ReactElement {
return (<Grid container spacing={3}> return (<Grid container spacing={3}>
<GameTimer millis={timer} onExpire={props.onFailure} /> <GameTimer millis={timer} onExpire={props.onFailure} />
<Grid item xs={12}> <Grid item xs={12}>
<h1 className={"noselect"}>Cut the wires with the following properties!</h1> <h1 className={"noselect"}>Cut the wires with the following properties! (keyboard 1 to 9)</h1>
{questions.map((question, i) => <h3 key={i}>{question.toString()}</h3>)} {questions.map((question, i) => <h3 key={i}>{question.toString()}</h3>)}
<pre>{(new Array(wires.length)).fill(0).map((_, i) => <span key={i}>&nbsp;{i+1}&nbsp;&nbsp;&nbsp;&nbsp;</span>)}</pre> <pre>{(new Array(wires.length)).fill(0).map((_, i) => <span key={i}>&nbsp;{i+1}&nbsp;&nbsp;&nbsp;&nbsp;</span>)}</pre>
{(new Array(8)).fill(0).map((_, i) => <div key={i}> {(new Array(8)).fill(0).map((_, i) => <div key={i}>

@ -65,7 +65,7 @@ export class LocationCity extends React.Component<IProps, any> {
elems.push(<pre key={i}>{lineElems(lines[i])}</pre>) elems.push(<pre key={i}>{lineElems(lines[i])}</pre>)
} }
return elems; return <div className="noselect">{elems}</div>;
} }
listCity(): React.ReactNode { listCity(): React.ReactNode {

@ -158,7 +158,7 @@ export class GenericLocation extends React.Component<IProps, any> {
return ( return (
<div> <div>
<StdButton onClick={this.props.returnToCity} style={this.btnStyle} text={"Return to World"} /> <StdButton onClick={this.props.returnToCity} style={this.btnStyle} text={"Return to World"} />
<h1> <h1 className="noselect">
{backdoorInstalled && !Settings.DisableTextEffects {backdoorInstalled && !Settings.DisableTextEffects
? <CorruptableText content={this.props.loc.name}/> ? <CorruptableText content={this.props.loc.name}/>
: this.props.loc.name : this.props.loc.name

@ -74,7 +74,7 @@ export class LocationRoot extends React.Component<IProps, IState> {
} }
return ( return (
<div> <div className="noselect">
<h2>{this.state.city}</h2> <h2>{this.state.city}</h2>
<LocationCity city={city} enterLocation={this.enterLocation} /> <LocationCity city={city} enterLocation={this.enterLocation} />
</div> </div>
@ -120,7 +120,7 @@ export class LocationRoot extends React.Component<IProps, IState> {
p.loseMoney(cost); p.loseMoney(cost);
p.travel(to); p.travel(to);
dialogBoxCreate(`You are now in ${to}!`); dialogBoxCreate(<span className="noselect">You are now in {to}!</span>);
// Dynamically update main menu // Dynamically update main menu
if (p.firstTimeTraveled === false) { if (p.firstTimeTraveled === false) {

@ -44,7 +44,7 @@ export class TravelAgencyLocation extends React.Component<IProps, any> {
} }
return ( return (
<div> <div className="noselect">
<p> <p>
From here, you can travel to any other city! A ticket From here, you can travel to any other city! A ticket
costs {Money(CONSTANTS.TravelCost)}. costs {Money(CONSTANTS.TravelCost)}.