Skip to content

Commit

Permalink
Diablo II Ressurected changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterCouto committed Oct 1, 2021
1 parent ef2a32d commit 55a7435
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
Binary file modified D2Editor.exe
Binary file not shown.
Binary file modified UserGuide.pdf
Binary file not shown.
7 changes: 5 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ You can edit the following stats:<br>

### Known Issues

- Tested with Diablo II V1.14d (It has the logic for V1.00 through V1.09 including the Lord of Destruction expansion set so it should work the same as version 1.92 on those files)**
- Starting with Diablo II V1.13c the maximum gold in your stash no longer depends on yoru character's level, and is now a flat cap of 2,500,000 instead. The editor will now use this value when editing files marked as v1.10 or higher when determining the limit for your gold in your stash.
- Tested with Diablo II Ressurected V1.01 and Diablo II Classic V1.14d (It has the logic for V1.00 through V1.09 including the Lord of Destruction expansion set so it should work the same as version 1.92 of the orginal code on those files)**
- Starting with Diablo II Classic V1.13c the maximum gold in your stash no longer depends on yoru character's level, and is now a flat cap of 2,500,000 instead. The editor will now use this value when editing Ressurrected files or Classic files marked as v1.10 or higher when determining the limit for your gold in your stash.
- You must close the character file before playing Diablo II. This is because there are no options to enable file sharing for the read and write functions I'm using in ANSI C++.

### Distribution
Expand All @@ -69,6 +69,9 @@ Check the following site for updates at https://github.com/WalterCouto/D2CE<br>
* [d2s Binary File Format](d2s_File_Format.md)<br>

### Revision History
**Version 2.02 (Oct 1, 2021)**<br>
- Updated: Logic to account for Diablo II Ressurected Saved Games folder<br>

**Version 2.01 (Sept 25, 2021)**<br>
- Updated: Moved logic in UI down to Character class for consistency. Refactored and cleaned up code to simplify logic<br>
- Updated: Fixed bug in About window to properly show version as 3 digits.<br>
Expand Down
3 changes: 3 additions & 0 deletions source/D2Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
Revision History
================
Version 2.02 (Oct 1, 2021)
- Updated: Logic to account for Diablo II Ressurected Saved Games folder
Version 2.01 (Sept 25, 2021)
- Updated: Moved logic in UI down to Character class for consistency.
Refactored and cleaned up code to simplify logic
Expand Down
28 changes: 27 additions & 1 deletion source/D2MainForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2681,7 +2681,33 @@ void CD2MainForm::OnUpdateOptionsMaxEverything(CCmdUI* pCmdUI)
#define MAX_VALUE_NAME 4096
void CD2MainForm::SetStartDir()
{
// Check to see if this is the one to use by camparing the driver's path
// get the 'Saved Games' shell directory and try searching there
PWSTR saveBasePath;
if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_SavedGames, 0, nullptr, &saveBasePath)))
{
std::filesystem::path savePath(saveBasePath);
CoTaskMemFree(saveBasePath);

// Look for Ressurected path first
auto d2Path = savePath / _T("Diablo II Resurrected");
if (std::filesystem::exists(d2Path))
{
d2Path += _T("\\");
InitialDir = d2Path.string().c_str();
return;
}

// Fall back on classic Diablo II
d2Path = savePath / _T("Diablo II");
if (std::filesystem::exists(d2Path))
{
d2Path += _T("\\");
InitialDir = d2Path.string().c_str();
return;
}
}

// Search the Classic register position for the path to use
HKEY regKey = 0;
if (::RegOpenKeyEx(HKEY_CURRENT_USER, _T("SOFTWARE\\Blizzard Entertainment\\Diablo II"), 0, KEY_QUERY_VALUE, &regKey) != ERROR_SUCCESS)
{
Expand Down

0 comments on commit 55a7435

Please sign in to comment.