Merge pull request #254 from hydroflame/green-stock-buttons

make the stock market accound and api button green when bought
This commit is contained in:
danielyxie 2018-05-30 17:29:39 -05:00 committed by GitHub
commit 429894707f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

@ -168,6 +168,27 @@ a:link, a:visited {
pointer-events: none;
}
/* Make anchor tags ("a" elements) for activated actions */
.a-link-button-bought {
text-decoration: none;
background-color: #00AA00;
color: #FFFFFF;
padding: 5px;
margin: 5px;
border: 1px solid #00AA00;
cursor: default;
}
.a-link-button-bought:hover .tooltiptext,
.a-link-button-bought:hover .tooltiptexthigh,
.a-link-button-bought:hover .tooltiptextleft {
visibility: visible;
}
.a-link-button-bought:active {
pointer-events: none;
}
/* Notification icon (for create program right now only) */
#create-program-tab {
position:relative;

@ -702,6 +702,9 @@ function displayStockMarketContent() {
wseAccountButton.innerText = "Buy WSE Account - $" + formatNumber(CONSTANTS.WSEAccountCost, 2).toString();
if (!Player.hasWseAccount && Player.money.gte(CONSTANTS.WSEAccountCost)) {
wseAccountButton.setAttribute("class", "a-link-button");
} else if (Player.hasWseAccount){
wseAccountButton.innerText = "WSE Account - acquired";
wseAccountButton.setAttribute("class", "a-link-button-bought");
} else {
wseAccountButton.setAttribute("class", "a-link-button-inactive");
}
@ -720,6 +723,9 @@ function displayStockMarketContent() {
formatNumber(CONSTANTS.TIXAPICost, 2).toString();
if (!Player.hasTixApiAccess && Player.money.gte(CONSTANTS.TIXAPICost)) {
tixApiAccessButton.setAttribute("class", "a-link-button");
} else if(Player.hasTixApiAccess) {
tixApiAccessButton.innerText = "Trade Information eXchange (TIX) API Access - granted"
tixApiAccessButton.setAttribute("class", "a-link-button-bought");
} else {
tixApiAccessButton.setAttribute("class", "a-link-button-inactive");
}