feat: 初回コミット (GameLauncher)
This commit is contained in:
commit
7ac4dbc825
45 files changed
+9779
No files matched your search
@@ -0,0 +1,51 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using GameLauncher.Models;
|
||||
|
||||
namespace GameLauncher
|
||||
{
|
||||
/// <summary>
|
||||
/// PlayerPrefsキー追加ダイアログ
|
||||
/// </summary>
|
||||
public partial class AddKeyDialog : Window
|
||||
{
|
||||
public string KeyName { get; private set; } = string.Empty;
|
||||
public PlayerPrefsType KeyType { get; private set; } = PlayerPrefsType.Int;
|
||||
public string KeyValue { get; private set; } = string.Empty;
|
||||
|
||||
public AddKeyDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
txtKeyName.Focus();
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var keyName = txtKeyName.Text.Trim();
|
||||
if (string.IsNullOrWhiteSpace(keyName))
|
||||
{
|
||||
MessageBox.Show("キー名を入力してください。", "入力エラー", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
KeyName = keyName;
|
||||
var selectedTag = (cmbKeyType.SelectedItem as ComboBoxItem)?.Tag?.ToString();
|
||||
KeyType = selectedTag switch
|
||||
{
|
||||
"Float" => PlayerPrefsType.Float,
|
||||
"String" => PlayerPrefsType.String,
|
||||
_ => PlayerPrefsType.Int
|
||||
};
|
||||
KeyValue = txtKeyValue.Text;
|
||||
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DialogResult = false;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user