v14.01 by Yohann

This commit is contained in:
ChaosMarc 2021-01-04 21:29:37 +01:00
parent 2597bc3946
commit b6e0436944
No known key found for this signature in database
GPG Key ID: E1116DF82FEF02EC
20 changed files with 50 additions and 36 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);
}
}

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,7 @@
#include "common.h"
bool active_AutoBackup = false;
int maxBackupPerCharacter = 5;
int maxBackupPerCharacter = 20;
/*backup
Save SP :

View File

@ -6,7 +6,7 @@
=================================================================*/
#pragma once
#define PLUGY_VERSION "14.00"
#define PLUGY_VERSION "14.01"
enum TargetMod
{

View File

@ -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"

Binary file not shown.

View File

@ -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]

View File

@ -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"

View File

@ -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]

View File

@ -6,7 +6,7 @@
; ;
; by Yohann Nicolas ;
; ;
; version 14.00 ;
; version 14.01 ;
; ;
;--------------------------------------------------------------------------------------;

View File

@ -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]

View File

@ -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
;--------------------------------------------------------------------------------------;

View File

@ -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
;--------------------------------------------------------------------------------------;

Binary file not shown.

Binary file not shown.