Skip to content

Commit 88c8e6b

Browse files
committed
For release v1.1.5b. Added setting to make new game files. Fix 3 bugs.
1 parent 88eddc1 commit 88c8e6b

File tree

13 files changed

+358
-227
lines changed

13 files changed

+358
-227
lines changed

COMDeviceList/ComDeviceList.cpp

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ComDeviceList::ComDeviceList()
2222
displayAmmoPriority = true;
2323
displayLifePriority = false;
2424
displayOtherPriority = false;
25+
enableNewGameFileCreation = false;
2526

2627
//More Set Defaults
2728
for(quint8 comPortIndx=0;comPortIndx<MAXCOMPORTS;comPortIndx++)
@@ -457,6 +458,8 @@ void ComDeviceList::SaveLightGunList()
457458
//If Light Gun Number is Zero, then Erase Old Save File & Done
458459
if(numberLightGuns == 0)
459460
{
461+
SavePlayersAss();
462+
460463
if(saveLGData.exists ())
461464
removedFile = saveLGData.remove ();
462465

@@ -1372,6 +1375,11 @@ void ComDeviceList::SaveSettings()
13721375
else
13731376
out << "0\n";
13741377

1378+
if(enableNewGameFileCreation)
1379+
out << "1\n";
1380+
else
1381+
out << "0\n";
1382+
13751383

13761384
out << ENDOFFILE;
13771385

@@ -1539,24 +1547,14 @@ void ComDeviceList::LoadSettings()
15391547
//Next Line is End of File or Display Ammo Priority
15401548
line = in.readLine();
15411549

1542-
if(line.startsWith (ENDOFFILE))
1550+
if(line.startsWith ("1"))
15431551
{
15441552
displayAmmoPriority = true;
1545-
displayLifePriority = false;
1546-
displayOtherPriority = false;
1547-
displayAmmoLife = false;
1548-
displayAmmoLifeGlyphs = true;
1549-
displayAmmoLifeBar = false;
1550-
displayAmmoLifeNumber = false;
1551-
loadSetData.close ();
1552-
this->SaveSettings();
1553-
this->UpdateLightGunWithSettings ();
1554-
return;
15551553
}
1556-
else if(line.startsWith ("1"))
1557-
displayAmmoPriority = true;
15581554
else if(line.startsWith ("0"))
1555+
{
15591556
displayAmmoPriority = false;
1557+
}
15601558
else
15611559
{
15621560
QMessageBox::critical (nullptr, "Settings File Error", "Settings save data file is corrupted at Display Ammo Priority. Please close program and solve file problem.", QMessageBox::Ok);
@@ -1666,6 +1664,27 @@ void ComDeviceList::LoadSettings()
16661664
return;
16671665
}
16681666

1667+
//Setting for New Game File Creation
1668+
line = in.readLine();
1669+
1670+
if(line.startsWith (ENDOFFILE))
1671+
{
1672+
enableNewGameFileCreation = false;
1673+
loadSetData.close ();
1674+
this->SaveSettings();
1675+
this->UpdateLightGunWithSettings ();
1676+
return;
1677+
}
1678+
else if(line.startsWith ("1"))
1679+
enableNewGameFileCreation = true;
1680+
else if(line.startsWith ("0"))
1681+
enableNewGameFileCreation = false;
1682+
else
1683+
{
1684+
QMessageBox::critical (nullptr, "Settings File Error", "Settings save data file is corrupted at Enable New Game File Creation. Please close program and solve file problem.", QMessageBox::Ok);
1685+
return;
1686+
}
1687+
16691688
//Next Line is End of File
16701689
line = in.readLine();
16711690

@@ -1821,6 +1840,16 @@ void ComDeviceList::SetDisplayAmmoAndLife(bool displayAAL, bool displayLG, bool
18211840

18221841
}
18231842

1843+
bool ComDeviceList::GetEnableNewGameFileCreation()
1844+
{
1845+
return enableNewGameFileCreation;
1846+
}
1847+
1848+
void ComDeviceList::SetEnableNewGameFileCreation(bool enableNGFC)
1849+
{
1850+
enableNewGameFileCreation = enableNGFC;
1851+
}
1852+
18241853
void ComDeviceList::UpdateLightGunWithSettings()
18251854
{
18261855
bool isDefaultLG;

COMDeviceList/ComDeviceList.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ class ComDeviceList
125125
bool GetDisplayAmmoAndLife(bool *displayLG, bool *displayLB, bool *displayLN);
126126
void SetDisplayAmmoAndLife(bool displayAAL, bool displayLG, bool displayLB, bool displayLN);
127127

128+
//Enable New Game File Creation
129+
bool GetEnableNewGameFileCreation();
130+
void SetEnableNewGameFileCreation(bool enableNGFC);
131+
128132
//Update Light Gun Settings
129133
void UpdateLightGunWithSettings();
130134

@@ -203,6 +207,7 @@ class ComDeviceList
203207
bool displayAmmoPriority;
204208
bool displayLifePriority;
205209
bool displayOtherPriority;
210+
bool enableNewGameFileCreation;
206211

207212
quint8 userRecoilPriority[NUMBEROFRECOILS];
208213

COMDeviceList/LightGun.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,14 +1271,17 @@ void LightGun::LoadDefaultLGCommands()
12711271
for(i = 0; i < numberCommands; i++)
12721272
{
12731273
commands[i] = commands[i].trimmed ();
1274+
closeComPortCmds << commands[i];
12741275

1276+
/* The ZX command should not be taken out, as it gives recoil control back to light gun
12751277
if(disableReaperLEDs)
12761278
{
12771279
if(commands[i] != DISABLEREAPERLEDSCLOSE)
12781280
closeComPortCmds << commands[i];
12791281
}
12801282
else
12811283
closeComPortCmds << commands[i];
1284+
*/
12821285
}
12831286
closeComPortCmdsSet = true;
12841287
}

Global.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <qobject.h>
55

6-
#define VERSION "1.1.5"
6+
#define VERSION "1.1.5b"
77
#define VERSIONMAIN 1
88
#define VERSIONMID 1
99
#define VERSIONLAST 3

0 commit comments

Comments
 (0)