Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheric0210 committed Apr 6, 2022
1 parent a1dd99b commit 0081e58
Show file tree
Hide file tree
Showing 12 changed files with 666 additions and 752 deletions.
Binary file modified .vs/AutoKkutu/v17/.suo
Binary file not shown.
36 changes: 36 additions & 0 deletions Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoKkutu
{
public class Config
{
public const string DBAUTOUPDATE_GAME_END = "게임이 끝났을 때";
public const int DBAUTOUPDATE_GAME_END_INDEX = 0;
public const string DBAUTOUPDATE_ROUND_END = "라운드가 끝났을 때";
public const int DBAUTOUPDATE_GAME_ROUND_INDEX = 1;

public const string WORDPREFERENCE_BY_DAMAGE = "단어의 공격력 우선";
public const int WORDPREFERENCE_BY_DAMAGE_INDEX = 0;
public const string WORDPREFERENCE_BY_LENGTH = "단어의 길이 우선";
public const int WORDPREFERENCE_BY_LENGTH_INDEX = 1;

public bool AutoEnter = true;
public bool AutoDBUpdate = true;
public int AutoDBUpdateMode = DBAUTOUPDATE_GAME_END_INDEX;
public int WordPreference = WORDPREFERENCE_BY_DAMAGE_INDEX;
public bool UseEndWord = false;
public bool ReturnMode = false;
public bool AutoFix = true;
public bool MissionDetection = true;

public Config()
{
}
}
}
124 changes: 124 additions & 0 deletions ConfigWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<Window x:Class="AutoKkutu.ConfigWindow" xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:AutoKkutu" mc:Ignorable="d" Title="Configuration" Height="Auto" Width="Auto" ResizeMode="CanResizeWithGrip" SizeToContent="WidthAndHeight">
<Grid UseLayoutRounding="True" Background="#252526">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid UseLayoutRounding="True" Background="#FF333337" Margin="15,15,15,15">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Name="AutoEnter" Content="자동 단어 입력 활성화" IsChecked="True" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Margin="5,10,5,0" VerticalAlignment="Top" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFFFFFFF" FontSize="16" />
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="5,15,5,0"/>
<Label Content="자동으로 가장 적절한 단어를 선택하여 입력합니다." Grid.Row="0" Grid.Column="2" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,5,10,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
</Grid>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Name="DBAutoUpdate" Content="데이터베이스 자동 업데이트" IsChecked="True" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Margin="5,10,5,0" VerticalAlignment="Top" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFFFFFFF" FontSize="16" />
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" Margin="5,15,5,0"/>
<Label Content="이전에 제시되었던 단어들을 기반으로 데이터베이스를 개선합니다." Grid.Row="0" Grid.Column="2" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,5,10,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
<ComboBox Name="DBAutoUpdateModeCB" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" MinWidth="150" Margin="40,5,5,0"/>
</Grid>
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox Name="WordPreference" Grid.Row="0" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Center" MinWidth="150" Margin="10,10,5,0"/>
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" Margin="5,20,5,0"/>
<Label Content="단어 추천 기준을 설정합니다." Grid.Row="0" Grid.Column="2" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,8,10,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Content="단어 공격력 최우선" Grid.Row="1" Grid.Column="0" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,8,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="14" Padding="20,5,5,5"/>
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" Margin="5,20,5,0"/>
<Label Content="한방 단어(활성화되었을 경우), 공격 단어 위주로 단어를 추천합니다" Grid.Row="1" Grid.Column="2" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,8,30,0" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="11"/>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Content="단어 길이 우선" Grid.Row="2" Grid.Column="0" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,8,5,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="14" Padding="20,5,5,5"/>
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Grid.Row="2" Grid.Column="1" VerticalAlignment="Top" Margin="5,20,5,0"/>
<Label Content="긴 단어 위주로 단어를 추천합니다" Grid.Row="2" Grid.Column="2" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,8,30,0" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="11"/>
</Grid>
</Grid>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Name="EndWord" Content="한방 단어 사용" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Margin="5,10,5,0" VerticalAlignment="Top" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFFFFFFF" FontSize="16" />
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="5,15,5,0"/>
<Label Content="한방 단어(-듐, -긶 등)을 사용합니다." Grid.Row="0" Grid.Column="2" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,5,10,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
</Grid>
<Grid Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Name="ReturnMode" Content="리턴" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Margin="5,10,5,0" VerticalAlignment="Top" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFFFFFFF" FontSize="16" />
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="5,15,5,0"/>
<Label Content="이미 사용했던 단어를 다시 사용할 수 있게 합니다." Grid.Row="0" Grid.Column="2" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,5,10,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
</Grid>
<Grid Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Name="AutoFix" Content="오답 자동 수정" IsChecked="True" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Margin="5,10,5,0" VerticalAlignment="Top" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFFFFFFF" FontSize="16" />
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="5,15,5,0"/>
<Label Content="입력한 단어가 잘못되었다고 떴을 때, 자동으로 다음 단어를 입력하고 해당 단어를 더이상 추천하지 않습니다." Grid.Row="0" Grid.Column="2" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,5,10,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
</Grid>
<Grid Grid.Row="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Name="MissionDetection" Content="미션 감지 및 단어 선호도 조정" IsChecked="True" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Margin="5,10,5,0" VerticalAlignment="Top" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFFFFFFF" FontSize="16" />
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="5,15,5,0"/>
<Label Content="미션 글자를 감지했을 경우, 해당 글자가 많이 존재하는 단어들 위주로 단어를 추천합니다." Grid.Row="0" Grid.Column="2" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" Foreground="#FFBDBDBD" Margin="5,5,10,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
</Grid>
</Grid>
<Button Name="Cancel" Content="취소" Grid.Row="1" Grid.Column="0" Margin="20,0,135,20" IsDefault="True" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" FontSize="14" MinWidth="100" MinHeight="20" Click="Cancel_Click" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
<Button Name="Submit" Content="적용" Grid.Row="1" Grid.Column="0" Margin="20,0,20,20" IsDefault="True" FontFamily="/AutoKkutu;component/Resources/Font/#NanumBarunGothic" FontSize="14" MinWidth="100" MinHeight="20" Click="Submit_Click" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
</Grid>
</Window>
59 changes: 59 additions & 0 deletions ConfigWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace AutoKkutu
{
/// <summary>
/// ConfigWindow.xaml에 대한 상호 작용 논리
/// </summary>
public partial class ConfigWindow : Window
{
public ConfigWindow(Config config)
{
InitializeComponent();
DBAutoUpdateModeCB.ItemsSource = new string[] { Config.DBAUTOUPDATE_GAME_END, Config.DBAUTOUPDATE_ROUND_END };
WordPreference.ItemsSource = new string[] { Config.WORDPREFERENCE_BY_DAMAGE, Config.WORDPREFERENCE_BY_LENGTH };

AutoEnter.IsChecked = config.AutoEnter;
DBAutoUpdate.IsChecked = config.AutoDBUpdate;
DBAutoUpdateModeCB.SelectedIndex = config.AutoDBUpdateMode;
WordPreference.SelectedIndex = config.WordPreference;
EndWord.IsChecked = config.UseEndWord;
ReturnMode.IsChecked = config.ReturnMode;
AutoFix.IsChecked = config.AutoFix;
MissionDetection.IsChecked = config.MissionDetection;
}

private void Submit_Click(object sender, RoutedEventArgs e)
{
Dispatcher.Invoke(() => MainWindow.UpdateConfig(new Config
{
AutoEnter = AutoEnter.IsChecked ?? false,
AutoDBUpdate = DBAutoUpdate.IsChecked ?? false,
AutoDBUpdateMode = DBAutoUpdateModeCB.SelectedIndex,
WordPreference = WordPreference.SelectedIndex,
UseEndWord = EndWord.IsChecked ?? false,
ReturnMode = ReturnMode.IsChecked ?? false,
AutoFix = AutoFix.IsChecked ?? false,
MissionDetection = MissionDetection.IsChecked ?? false
}));
Close();
}

private void Cancel_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}
Loading

0 comments on commit 0081e58

Please sign in to comment.