Merchant look&feel.

This commit is contained in:
marcins78@gmail.com
2012-03-14 12:12:40 +00:00
parent fec1c22509
commit 93b1f9fbc7
3 changed files with 37 additions and 12 deletions

View File

@@ -55,6 +55,23 @@ public class ParametrizedMerchantTest {
}
}
// @Test
public void plotPriceEasingFromSetup() {
Date setupDate = new Date(0);
MerchantDAO merchantDao = new MockMerchantDAO();
ParametrizedMerchant merchant = new ParametrizedMerchant(new LotroCardBlueprintLibrary());
merchant.setMerchantDao(merchantDao);
merchant.setMerchantSetupDate(setupDate);
long hour = 1000 * 60 * 60;
for (long time = 0; time < hour * 24 * 35L; time += hour * 2)
System.out.println(time / hour + "," + ((int) merchant.getCardSellPrice("1_1", new Date(time))) + "," + ((int) merchant.getCardBuyPrice("1_1", new Date(time))));
}
private void assertEqualsMoreOrLess(int expected, int given) {
assertTrue("Expected " + expected + " more or less, but received " + given, given <= expected + 1 && given >= expected - 1);
}

View File

@@ -46,20 +46,20 @@ var GempLotrMerchantUI = Class.extend({
this.infoDialog = $("<div></div>")
.dialog({
autoOpen: false,
closeOnEscape: true,
resizable: false,
title: "Card information"
});
autoOpen: false,
closeOnEscape: true,
resizable: false,
title: "Card information"
});
this.questionDialog = $("<div></div>")
.dialog({
autoOpen: false,
closeOnEscape: true,
resizable: false,
modal: true,
title: "Merchant operation"
});
autoOpen: false,
closeOnEscape: true,
resizable: false,
modal: true,
title: "Merchant operation"
});
var swipeOptions = {
threshold: 20,
@@ -230,7 +230,7 @@ var GempLotrMerchantUI = Class.extend({
});
cardDiv.append(buyBut);
}
if (sellPrice != null && sellPrice <= this.currencyCount) {
if (sellPrice != null) {
var formattedSellPrice = this.formatPrice(sellPrice);
var sellBut = $("<div class='sellPrice'>Buy for<br/>" + this.formatPrice(sellPrice) + "</div>").button();
sellBut.click(
@@ -242,6 +242,10 @@ var GempLotrMerchantUI = Class.extend({
});
});
});
if (parseInt(sellPrice) > parseInt(this.currencyCount)) {
sellBut.button({disabled: true});
sellBut.css({color: "#ff0000"});
}
cardDiv.append(sellBut);
}
if (tradeFoil == "true") {

View File

@@ -19,6 +19,10 @@
opacity: 0.2;
}
.buyPrice.ui-state-disabled, .sellPrice.ui-state-disabled, .tradeFoil {
opacity: 0.6;
}
.owned {
background-color: #000000;
border: 1px solid #ffffff;