Skip to content

Commit

Permalink
Add settings window
Browse files Browse the repository at this point in the history
  • Loading branch information
siegrest committed Feb 15, 2018
1 parent 0148027 commit 676141d
Show file tree
Hide file tree
Showing 11 changed files with 613 additions and 605 deletions.
7 changes: 5 additions & 2 deletions Pricer/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Text.RegularExpressions;

namespace Pricer {
class Item {
public class Item {
public string rarity, name, type, key = "";
public string[] splitRaw;
public int stackSize;
Expand Down Expand Up @@ -120,6 +120,8 @@ private void Parse_GemData() {
// Last line will contain "Note:" if item has a note
bool isCorrupted = splitRaw[splitRaw.Length - 1].Contains("Corrupted");



// Special gems have special needs
if (name.Contains("Empower") || name.Contains("Enlighten") || name.Contains("Enhance")) {
if (isCorrupted) quality = 0;
Expand All @@ -131,11 +133,12 @@ private void Parse_GemData() {
} else {
if (level < 10) level = 1;
else if (level < 20) level = 10;

if (quality < 10) quality = 0;
else if (quality < 20) quality = 10;
else if (quality == 21) quality = 20;
else if (quality > 21) quality = 23;

if (level < 20) isCorrupted = false;
}

// Build key in the format of "<gem name>|4|<lvl>|<quality>"
Expand Down
24 changes: 4 additions & 20 deletions Pricer/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,10 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Pricer"
mc:Ignorable="d"
Title="MainWindow" Height="320" Width="750" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Margin="0" Padding="0" Closing="Window_Closing">
Title="MainWindow" Height="290" Width="580" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Margin="0" Padding="0" Closing="Window_Closing">
<Grid Background="#FFF0F0F0" Margin="0,0,0,0" UseLayoutRounding="False" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<TextBox x:Name="console_window" AllowDrop="False" IsReadOnly="True" VerticalScrollBarVisibility="Visible" IsUndoEnabled="False" TextWrapping="Wrap" Padding="0" FontFamily="Courier New" HorizontalAlignment="Left" Width="540" Margin="10,10,0,10"/>
<Grid HorizontalAlignment="Right" Width="160" Margin="0,10,10,9" >
<Button x:Name="button_run" Content="Run" Width="75" Click="button_run_Click" Height="20" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Top" HorizontalAlignment="Left" IsEnabled="False" Margin="80,242,0,0" ToolTip="Listen to mouse/clipboard events"/>
<Button x:Name="button_download" Content="Download" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" IsEnabled="False" Margin="0,242,0,0" Click="button_download_Click" ToolTip="Download the datapackage associated with the selected league" />
<RadioButton x:Name="radio_bo" Content="~b/o" HorizontalAlignment="Left" VerticalAlignment="Top" IsChecked="True" Checked="radio_bo_Checked" Margin="102,137,0,0" />
<RadioButton x:Name="radio_price" Content="~price" HorizontalAlignment="Left" VerticalAlignment="Top" Checked="radio_price_Checked" Margin="102,157,0,0" />
<Button x:Name="button_meanMedSel" Content="Mean" Click="button_meanMedSel_Click" VerticalAlignment="Top" HorizontalAlignment="Left" Width="75" Margin="0,217,0,0" ToolTip="Swap prices between mean and median (Not supported by Poe.Ninja)" IsEnabled="False" />
<CheckBox x:Name="checkBox_enter" Content="Send Enter" HorizontalAlignment="Left" VerticalAlignment="Top" IsChecked="True" Click="checkBox_enter_Click" Margin="0,157,0,0" ToolTip="Press enter after sending note"/>
<CheckBox x:Name="checkBox_outputNote" Content="Send Note" HorizontalAlignment="Left" VerticalAlignment="Top" IsChecked="True" Click="checkBox_outputNote_Click" Margin="0,137,0,0" ToolTip="Send the note"/>
<Label Content="League" Padding="0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<ComboBox x:Name="leagueSelector" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,21,0,0" SelectionChanged="leagueSelector_SelectionChanged" ToolTip="Current active league" />
<Slider x:Name="slider_lowerPrice" Width="155" Maximum="100" SmallChange="0" ValueChanged="slider_lowerPrice_ValueChanged" IsSnapToTickEnabled="True" LargeChange="0" Height="18" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,114,0,0" ToolTip="How much % of the price should be reduced?"/>
<Label x:Name="label_lowerPrice" Content="Lower price by 0%" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="0" Margin="0,93,0,0"/>
<TextBox x:Name="textBox_delay" HorizontalAlignment="Left" Height="20" Margin="80,217,0,0" TextWrapping="Wrap" Text="120" VerticalAlignment="Top" Width="75" LostFocus="textBox_delay_LostFocus" ToolTip="Delay in MS that occurs between right clicking and pasting text"/>
<ComboBox x:Name="sourceSelector" HorizontalAlignment="Left" Margin="0,66,0,0" VerticalAlignment="Top" Width="150" SelectionChanged="sourceSelector_SelectionChanged" ToolTip="API from which to download price data"/>
<Label Content="Source" Padding="0" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,48,0,0"/>
<CheckBox x:Name="checkBox_fallBack" Content="PoePrices Fallback" HorizontalAlignment="Left" Margin="0,177,0,0" VerticalAlignment="Top" IsChecked="True" Click="checkBox_fallBack_Click" ToolTip="Send item data to PoePrices API when there's no local match"/>
<CheckBox x:Name="CheckBox_EnablePriceBox" Content="Show pricebox" HorizontalAlignment="Left" Margin="0,197,0,0" VerticalAlignment="Top" ToolTip="Display a small window with the price" Click="CheckBox_EnablePriceBox_Click"/>
</Grid>
<TextBox x:Name="console_window" AllowDrop="False" IsReadOnly="True" VerticalScrollBarVisibility="Visible" IsUndoEnabled="False" TextWrapping="Wrap" FontFamily="Courier New" HorizontalAlignment="Left" Width="540" Margin="10,10,10,10" VerticalAlignment="Top" Height="200"/>
<Button x:Name="Button_Run" Content="Run" Width="75" Click="Button_Run_Click" Height="20" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="475,220,0,0" ToolTip="Listen to mouse/clipboard events" IsEnabled="False"/>
<Button x:Name="Button_Settings" Content="Settings" HorizontalAlignment="Left" Margin="395,220,0,0" VerticalAlignment="Top" Width="75" Click="Button_Settings_Click" ToolTip="Open up settings window"/>
</Grid>
</Window>
Loading

0 comments on commit 676141d

Please sign in to comment.