From 008ba3f1a1c76bbb63c7e9b3240ef2a1ef7e0dd2 Mon Sep 17 00:00:00 2001
From: nqrcqn <47343000+nqrcqn@users.noreply.github.com>
Date: Sat, 14 Sep 2019 15:49:29 +0300
Subject: [PATCH 1/2] Make currency type editable when pricing
---
Procurement/Controls/ItemDisplay.xaml.cs | 3 +++
Procurement/Controls/SetBuyoutView.xaml | 6 +++---
Procurement/Controls/SetTabBuyoutView.xaml | 2 +-
Procurement/ViewModel/PricingInfo.cs | 14 +++++++++++---
4 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/Procurement/Controls/ItemDisplay.xaml.cs b/Procurement/Controls/ItemDisplay.xaml.cs
index dd41a9cd..6c4ab781 100644
--- a/Procurement/Controls/ItemDisplay.xaml.cs
+++ b/Procurement/Controls/ItemDisplay.xaml.cs
@@ -276,6 +276,9 @@ private void buyoutView_SaveClicked(string amount, string orbType)
{
var abbreviation = CurrencyAbbreviationMap.Instance.FromCurrency(orbType);
+ if (string.IsNullOrEmpty(abbreviation))
+ abbreviation = orbType;
+
var vm = DataContext as ItemDisplayViewModel;
var item = vm.Item;
diff --git a/Procurement/Controls/SetBuyoutView.xaml b/Procurement/Controls/SetBuyoutView.xaml
index 4b1b6dc2..75d49498 100644
--- a/Procurement/Controls/SetBuyoutView.xaml
+++ b/Procurement/Controls/SetBuyoutView.xaml
@@ -29,7 +29,7 @@
-
+
@@ -38,7 +38,7 @@
-
+
@@ -47,7 +47,7 @@
-
+
diff --git a/Procurement/Controls/SetTabBuyoutView.xaml b/Procurement/Controls/SetTabBuyoutView.xaml
index de878090..b1ad9cd9 100644
--- a/Procurement/Controls/SetTabBuyoutView.xaml
+++ b/Procurement/Controls/SetTabBuyoutView.xaml
@@ -24,7 +24,7 @@
-
+
diff --git a/Procurement/ViewModel/PricingInfo.cs b/Procurement/ViewModel/PricingInfo.cs
index 0587df68..f56aa35e 100644
--- a/Procurement/ViewModel/PricingInfo.cs
+++ b/Procurement/ViewModel/PricingInfo.cs
@@ -88,15 +88,23 @@ public void Update(string info)
value = valueOrbPair[0];
orb = CurrencyAbbreviationMap.Instance.FromAbbreviation(valueOrbPair[1]);
- enabled = value != string.Empty;
+ if (string.IsNullOrEmpty(orb))
+ orb = valueOrbPair[1];
+
+ enabled = !string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(orb);
}
public string GetSaveText()
{
- if (!enabled || (string.IsNullOrEmpty(value) && string.IsNullOrEmpty(orb)))
+ if (!enabled)
return string.Empty;
- return $"{value} {CurrencyAbbreviationMap.Instance.FromCurrency(orb)}";
+ string abbreviation = CurrencyAbbreviationMap.Instance.FromCurrency(orb);
+
+ if (string.IsNullOrEmpty(abbreviation))
+ return $"{value} {orb}";
+
+ return $"{value} {abbreviation}";
}
}
}
From 1e3073ecfeb875c27f0e5d8f18b9cb950c183ff8 Mon Sep 17 00:00:00 2001
From: nqrcqn <47343000+nqrcqn@users.noreply.github.com>
Date: Sat, 14 Sep 2019 20:01:15 +0300
Subject: [PATCH 2/2] Use a wider box to fit most currency tags, minor fixes
---
Procurement/Controls/SetBuyoutView.xaml | 22 ++++++++++-----------
Procurement/Controls/SetTabBuyoutView.xaml | 16 +++++++--------
Procurement/ViewModel/SetBuyoutViewModel.cs | 2 +-
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/Procurement/Controls/SetBuyoutView.xaml b/Procurement/Controls/SetBuyoutView.xaml
index 75d49498..488ee79a 100644
--- a/Procurement/Controls/SetBuyoutView.xaml
+++ b/Procurement/Controls/SetBuyoutView.xaml
@@ -11,15 +11,15 @@
-
+
-
-
-
+
+
+
@@ -29,7 +29,7 @@
-
+
@@ -38,7 +38,7 @@
-
+
@@ -47,12 +47,12 @@
-
+
-
+
-
+
-
+
-
+
diff --git a/Procurement/Controls/SetTabBuyoutView.xaml b/Procurement/Controls/SetTabBuyoutView.xaml
index b1ad9cd9..ef9cd568 100644
--- a/Procurement/Controls/SetTabBuyoutView.xaml
+++ b/Procurement/Controls/SetTabBuyoutView.xaml
@@ -1,7 +1,7 @@
+ Title="Set Tabwide Buyout" WindowStyle="None" ResizeMode="NoResize" Width="370" Height="90">
@@ -13,8 +13,8 @@
-
-
+
+
@@ -24,16 +24,16 @@
-
+
-
-
-
+
+
+
-
+
diff --git a/Procurement/ViewModel/SetBuyoutViewModel.cs b/Procurement/ViewModel/SetBuyoutViewModel.cs
index b362968f..d0bb3a43 100644
--- a/Procurement/ViewModel/SetBuyoutViewModel.cs
+++ b/Procurement/ViewModel/SetBuyoutViewModel.cs
@@ -109,7 +109,7 @@ private void GetPobData(object o)
private bool CanGetPobData(object o)
{
- return item.GetType() == typeof(Gear);
+ return item.GetType() == typeof(Gear) && item.ItemLevel > 0;
}
}
}