diff --git a/PlugY/InfinityStash.cpp b/PlugY/InfinityStash.cpp index e72cf5a..7055a32 100644 --- a/PlugY/InfinityStash.cpp +++ b/PlugY/InfinityStash.cpp @@ -92,7 +92,7 @@ Stash* addStash(Unit* ptChar, bool isShared, bool autoSetIndex, Stash* previous) previous = getLastStash(previous ? previous : isShared ? PCPY->sharedStash : PCPY->selfStash); if (previous) isShared = previous->isShared; - + Stash* stash = newStash(isShared ? PCPY->nbSharedPages++ : PCPY->nbSelfPages++); stash->isShared = isShared; stash->previousStash = previous; @@ -100,8 +100,11 @@ Stash* addStash(Unit* ptChar, bool isShared, bool autoSetIndex, Stash* previous) if (previous) { previous->nextStash = stash; - stash->isIndex = ((stash->id + 1) % nbPagesPerIndex) == 0; - stash->isMainIndex = ((stash->id + 1) % nbPagesPerIndex2) == 0; + if (autoSetIndex) + { + stash->isIndex = ((stash->id + 1) % nbPagesPerIndex) == 0; + stash->isMainIndex = ((stash->id + 1) % nbPagesPerIndex2) == 0; + } } else if (isShared) { @@ -286,19 +289,21 @@ DWORD loadStash(Unit* ptChar, Stash* ptStash, BYTE data[], DWORD startSize, DWOR return ret; } -void autoSetIndex(Stash* fistStash) +void autoSetIndex(Stash* firstStash) { - if (!fistStash) + if (!firstStash) return; - Stash* stash = fistStash; + log_msg("autoSetIndex\n"); + Stash* stash = firstStash; while (stash) { if (stash->isIndex || stash->isMainIndex) return; stash = stash->nextStash; } - stash = fistStash; + stash = firstStash; stash->isIndex = 1; + stash->isMainIndex = 1; stash = stash->nextStash; while (stash) { @@ -326,11 +331,6 @@ DWORD loadStashList(Unit* ptChar, BYTE* data, DWORD maxSize, DWORD* curSize, boo if (ret) return ret; curStash++; } - if (nbStash <2) - { - newStash = addStash(ptChar, isShared, false, newStash); - changeToSelectedStash(ptChar, newStash, 0, false); - } if (!isShared) { @@ -355,6 +355,12 @@ DWORD loadStashList(Unit* ptChar, BYTE* data, DWORD maxSize, DWORD* curSize, boo } } + if (nbStash == 1) + { + newStash = addStash(ptChar, isShared, true, newStash); + changeToSelectedStash(ptChar, newStash, 0, false); + } + return 0; } @@ -452,7 +458,7 @@ void setSelectedStashClient(DWORD stashId, DWORD stashFlags, DWORD flags, bool b Unit* ptChar = D2GetClientPlayer(); Stash* newStash = getStash(ptChar, (stashFlags & 1) == 1, stashId); if (!newStash) do - newStash = addStash(ptChar, (stashFlags & 1) == 1, true, newStash); + newStash = addStash(ptChar, (stashFlags & 1) == 1, false, newStash); while (newStash->id < stashId); newStash->flags = stashFlags; changeToSelectedStash(ptChar, newStash, bOnlyItems, 1); @@ -466,7 +472,7 @@ void selectStash(Unit* ptChar, Stash* newStash, bool forceUpdate) return; if (!forceUpdate && newStash == PCPY->currentStash) return; - log_msg("selectStash ID:%d\tshared:%d\tonlyItems:%d\tclient:%d\n", newStash->id, newStash->isShared, 0, 0); + log_msg("selectStash ID:%d\tshared:%d\tforceUpdate:%d\n", newStash->id, newStash->isShared, forceUpdate); changeToSelectedStash(ptChar, newStash, 0, 0); updateSelectedStashClient(ptChar); } @@ -522,7 +528,7 @@ void swapStash(Unit* ptChar, DWORD page, bool toggle) { log_msg("swap stash : %i\n", i); if (swpStash->nextStash == NULL) - addStash(ptChar, swpStash->isShared, true, swpStash); + addStash(ptChar, swpStash->isShared, false, swpStash); swpStash = swpStash->nextStash; } swapStash(ptChar, curStash, swpStash); diff --git a/PlugY/Parameters.cpp b/PlugY/Parameters.cpp index 9a0bfa2..b4dc915 100644 --- a/PlugY/Parameters.cpp +++ b/PlugY/Parameters.cpp @@ -500,7 +500,7 @@ void init_SavePath(INIFile* iniFile, INIFile* iniFixedFile, INIFile* iniDefaultF active_AutoBackup = atoi(buffer) != 0; log_msg("active_autoBackup\t\t= %u\n", active_AutoBackup); - GET_PRIVATE_PROFILE_STRING3(S_SAVEPATH, S_maxBackupPerCharacter, "5"); + GET_PRIVATE_PROFILE_STRING3(S_SAVEPATH, S_maxBackupPerCharacter, "20"); maxBackupPerCharacter = atoi(buffer); log_msg("maxBackupPerCharacter\t\t= %u\n", maxBackupPerCharacter); diff --git a/PlugY/PlayerCustomData.cpp b/PlugY/PlayerCustomData.cpp index d95035b..648c43e 100644 --- a/PlugY/PlayerCustomData.cpp +++ b/PlugY/PlayerCustomData.cpp @@ -64,7 +64,7 @@ Unit* FASTCALL updateItem(Game* ptGame, DWORD type, DWORD itemNum, Unit* ptChar) { Stash* ptStash = getStashFromItem(ptChar, ptItem); if (!ptStash) return NULL; - selectStash(ptChar, ptStash); + selectStash(ptChar, ptStash, ptStash->id == 0); } return ptItem; } @@ -75,7 +75,7 @@ void FASTCALL updateItem_111(Unit* ptItem, Unit* ptChar) { Stash* ptStash = getStashFromItem(ptChar, ptItem); if (ptStash) - selectStash(ptChar, ptStash); + selectStash(ptChar, ptStash, ptStash->id == 0); } } diff --git a/PlugY/PlugY.rc b/PlugY/PlugY.rc index ed2613d..e310f7e 100644 Binary files a/PlugY/PlugY.rc and b/PlugY/PlugY.rc differ diff --git a/PlugY/PlugY.suo b/PlugY/PlugY.suo index a496351..8203822 100644 Binary files a/PlugY/PlugY.suo and b/PlugY/PlugY.suo differ diff --git a/PlugY/SavePlayerData.cpp b/PlugY/SavePlayerData.cpp index 018bf2c..4b87310 100644 --- a/PlugY/SavePlayerData.cpp +++ b/PlugY/SavePlayerData.cpp @@ -14,7 +14,7 @@ #include "common.h" bool active_AutoBackup = false; -int maxBackupPerCharacter = 5; +int maxBackupPerCharacter = 20; /*backup Save SP : diff --git a/PlugY/parameters.h b/PlugY/parameters.h index 15e4d8b..8e4c7b8 100644 --- a/PlugY/parameters.h +++ b/PlugY/parameters.h @@ -6,7 +6,7 @@ =================================================================*/ #pragma once -#define PLUGY_VERSION "14.00" +#define PLUGY_VERSION "14.01" enum TargetMod { diff --git a/PlugYInstall/PlugYInstall.rc b/PlugYInstall/PlugYInstall.rc index eae66ba..4febfbf 100644 --- a/PlugYInstall/PlugYInstall.rc +++ b/PlugYInstall/PlugYInstall.rc @@ -50,7 +50,7 @@ BEGIN VALUE "LegalCopyright", "Copyright (C) 2017" VALUE "OriginalFilename", "PlugYInstall.exe" VALUE "ProductName", "PlugY, The Survival Kit" - VALUE "ProductVersion", "14.00" + VALUE "ProductVersion", "14.01" END END BLOCK "VarFileInfo" diff --git a/PlugYInstall/PlugYInstall.suo b/PlugYInstall/PlugYInstall.suo index e4b87bf..ff99e69 100644 Binary files a/PlugYInstall/PlugYInstall.suo and b/PlugYInstall/PlugYInstall.suo differ diff --git a/PlugYInstaller/PlugY.ini b/PlugYInstaller/PlugY.ini index f7e281e..4764551 100644 --- a/PlugYInstaller/PlugY.ini +++ b/PlugYInstaller/PlugY.ini @@ -5,7 +5,7 @@ ; ; ; by Yohann Nicolas ; ; ; -; version 14.00 ; +; version 14.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -38,7 +38,7 @@ X=0 Y=0 Width=0 Height=0 -LockMouseOnStartup=1 +LockMouseOnStartup=0 [LANGUAGE] @@ -52,7 +52,7 @@ ActiveSavePathChange=0 SavePath=Mod PlugY ActiveAutoBackup=1 -MaxBackupPerCharacter=5 +MaxBackupPerCharacter=20 [MAIN SCREEN] diff --git a/PlugYInstaller/PlugY.nsi b/PlugYInstaller/PlugY.nsi index d9fcc22..8145048 100644 --- a/PlugYInstaller/PlugY.nsi +++ b/PlugYInstaller/PlugY.nsi @@ -3,7 +3,7 @@ Unicode True !include "MUI2.nsh" -!define VERSION "v14.00" +!define VERSION "v14.01" !define D2FILES "." !define NAME "PlugY, The Survival Kit" !define MOD_DIR "Mod PlugY" diff --git a/PlugYInstaller/PlugY/LocalizedStrings.ini b/PlugYInstaller/PlugY/LocalizedStrings.ini index 5d62da3..c5c9af6 100644 Binary files a/PlugYInstaller/PlugY/LocalizedStrings.ini and b/PlugYInstaller/PlugY/LocalizedStrings.ini differ diff --git a/PlugYInstaller/PlugY/PlugYDefault.ini b/PlugYInstaller/PlugY/PlugYDefault.ini index 79d65a4..45622bc 100644 --- a/PlugYInstaller/PlugY/PlugYDefault.ini +++ b/PlugYInstaller/PlugY/PlugYDefault.ini @@ -6,7 +6,7 @@ ; ; ; by Yohann Nicolas ; ; ; -; version 14.00 ; +; version 14.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -58,7 +58,7 @@ ActiveSavePathChange=0 SavePath= ActiveAutoBackup=0 -MaxBackupPerCharacter=5 +MaxBackupPerCharacter=20 [MAIN SCREEN] diff --git a/PlugYInstaller/PlugY/PlugYFixed.ini b/PlugYInstaller/PlugY/PlugYFixed.ini index a230836..004e6d8 100644 --- a/PlugYInstaller/PlugY/PlugYFixed.ini +++ b/PlugYInstaller/PlugY/PlugYFixed.ini @@ -6,7 +6,7 @@ ; ; ; by Yohann Nicolas ; ; ; -; version 14.00 ; +; version 14.01 ; ; ; ;--------------------------------------------------------------------------------------; diff --git a/PlugYInstaller/PlugY_The_Survival_Kit_-_Liesmich.txt b/PlugYInstaller/PlugY_The_Survival_Kit_-_Liesmich.txt index b454bd0..c3b981c 100644 --- a/PlugYInstaller/PlugY_The_Survival_Kit_-_Liesmich.txt +++ b/PlugYInstaller/PlugY_The_Survival_Kit_-_Liesmich.txt @@ -4,7 +4,7 @@ ; ; ; von Yohann Nicolas ; ; ; -; version 14.00 ; +; version 14.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -75,6 +75,8 @@ Jedes Feature kann via PlugY.ini an/ausgeschaltet werden (siehe "Kommentare aus /listcube: (Beta) Erstellt eine "cube.txt" Datei im Savegame-Verzeichnis mit allen Würfelrezepten. /renamechar newname: (Beta) Speichert und benennt den Char um. +v14.01 Änderungen : +- Fix stash items lost on loading a character for the first time. v14.00 Änderungen : - Kompatibilität mit 1.14d (Vielen Dank an Haxifix) @@ -697,7 +699,7 @@ Beispiele: Active autobackup save file just before the save. The backup will be store in a folder name "backup" in the save folder. - ActiveAutoBackup=0 {0:Disabled; 1:Enabled} -- MaxBackupPerCharacter=5 {5: Number of backup to keep before delete; 0:No backup purge} +- MaxBackupPerCharacter=20 {20: Number of backup to keep before delete; 0:No backup purge} [MAIN SCREEN] diff --git a/PlugYInstaller/PlugY_The_Survival_Kit_-_LisezMoi.txt b/PlugYInstaller/PlugY_The_Survival_Kit_-_LisezMoi.txt index c838aa7..9474aeb 100644 --- a/PlugYInstaller/PlugY_The_Survival_Kit_-_LisezMoi.txt +++ b/PlugYInstaller/PlugY_The_Survival_Kit_-_LisezMoi.txt @@ -4,7 +4,7 @@ ; ; ; par Yohann Nicolas ; ; ; -; version 14.00 ; +; version 14.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -75,6 +75,8 @@ Toutes ces fonctions peuvent être activé/désactivé via PlugY.ini (voir "COMM /listcube : (beta) Crée un fichier "cube.txt" dans le répertoire de sauvegarde contenant toutes les formules du cube. /renamechar newname : (beta) Renomme la personnage et le sauvegarde. +Changements apportés par la v14.01 : +- Corrige la perte des objets du coffre lors du chargement d'un personnage pour la première fois. Changements apportés par la v14.00: - Ajout de la compatibilité avec la version 1.13d de LOD. (merci à Haxifix) @@ -603,7 +605,7 @@ Ci-dessous, les valeurs par défauts et entre {} des exemples avec leurs signifi ACtive le backup des fichiers de sauvegardes avant la sauvegarde. Les fichiers de backup sont sauvegardé dans un répertoire nommé "backup" dans le répertoire de sauvegarde. - ActiveAutoBackup=0 {0:Désactivé; 1:Activé} -- MaxBackupPerCharacter=5 {5: Nombre de backup à conserver avant suppression; 0:Pas de purge des backups} +- MaxBackupPerCharacter=20 {20: Nombre de backup à conserver avant suppression; 0:Pas de purge des backups} [MAIN SCREEN] @@ -831,6 +833,7 @@ Déplace Deckar Cain à coté du portail d'Harrogath. * Espagnol : Acrerune * Polonais : Serdel * Russe : L'Autour - * Chinois: Nagahaku + * Chinois (Traditionnel): Nagahaku + * Japanase : CaiMiao ;--------------------------------------------------------------------------------------; \ No newline at end of file diff --git a/PlugYInstaller/PlugY_The_Survival_Kit_-_Readme.txt b/PlugYInstaller/PlugY_The_Survival_Kit_-_Readme.txt index 65a77cd..bca673c 100644 --- a/PlugYInstaller/PlugY_The_Survival_Kit_-_Readme.txt +++ b/PlugYInstaller/PlugY_The_Survival_Kit_-_Readme.txt @@ -4,7 +4,7 @@ ; ; ; by Yohann Nicolas ; ; ; -; version 14.00 ; +; version 14.01 ; ; ; ;--------------------------------------------------------------------------------------; @@ -75,6 +75,8 @@ Each features can be turn on/off via PlugY.ini (see "COMMENTS ON THE CONFIGURATI /listcube : (beta) Create a "cube.txt" file in save directory containing all cube's receipts. /renamechar newname : (beta) Rename your character and save it. +v14.01 changes : +- Fix stash items lost on loading a character for the first time. v14.00 changes : - Add compatibility with LOD 1.14d. (Thanks to Haxifix) @@ -674,7 +676,7 @@ Following are default values, between {} are some examples values with descripti Active autobackup save file just before the save. The backup will be store in a folder name "backup" in the save folder. - ActiveAutoBackup=0 {0:Disabled; 1:Enabled} -- MaxBackupPerCharacter=5 {5: Number of backup to keep before delete; 0:No backup purge} +- MaxBackupPerCharacter=20 {20: Number of backup to keep before delete; 0:No backup purge} [MAIN SCREEN] @@ -917,6 +919,7 @@ Move Cain near Harrogath waypoint. * Spanish: Acrerune * Polish: Serdel * Russian: L'Autour - * Chinese: Nagahaku + * Chinese (Traditional): Nagahaku + * Japanase : CaiMiao ;--------------------------------------------------------------------------------------; \ No newline at end of file diff --git a/PlugYInstaller/PlugY_The_Survival_Kit_-_讀我檔案.txt b/PlugYInstaller/PlugY_The_Survival_Kit_-_讀我檔案.txt index 222a724..9b448be 100644 Binary files a/PlugYInstaller/PlugY_The_Survival_Kit_-_讀我檔案.txt and b/PlugYInstaller/PlugY_The_Survival_Kit_-_讀我檔案.txt differ diff --git a/PlugYRun/PlugYRun.rc b/PlugYRun/PlugYRun.rc index 1a5d9ba..0512cca 100644 Binary files a/PlugYRun/PlugYRun.rc and b/PlugYRun/PlugYRun.rc differ diff --git a/PlugYRun/PlugYRun.suo b/PlugYRun/PlugYRun.suo index 86da9d1..f9be07e 100644 Binary files a/PlugYRun/PlugYRun.suo and b/PlugYRun/PlugYRun.suo differ