Skip to content

Commit

Permalink
Default Directories + Spider's Kiss Talent + Few Missing Skills
Browse files Browse the repository at this point in the history
* Added an option to reset directories (savegame and temporary files)
* Added missing "Spider's Kiss" variants
* Added few missing skills in permanent bonuses
  • Loading branch information
NovFR committed Sep 4, 2020
1 parent 002f1be commit 469a8b6
Show file tree
Hide file tree
Showing 15 changed files with 125 additions and 25 deletions.
Binary file modified Binaries/GlEd.exe
Binary file not shown.
Binary file modified Binaries/Icons/Skills.icl
Binary file not shown.
Binary file modified Binaries/Locales/eng.db
Binary file not shown.
Binary file modified Binaries/Locales/fra.db
Binary file not shown.
2 changes: 1 addition & 1 deletion Source/Application.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.10" processorArchitecture="amd64" name="GlEd" type="win32"/>
<assemblyIdentity version="1.0.0.11" processorArchitecture="amd64" name="GlEd" type="win32"/>
<description>GlEd</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
Expand Down
6 changes: 4 additions & 2 deletions Source/Includes/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ BOOL Config_SelectLanguageDrawItem(DRAWITEMSTRUCT *);
int Config_SelectLanguageSet(HWND);
int Config_SetLanguage(HWND,WCHAR *);

void Config_ResetLocations(void);
int Config_ResetLocationsRequest(WCHAR *,WCHAR *,UINT);
void Config_SelectTempLocation(void);
void Config_SelectSaveLocation(void);

int Config_Defaults(CONFIG *);
void Config_DefaultTempLocation(CONFIG *);
void Config_DefaultSaveLocation(CONFIG *);
BOOL Config_DefaultTempLocation(CONFIG *,BOOL);
BOOL Config_DefaultSaveLocation(CONFIG *,BOOL);
void Config_Release(CONFIG *);

#endif
5 changes: 5 additions & 0 deletions Source/Includes/Locale.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enum {
LOCALE(IDM_CONFIGTEMPLOCATION), \
LOCALE(IDM_CONFIGSAVELOCATION), \
LOCALE(IDM_CONFIGLANGUAGE), \
LOCALE(IDM_CONFIGRESETLOCATIONS), \
LOCALE(IDM_CONFIGSAVE), \
LOCALE(IDM_CONFIGSAVEONEXIT), \
LOCALE(IDM_ABOUT), \
Expand Down Expand Up @@ -403,6 +404,9 @@ enum {
LOCALE(TEXT_CONFIG_OPENEDSAVEGAME), \
LOCALE(TEXT_CONFIG_TEMPLOCATION), \
LOCALE(TEXT_CONFIG_SAVELOCATION), \
LOCALE(TEXT_CONFIG_LOCATION), \
LOCALE(TEXT_CONFIG_LOCATION_TEMP), \
LOCALE(TEXT_CONFIG_LOCATION_LARIAN), \
LOCALE(TEXT_ABOUT), \
LOCALE(TEXT_OK), \
LOCALE(TEXT_CANCEL), \
Expand Down Expand Up @@ -452,6 +456,7 @@ enum {
LOCALE(TEXT_ERR_CONFIGLOAD), \
LOCALE(TEXT_ERR_CONFIGCUSTOMSAVELOCATION), \
LOCALE(TEXT_ERR_CONFIGCUSTOMTEMPLOCATION), \
LOCALE(TEXT_ERR_CONFIGCUSTOMLOCATION), \
LOCALE(TEXT_ERR_CONFIGSAVELOCATION), \
LOCALE(TEXT_ERR_CONFIGTEMPLOCATION), \
LOCALE(TEXT_ERR_LSV_LOAD), \
Expand Down
1 change: 1 addition & 0 deletions Source/Includes/Texts.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ extern WCHAR szLocaleMissingAppErr[];
extern WCHAR szLocaleLangErr[];
extern WCHAR szConfigCustSaveLocationErr[];
extern WCHAR szConfigCustTempLocationErr[];
extern WCHAR szConfigCustLocationErr[];
extern WCHAR szConfigSaveLocationErr[];
extern WCHAR szConfigTempLocationErr[];

Expand Down
2 changes: 1 addition & 1 deletion Source/Includes/_Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define VERSION_MAJOR 1
#define REVISION_MAJOR 0
#define VERSION_MINOR 0
#define REVISION_MINOR 10
#define REVISION_MINOR 11

#define TOSTRINGTMP(x) #x
#define TOSTRING(x) TOSTRINGTMP(x)
Expand Down
2 changes: 2 additions & 0 deletions Source/Sources/Application.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ CUSTOMMENUTEMPLATE MainMenu[] = {
{ MENU_ITEM, IDM_CONFIGSAVELOCATION },
{ MENU_ITEM, IDM_CONFIGLANGUAGE },
{ MENU_SEPARATOR },
{ MENU_ITEM, IDM_CONFIGRESETLOCATIONS },
{ MENU_SEPARATOR },
{ MENU_ITEM, IDM_CONFIGSAVE, 0, 0, 101 },
{ MENU_SEPARATOR },
{ MENU_ITEM, IDM_CONFIGSAVEONEXIT, 0, 0, 0, MENU_FLAG_CHECKBOX },
Expand Down
1 change: 1 addition & 0 deletions Source/Sources/Datas/Datas_Texts.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ WCHAR szLocaleMissingAppErr[] = L"Translation for %2 is missing in language fil
WCHAR szLocaleLangErr[] = L"Unable to obtain language name in database \"%1\".";
WCHAR szConfigCustSaveLocationErr[] = L"The savegame location stored in your configuration is not found. Default location will be used.";
WCHAR szConfigCustTempLocationErr[] = L"The temp location stored in your configuration is not found. Default location will be used.";
WCHAR szConfigCustLocationErr[] = L"The temporary locations stored in your configuration are not found. Default locations will be used.";
WCHAR szConfigSaveLocationErr[] = L"An error occurred while creating default savegame location.";
WCHAR szConfigTempLocationErr[] = L"An error occurred while creating default temp location.";

Expand Down
3 changes: 3 additions & 0 deletions Source/Sources/Game/Edit/Game_Edit_Bonuses.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ static GAMESKILL Skills[] = {
{ L"Target_CripplingBlow", NULL, 0, 2, 149, TEXT_ABILITIES_WARFARE },
{ L"Target_CryogenicStasis", NULL, 0, 2, 393, TEXT_ABILITIES_WATER },
{ L"Target_Curse", NULL, 0, 1, 366, TEXT_ABILITIES_SOURCE },
{ L"Target_CursedBloodInfusion", NULL, 2, 1, 2000, TEXT_ABILITIES_SUMMONING },
{ L"Target_CursedElectricInfusion", NULL, 2, 1, 529, TEXT_ABILITIES_SUMMONING },
{ L"Target_CursedOilInfusion", NULL, 2, 1, 2001, TEXT_ABILITIES_SUMMONING },
{ L"Target_DaggersDrawn", NULL, 2, 4, 114, TEXT_ABILITIES_ROGUES },
{ L"Target_DeathWish", NULL, 0, 2, 445, TEXT_ABILITIES_DEATH },
{ L"Target_DeathsDoor", NULL, 0, 3, 554, TEXT_ABILITIES_DEATH },
Expand Down Expand Up @@ -281,6 +283,7 @@ static GAMESKILL Skills[] = {
{ L"Target_MasterOfSparks", NULL, 1, 1, 497, TEXT_ABILITIES_FIRE },
{ L"Target_MosquitoSwarm", NULL, 0, 2, 344, TEXT_ABILITIES_DEATH },
{ L"Target_NecrofireInfusion", NULL, 2, 1, 500, TEXT_ABILITIES_SUMMONING },
{ L"Target_OilInfusion", NULL, 0, 1, 427, TEXT_ABILITIES_SUMMONING },
{ L"Target_Overpower", NULL, 3, 2, 339, TEXT_ABILITIES_WARFARE },
{ L"Target_PetrifyingTouch", NULL, 0, 1, 332, TEXT_ABILITIES_SPECIAL },
{ L"Target_PoisonInfusion", NULL, 0, 1, 421, TEXT_ABILITIES_SUMMONING },
Expand Down
7 changes: 3 additions & 4 deletions Source/Sources/Game/Edit/Game_Edit_Talents.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ static GAMETALENT GameTalents[] = { { 0x00000008, 0 }, // Opportuniste
{ 0x80000000, 2 }, // Bourreau
{ 0x00000001, 3 }, // Sortilège sauvage
{ 0x00000002, 3 }, // Pion
// { 0x00000000, 3 }, // Baiser de l'araignée [For +2 | Con -2] (Towering Oak)
// { 0x00000000, 3 }, // Baiser de l'araignée [Int +2 | Con -2] (Curved Quill)
// { 0x00000000, 3 }, // Baiser de l'araignée [ 2000G | Con -2] (Golden Chest)
{ 0x00000004, 3 }, // Baiser de l'araignée [For +2 | Con -2] (Towering Oak)
{ 0x00000008, 3 }, // Baiser de l'araignée [Int +2 | Con -2] (Curved Quill)
{ 0x00000010, 3 }, // Baiser de l'araignée [Dex +2 | Con -2] (Stately Dragon)
// { 0x00000000, 3 }, // Baiser de l'araignée [ Idol | Con -2] (Transparent Chrysalis)
{ 0x00000020, 3 }, // Baiser de l'araignée [------ | Con -2] (Golden Chest: 200G / Transparent Chrysalis: Idol) (???)
{ 0x00000040, 3 }, // Mnémonique
{ 0x00000080, 3 }, // Secrets professionnels
{ 0x00000400, 3 }, // Armure vivante
Expand Down
118 changes: 101 additions & 17 deletions Source/Sources/Main/Main_Config.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ void Config_Load(CONFIG *pConfig)
UINT uType;
DWORD dwRead;
BOOL bCompleted;
BOOL bTempPathIsValid;
BOOL bLarianPathIsValid;

if (!PathFileExists(szConfigPath)) return;

Expand Down Expand Up @@ -195,9 +197,12 @@ Done: if (!bCompleted) Request_PrintError(App.hWnd,pszErrorMsg,NULL,MB_ICONERROR
}
List_ReleaseMemory(&Root);

//--- Vérifie que le chemin des sauvegardes est toujours valide ---
//--- Vérifie que les chemins sont toujours valides ---

if (!PathFileExists(pConfig->pszLarianPath))
bLarianPathIsValid = PathFileExists(pConfig->pszLarianPath);
bTempPathIsValid = PathFileExists(pConfig->pszTempPath);

if (bTempPathIsValid && !bLarianPathIsValid) // SAVEGAME path is NOT OK, TEMP path is OK
{
WCHAR* pszWarningMsg;
WCHAR* pszWarningTitle;
Expand All @@ -207,10 +212,10 @@ Done: if (!bCompleted) Request_PrintError(App.hWnd,pszErrorMsg,NULL,MB_ICONERROR
if (!pszWarningMsg) pszWarningMsg = szConfigCustSaveLocationErr;
if (!pszWarningTitle) pszWarningTitle = szWarning;
MessageBox(App.hWnd,pszWarningMsg,pszWarningTitle,MB_ICONWARNING|MB_OK);
Config_DefaultSaveLocation(pConfig);
Config_DefaultSaveLocation(pConfig,FALSE);
}

if (!PathFileExists(pConfig->pszTempPath))
else if (!bTempPathIsValid && bLarianPathIsValid) // SAVEGAME path is OK, TEMP path is NOT OK
{
WCHAR* pszWarningMsg;
WCHAR* pszWarningTitle;
Expand All @@ -220,7 +225,21 @@ Done: if (!bCompleted) Request_PrintError(App.hWnd,pszErrorMsg,NULL,MB_ICONERROR
if (!pszWarningMsg) pszWarningMsg = szConfigCustTempLocationErr;
if (!pszWarningTitle) pszWarningTitle = szWarning;
MessageBox(App.hWnd,pszWarningMsg,pszWarningTitle,MB_ICONWARNING|MB_OK);
Config_DefaultTempLocation(pConfig);
Config_DefaultTempLocation(pConfig,FALSE);
}

else if (!bTempPathIsValid && !bLarianPathIsValid) // BOTH paths are NOT OK
{
WCHAR* pszWarningMsg;
WCHAR* pszWarningTitle;

pszWarningMsg = Locale_GetText(TEXT_ERR_CONFIGCUSTOMLOCATION);
pszWarningTitle = Locale_GetText(TEXT_TITLE_WARNING);
if (!pszWarningMsg) pszWarningMsg = szConfigCustLocationErr;
if (!pszWarningTitle) pszWarningTitle = szWarning;
MessageBox(App.hWnd,pszWarningMsg,pszWarningTitle,MB_ICONWARNING|MB_OK);
Config_DefaultSaveLocation(pConfig,FALSE);
Config_DefaultTempLocation(pConfig,FALSE);
}

return;
Expand Down Expand Up @@ -585,6 +604,71 @@ int Config_SetLanguage(HWND hWnd, WCHAR *pszLang)
// ¤¤¤ ¤¤¤ //
// ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ //

// «»»» Restaurer les répertoires temporaires «««««««««««««««««««««««««««»

void Config_ResetLocations()
{
CONFIG* pConfig;
BOOL bTempIsValid;
BOOL bLarianIsValid;
int iTempResult;
int iLarianResult;

if (App.Game.Save.pszSaveName)
{
MessageBox(App.hWnd,Locale_GetText(TEXT_CONFIG_OPENEDSAVEGAME),Locale_GetText(TEXT_TITLE_INFO),MB_ICONEXCLAMATION|MB_OK);
return;
}

pConfig = HeapAlloc(App.hHeap,HEAP_ZERO_MEMORY,sizeof(CONFIG));
if (!pConfig) return;

bTempIsValid = Config_DefaultTempLocation(pConfig,TRUE);
bLarianIsValid = Config_DefaultSaveLocation(pConfig,TRUE);
if (!bTempIsValid || !bLarianIsValid) goto Done;

iTempResult = Config_ResetLocationsRequest(pConfig->pszTempPath,App.Config.pszTempPath,TEXT_CONFIG_LOCATION_TEMP);
if (iTempResult == IDCANCEL) goto Done;
iLarianResult = Config_ResetLocationsRequest(pConfig->pszLarianPath,App.Config.pszLarianPath,TEXT_CONFIG_LOCATION_LARIAN);
if (iLarianResult == IDCANCEL) goto Done;

if (iTempResult == IDYES)
{
if (App.Config.pszTempPath) HeapFree(App.hHeap,0,App.Config.pszTempPath);
App.Config.pszTempPath = pConfig->pszTempPath;
pConfig->pszTempPath = NULL;
}

if (iLarianResult == IDYES)
{
if (App.Config.pszLarianPath) HeapFree(App.hHeap,0,App.Config.pszLarianPath);
App.Config.pszLarianPath = pConfig->pszLarianPath;
pConfig->pszLarianPath = NULL;
}

Done: Config_Release(pConfig);
HeapFree(App.hHeap,0,pConfig);
return;
}

//--- Requête de confirmation ---

int Config_ResetLocationsRequest(WCHAR *pszNewPath, WCHAR *pszOldPath, UINT uLocaleId)
{
WCHAR* pszText;
DWORD_PTR vl[3];
int iResult;

vl[0] = (DWORD_PTR)pszNewPath;
vl[1] = (DWORD_PTR)Locale_GetText(uLocaleId);
vl[2] = (DWORD_PTR)pszOldPath;
if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,Locale_GetText(TEXT_CONFIG_LOCATION),0,0,(WCHAR *)&pszText,1,(va_list *)&vl)) return(IDCANCEL);
iResult = MessageBox(App.hWnd,pszText,Locale_GetText(IDM_CONFIGRESETLOCATIONS),MB_ICONQUESTION|MB_YESNOCANCEL);
LocalFree(pszText);
return(iResult);
}


// «»»» Sélection du répertoire temporaire ««««««««««««««««««««««««««««««»

void Config_SelectTempLocation()
Expand Down Expand Up @@ -754,8 +838,8 @@ int Config_Defaults(CONFIG *pConfig)

//--- Jeu ---

Config_DefaultSaveLocation(pConfig);
Config_DefaultTempLocation(pConfig);
Config_DefaultSaveLocation(pConfig,FALSE);
Config_DefaultTempLocation(pConfig,FALSE);

//--- Edition ---

Expand All @@ -774,7 +858,7 @@ int Config_Defaults(CONFIG *pConfig)

// «»»» Répertoire temporaire par défaut ««««««««««««««««««««««««««««««««»

void Config_DefaultTempLocation(CONFIG *pConfig)
BOOL Config_DefaultTempLocation(CONFIG *pConfig, BOOL bQuiet)
{
WCHAR* pszWarningMsg;
WCHAR* pszWarningTitle;
Expand All @@ -790,17 +874,17 @@ void Config_DefaultTempLocation(CONFIG *pConfig)
if (!pConfig->pszTempPath)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
Request_PrintError(NULL,pszWarningMsg,pszWarningTitle,MB_ICONWARNING|MB_OK);
return;
if (!bQuiet) Request_PrintError(NULL,pszWarningMsg,pszWarningTitle,MB_ICONWARNING|MB_OK);
return(FALSE);
}
GetTempPath(iSize,pConfig->pszTempPath);
return;
return(TRUE);
}


// «»»» Répertoire par défaut pour les sauvegardes ««««««««««««««««««««««»

void Config_DefaultSaveLocation(CONFIG *pConfig)
BOOL Config_DefaultSaveLocation(CONFIG *pConfig, BOOL bQuiet)
{
static const GUID FOLDERID_Documents = { 0xfdd39ad0, 0x238f, 0x46af, { 0xad, 0xb4, 0x6c, 0x85, 0x48, 0x03, 0x69, 0xc7 } };
WCHAR* pszTemp;
Expand All @@ -815,20 +899,20 @@ void Config_DefaultSaveLocation(CONFIG *pConfig)
SHGetKnownFolderPath(&FOLDERID_Documents,KF_FLAG_DEFAULT,NULL,&pszTemp);
if (!pszTemp)
{
Request_PrintError(NULL,pszWarningMsg,pszWarningTitle,MB_ICONWARNING|MB_OK);
return;
if (!bQuiet) Request_PrintError(NULL,pszWarningMsg,pszWarningTitle,MB_ICONWARNING|MB_OK);
return(FALSE);
}
pConfig->pszLarianPath = HeapAlloc(App.hHeap,0,wcslen(pszTemp)*sizeof(WCHAR)+sizeof(WCHAR)+wcslen(szLarianStudios)*sizeof(WCHAR)+sizeof(WCHAR));
if (!pConfig->pszLarianPath)
{
Request_PrintError(NULL,pszWarningMsg,pszWarningTitle,MB_ICONWARNING|MB_OK);
if (!bQuiet) Request_PrintError(NULL,pszWarningMsg,pszWarningTitle,MB_ICONWARNING|MB_OK);
CoTaskMemFree(pszTemp);
return;
return(FALSE);
}
wcscpy(pConfig->pszLarianPath,pszTemp);
PathAppend(pConfig->pszLarianPath,szLarianStudios);
CoTaskMemFree(pszTemp);
return;
return(TRUE);
}


Expand Down
3 changes: 3 additions & 0 deletions Source/Sources/Windows/Windows_Windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ void Window_Command(HWND hWnd, UINT uCode, UINT idCtrl, HWND hwndCtrl)
case IDM_CONFIGSAVELOCATION:
Config_SelectSaveLocation();
break;
case IDM_CONFIGRESETLOCATIONS:
Config_ResetLocations();
break;
case IDM_ABOUT:
About_Display(hWnd);
break;
Expand Down

0 comments on commit 469a8b6

Please sign in to comment.