mirror of
https://github.com/k1tbyte/Wand-Enhancer.git
synced 2026-08-28 17:01:04 +00:00
feat: implement localization support and add language settings
This commit is contained in:
@@ -138,3 +138,7 @@ dist
|
||||
packages
|
||||
*/bin/
|
||||
*/obj/
|
||||
*/obj/.nuget/
|
||||
|
||||
# App settings (user preferences)
|
||||
appsettings.json
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Locale/lang.en-US.xaml"/>
|
||||
<ResourceDictionary Source="Style/ColorScheme.xaml"/>
|
||||
<ResourceDictionary Source="Style/Styles.xaml"/>
|
||||
<ResourceDictionary Source="Style/Icons.xaml"/>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using WeModPatcher.Core;
|
||||
using WeModPatcher.Core.Services;
|
||||
using WeModPatcher.View.MainWindow;
|
||||
using MessageBox = System.Windows.Forms.MessageBox;
|
||||
|
||||
@@ -14,6 +15,7 @@ namespace WeModPatcher
|
||||
{
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
LocalizationManager.Initialize();
|
||||
this.MainWindow.Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace WeModPatcher
|
||||
public static readonly string RepositoryUrl = $"https://github.com/{Owner}/{RepoName}";
|
||||
public static readonly Version Version;
|
||||
public static readonly string[] WeModBrandNames = { "Wand", "WeMod" };
|
||||
public const string AppSettingsFileName = "appsettings.json";
|
||||
|
||||
public const string ProxyDllResouceName = "proxydll";
|
||||
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
|
||||
namespace WeModPatcher.Core.Services
|
||||
{
|
||||
public static class LocalizationManager
|
||||
{
|
||||
public static readonly List<CultureInfo> SupportedLanguages = new List<CultureInfo>
|
||||
{
|
||||
new CultureInfo("en-US"),
|
||||
new CultureInfo("zh-CN"),
|
||||
new CultureInfo("de-DE"),
|
||||
new CultureInfo("fr-FR"),
|
||||
new CultureInfo("es-ES"),
|
||||
new CultureInfo("it-IT"),
|
||||
new CultureInfo("pt-BR"),
|
||||
new CultureInfo("pl-PL"),
|
||||
new CultureInfo("ru-RU"),
|
||||
new CultureInfo("uk-UA"),
|
||||
new CultureInfo("ja-JP"),
|
||||
new CultureInfo("tr-TR")
|
||||
};
|
||||
|
||||
private static CultureInfo _currentLanguage;
|
||||
private static ResourceDictionary _englishBaseDictionary;
|
||||
|
||||
public static CultureInfo CurrentLanguage
|
||||
{
|
||||
get => _currentLanguage;
|
||||
set => SetLanguage(value);
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
// Load English as the base fallback dictionary
|
||||
_englishBaseDictionary = new ResourceDictionary
|
||||
{
|
||||
Source = new Uri("Locale/lang.en-US.xaml", UriKind.Relative)
|
||||
};
|
||||
|
||||
// Try to load saved language preference
|
||||
var savedLanguage = SettingsManager.LoadSettings()?.Language;
|
||||
CultureInfo targetCulture = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(savedLanguage))
|
||||
{
|
||||
targetCulture = SupportedLanguages.FirstOrDefault(c => c.Name == savedLanguage);
|
||||
}
|
||||
|
||||
if (targetCulture == null)
|
||||
{
|
||||
// Fall back to system culture detection
|
||||
var systemCulture = Thread.CurrentThread.CurrentUICulture;
|
||||
targetCulture = SupportedLanguages.FirstOrDefault(c =>
|
||||
c.Name == systemCulture.Name ||
|
||||
c.TwoLetterISOLanguageName == systemCulture.TwoLetterISOLanguageName);
|
||||
}
|
||||
|
||||
SetLanguage(targetCulture ?? SupportedLanguages[0], saveSettings: false);
|
||||
}
|
||||
|
||||
private static void SetLanguage(CultureInfo culture, bool saveSettings = true)
|
||||
{
|
||||
if (culture == null)
|
||||
throw new ArgumentNullException(nameof(culture));
|
||||
|
||||
if (Equals(culture, _currentLanguage))
|
||||
return;
|
||||
|
||||
var supportedCulture = SupportedLanguages.FirstOrDefault(c => c.Name == culture.Name);
|
||||
if (supportedCulture == null)
|
||||
{
|
||||
supportedCulture = SupportedLanguages[0]; // Default to English
|
||||
}
|
||||
|
||||
_currentLanguage = supportedCulture;
|
||||
Thread.CurrentThread.CurrentUICulture = supportedCulture;
|
||||
|
||||
// Create the locale dictionary with English as base for fallback
|
||||
var localeDict = new ResourceDictionary();
|
||||
|
||||
// First, add English base dictionary for fallback
|
||||
if (_englishBaseDictionary != null && supportedCulture.Name != SupportedLanguages[0].Name)
|
||||
{
|
||||
foreach (var key in _englishBaseDictionary.Keys)
|
||||
{
|
||||
localeDict[key] = _englishBaseDictionary[key];
|
||||
}
|
||||
}
|
||||
|
||||
// Then overlay with the selected language (will override English keys)
|
||||
var targetDict = new ResourceDictionary
|
||||
{
|
||||
Source = new Uri($"Locale/lang.{supportedCulture.Name}.xaml", UriKind.Relative)
|
||||
};
|
||||
|
||||
foreach (DictionaryEntry entry in targetDict)
|
||||
{
|
||||
localeDict[entry.Key] = targetDict[entry.Key];
|
||||
}
|
||||
|
||||
// Find and replace the old locale dictionary
|
||||
var oldDict = Application.Current.Resources.MergedDictionaries
|
||||
.FirstOrDefault(d => d.Source != null && d.Source.OriginalString.StartsWith("Locale/lang."));
|
||||
|
||||
if (oldDict != null)
|
||||
{
|
||||
var index = Application.Current.Resources.MergedDictionaries.IndexOf(oldDict);
|
||||
Application.Current.Resources.MergedDictionaries.Remove(oldDict);
|
||||
Application.Current.Resources.MergedDictionaries.Insert(index, localeDict);
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.Current.Resources.MergedDictionaries.Add(localeDict);
|
||||
}
|
||||
|
||||
if (saveSettings)
|
||||
{
|
||||
SettingsManager.SaveSettings(new AppSettings { Language = supportedCulture.Name });
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetLanguageDisplayName(CultureInfo culture)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dict = new ResourceDictionary
|
||||
{
|
||||
Source = new Uri($"Locale/lang.{culture.Name}.xaml", UriKind.Relative)
|
||||
};
|
||||
|
||||
if (dict.Contains("language_display_name"))
|
||||
{
|
||||
return dict["language_display_name"] as string ?? culture.NativeName;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Fallback to native name if loading fails
|
||||
}
|
||||
|
||||
return culture.NativeName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace WeModPatcher.Core.Services
|
||||
{
|
||||
public class AppSettings
|
||||
{
|
||||
public string Language { get; set; }
|
||||
}
|
||||
|
||||
public static class SettingsManager
|
||||
{
|
||||
private static readonly string SettingsPath = Path.Combine(
|
||||
AppDomain.CurrentDomain.BaseDirectory,
|
||||
Constants.AppSettingsFileName);
|
||||
|
||||
public static AppSettings LoadSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(SettingsPath))
|
||||
{
|
||||
var json = File.ReadAllText(SettingsPath);
|
||||
return JsonConvert.DeserializeObject<AppSettings>(json);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Settings loading is non-critical - silently fall back to defaults
|
||||
// This can fail due to file permissions, corrupted JSON, etc.
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void SaveSettings(AppSettings settings)
|
||||
{
|
||||
try
|
||||
{
|
||||
var json = JsonConvert.SerializeObject(settings, Formatting.Indented);
|
||||
File.WriteAllText(SettingsPath, json);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Settings saving is non-critical - silently ignore errors
|
||||
// This can fail due to file permissions or read-only directories
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">Deutsch</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">Eine neue Version ist verfügbar</s:String>
|
||||
<s:String x:Key="mw_folder_path">Ordnerpfad</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">Ordner nicht gefunden</s:String>
|
||||
<s:String x:Key="mw_patch">Patch</s:String>
|
||||
<s:String x:Key="mw_restore">Wiederherstellen</s:String>
|
||||
<s:String x:Key="mw_source_code">Quellcode</s:String>
|
||||
<s:String x:Key="mw_made_by">Mit ❤️ von k1tbyte erstellt</s:String>
|
||||
<s:String x:Key="mw_star_hint">Gib einen Stern, wenn dir das geholfen hat ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">Einstellungen</s:String>
|
||||
<s:String x:Key="settings_language">Sprache</s:String>
|
||||
<s:String x:Key="settings_save">Speichern</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">WeMod Pro aktivieren</s:String>
|
||||
<s:String x:Key="pv_devtools">DevTools mit F12</s:String>
|
||||
<s:String x:Key="pv_disable_updates">Updates deaktivieren</s:String>
|
||||
<s:String x:Key="pv_start">Starten</s:String>
|
||||
<s:String x:Key="pv_popup_title">Was werden wir patchen?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">Vor dem Update wird dringend empfohlen, Patches rückgängig zu machen, falls sie angewendet wurden</s:String>
|
||||
<s:String x:Key="up_update_now">Jetzt aktualisieren</s:String>
|
||||
<s:String x:Key="up_popup_title">Update verfügbar!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">English</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">A new version is available</s:String>
|
||||
<s:String x:Key="mw_folder_path">Folder path</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">Folder not found</s:String>
|
||||
<s:String x:Key="mw_patch">Patch</s:String>
|
||||
<s:String x:Key="mw_restore">Restore</s:String>
|
||||
<s:String x:Key="mw_source_code">Source code</s:String>
|
||||
<s:String x:Key="mw_made_by">Made with ❤️ by k1tbyte</s:String>
|
||||
<s:String x:Key="mw_star_hint">Put a star if you found this helpful ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">Settings</s:String>
|
||||
<s:String x:Key="settings_language">Language</s:String>
|
||||
<s:String x:Key="settings_save">Save</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">Activate WeMod Pro</s:String>
|
||||
<s:String x:Key="pv_devtools">DevTools on F12</s:String>
|
||||
<s:String x:Key="pv_disable_updates">Disable updates</s:String>
|
||||
<s:String x:Key="pv_start">Start</s:String>
|
||||
<s:String x:Key="pv_popup_title">What are we gonna patch?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">Before updating, it is strongly recommended to roll back patches if they have been applied</s:String>
|
||||
<s:String x:Key="up_update_now">Update now</s:String>
|
||||
<s:String x:Key="up_popup_title">Update available!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">Español</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">Una nueva versión está disponible</s:String>
|
||||
<s:String x:Key="mw_folder_path">Ruta de la carpeta</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">Carpeta no encontrada</s:String>
|
||||
<s:String x:Key="mw_patch">Parchear</s:String>
|
||||
<s:String x:Key="mw_restore">Restaurar</s:String>
|
||||
<s:String x:Key="mw_source_code">Código fuente</s:String>
|
||||
<s:String x:Key="mw_made_by">Hecho con ❤️ por k1tbyte</s:String>
|
||||
<s:String x:Key="mw_star_hint">Pon una estrella si te fue útil ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">Configuración</s:String>
|
||||
<s:String x:Key="settings_language">Idioma</s:String>
|
||||
<s:String x:Key="settings_save">Guardar</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">Activar WeMod Pro</s:String>
|
||||
<s:String x:Key="pv_devtools">DevTools en F12</s:String>
|
||||
<s:String x:Key="pv_disable_updates">Desactivar actualizaciones</s:String>
|
||||
<s:String x:Key="pv_start">Iniciar</s:String>
|
||||
<s:String x:Key="pv_popup_title">¿Qué vamos a parchear?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">Antes de actualizar, se recomienda encarecidamente revertir los parches si se han aplicado</s:String>
|
||||
<s:String x:Key="up_update_now">Actualizar ahora</s:String>
|
||||
<s:String x:Key="up_popup_title">¡Actualización disponible!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">Français</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">Une nouvelle version est disponible</s:String>
|
||||
<s:String x:Key="mw_folder_path">Chemin du dossier</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">Dossier non trouvé</s:String>
|
||||
<s:String x:Key="mw_patch">Patcher</s:String>
|
||||
<s:String x:Key="mw_restore">Restaurer</s:String>
|
||||
<s:String x:Key="mw_source_code">Code source</s:String>
|
||||
<s:String x:Key="mw_made_by">Fait avec ❤️ par k1tbyte</s:String>
|
||||
<s:String x:Key="mw_star_hint">Mettez une étoile si cela vous a aidé ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">Paramètres</s:String>
|
||||
<s:String x:Key="settings_language">Langue</s:String>
|
||||
<s:String x:Key="settings_save">Enregistrer</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">Activer WeMod Pro</s:String>
|
||||
<s:String x:Key="pv_devtools">DevTools sur F12</s:String>
|
||||
<s:String x:Key="pv_disable_updates">Désactiver les mises à jour</s:String>
|
||||
<s:String x:Key="pv_start">Démarrer</s:String>
|
||||
<s:String x:Key="pv_popup_title">Qu'allons-nous patcher ?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">Avant la mise à jour, il est fortement recommandé d'annuler les patchs s'ils ont été appliqués</s:String>
|
||||
<s:String x:Key="up_update_now">Mettre à jour maintenant</s:String>
|
||||
<s:String x:Key="up_popup_title">Mise à jour disponible !</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">Italiano</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">È disponibile una nuova versione</s:String>
|
||||
<s:String x:Key="mw_folder_path">Percorso cartella</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">Cartella non trovata</s:String>
|
||||
<s:String x:Key="mw_patch">Patch</s:String>
|
||||
<s:String x:Key="mw_restore">Ripristina</s:String>
|
||||
<s:String x:Key="mw_source_code">Codice sorgente</s:String>
|
||||
<s:String x:Key="mw_made_by">Creato con ❤️ da k1tbyte</s:String>
|
||||
<s:String x:Key="mw_star_hint">Metti una stella se ti è stato utile ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">Impostazioni</s:String>
|
||||
<s:String x:Key="settings_language">Lingua</s:String>
|
||||
<s:String x:Key="settings_save">Salva</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">Attiva WeMod Pro</s:String>
|
||||
<s:String x:Key="pv_devtools">DevTools su F12</s:String>
|
||||
<s:String x:Key="pv_disable_updates">Disattiva aggiornamenti</s:String>
|
||||
<s:String x:Key="pv_start">Avvia</s:String>
|
||||
<s:String x:Key="pv_popup_title">Cosa patcheremo?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">Prima dell'aggiornamento, si consiglia vivamente di annullare le patch se sono state applicate</s:String>
|
||||
<s:String x:Key="up_update_now">Aggiorna ora</s:String>
|
||||
<s:String x:Key="up_popup_title">Aggiornamento disponibile!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">日本語</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">新しいバージョンが利用可能です</s:String>
|
||||
<s:String x:Key="mw_folder_path">フォルダパス</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">フォルダが見つかりません</s:String>
|
||||
<s:String x:Key="mw_patch">パッチ</s:String>
|
||||
<s:String x:Key="mw_restore">復元</s:String>
|
||||
<s:String x:Key="mw_source_code">ソースコード</s:String>
|
||||
<s:String x:Key="mw_made_by">k1tbyte が ❤️ を込めて作成</s:String>
|
||||
<s:String x:Key="mw_star_hint">役に立ったらスターをつけてください ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">設定</s:String>
|
||||
<s:String x:Key="settings_language">言語</s:String>
|
||||
<s:String x:Key="settings_save">保存</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">WeMod Pro を有効化</s:String>
|
||||
<s:String x:Key="pv_devtools">F12でDevTools</s:String>
|
||||
<s:String x:Key="pv_disable_updates">アップデートを無効化</s:String>
|
||||
<s:String x:Key="pv_start">開始</s:String>
|
||||
<s:String x:Key="pv_popup_title">何をパッチしますか?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">アップデート前に、パッチが適用されている場合はロールバックすることを強くお勧めします</s:String>
|
||||
<s:String x:Key="up_update_now">今すぐ更新</s:String>
|
||||
<s:String x:Key="up_popup_title">アップデート利用可能!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">Polski</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">Dostępna jest nowa wersja</s:String>
|
||||
<s:String x:Key="mw_folder_path">Ścieżka folderu</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">Folder nie znaleziony</s:String>
|
||||
<s:String x:Key="mw_patch">Patchuj</s:String>
|
||||
<s:String x:Key="mw_restore">Przywróć</s:String>
|
||||
<s:String x:Key="mw_source_code">Kod źródłowy</s:String>
|
||||
<s:String x:Key="mw_made_by">Wykonane z ❤️ przez k1tbyte</s:String>
|
||||
<s:String x:Key="mw_star_hint">Daj gwiazdkę, jeśli ci pomogło ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">Ustawienia</s:String>
|
||||
<s:String x:Key="settings_language">Język</s:String>
|
||||
<s:String x:Key="settings_save">Zapisz</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">Aktywuj WeMod Pro</s:String>
|
||||
<s:String x:Key="pv_devtools">DevTools na F12</s:String>
|
||||
<s:String x:Key="pv_disable_updates">Wyłącz aktualizacje</s:String>
|
||||
<s:String x:Key="pv_start">Rozpocznij</s:String>
|
||||
<s:String x:Key="pv_popup_title">Co będziemy patchować?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">Przed aktualizacją zdecydowanie zaleca się cofnięcie patchów, jeśli zostały zastosowane</s:String>
|
||||
<s:String x:Key="up_update_now">Aktualizuj teraz</s:String>
|
||||
<s:String x:Key="up_popup_title">Dostępna aktualizacja!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">Português</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">Uma nova versão está disponível</s:String>
|
||||
<s:String x:Key="mw_folder_path">Caminho da pasta</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">Pasta não encontrada</s:String>
|
||||
<s:String x:Key="mw_patch">Patch</s:String>
|
||||
<s:String x:Key="mw_restore">Restaurar</s:String>
|
||||
<s:String x:Key="mw_source_code">Código fonte</s:String>
|
||||
<s:String x:Key="mw_made_by">Feito com ❤️ por k1tbyte</s:String>
|
||||
<s:String x:Key="mw_star_hint">Dê uma estrela se isso te ajudou ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">Configurações</s:String>
|
||||
<s:String x:Key="settings_language">Idioma</s:String>
|
||||
<s:String x:Key="settings_save">Salvar</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">Ativar WeMod Pro</s:String>
|
||||
<s:String x:Key="pv_devtools">DevTools no F12</s:String>
|
||||
<s:String x:Key="pv_disable_updates">Desativar atualizações</s:String>
|
||||
<s:String x:Key="pv_start">Iniciar</s:String>
|
||||
<s:String x:Key="pv_popup_title">O que vamos patchear?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">Antes de atualizar, é altamente recomendável reverter os patches se eles foram aplicados</s:String>
|
||||
<s:String x:Key="up_update_now">Atualizar agora</s:String>
|
||||
<s:String x:Key="up_popup_title">Atualização disponível!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">Русский</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">Доступна новая версия</s:String>
|
||||
<s:String x:Key="mw_folder_path">Путь к папке</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">Папка не найдена</s:String>
|
||||
<s:String x:Key="mw_patch">Патч</s:String>
|
||||
<s:String x:Key="mw_restore">Восстановить</s:String>
|
||||
<s:String x:Key="mw_source_code">Исходный код</s:String>
|
||||
<s:String x:Key="mw_made_by">Сделано с ❤️ by k1tbyte</s:String>
|
||||
<s:String x:Key="mw_star_hint">Поставьте звезду, если это было полезно ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">Настройки</s:String>
|
||||
<s:String x:Key="settings_language">Язык</s:String>
|
||||
<s:String x:Key="settings_save">Сохранить</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">Активировать WeMod Pro</s:String>
|
||||
<s:String x:Key="pv_devtools">DevTools на F12</s:String>
|
||||
<s:String x:Key="pv_disable_updates">Отключить обновления</s:String>
|
||||
<s:String x:Key="pv_start">Начать</s:String>
|
||||
<s:String x:Key="pv_popup_title">Что будем патчить?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">Перед обновлением настоятельно рекомендуется откатить патчи, если они были применены</s:String>
|
||||
<s:String x:Key="up_update_now">Обновить сейчас</s:String>
|
||||
<s:String x:Key="up_popup_title">Доступно обновление!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">Türkçe</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">Yeni bir sürüm mevcut</s:String>
|
||||
<s:String x:Key="mw_folder_path">Klasör yolu</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">Klasör bulunamadı</s:String>
|
||||
<s:String x:Key="mw_patch">Yama</s:String>
|
||||
<s:String x:Key="mw_restore">Geri Yükle</s:String>
|
||||
<s:String x:Key="mw_source_code">Kaynak kodu</s:String>
|
||||
<s:String x:Key="mw_made_by">k1tbyte tarafından ❤️ ile yapıldı</s:String>
|
||||
<s:String x:Key="mw_star_hint">Yardımcı olduysa yıldız verin ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">Ayarlar</s:String>
|
||||
<s:String x:Key="settings_language">Dil</s:String>
|
||||
<s:String x:Key="settings_save">Kaydet</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">WeMod Pro'yu Etkinleştir</s:String>
|
||||
<s:String x:Key="pv_devtools">F12 ile DevTools</s:String>
|
||||
<s:String x:Key="pv_disable_updates">Güncellemeleri devre dışı bırak</s:String>
|
||||
<s:String x:Key="pv_start">Başlat</s:String>
|
||||
<s:String x:Key="pv_popup_title">Ne yamalayacağız?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">Güncellemeden önce, yamalar uygulandıysa geri almak şiddetle tavsiye edilir</s:String>
|
||||
<s:String x:Key="up_update_now">Şimdi güncelle</s:String>
|
||||
<s:String x:Key="up_popup_title">Güncelleme mevcut!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">Українська</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">Доступна нова версія</s:String>
|
||||
<s:String x:Key="mw_folder_path">Шлях до папки</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">Папку не знайдено</s:String>
|
||||
<s:String x:Key="mw_patch">Патч</s:String>
|
||||
<s:String x:Key="mw_restore">Відновити</s:String>
|
||||
<s:String x:Key="mw_source_code">Вихідний код</s:String>
|
||||
<s:String x:Key="mw_made_by">Зроблено з ❤️ by k1tbyte</s:String>
|
||||
<s:String x:Key="mw_star_hint">Поставте зірку, якщо це було корисно ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">Налаштування</s:String>
|
||||
<s:String x:Key="settings_language">Мова</s:String>
|
||||
<s:String x:Key="settings_save">Зберегти</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">Активувати WeMod Pro</s:String>
|
||||
<s:String x:Key="pv_devtools">DevTools на F12</s:String>
|
||||
<s:String x:Key="pv_disable_updates">Вимкнути оновлення</s:String>
|
||||
<s:String x:Key="pv_start">Почати</s:String>
|
||||
<s:String x:Key="pv_popup_title">Що будемо патчити?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">Перед оновленням наполегливо рекомендується відкотити патчі, якщо вони були застосовані</s:String>
|
||||
<s:String x:Key="up_update_now">Оновити зараз</s:String>
|
||||
<s:String x:Key="up_popup_title">Доступне оновлення!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--#region Language Metadata -->
|
||||
<s:String x:Key="language_display_name">简体中文</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region MainWindow -->
|
||||
<s:String x:Key="mw_title">WeMod Patcher</s:String>
|
||||
<s:String x:Key="mw_update_available">有新版本可用</s:String>
|
||||
<s:String x:Key="mw_folder_path">文件夹路径</s:String>
|
||||
<s:String x:Key="mw_folder_not_found">未找到文件夹</s:String>
|
||||
<s:String x:Key="mw_patch">补丁</s:String>
|
||||
<s:String x:Key="mw_restore">恢复</s:String>
|
||||
<s:String x:Key="mw_source_code">源代码</s:String>
|
||||
<s:String x:Key="mw_made_by">由 k1tbyte 用 ❤️ 制作</s:String>
|
||||
<s:String x:Key="mw_star_hint">如果这对您有帮助,请给个星标 ;)</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region Settings -->
|
||||
<s:String x:Key="settings_title">设置</s:String>
|
||||
<s:String x:Key="settings_language">语言</s:String>
|
||||
<s:String x:Key="settings_save">保存</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region PatchVectorsPopup -->
|
||||
<s:String x:Key="pv_activate_pro">激活 WeMod Pro</s:String>
|
||||
<s:String x:Key="pv_devtools">按 F12 打开开发者工具</s:String>
|
||||
<s:String x:Key="pv_disable_updates">禁用更新</s:String>
|
||||
<s:String x:Key="pv_start">开始</s:String>
|
||||
<s:String x:Key="pv_popup_title">我们要打什么补丁?</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
<!--#region UpdatePopup -->
|
||||
<s:String x:Key="up_warning">在更新之前,强烈建议回滚已应用的补丁</s:String>
|
||||
<s:String x:Key="up_update_now">立即更新</s:String>
|
||||
<s:String x:Key="up_popup_title">有更新可用!</s:String>
|
||||
<!--#endregion -->
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -211,7 +211,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border BorderBrush="{DynamicResource Border}"
|
||||
BorderThickness="0 0 1 0" IsHitTestVisible="False">
|
||||
<TextBlock Text="{TemplateBinding Uid}"
|
||||
<TextBlock Text="{DynamicResource mw_folder_path}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource MutedForeground}"
|
||||
@@ -225,7 +225,7 @@
|
||||
<TextBlock IsHitTestVisible="False"
|
||||
Grid.Column="1"
|
||||
Opacity="0.3"
|
||||
Text="{TemplateBinding Tag}"
|
||||
Text="{DynamicResource mw_folder_not_found}"
|
||||
Margin="7 0 5 1"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="Collapsed"
|
||||
@@ -242,4 +242,113 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type ComboBox}">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource Border}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource Foreground}"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Padding" Value="10 0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ComboBox}">
|
||||
<Grid>
|
||||
<ToggleButton x:Name="ToggleButton"
|
||||
Focusable="False"
|
||||
Background="Transparent"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ClickMode="Press">
|
||||
<ToggleButton.Template>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Border x:Name="Border" CornerRadius="3"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Background="Transparent">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Grid.Column="1" BorderBrush="{DynamicResource Border}"
|
||||
BorderThickness="1 0 0 0" Margin="0 5"/>
|
||||
<Path x:Name="Arrow" Grid.Column="1"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Data="M0,0 L4,4 L8,0" Stroke="{DynamicResource MutedForeground}"
|
||||
StrokeThickness="1.5"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource Secondary}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</ToggleButton.Template>
|
||||
</ToggleButton>
|
||||
<ContentPresenter x:Name="ContentSite"
|
||||
IsHitTestVisible="False"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
||||
Margin="10,0,25,0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"/>
|
||||
<Popup x:Name="Popup"
|
||||
Placement="Bottom"
|
||||
IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
AllowsTransparency="True"
|
||||
Focusable="False"
|
||||
PopupAnimation="Slide">
|
||||
<Grid x:Name="DropDown"
|
||||
SnapsToDevicePixels="True"
|
||||
MinWidth="{TemplateBinding ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
||||
<Border x:Name="DropDownBorder"
|
||||
CornerRadius="3"
|
||||
Margin="0 2 0 0"
|
||||
Background="{DynamicResource Background}"
|
||||
BorderBrush="{DynamicResource Border}"
|
||||
BorderThickness="1">
|
||||
<ScrollViewer Margin="4" SnapsToDevicePixels="True">
|
||||
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained"/>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type ComboBoxItem}">
|
||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource Foreground}"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Padding" Value="8 5"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
|
||||
<Border x:Name="Border" CornerRadius="3" Padding="{TemplateBinding Padding}"
|
||||
Background="Transparent">
|
||||
<ContentPresenter/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource Secondary}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource Accent}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -50,7 +50,7 @@
|
||||
ToolTip="Click to update"
|
||||
Command="{Binding UpdateCommand}"
|
||||
Visibility="{Binding IsUpdateAvailable, Converter={StaticResource ToVisibilityConverter}}"
|
||||
Content="A new version is available"/>
|
||||
Content="{DynamicResource mw_update_available}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
@@ -59,6 +59,7 @@
|
||||
Width="25" Height="25" Padding="5.5"
|
||||
Style="{StaticResource IconButton}"
|
||||
Tag="{StaticResource CogIcon}"
|
||||
Command="{Binding OpenSettingsCommand}"
|
||||
/>
|
||||
<Button
|
||||
Margin="9 0 15 0"
|
||||
@@ -95,9 +96,9 @@
|
||||
|
||||
<Grid Margin="10" Cursor="Hand" Background="Transparent">
|
||||
<TextBox Style="{StaticResource TitledTextBox}"
|
||||
Uid="Folder path" IsReadOnly="True"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding WeModInfo.RootDirectory, Mode=OneWay}"
|
||||
VerticalAlignment="Center" Tag="Folder not found">
|
||||
VerticalAlignment="Center">
|
||||
</TextBox>
|
||||
<Grid.InputBindings>
|
||||
<MouseBinding Gesture="LeftClick" Command="{Binding SetFolderPathCommand}" />
|
||||
@@ -169,14 +170,15 @@
|
||||
<Button Style="{StaticResource ColoredButton}"
|
||||
IsEnabled="{Binding IsPatchEnabled}"
|
||||
FontWeight="Bold" FontSize="16" Width="200"
|
||||
Command="{Binding ApplyPatchCommand}">Patch</Button>
|
||||
Command="{Binding ApplyPatchCommand}"
|
||||
Content="{DynamicResource mw_patch}"/>
|
||||
</Grid>
|
||||
<Button HorizontalAlignment="Right"
|
||||
Command="{Binding RestoreBackupCommand }"
|
||||
FontWeight="Bold" FontSize="16" Width="200"
|
||||
Style="{StaticResource ColoredButton}"
|
||||
Visibility="{Binding AlreadyPatched, Converter={StaticResource ToVisibilityConverter}}"
|
||||
Content="Restore"/>
|
||||
Content="{DynamicResource mw_restore}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
@@ -194,13 +196,13 @@
|
||||
</Viewbox>
|
||||
<Grid>
|
||||
<TextBlock Margin="8 0 0 0" FontSize="10" Foreground="{DynamicResource AccentForeground}">
|
||||
<Hyperlink Foreground="{DynamicResource AccentForeground}">Source code </Hyperlink>
|
||||
<Hyperlink Foreground="{DynamicResource AccentForeground}"><Run Text="{DynamicResource mw_source_code}"/></Hyperlink>
|
||||
<LineBreak/>
|
||||
<Run>Made with ❤️ by k1tbyte</Run>
|
||||
<Run Text="{DynamicResource mw_made_by}"/>
|
||||
|
||||
|
||||
<LineBreak/>
|
||||
<Run Foreground="{DynamicResource MutedForeground}">Put a star if you found this helpful ;)</Run>
|
||||
<Run Foreground="{DynamicResource MutedForeground}" Text="{DynamicResource mw_star_hint}"/>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
@@ -72,6 +72,7 @@ namespace WeModPatcher.View.MainWindow
|
||||
public RelayCommand ApplyPatchCommand { get; }
|
||||
public RelayCommand RestoreBackupCommand { get; }
|
||||
public RelayCommand UpdateCommand { get; }
|
||||
public RelayCommand OpenSettingsCommand { get; }
|
||||
|
||||
private void OnFolderPathSelection(object obj)
|
||||
{
|
||||
@@ -162,7 +163,7 @@ namespace WeModPatcher.View.MainWindow
|
||||
IsPatchEnabled = true;
|
||||
}
|
||||
});
|
||||
}), "What are we gonna patch?");
|
||||
}), Application.Current.FindResource("pv_popup_title") as string);
|
||||
}
|
||||
|
||||
private void Log(string message, ELogType logType)
|
||||
@@ -199,7 +200,12 @@ namespace WeModPatcher.View.MainWindow
|
||||
|
||||
Log("WeModPatcher updated successfully. Restarting...", ELogType.Success);
|
||||
});
|
||||
}), "Update available!");
|
||||
}), Application.Current.FindResource("up_popup_title") as string);
|
||||
}
|
||||
|
||||
private void OnOpenSettings(object param)
|
||||
{
|
||||
MainWindow.Instance.OpenPopup(new SettingsPopup(), Application.Current.FindResource("settings_title") as string);
|
||||
}
|
||||
|
||||
public MainWindowVm(MainWindow view)
|
||||
@@ -210,6 +216,7 @@ namespace WeModPatcher.View.MainWindow
|
||||
ApplyPatchCommand = new RelayCommand(OnPatching);
|
||||
RestoreBackupCommand = new RelayCommand(OnBackupRestoring);
|
||||
UpdateCommand = new RelayCommand(OnUpdate);
|
||||
OpenSettingsCommand = new RelayCommand(OnOpenSettings);
|
||||
|
||||
WeModInfo = Extensions.FindWeMod();
|
||||
if (WeModInfo == null)
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" VerticalAlignment="Center" Text="Activate WeMod Pro" />
|
||||
<TextBlock Grid.Row="0" VerticalAlignment="Center" Text="{DynamicResource pv_activate_pro}" />
|
||||
<CheckBox Grid.Row="0" x:Name="ActivateProBox" HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
IsChecked="True" />
|
||||
|
||||
<TextBlock Grid.Row="1" VerticalAlignment="Center" Text="DevTools on F12" />
|
||||
<TextBlock Grid.Row="1" VerticalAlignment="Center" Text="{DynamicResource pv_devtools}" />
|
||||
<CheckBox Grid.Row="1" x:Name="DevToolsHotkeyBox" HorizontalAlignment="Right" VerticalAlignment="Center" />
|
||||
|
||||
<TextBlock Grid.Row="2" VerticalAlignment="Center" Text="Disable updates" />
|
||||
<TextBlock Grid.Row="2" VerticalAlignment="Center" Text="{DynamicResource pv_disable_updates}" />
|
||||
<CheckBox Grid.Row="2" x:Name="DisableUpdateBox" HorizontalAlignment="Right" VerticalAlignment="Center" />
|
||||
|
||||
<!--<TextBlock
|
||||
@@ -39,7 +39,7 @@
|
||||
<CheckBox Grid.Row="3" x:Name="AutoUpdates" HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
IsChecked="True" />-->
|
||||
|
||||
<Button Grid.Row="3" Padding="0 5 0 5" Margin="0 15 0 0" Content="Start"
|
||||
<Button Grid.Row="3" Padding="0 5 0 5" Margin="0 15 0 0" Content="{DynamicResource pv_start}"
|
||||
Click="OnPatchButtonClick" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<UserControl x:Class="WeModPatcher.View.Popups.SettingsPopup"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="Auto" d:DesignWidth="Auto"
|
||||
Background="{DynamicResource Background}"
|
||||
Foreground="{DynamicResource MutedForeground}"
|
||||
FontWeight="Medium"
|
||||
FontSize="13">
|
||||
<Grid MinWidth="250">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Margin="0 0 0 15">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" VerticalAlignment="Center"
|
||||
Text="{DynamicResource settings_language}" />
|
||||
<ComboBox Grid.Column="1" x:Name="LanguageComboBox"
|
||||
Width="130"
|
||||
SelectionChanged="OnLanguageSelectionChanged">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DisplayName}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
|
||||
<Button Grid.Row="1" Padding="0 5 0 5" Margin="0 5 0 0"
|
||||
Content="{DynamicResource settings_save}"
|
||||
Click="OnSaveClick" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,68 @@
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using WeModPatcher.Core;
|
||||
using WeModPatcher.Core.Services;
|
||||
using WeModPatcher.View.MainWindow;
|
||||
|
||||
namespace WeModPatcher.View.Popups
|
||||
{
|
||||
public partial class SettingsPopup : UserControl
|
||||
{
|
||||
private CultureInfo _selectedLanguage;
|
||||
|
||||
public SettingsPopup()
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadLanguages();
|
||||
}
|
||||
|
||||
private void LoadLanguages()
|
||||
{
|
||||
var items = LocalizationManager.SupportedLanguages
|
||||
.Select(c => new LanguageItem
|
||||
{
|
||||
Culture = c,
|
||||
DisplayName = LocalizationManager.GetLanguageDisplayName(c)
|
||||
})
|
||||
.ToList();
|
||||
|
||||
LanguageComboBox.ItemsSource = items;
|
||||
|
||||
var currentItem = items.FirstOrDefault(i => i.Culture.Name == LocalizationManager.CurrentLanguage?.Name);
|
||||
if (currentItem != null)
|
||||
{
|
||||
LanguageComboBox.SelectedItem = currentItem;
|
||||
}
|
||||
|
||||
_selectedLanguage = LocalizationManager.CurrentLanguage;
|
||||
}
|
||||
|
||||
private void OnLanguageSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (LanguageComboBox.SelectedItem is LanguageItem item)
|
||||
{
|
||||
_selectedLanguage = item.Culture;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSaveClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_selectedLanguage != null &&
|
||||
(LocalizationManager.CurrentLanguage == null ||
|
||||
_selectedLanguage.Name != LocalizationManager.CurrentLanguage.Name))
|
||||
{
|
||||
LocalizationManager.CurrentLanguage = _selectedLanguage;
|
||||
}
|
||||
|
||||
MainWindow.MainWindow.Instance.ClosePopup();
|
||||
}
|
||||
|
||||
private class LanguageItem
|
||||
{
|
||||
public CultureInfo Culture { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@
|
||||
FontSize="13">
|
||||
<StackPanel>
|
||||
|
||||
<TextBlock Foreground="Red" MaxWidth="320" TextAlignment="Center" Text="Before updating, it is strongly recommended to roll back patches if they have been applied" TextWrapping="Wrap" />
|
||||
<TextBlock Foreground="Red" MaxWidth="320" TextAlignment="Center" Text="{DynamicResource up_warning}" TextWrapping="Wrap" />
|
||||
|
||||
<Button Padding="0 5 0 5" Margin="0 15 0 0" Content="Update now"
|
||||
<Button Padding="0 5 0 5" Margin="0 15 0 0" Content="{DynamicResource up_update_now}"
|
||||
Click="OnUpdateClick" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -70,6 +70,8 @@
|
||||
<Compile Include="Converters\ToVisibilityConverter.cs" />
|
||||
<Compile Include="Core\Patcher.cs" />
|
||||
<Compile Include="Core\PatcherConfig.cs" />
|
||||
<Compile Include="Core\Services\LocalizationManager.cs" />
|
||||
<Compile Include="Core\Services\SettingsManager.cs" />
|
||||
<Compile Include="Models\WeModConfig.cs" />
|
||||
<Compile Include="Models\PatchConfig.cs" />
|
||||
<Compile Include="Models\Signature.cs" />
|
||||
@@ -91,6 +93,9 @@
|
||||
<Compile Include="View\Popups\PatchVectorsPopup.xaml.cs">
|
||||
<DependentUpon>PatchVectorsPopup.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Popups\SettingsPopup.xaml.cs">
|
||||
<DependentUpon>SettingsPopup.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
@@ -98,6 +103,18 @@
|
||||
<Compile Include="View\Popups\UpdatePopup.xaml.cs">
|
||||
<DependentUpon>UpdatePopup.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="Locale\lang.en-US.xaml" />
|
||||
<Page Include="Locale\lang.zh-CN.xaml" />
|
||||
<Page Include="Locale\lang.de-DE.xaml" />
|
||||
<Page Include="Locale\lang.fr-FR.xaml" />
|
||||
<Page Include="Locale\lang.es-ES.xaml" />
|
||||
<Page Include="Locale\lang.it-IT.xaml" />
|
||||
<Page Include="Locale\lang.pt-BR.xaml" />
|
||||
<Page Include="Locale\lang.pl-PL.xaml" />
|
||||
<Page Include="Locale\lang.ru-RU.xaml" />
|
||||
<Page Include="Locale\lang.uk-UA.xaml" />
|
||||
<Page Include="Locale\lang.ja-JP.xaml" />
|
||||
<Page Include="Locale\lang.tr-TR.xaml" />
|
||||
<Page Include="Style\ColorScheme.xaml" />
|
||||
<Page Include="Style\Icons.xaml" />
|
||||
<Page Include="Style\Styles.xaml" />
|
||||
@@ -105,6 +122,7 @@
|
||||
<Page Include="View\Controls\PopupHost.xaml" />
|
||||
<Page Include="View\MainWindow\MainWindow.xaml" />
|
||||
<Page Include="View\Popups\PatchVectorsPopup.xaml" />
|
||||
<Page Include="View\Popups\SettingsPopup.xaml" />
|
||||
<Page Include="View\Popups\UpdatePopup.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user