mirror of
https://github.com/miky-kr5/CEIDEC-Pong-Web.git
synced 2023-01-29 18:47:06 +00:00
Changed some site UI stuff.
This commit is contained in:
@@ -10,6 +10,7 @@ function canIPlayTheGame() {
|
|||||||
if (result.logs[0].args.player === myAccount) {
|
if (result.logs[0].args.player === myAccount) {
|
||||||
$('#can_play').text(myAccount + ' can play the game!');
|
$('#can_play').text(myAccount + ' can play the game!');
|
||||||
getTimesPlayed();
|
getTimesPlayed();
|
||||||
|
loadBalance();
|
||||||
playTheGame();
|
playTheGame();
|
||||||
} else {
|
} else {
|
||||||
alert("Whoops! An error ocurred.\nThanks for your money, though :P");
|
alert("Whoops! An error ocurred.\nThanks for your money, though :P");
|
||||||
@@ -26,7 +27,6 @@ function loadBalance() {
|
|||||||
myWeb3.eth.getBalance(account, function(err, balance) {
|
myWeb3.eth.getBalance(account, function(err, balance) {
|
||||||
if (err === null) {
|
if (err === null) {
|
||||||
$('#balance').text(myWeb3.fromWei(balance, "ether") + " ETH");
|
$('#balance').text(myWeb3.fromWei(balance, "ether") + " ETH");
|
||||||
$('#can_play').text(myAccount + " can't play the game... so sad!");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -65,6 +65,7 @@ function initWeb3() {
|
|||||||
// update UI
|
// update UI
|
||||||
loadBalance();
|
loadBalance();
|
||||||
getTimesPlayed();
|
getTimesPlayed();
|
||||||
|
$('#can_play').text(myAccount + " can't play the game... so sad!");
|
||||||
|
|
||||||
// Register call and listen for events.
|
// Register call and listen for events.
|
||||||
ethCallback = canIPlayTheGame;
|
ethCallback = canIPlayTheGame;
|
||||||
|
@@ -40,7 +40,7 @@ function randSig() {
|
|||||||
|
|
||||||
function startGame() {
|
function startGame() {
|
||||||
if (ethCallback !== null) {
|
if (ethCallback !== null) {
|
||||||
canIPlayTheGame()
|
ethCallback();
|
||||||
} else {
|
} else {
|
||||||
alert("Can't play the game\nWeb3 not initialized.");
|
alert("Can't play the game\nWeb3 not initialized.");
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ function canIPlayTheGame() {
|
|||||||
if (result.logs[0].args.player === myAccount) {
|
if (result.logs[0].args.player === myAccount) {
|
||||||
$('#can_play').text(myAccount + ' can play the game!');
|
$('#can_play').text(myAccount + ' can play the game!');
|
||||||
getTimesPlayed();
|
getTimesPlayed();
|
||||||
|
loadBalance();
|
||||||
playTheGame();
|
playTheGame();
|
||||||
} else {
|
} else {
|
||||||
alert("Whoops! An error ocurred.\nThanks for your money, though :P");
|
alert("Whoops! An error ocurred.\nThanks for your money, though :P");
|
||||||
@@ -26,7 +27,6 @@ function loadBalance() {
|
|||||||
myWeb3.eth.getBalance(account, function(err, balance) {
|
myWeb3.eth.getBalance(account, function(err, balance) {
|
||||||
if (err === null) {
|
if (err === null) {
|
||||||
$('#balance').text(myWeb3.fromWei(balance, "ether") + " ETH");
|
$('#balance').text(myWeb3.fromWei(balance, "ether") + " ETH");
|
||||||
$('#can_play').text(myAccount + " can't play the game... so sad!");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -65,6 +65,7 @@ function initWeb3() {
|
|||||||
// update UI
|
// update UI
|
||||||
loadBalance();
|
loadBalance();
|
||||||
getTimesPlayed();
|
getTimesPlayed();
|
||||||
|
$('#can_play').text(myAccount + " can't play the game... so sad!");
|
||||||
|
|
||||||
// Register call and listen for events.
|
// Register call and listen for events.
|
||||||
ethCallback = canIPlayTheGame;
|
ethCallback = canIPlayTheGame;
|
||||||
|
@@ -40,7 +40,7 @@ function randSig() {
|
|||||||
|
|
||||||
function startGame() {
|
function startGame() {
|
||||||
if (ethCallback !== null) {
|
if (ethCallback !== null) {
|
||||||
canIPlayTheGame()
|
ethCallback();
|
||||||
} else {
|
} else {
|
||||||
alert("Can't play the game\nWeb3 not initialized.");
|
alert("Can't play the game\nWeb3 not initialized.");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user