diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c4efe2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,261 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc \ No newline at end of file diff --git a/DayZLootEdit.sln b/DayZLootEdit.sln new file mode 100644 index 0000000..fe90876 --- /dev/null +++ b/DayZLootEdit.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31105.61 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DayZLootEdit", "DayZLootEdit\DayZLootEdit.csproj", "{9747E2CC-3468-4864-A359-A2F0F1874450}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9747E2CC-3468-4864-A359-A2F0F1874450}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {9747E2CC-3468-4864-A359-A2F0F1874450}.Debug|Any CPU.Build.0 = Release|Any CPU + {9747E2CC-3468-4864-A359-A2F0F1874450}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9747E2CC-3468-4864-A359-A2F0F1874450}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {54C5E96A-06ED-4354-870B-F873442C8DAE} + EndGlobalSection +EndGlobal diff --git a/DayZLootEdit/App.config b/DayZLootEdit/App.config new file mode 100644 index 0000000..bae5d6d --- /dev/null +++ b/DayZLootEdit/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/DayZLootEdit/App.xaml b/DayZLootEdit/App.xaml new file mode 100644 index 0000000..5c0bc8b --- /dev/null +++ b/DayZLootEdit/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/DayZLootEdit/App.xaml.cs b/DayZLootEdit/App.xaml.cs new file mode 100644 index 0000000..25de200 --- /dev/null +++ b/DayZLootEdit/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace DayZLootEdit +{ + /// + /// Interaktionslogik für "App.xaml" + /// + public partial class App : Application + { + } +} diff --git a/DayZLootEdit/DayZLootEdit.csproj b/DayZLootEdit/DayZLootEdit.csproj new file mode 100644 index 0000000..9b0a79a --- /dev/null +++ b/DayZLootEdit/DayZLootEdit.csproj @@ -0,0 +1,160 @@ + + + + + Debug + AnyCPU + {9747E2CC-3468-4864-A359-A2F0F1874450} + WinExe + DayZLootEdit + DayZLootEdit + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 1 + 0.2.1.%2a + false + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + 229AEDC982ACA4F6C5DEAF6B83D2A10EEBE66534 + + + DayZLootEdit_TemporaryKey.pfx + + + true + + + true + + + dayz_types.ico + + + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + + InfoWindow.xaml + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + MainWindow.xaml + Code + + + Designer + MSBuild:Compile + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + False + Microsoft .NET Framework 4.6.1 %28x86 und x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + + + \ No newline at end of file diff --git a/DayZLootEdit/InfoWindow.xaml b/DayZLootEdit/InfoWindow.xaml new file mode 100644 index 0000000..97bba59 --- /dev/null +++ b/DayZLootEdit/InfoWindow.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DayZLootEdit/MainWindow.xaml.cs b/DayZLootEdit/MainWindow.xaml.cs new file mode 100644 index 0000000..e4e0036 --- /dev/null +++ b/DayZLootEdit/MainWindow.xaml.cs @@ -0,0 +1,1001 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Input; + +namespace DayZLootEdit +{ + /// + /// Interaktionslogik für MainWindow.xaml + /// + public partial class MainWindow : Window + { + + // VARIABLES + + private const string WINDOW_TITLE_DEFAULT = "DayZ Loot Editor"; + private const string WINDOW_TITLE_FILE = "DayZ Loot Editor - [%1]"; + + private string LootFile = ""; + private LootTable LootTable; + + private List categoryList = new List(); + private List tagList = new List(); + + // MAIN WINDOW + + public MainWindow() + { + + InitializeComponent(); + InitializeControls(); + + } + + private void InitializeControls() + { + + this.Title = WINDOW_TITLE_DEFAULT; + MnuFileSave.IsEnabled = false; + MnuFileSaveAs.IsEnabled = false; + MnuFileClose.IsEnabled = false; + MnuFileReload.IsEnabled = false; + MnuEditSelectAll.IsEnabled = false; + MnuEditSelectNone.IsEnabled = false; + MnuEditName.IsEnabled = false; + MnuEditAmount.IsEnabled = false; + MnuEditLifetime.IsEnabled = false; + MnuEditRestock.IsEnabled = false; + MnuEditQuantity.IsEnabled = false; + MnuEditCost.IsEnabled = false; + MnuEditClear.IsEnabled = false; + + ResetPercentControls(); + ResetFilterControls(); + + txtFilterName.Text = ""; + cmbFilterCategory.SelectedIndex = 0; + cmbFilterTag.SelectedIndex = 0; + txtFilterUsage.Text = ""; + txtFilterValue.Text = ""; + + grpPercent.IsEnabled = false; + grpFilter.IsEnabled = false; + + lblStatusCount.Content = "No Data"; + prgLoading.Visibility = Visibility.Hidden; + + } + + private async void OpenLootFile(string lFile) + { + + try + { + + string windowTitle = ""; + StringBuilder builder = new StringBuilder(WINDOW_TITLE_FILE); + builder.Replace("%1", lFile); + windowTitle = builder.ToString(); + this.Title = windowTitle; + this.IsEnabled = false; + Mouse.OverrideCursor = Cursors.Wait; + + LootList.ItemsSource = null; + ResetPercentControls(); + ResetFilterControls(); + + lblStatusCount.Content = "loading..."; + + LootTable = new LootTable(lFile); + LootTable.LoadFile(); + + prgLoading.Value = 0; + prgLoading.Maximum = LootTable.Loot.Count; + prgLoading.Visibility = Visibility.Visible; + await Task.Delay(TimeSpan.FromMilliseconds(500)); + + RefreshFilterListing(); + + prgLoading.Value = LootTable.Loot.Count; + await Task.Delay(TimeSpan.FromSeconds(1)); + prgLoading.Visibility = Visibility.Hidden; + + this.IsEnabled = true; + + LootList.ItemsSource = LootTable.Loot; + LootList.IsEnabled = true; + + MnuFileSave.IsEnabled = true; + MnuFileSaveAs.IsEnabled = true; + MnuFileClose.IsEnabled = true; + MnuFileReload.IsEnabled = true; + MnuEditSelectAll.IsEnabled = true; + MnuEditSelectNone.IsEnabled = false; + MnuEditAmount.IsEnabled = false; + MnuEditLifetime.IsEnabled = false; + MnuEditRestock.IsEnabled = false; + MnuEditQuantity.IsEnabled = false; + MnuEditCost.IsEnabled = false; + MnuEditClear.IsEnabled = false; + + grpFilter.IsEnabled = true; + + Mouse.OverrideCursor = Cursors.Arrow; + UpdateStatus(); + + } + catch (Exception err) + { + + Mouse.OverrideCursor = Cursors.Arrow; + + string mb_caption = "Error"; + string mb_message = "An error occurred!\n\n%1"; + StringBuilder builder = new StringBuilder(mb_message); + builder.Replace("%1", err.ToString()); + mb_message = builder.ToString(); + + MessageBox.Show( + mb_message, + mb_caption, + MessageBoxButton.OK, + MessageBoxImage.Error + ); + + this.IsEnabled = true; + InitializeControls(); + + } + + } + + private async void SaveLootFile(string lFile = "") + { + + try + { + + if (lFile == "") + { + lFile = LootTable.FilePath; + } + + string windowTitle = ""; + StringBuilder builder = new StringBuilder(WINDOW_TITLE_FILE); + builder.Replace("%1", lFile); + windowTitle = builder.ToString(); + this.Title = windowTitle; + this.IsEnabled = false; + Mouse.OverrideCursor = Cursors.Wait; + + lblStatusCount.Content = "saving..."; + + prgLoading.Value = 0; + prgLoading.Maximum = LootTable.Loot.Count; + prgLoading.Visibility = Visibility.Visible; + await Task.Delay(TimeSpan.FromMilliseconds(500)); + + LootTable.SaveFile(lFile); + + prgLoading.Value = LootTable.Loot.Count; + await Task.Delay(TimeSpan.FromSeconds(1)); + prgLoading.Visibility = Visibility.Hidden; + + /* + string mb_caption = "Success"; + string mb_message = "File '%1' saved."; + StringBuilder mb_builder = new StringBuilder(mb_message); + mb_builder.Replace("%1", LootTable.FilePath); + mb_message = mb_builder.ToString(); + + MessageBox.Show( + mb_message, + mb_caption, + MessageBoxButton.OK, + MessageBoxImage.Information + ); + */ + + this.IsEnabled = true; + + Mouse.OverrideCursor = Cursors.Arrow; + UpdateStatus(); + + } + catch (Exception err) + { + + Mouse.OverrideCursor = Cursors.Arrow; + + string mb_caption = "Error"; + string mb_message = "An error occurred!\n\n%1"; + StringBuilder builder = new StringBuilder(mb_message); + builder.Replace("%1", err.ToString()); + mb_message = builder.ToString(); + + MessageBox.Show( + mb_message, + mb_caption, + MessageBoxButton.OK, + MessageBoxImage.Error + ); + + this.IsEnabled = true; + InitializeControls(); + + } + + } + + // MAIN MENU + + private void MnuFileOpen_Click(object sender, RoutedEventArgs e) + { + + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = "XML Files (*.xml)|*.xml|All Files (*.*)|*.*"; + dlg.Title = "Open DayZ Types-File"; + + if (dlg.ShowDialog().Value) + { + LootFile = dlg.FileName; + OpenLootFile(LootFile); + } + + } + + private void MnuFileSave_Click(object sender, RoutedEventArgs e) + { + + SaveLootFile(); + + } + + private void MnuFileSaveAs_Click(object sender, RoutedEventArgs e) + { + + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Filter = "XML Files (*.xml)|*.xml|All Files (*.*)|*.*"; + dlg.Title = "Save DayZ Types-File"; + + if (dlg.ShowDialog().Value) + { + LootFile = dlg.FileName; + SaveLootFile(LootFile); + } + + } + + private void MnuFileReload_Click(object sender, RoutedEventArgs e) + { + + OpenLootFile(LootFile); + + } + + private void MnuFileClose_Click(object sender, RoutedEventArgs e) + { + + LootList.ItemsSource = null; + InitializeControls(); + + } + + private void MnuFileExit_Click(object sender, RoutedEventArgs e) + { + + this.Close(); + + } + + private void MnuHelpInfo_Click(object sender, RoutedEventArgs e) + { + + InfoWindow iw = new InfoWindow(); + iw.ShowDialog(); + + } + + private void MnuEditSelectAll_Click(object sender, RoutedEventArgs e) + { + LootList.SelectAll(); + LootList.Focus(); + } + + private void MnuEditSelectNone_Click(object sender, RoutedEventArgs e) + { + LootList.SelectedIndex = -1; + LootList.Focus(); + } + + private void MnuEditNameSearchDuckDuck_Click(object sender, RoutedEventArgs e) + { + string uriBase = "https://duckduckgo.com/?q="; + string selectedClass = ""; + foreach (LootType loot in LootList.SelectedItems) + { + selectedClass = loot.Name; + break; + } + string searchText = "DayZ " + selectedClass; + string uriQuery = uriBase + HttpUtility.UrlEncode(searchText); + Process.Start(uriQuery); + } + + private void MnuEditNameSearchGoogle_Click(object sender, RoutedEventArgs e) + { + string uriBase = "https://www.google.com/search?q="; + string selectedClass = ""; + foreach (LootType loot in LootList.SelectedItems) + { + selectedClass = loot.Name; + break; + } + string searchText = "DayZ " + selectedClass; + string uriQuery = uriBase + HttpUtility.UrlEncode(searchText); + Process.Start(uriQuery); + } + + private void MnuEditAmountNominalToMin_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + int value = loot.Nominal; + loot.Min = value; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditAmountMinToNominal_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + int value = loot.Min; + loot.Nominal = value; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditAmountZero_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.Nominal = 0; + loot.Min = 0; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditLifetimeValue_Click(object sender, RoutedEventArgs e) + { + MenuItem item = e.OriginalSource as MenuItem; + foreach (LootType loot in LootList.SelectedItems) + { + loot.Lifetime = int.Parse(item.Tag.ToString()); + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditRestockValue_Click(object sender, RoutedEventArgs e) + { + MenuItem item = e.OriginalSource as MenuItem; + foreach (LootType loot in LootList.SelectedItems) + { + loot.Restock = int.Parse(item.Tag.ToString()); + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityNormal_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = -1; + loot.QMin = -1; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityQMaxValue_Click(object sender, RoutedEventArgs e) + { + MenuItem item = e.OriginalSource as MenuItem; + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = int.Parse(item.Header.ToString()); + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityQMinValue_Click(object sender, RoutedEventArgs e) + { + MenuItem item = e.OriginalSource as MenuItem; + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMin = int.Parse(item.Header.ToString()); + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_100_1_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 100; + loot.QMin = 1; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_100_10_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 100; + loot.QMin = 10; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_100_20_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 100; + loot.QMin = 20; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_100_30_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 100; + loot.QMin = 30; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_90_10_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 90; + loot.QMin = 10; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_80_20_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 80; + loot.QMin = 20; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_70_30_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 70; + loot.QMin = 30; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_60_10_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 60; + loot.QMin = 10; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_50_10_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 50; + loot.QMin = 10; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_40_10_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 40; + loot.QMin = 10; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_30_10_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 30; + loot.QMin = 10; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditQuantityPresets_0_0_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.QMax = 0; + loot.QMin = 0; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditCostValue_Click(object sender, RoutedEventArgs e) + { + MenuItem item = e.OriginalSource as MenuItem; + foreach (LootType loot in LootList.SelectedItems) + { + loot.Cost = int.Parse(item.Header.ToString()); + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditClearTag_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.Tag = ""; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditClearUsage_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.Usage = ""; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + private void MnuEditClearValue_Click(object sender, RoutedEventArgs e) + { + foreach (LootType loot in LootList.SelectedItems) + { + loot.Value = ""; + } + LootList.Items.Refresh(); + LootList.Focus(); + } + + // PERCENT + + private void UpdatePercentControls() + { + + int newval = 0; + bool ok = int.TryParse(txtPercent.Text.Replace("%", ""), out newval); + + if (ok) + { + sldPercent.Value = newval; + txtPercent.Text = String.Format("{0}%", newval); + btnPercent?.Focus(); + } + + } + + private void ResetPercentControls() + { + + txtPercent.Text = "100%"; + sldPercent.Value = 100; + btnPercent.IsEnabled = true; + + } + + private void txtPercent_GotFocus(object sender, RoutedEventArgs e) + { + + txtPercent.SelectAll(); + + } + + private void txtPercent_LostFocus(object sender, RoutedEventArgs e) + { + + UpdatePercentControls(); + + } + + private void txtPercent_KeyUp(object sender, KeyEventArgs e) + { + + if (e.Key == Key.Enter) + { + UpdatePercentControls(); + } + + } + + private void sldPercent_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) + { + + txtPercent.Text = Math.Round(sldPercent.Value).ToString(); + UpdatePercentControls(); + + } + + private void btnPercent_Click(object sender, RoutedEventArgs e) + { + + int percentage = 0; + bool ok = int.TryParse(txtPercent.Text.Replace("%", ""), out percentage); + if (!ok) return; + + foreach (LootType loot in LootList.SelectedItems) + { + loot.SetNominal(percentage); + loot.SetMin(percentage); + } + + UpdatePercentControls(); + LootList.Items.Refresh(); + LootList.Focus(); + + } + + // FILTER + + private void RefreshFilterListing() + { + + categoryList.Clear(); + categoryList.Add(""); + + for (int i = 1; i < LootTable.Loot.Count; i++) + { + prgLoading.Value = i; + if (LootTable.Loot[i].Category != null) + { + bool exists = string.Concat(categoryList).Contains(LootTable.Loot[i].Category); + if (!exists) + { + categoryList.Add(LootTable.Loot[i].Category); + } + } + } + + cmbFilterCategory.ItemsSource = categoryList; + cmbFilterCategory.SelectedIndex = 0; + + tagList.Clear(); + tagList.Add(""); + + for (int i = 1; i < LootTable.Loot.Count; i++) + { + prgLoading.Value = i; + if (LootTable.Loot[i].Tag != null) + { + bool exists = string.Concat(tagList).Contains(LootTable.Loot[i].Tag); + if (!exists) + { + tagList.Add(LootTable.Loot[i].Tag); + } + } + } + + cmbFilterTag.ItemsSource = tagList; + cmbFilterTag.SelectedIndex = 0; + + } + + private void ResetFilterControls() + { + + chkFilterName.IsChecked = false; + //txtFilterName.Text = ""; + + chkFilterInCargo.IsChecked = false; + chkFilterInHoarder.IsChecked = false; + chkFilterInMap.IsChecked = false; + chkFilterInPlayer.IsChecked = false; + chkFilterCrafted.IsChecked = false; + chkFilterDeloot.IsChecked = false; + + chkFilterCategory.IsChecked = false; + //cmbFilterCategory.SelectedIndex = 0; + + chkFilterTag.IsChecked = false; + //cmbFilterTag.SelectedIndex = 0; + + chkFilterUsage.IsChecked = false; + //txtFilterUsage.Text = ""; + + chkFilterValue.IsChecked = false; + //txtFilterValue.Text = ""; + + //btnFilterReset.IsEnabled = true; + btnFilterExec.IsEnabled = false; + + } + + private void ResetFilter() + { + LootList.ItemsSource = LootTable.Loot; + ResetFilterControls(); + UpdateStatus(); + + } + + private void UpdateFilter() + { + ListCollectionView collectionView = new ListCollectionView(LootTable.Loot); + List filteredList = new List(); + + foreach (var item in collectionView) + { + LootType lt = item as LootType; + if (chkFilterName.IsChecked == true) + { + string nameItem = txtFilterName.Text.ToString(); + if (!lt.Name.ToLower().Contains(nameItem.ToLower())) + continue; + } + if (chkFilterInCargo.IsChecked == true) + { + if (!(lt.InCargo == true)) + continue; + } + if (chkFilterInHoarder.IsChecked == true) + { + if (!(lt.InHoarder == true)) + continue; + } + if (chkFilterInMap.IsChecked == true) + { + if (!(lt.InMap == true)) + continue; + } + if (chkFilterInPlayer.IsChecked == true) + { + if (!(lt.InPlayer == true)) + continue; + } + if (chkFilterCrafted.IsChecked == true) + { + if (!(lt.Crafted == true)) + continue; + } + if (chkFilterDeloot.IsChecked == true) + { + if (!(lt.Deloot == true)) + continue; + } + if (chkFilterCategory.IsChecked == true) + { + string categoryItem = cmbFilterCategory.Items[cmbFilterCategory.SelectedIndex].ToString(); + if (categoryItem == "") + { + if (!(lt.Category == null)) + continue; + } + else + { + if (!(lt.Category == categoryItem)) + continue; + } + } + if (chkFilterTag.IsChecked == true) + { + string tagItem = cmbFilterTag.Items[cmbFilterTag.SelectedIndex].ToString(); + if (!(lt.Tag == tagItem)) + continue; + } + if (chkFilterUsage.IsChecked == true) + { + var usageItem = txtFilterUsage.Text.ToLower().ToString(); + var filterStr = usageItem.Split(',').Select(x => x.Trim()).ToArray(); + if (!filterStr.All(x => lt.Usage.ToLower().Contains(x))) + continue; + } + if (chkFilterValue.IsChecked == true) + { + var valueItem = txtFilterValue.Text.ToLower().ToString(); + var filterStr = valueItem.Split(',').Select(x => x.Trim()).ToArray(); + if (!filterStr.All(x => lt.Value.ToLower().Contains(x))) + continue; + } + filteredList.Add(item); + } + UpdateStatus(filteredList.Count); + LootList.ItemsSource = filteredList; + } + + private void UpdateFilterExec() + { + + if ( + (chkFilterName.IsChecked == false) && + (chkFilterInCargo.IsChecked == false) && + (chkFilterInHoarder.IsChecked == false) && + (chkFilterInMap.IsChecked == false) && + (chkFilterInPlayer.IsChecked == false) && + (chkFilterCrafted.IsChecked == false) && + (chkFilterDeloot.IsChecked == false) && + (chkFilterCategory.IsChecked == false) && + (chkFilterTag.IsChecked == false) && + (chkFilterUsage.IsChecked == false) && + (chkFilterValue.IsChecked == false) + ) + { + btnFilterExec.IsEnabled = false; + } + else + { + btnFilterExec.IsEnabled = true; + } + + } + + private void btnFilterExec_Click(object sender, RoutedEventArgs e) + { + UpdateFilter(); + LootList.Focus(); + } + + private void btnFilterReset_Click(object sender, RoutedEventArgs e) + { + ResetFilter(); + if (Keyboard.IsKeyDown(Key.LeftCtrl)) + { + txtFilterName.Text = ""; + cmbFilterCategory.SelectedIndex = 0; + cmbFilterTag.SelectedIndex = 0; + txtFilterUsage.Text = ""; + txtFilterValue.Text = ""; + } + LootList.Focus(); + } + + private void txtFilterName_GotFocus(object sender, RoutedEventArgs e) + { + txtFilterName.SelectAll(); + } + + private void txtFilterUsage_GotFocus(object sender, RoutedEventArgs e) + { + txtFilterUsage.SelectAll(); + } + + private void txtFilterValue_GotFocus(object sender, RoutedEventArgs e) + { + txtFilterValue.SelectAll(); + } + + private void chkFilterName_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + private void chkFilterInCargo_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + private void chkFilterInHoarder_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + private void chkFilterInMap_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + private void chkFilterInPlayer_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + private void chkFilterCrafted_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + private void chkFilterDeloot_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + private void chkFilterCategory_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + private void chkFilterTag_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + private void chkFilterUsage_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + private void chkFilterValue_Click(object sender, RoutedEventArgs e) + { + UpdateFilterExec(); + } + + // LOOT LIST + + private void LootList_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + bool IsLootSelected = LootList.SelectedItems.Count > 0; + MnuEditSelectNone.IsEnabled = IsLootSelected; + MnuEditName.IsEnabled = IsLootSelected; + MnuEditAmount.IsEnabled = IsLootSelected; + MnuEditLifetime.IsEnabled = IsLootSelected; + MnuEditRestock.IsEnabled = IsLootSelected; + MnuEditQuantity.IsEnabled = IsLootSelected; + MnuEditCost.IsEnabled = IsLootSelected; + MnuEditClear.IsEnabled = IsLootSelected; + grpPercent.IsEnabled = IsLootSelected; + } + + // STATUS + + private void UpdateStatus(int filteredClasses = 0, int lootClasses = 0) + { + + if (filteredClasses == 0) + filteredClasses = LootTable.Loot.Count; + + if (lootClasses == 0) + lootClasses = LootTable.Loot.Count; + + lblStatusCount.Content = " Items: " + filteredClasses.ToString() + " / " + lootClasses.ToString(); + + } + + } +} diff --git a/DayZLootEdit/Properties/AssemblyInfo.cs b/DayZLootEdit/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c43a20f --- /dev/null +++ b/DayZLootEdit/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("DayZ LootEditor")] +[assembly: AssemblyDescription("A tool to edit the looting table of DayZ (Standalone)")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DayZ LootEditor")] +[assembly: AssemblyCopyright("Copyright © 2021 by Ojemineh")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie +//ImCodeVerwendeteKultur in der .csproj-Datei +//in einer fest. Wenn Sie in den Quelldateien beispielsweise Deutsch +//(Deutschland) verwenden, legen Sie auf \"de-DE\" fest. Heben Sie dann die Auskommentierung +//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile, +//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher + //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, + // oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.) + ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs + //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, + // designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.) +)] + + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.2.1.1")] +[assembly: AssemblyFileVersion("0.2.1.1")] diff --git a/DayZLootEdit/Properties/Resources.Designer.cs b/DayZLootEdit/Properties/Resources.Designer.cs new file mode 100644 index 0000000..502d1d1 --- /dev/null +++ b/DayZLootEdit/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace DayZLootEdit.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DayZLootEdit.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/DayZLootEdit/Properties/Resources.resx b/DayZLootEdit/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/DayZLootEdit/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DayZLootEdit/Properties/Settings.Designer.cs b/DayZLootEdit/Properties/Settings.Designer.cs new file mode 100644 index 0000000..cb769f6 --- /dev/null +++ b/DayZLootEdit/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace DayZLootEdit.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/DayZLootEdit/Properties/Settings.settings b/DayZLootEdit/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/DayZLootEdit/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/DayZLootEdit/dayz_types.ico b/DayZLootEdit/dayz_types.ico new file mode 100644 index 0000000..5cddcf1 Binary files /dev/null and b/DayZLootEdit/dayz_types.ico differ diff --git a/DayZLootEdit/dayz_types.png b/DayZLootEdit/dayz_types.png new file mode 100644 index 0000000..42e15f5 Binary files /dev/null and b/DayZLootEdit/dayz_types.png differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ab60297 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5ebaaa3 --- /dev/null +++ b/README.md @@ -0,0 +1,68 @@ + + +# DayZ LootEdit + + +An editor to comfortably modify the loot table of the game "DayZ (Standalone)". It features the ability to increase/decrease the number of spawns of several objects via a percentage value. + + +--- + + +**Version 0.1.0 Alpha** +#### **[DOWNLOAD](https://github.com/MrX13415/DayZLootEdit/releases)** + +This tool requires at least **Windows 7** with **ServicePack 1**. + + + +## Usage + + +The loot table of DayZ (Standalone) is stored in a XML file inside the current mission. +The file is called `types.xml` and can be found in the `mpmissions` folder in the server files or the game files. For the current version of the game it's stored in the following location: +`DayZ Server\mpmissions\dayzOffline.chernarusplus\db\types.xml` + +Usually the file from the dedicated server has to be changed. +Changing the file in your local game folder will only affect yourself while playing in offline mode. + +To start, open the file `types.xml`. +If you want to increase the general amount of "loot", select all or a selection of entries. +Now use the slider/text box reading **Nominal Percentage** at the top of the window to change the **Nominal** value on a percentage basis. +Don't forget to click on the **Set** button to confirm your changes. Save the file if you are done. + +On the first time the file gets saved, a backup file containing the original content with the name `types.xml.original.xml` will be created. + +Note: Alle values can be changed, even though you shouldn't do so. For example, don't change the name of any object, it will break the game. + +![DayZ LootEdit](dayzlootedit.png) + + + +## License + + +MIT License + +Copyright (c) 2018 MrX13415 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--- diff --git a/dayz_types.ico b/dayz_types.ico new file mode 100644 index 0000000..5cddcf1 Binary files /dev/null and b/dayz_types.ico differ diff --git a/dayz_types.png b/dayz_types.png new file mode 100644 index 0000000..42e15f5 Binary files /dev/null and b/dayz_types.png differ diff --git a/dayz_types.xcf b/dayz_types.xcf new file mode 100644 index 0000000..79d6c96 Binary files /dev/null and b/dayz_types.xcf differ diff --git a/dayzlootedit.png b/dayzlootedit.png new file mode 100644 index 0000000..84d9568 Binary files /dev/null and b/dayzlootedit.png differ