Formatting price.

This commit is contained in:
marcins78@gmail.com
2012-04-05 18:14:26 +00:00
parent 3115d5d463
commit 11ec7b39ff
11 changed files with 21 additions and 20 deletions

View File

@@ -93,7 +93,7 @@ public class GameRecorder {
final Date startData = new Date();
final Map<String, GatheringParticipantCommunicationChannel> recordingChannels = new HashMap<String, GatheringParticipantCommunicationChannel>();
for (String playerId : lotroGame.getPlayersPlaying()) {
GatheringParticipantCommunicationChannel recordChannel = new GatheringParticipantCommunicationChannel(playerId);
GatheringParticipantCommunicationChannel recordChannel = new GatheringParticipantCommunicationChannel(playerId, 0);
lotroGame.addGameStateListener(playerId, recordChannel);
recordingChannels.put(playerId, recordChannel);
}

View File

@@ -17,10 +17,11 @@
<form method="POST" action="server/admin/addLeague">
Name: <input type="text" name="name"><br/>
Code: <input type="text" name="type"><br/>
Type: <select name="class">
<option value="com.gempukku.lotro.league.ConstructedLeagueData">Constructed</option>
<option value="com.gempukku.lotro.league.SealedLeagueData">Sealed</option>
</select><br/>
Type:
<select name="class">
<option value="com.gempukku.lotro.league.ConstructedLeagueData">Constructed</option>
<option value="com.gempukku.lotro.league.SealedLeagueData">Sealed</option>
</select><br/>
Parameters: <input type="text" name="parameters"><br/>
Start: <input type="text" name="start"><br/>
End: <input type="text" name="end"><br/>

View File

@@ -94,6 +94,7 @@
<script type="text/javascript" src="js/jquery/jquery.touchSwipe.js"></script>
<script type="text/javascript" src="js/inheritance.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/communication.js"></script>
<script type="text/javascript" src="js/deliveryService.js"></script>
<script type="text/javascript" src="js/jCardGroup.js"></script>

View File

@@ -320,6 +320,7 @@ body {
<script type="text/javascript" src="js/inheritance.js"></script>
<script type="text/javascript" src="js/communication.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/chat.js"></script>
<script type="text/javascript" src="js/commonUi.js"></script>
<script type="text/javascript" src="js/gameUi.js"></script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

View File

@@ -9,4 +9,9 @@ function formatToTwoDigits(no) {
function formatDate(date) {
return monthNames[date.getMonth()] + " " + date.getDate() + " " + formatToTwoDigits(date.getHours()) + ":" + formatToTwoDigits(date.getMinutes()) + ":" + formatToTwoDigits(date.getSeconds());
}
}
function formatPrice(price) {
var silver = (price % 100);
return Math.floor(price / 100) + "<img src='images/gold.png'/> " + ((silver < 10) ? ("0" + silver) : silver) + "<img src='images/silver.png'/>";
}

View File

@@ -155,17 +155,13 @@ var GempLotrHallUI = Class.extend({
}
},
formatPrice: function(price) {
return Math.floor(price / 100) + "G " + price % 100 + "S";
},
processHall: function(xml) {
var root = xml.documentElement;
if (root.tagName == "hall") {
this.tablesDiv.html("");
var currency = root.getAttribute("currency");
this.pocketDiv.html(this.formatPrice(currency));
this.pocketDiv.html(formatPrice(currency));
var motd = root.getAttribute("motd");
if (motd != null)

View File

@@ -52,7 +52,7 @@ var LeagueResultsUI = Class.extend({
var leagueText = leagueName;
$("#leagueResults").append("<h1 class='leagueName'>" + leagueText + "</h1>");
var costStr = Math.floor(cost / 100) + "G " + cost % 100 + "S";
var costStr = formatPrice(cost);
$("#leagueResults").append("<div class='leagueCost'><b>Cost:</b> " + costStr + "</div>");
var duration = this.getDateString(start) + " to " + this.getDateString(end);

View File

@@ -200,7 +200,7 @@ var GempLotrMerchantUI = Class.extend({
clearList: function(rootElem) {
$(".card", this.cardsDiv).remove();
this.currencyCount = rootElem.getAttribute("currency");
this.pocketDiv.html(this.formatPrice(this.currencyCount));
this.pocketDiv.html(formatPrice(this.currencyCount));
},
addCardToList: function(elem, type, blueprintId, count) {
@@ -240,7 +240,7 @@ var GempLotrMerchantUI = Class.extend({
cardDiv.append("<div class='owned'>" + count + "</div>");
if (!this.hideMerchant) {
if (buyPrice != null) {
var formattedBuyPrice = this.formatPrice(buyPrice);
var formattedBuyPrice = formatPrice(buyPrice);
var buyBut = $("<div class='buyPrice'>Sell for<br/>" + formattedBuyPrice + "</div>").button();
buyBut.click(
function() {
@@ -254,8 +254,8 @@ var GempLotrMerchantUI = Class.extend({
cardDiv.append(buyBut);
}
if (sellPrice != null) {
var formattedSellPrice = this.formatPrice(sellPrice);
var sellBut = $("<div class='sellPrice'>Buy for<br/>" + this.formatPrice(sellPrice) + "</div>").button();
var formattedSellPrice = formatPrice(sellPrice);
var sellBut = $("<div class='sellPrice'>Buy for<br/>" + formattedSellPrice + "</div>").button();
sellBut.click(
function() {
that.displayMerchantAction(card, "Do you want to buy this item for " + formattedSellPrice + "?",
@@ -324,10 +324,6 @@ var GempLotrMerchantUI = Class.extend({
this.questionDialog.dialog("open");
},
formatPrice: function(price) {
return Math.floor(price / 100) + "G " + price % 100 + "S";
},
finishList: function() {
this.cardsGroup.layoutCards();
},

View File

@@ -94,6 +94,7 @@
<script type="text/javascript" src="js/jquery/jquery.touchSwipe.js"></script>
<script type="text/javascript" src="js/inheritance.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/communication.js"></script>
<script type="text/javascript" src="js/deliveryService.js"></script>
<script type="text/javascript" src="js/jCardGroup.js"></script>