diff --git a/BackEnd/BackEnd.vbproj b/BackEnd/BackEnd.vbproj index 60d800a..d4400ef 100644 --- a/BackEnd/BackEnd.vbproj +++ b/BackEnd/BackEnd.vbproj @@ -22,7 +22,6 @@ true true 40 - J:\JA2 1.13 SVN\xml-editor-vb\Backup\BackEnd\ 2.0 @@ -70,23 +69,6 @@ Application.Designer.vb - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - @@ -97,7 +79,4 @@ - - - \ No newline at end of file diff --git a/BackEnd/Data Access/TableComments.vb b/BackEnd/Data Access/TableComments.vb index a703207..44efdb9 100644 --- a/BackEnd/Data Access/TableComments.vb +++ b/BackEnd/Data Access/TableComments.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Imports System.Runtime.CompilerServices diff --git a/BackEnd/Data Access/Tables.vb b/BackEnd/Data Access/Tables.vb index 7948ed6..3413794 100644 --- a/BackEnd/Data Access/Tables.vb +++ b/BackEnd/Data Access/Tables.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Public Class Tables Public Const Sounds As String = "SOUND" Public Const BurstSounds As String = "BURSTSOUND" diff --git a/BackEnd/Data Access/Tables/AutoIncrementTable.vb b/BackEnd/Data Access/Tables/AutoIncrementTable.vb index e734fb9..d6d79b6 100644 --- a/BackEnd/Data Access/Tables/AutoIncrementTable.vb +++ b/BackEnd/Data Access/Tables/AutoIncrementTable.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class AutoIncrementTable diff --git a/BackEnd/Data Access/Tables/ControlTable.vb b/BackEnd/Data Access/Tables/ControlTable.vb index d229891..aae50d4 100644 --- a/BackEnd/Data Access/Tables/ControlTable.vb +++ b/BackEnd/Data Access/Tables/ControlTable.vb @@ -1,4 +1,7 @@ -Imports System.Xml +Option Strict On +Option Explicit On + +Imports System.Xml Imports System.IO Imports System.Data @@ -42,8 +45,10 @@ Public Class ControlTable Protected Overridable Sub LoadControlData(ByVal fileName As String, ByVal filePath As String) Dim xmldoc As New XmlDocument() - Dim fs As New FileStream(filePath, FileMode.Open, FileAccess.Read) - xmldoc.Load(fs) + + Using fs As New FileStream(filePath, FileMode.Open, FileAccess.Read) + xmldoc.Load(fs) + End Using Dim xmlnode As XmlNode = xmldoc.GetElementsByTagName("INVENTORYLIST").Item(0) Dim xmlParentNode As XmlNodeList diff --git a/BackEnd/Data Access/Tables/DefaultTable.vb b/BackEnd/Data Access/Tables/DefaultTable.vb index c8e448b..a72a974 100644 --- a/BackEnd/Data Access/Tables/DefaultTable.vb +++ b/BackEnd/Data Access/Tables/DefaultTable.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Imports System.IO @@ -7,6 +10,24 @@ Public Class DefaultTable Protected _table As DataTable Protected WithEvents _dm As DataManager + ' Dictionary mapping file names to table names for special cases + Private Shared ReadOnly FileNameToTableNameMap As New Dictionary(Of String, String) From { + {"Inventory\EnemyGunChoices.xml", "ENEMYGUNCHOICESDEFAULT"}, + {"Inventory\GunChoices_Enemy_Admin.xml", "ENEMYGUNCHOICESADMIN"}, + {"Inventory\GunChoices_Enemy_Regular.xml", "ENEMYGUNCHOICESREGULAR"}, + {"Inventory\GunChoices_Enemy_Elite.xml", "ENEMYGUNCHOICESELITE"}, + {"Inventory\GunChoices_Militia_Green.xml", "MILITIAGUNCHOICESGREEN"}, + {"Inventory\GunChoices_Militia_Regular.xml", "MILITIAGUNCHOICESREGULAR"}, + {"Inventory\GunChoices_Militia_Elite.xml", "MILITIAGUNCHOICESELITE"}, + {"Inventory\EnemyItemChoices.xml", "ENEMYITEMCHOICESDEFAULT"}, + {"Inventory\ItemChoices_Enemy_Admin.xml", "ENEMYITEMCHOICESADMIN"}, + {"Inventory\ItemChoices_Enemy_Regular.xml", "ENEMYITEMCHOICESREGULAR"}, + {"Inventory\ItemChoices_Enemy_Elite.xml", "ENEMYITEMCHOICESELITE"}, + {"Inventory\ItemChoices_Militia_Green.xml", "MILITIAITEMCHOICESGREEN"}, + {"Inventory\ItemChoices_Militia_Regular.xml", "MILITIAITEMCHOICESREGULAR"}, + {"Inventory\ItemChoices_Militia_Elite.xml", "MILITIAITEMCHOICESELITE"} + } + Public Sub New(ByVal table As DataTable, ByVal manager As DataManager) _table = table _dm = manager @@ -27,6 +48,15 @@ Public Class DefaultTable Return filePath End Function + ''' + ''' Applies table name mapping based on file name if it exists in the dictionary + ''' + Private Sub ApplyTableNameMapping(fileName As String) + If FileNameToTableNameMap.ContainsKey(fileName) Then + _table.TableName = FileNameToTableNameMap(fileName) + End If + End Sub + Public Overridable Sub LoadData() Const Temp As String = "temp" @@ -45,35 +75,7 @@ Public Class DefaultTable _table.TableName() = "ENEMYITEMCHOICES" End If _table.ReadXml(filePath) - If fileName = "Inventory\EnemyGunChoices.xml" Then - _table.TableName = "ENEMYGUNCHOICESDEFAULT" - ElseIf fileName = "Inventory\GunChoices_Enemy_Admin.xml" Then - _table.TableName = "ENEMYGUNCHOICESADMIN" - ElseIf fileName = "Inventory\GunChoices_Enemy_Regular.xml" Then - _table.TableName = "ENEMYGUNCHOICESREGULAR" - ElseIf fileName = "Inventory\GunChoices_Enemy_Elite.xml" Then - _table.TableName = "ENEMYGUNCHOICESELITE" - ElseIf fileName = "Inventory\GunChoices_Militia_Green.xml" Then - _table.TableName = "MILITIAGUNCHOICESGREEN" - ElseIf fileName = "Inventory\GunChoices_Militia_Regular.xml" Then - _table.TableName = "MILITIAGUNCHOICESREGULAR" - ElseIf fileName = "Inventory\GunChoices_Militia_Elite.xml" Then - _table.TableName = "MILITIAGUNCHOICESELITE" - ElseIf fileName = "Inventory\EnemyItemChoices.xml" Then - _table.TableName = "ENEMYITEMCHOICESDEFAULT" - ElseIf fileName = "Inventory\ItemChoices_Enemy_Admin.xml" Then - _table.TableName = "ENEMYITEMCHOICESADMIN" - ElseIf fileName = "Inventory\ItemChoices_Enemy_Regular.xml" Then - _table.TableName = "ENEMYITEMCHOICESREGULAR" - ElseIf fileName = "Inventory\ItemChoices_Enemy_Elite.xml" Then - _table.TableName = "ENEMYITEMCHOICESELITE" - ElseIf fileName = "Inventory\ItemChoices_Militia_Green.xml" Then - _table.TableName = "MILITIAITEMCHOICESGREEN" - ElseIf fileName = "Inventory\ItemChoices_Militia_Regular.xml" Then - _table.TableName = "MILITIAITEMCHOICESREGULAR" - ElseIf fileName = "Inventory\ItemChoices_Militia_Elite.xml" Then - _table.TableName = "MILITIAITEMCHOICESELITE" - End If + ApplyTableNameMapping(fileName) Else Dim tableName As String = _table.TableName For Each t In _table.DataSet.Tables @@ -104,35 +106,7 @@ Public Class DefaultTable _table.TableName() = "ENEMYITEMCHOICES" End If SaveData(_table) - If fileName = "Inventory\EnemyGunChoices.xml" Then - _table.TableName = "ENEMYGUNCHOICESDEFAULT" - ElseIf fileName = "Inventory\GunChoices_Enemy_Admin.xml" Then - _table.TableName = "ENEMYGUNCHOICESADMIN" - ElseIf fileName = "Inventory\GunChoices_Enemy_Regular.xml" Then - _table.TableName = "ENEMYGUNCHOICESREGULAR" - ElseIf fileName = "Inventory\GunChoices_Enemy_Elite.xml" Then - _table.TableName = "ENEMYGUNCHOICESELITE" - ElseIf fileName = "Inventory\GunChoices_Militia_Green.xml" Then - _table.TableName = "MILITIAGUNCHOICESGREEN" - ElseIf fileName = "Inventory\GunChoices_Militia_Regular.xml" Then - _table.TableName = "MILITIAGUNCHOICESREGULAR" - ElseIf fileName = "Inventory\GunChoices_Militia_Elite.xml" Then - _table.TableName = "MILITIAGUNCHOICESELITE" - ElseIf fileName = "Inventory\EnemyItemChoices.xml" Then - _table.TableName = "ENEMYITEMCHOICESDEFAULT" - ElseIf fileName = "Inventory\ItemChoices_Enemy_Admin.xml" Then - _table.TableName = "ENEMYITEMCHOICESADMIN" - ElseIf fileName = "Inventory\ItemChoices_Enemy_Regular.xml" Then - _table.TableName = "ENEMYITEMCHOICESREGULAR" - ElseIf fileName = "Inventory\ItemChoices_Enemy_Elite.xml" Then - _table.TableName = "ENEMYITEMCHOICESELITE" - ElseIf fileName = "Inventory\ItemChoices_Militia_Green.xml" Then - _table.TableName = "MILITIAITEMCHOICESGREEN" - ElseIf fileName = "Inventory\ItemChoices_Militia_Regular.xml" Then - _table.TableName = "MILITIAITEMCHOICESREGULAR" - ElseIf fileName = "Inventory\ItemChoices_Militia_Elite.xml" Then - _table.TableName = "MILITIAITEMCHOICESELITE" - End If + ApplyTableNameMapping(fileName) End Sub Protected Overridable Sub SaveData(ByVal table As DataTable) @@ -284,8 +258,6 @@ Public Class DefaultTable xw.WriteWhitespace(vbLf) xw.Close() view.Dispose() - - 'table.AcceptChanges() End Sub 'this just works on single pk tables for now @@ -346,8 +318,12 @@ Public Class DefaultTable If canAddRow Then Try row.Table.Rows.Add(dupeRow) + Catch ex As ConstraintException + ' Row already exists with this primary key, skip silently + ErrorHandler.LogError("Failed to add duplicate row", ex) Catch ex As Exception - + ErrorHandler.LogError("Unexpected error adding duplicate row", ex) + Throw End Try End If diff --git a/BackEnd/Data Access/Tables/DuplicateEntryTable.vb b/BackEnd/Data Access/Tables/DuplicateEntryTable.vb index e812834..a249804 100644 --- a/BackEnd/Data Access/Tables/DuplicateEntryTable.vb +++ b/BackEnd/Data Access/Tables/DuplicateEntryTable.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data 'for incompatible attachments and compatible face items diff --git a/BackEnd/Data Access/Tables/EnemyItemTable.vb b/BackEnd/Data Access/Tables/EnemyItemTable.vb index 6529618..68f2bbc 100644 --- a/BackEnd/Data Access/Tables/EnemyItemTable.vb +++ b/BackEnd/Data Access/Tables/EnemyItemTable.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class EnemyItemTable @@ -63,12 +66,6 @@ Public Class EnemyItemTable Exit For End If Next - 'row.ItemArray = ammoTable.Rows.Contains(rowindex) - - 'row.ItemArray = ammoTable.Rows(rowindex).ItemArray - 'row("uiIndex") = 19 - '_table.Rows.Add(row) - 'ammoTable.Rows.RemoveAt(0) End If End Sub End Class diff --git a/BackEnd/Data Access/Tables/InventoryTable.vb b/BackEnd/Data Access/Tables/InventoryTable.vb index be0bba3..c1e6446 100644 --- a/BackEnd/Data Access/Tables/InventoryTable.vb +++ b/BackEnd/Data Access/Tables/InventoryTable.vb @@ -1,4 +1,7 @@ -Imports System.Data +Option Strict On +Option Explicit On + +Imports System.Data Imports System.Xml Public Class InventoryTable diff --git a/BackEnd/Data Access/Tables/IteTable.vb b/BackEnd/Data Access/Tables/IteTable.vb index 7086229..1e10afe 100644 --- a/BackEnd/Data Access/Tables/IteTable.vb +++ b/BackEnd/Data Access/Tables/IteTable.vb @@ -1,4 +1,7 @@ -Imports System.Data +Option Strict On +Option Explicit On + +Imports System.Data Public Class IteTable Inherits DefaultTable diff --git a/BackEnd/Data Access/Tables/ItemTable.vb b/BackEnd/Data Access/Tables/ItemTable.vb index 44b858f..34f3aa5 100644 --- a/BackEnd/Data Access/Tables/ItemTable.vb +++ b/BackEnd/Data Access/Tables/ItemTable.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Xml Imports System.IO Imports System.Data @@ -291,23 +294,7 @@ Public Class ItemTable End Sub Public Overrides Sub DeleteRow(ByVal key As Decimal) - 'Dim row As DataRow = _table.Rows.Find(key) MyBase.DeleteRow(key) - ''MM: no longer needed due to nothing items being added automatically on save - 'Dim nothingRow As DataRow = tbl.Rows.Find(0) - 'If row IsNot Nothing Then - ' Dim maxID = tbl.Compute("MAX(" & tbl.PrimaryKey(0).ColumnName & ")", Nothing) - ' If row(Tables.Items.Fields.ID) = maxID Then 'if this is the last record, then we can delete it - 'row.Delete() - ' Else 'otherwise, we need to turn this into a nothing item, - ''because JA2 will stop looking for items once it hits this one's zero value itemclass - 'For Each c As DataColumn In tbl.Columns - ' If Not c.ReadOnly AndAlso c IsNot tbl.PrimaryKey(0) Then row(c) = nothingRow(c) - 'Next - 'row(Tables.Items.Fields.ItemClass) = ItemClass.None - 'row(Tables.Items.Fields.Description) = "Index " & row(Tables.Items.Fields.ID) - ' End If - 'End If End Sub Public Overrides Sub LoadData() @@ -332,9 +319,11 @@ Public Class ItemTable Dim a As Integer Dim da, aap As Integer Dim uicomments As Integer = 0 - Dim fs As New FileStream(filePath, FileMode.Open, FileAccess.Read) - xmldoc.Load(fs) + Using fs As New FileStream(filePath, FileMode.Open, FileAccess.Read) + xmldoc.Load(fs) + End Using + xmlnode = xmldoc.GetElementsByTagName("ITEMLIST").Item(0) For i = 0 To xmlnode.ChildNodes.Count - 1 If xmlnode.ChildNodes.Item(i).Name = "#comment" Then @@ -399,8 +388,6 @@ Public Class ItemTable Next _table.Rows(rowIndex).EndEdit() Next - fs.Close() - fs.Dispose() End Sub Protected Overrides Sub WriteXml(ByVal table As DataTable, ByVal fileName As String) @@ -616,8 +603,6 @@ Public Class ItemTable CopyExtraRow(Tables.Sounds, newRow, sourceRow, Tables.Weapons.Name & Tables.Weapons.Fields.LockNLoadSound, sourceDB) CopyExtraRow(Tables.Sounds, newRow, sourceRow, Tables.Weapons.Name & Tables.Weapons.Fields.ReloadSound, sourceDB) Case ItemClass.LBE - 'lbes - 'CopyExtraRow(Tables.Silhouettes, newRow, sourceRow, Tables.LoadBearingEquipment.Name & Tables.LoadBearingEquipment.Fields.Silhouette, sourceDB) CopyExtraRow(Tables.LbeClasses, newRow, sourceRow, Tables.LoadBearingEquipment.Name & Tables.LoadBearingEquipment.Fields.LbeClass, sourceDB) End Select @@ -629,7 +614,6 @@ Public Class ItemTable If row IsNot Nothing Then Dim extraRow As DataRow = _dm.Database.CopyRows(tableName, New DataRow() {row}, sourceDB, False) - 'newRow(fieldName) = extraRow(_dm.Database.Table(tableName).PrimaryKey(0)) End If End Sub diff --git a/BackEnd/Data Access/Tables/ItemTransformationTable.vb b/BackEnd/Data Access/Tables/ItemTransformationTable.vb index 8116221..db55349 100644 --- a/BackEnd/Data Access/Tables/ItemTransformationTable.vb +++ b/BackEnd/Data Access/Tables/ItemTransformationTable.vb @@ -1,4 +1,7 @@ -Imports System.Xml +Option Strict On +Option Explicit On + +Imports System.Xml Imports System.IO Imports System.Data @@ -28,9 +31,11 @@ Public Class ItemTransformationTable Dim x As Integer Dim da As Integer Dim uiComments As Integer = 0 - Dim fs As New FileStream(filePath, FileMode.Open, FileAccess.Read) - xmldoc.Load(fs) + Using fs As New FileStream(filePath, FileMode.Open, FileAccess.Read) + xmldoc.Load(fs) + End Using + xmlnode = xmldoc.GetElementsByTagName("TRANSFORMATIONS_LIST").Item(0) For i = 0 To xmlnode.ChildNodes.Count - 1 If xmlnode.ChildNodes.Item(i).Name = "#comment" Then diff --git a/BackEnd/Data Access/Tables/MercStartingGearTable.vb b/BackEnd/Data Access/Tables/MercStartingGearTable.vb index ad0d014..d1d7b7b 100644 --- a/BackEnd/Data Access/Tables/MercStartingGearTable.vb +++ b/BackEnd/Data Access/Tables/MercStartingGearTable.vb @@ -1,4 +1,7 @@ -Imports System.Xml +Option Strict On +Option Explicit On + +Imports System.Xml Imports System.IO Imports System.Data @@ -30,9 +33,11 @@ Public Class MercStartingGearTable Dim y As Integer Dim a As Integer Dim uiComments As Integer = 0 - Dim fs As New FileStream(filePath, FileMode.Open, FileAccess.Read) - xmldoc.Load(fs) + Using fs As New FileStream(filePath, FileMode.Open, FileAccess.Read) + xmldoc.Load(fs) + End Using + xmlnode = xmldoc.GetElementsByTagName("MERCGEARLIST").Item(0) For i = 0 To xmlnode.ChildNodes.Count - 1 @@ -86,7 +91,6 @@ Public Class MercStartingGearTable Protected Overrides Sub WriteXml(ByVal table As DataTable, ByVal fileName As String) 'the stupid table.WriteXml method doesn't let you sort the data first Dim view As New DataView(table, "", table.Columns(0).ColumnName, DataViewRowState.CurrentRows) - 'Dim trim As Boolean = table.GetBooleanProperty(TableProperty.Trim) Dim trim As Boolean = False Dim sourceDSName = table.GetStringProperty(TableProperty.DataSetName) If sourceDSName Is Nothing Then @@ -109,7 +113,6 @@ Public Class MercStartingGearTable xw.WriteStartElement(table.TableName) xw.WriteString(vbLf) - 'Dim dcIndex As Integer = -1 Dim isGearKit As Boolean = False Dim gkIndex As String = "" trim = False diff --git a/BackEnd/Data Access/Tables/SoundTable.vb b/BackEnd/Data Access/Tables/SoundTable.vb index 67ce3c2..0e7664a 100644 --- a/BackEnd/Data Access/Tables/SoundTable.vb +++ b/BackEnd/Data Access/Tables/SoundTable.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class SoundTable diff --git a/BackEnd/Data Access/Tables/WeaponTable.vb b/BackEnd/Data Access/Tables/WeaponTable.vb index d4512d9..6991670 100644 --- a/BackEnd/Data Access/Tables/WeaponTable.vb +++ b/BackEnd/Data Access/Tables/WeaponTable.vb @@ -1,4 +1,7 @@ -Imports System.Xml +Option Strict On +Option Explicit On + +Imports System.Xml Imports System.IO Imports System.Xml.Linq Imports System.Data diff --git a/BackEnd/Data Access/Utility.vb b/BackEnd/Data Access/Utility.vb index f80d538..a3fa024 100644 --- a/BackEnd/Data Access/Utility.vb +++ b/BackEnd/Data Access/Utility.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Imports System.Runtime.CompilerServices diff --git a/BackEnd/Data Access/XmlDB.vb b/BackEnd/Data Access/XmlDB.vb index 0ba679a..7c390e9 100644 --- a/BackEnd/Data Access/XmlDB.vb +++ b/BackEnd/Data Access/XmlDB.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class XmlDB diff --git a/BackEnd/DataManager.vb b/BackEnd/DataManager.vb index 7f2c9e5..8057804 100644 --- a/BackEnd/DataManager.vb +++ b/BackEnd/DataManager.vb @@ -1,4 +1,7 @@ -Public Class DataManager +Option Strict On +Option Explicit On + +Public Class DataManager Protected _dataDirectory As String Protected _gameDirRussianPath As String Protected _gameDirPolishPath As String diff --git a/BackEnd/DatabaseCode.vb b/BackEnd/DatabaseCode.vb index c951c91..567c6e4 100644 --- a/BackEnd/DatabaseCode.vb +++ b/BackEnd/DatabaseCode.vb @@ -1,5 +1,7 @@ +Option Strict On +Option Explicit On + Imports System.Data -Imports System.Security.Cryptography.Pkcs Public Module DatabaseCode 'JMich @@ -72,7 +74,6 @@ Public Module DatabaseCode Dim itemsToExplosives As DataTable = MakeITETable() Dim transform As DataTable = MakeTransformTable() Dim disease As DataTable = MakeDiseaseTable() - 'Dim drugs As DataTable = MakeDrugsTable() Dim food As DataTable = MakeFoodTable() Dim clothes As DataTable = MakeClothesTable() Dim randomitems As DataTable = MakeRandomTable() @@ -217,7 +218,6 @@ Public Module DatabaseCode ds.Tables.Add(transform) ds.Tables.Add(attachmentPoints) ds.Tables.Add(disease) - 'ds.Tables.Add(drugs) ds.Tables.Add(food) ds.Tables.Add(clothes) ds.Tables.Add(randomitems) @@ -572,7 +572,6 @@ Public Module DatabaseCode AddLookupData(itemClasses, 2048, "Armour") AddLookupData(itemClasses, 4096, "Medkit") AddLookupData(itemClasses, 8192, "Kit") - 'AddLookupData(itemClasses, 16384, "(Unused)") AddLookupData(itemClasses, 32768, "Face Item") AddLookupData(itemClasses, 65536, "Key") AddLookupData(itemClasses, 131072, "Load Bearing Equipment") @@ -926,8 +925,6 @@ Public Module DatabaseCode pk(0) = t.Columns("uiIndex") t.PrimaryKey = pk - 'AddConstraint(t, New String() {"ubCalibre", "ubMagSize", "ubAmmoType"}, False) - Return t End Function @@ -936,8 +933,8 @@ Public Module DatabaseCode t.ExtendedProperties.Add(TableProperty.DataSetName, t.TableName & "LIST") t.ExtendedProperties.Add(TableProperty.FileName, "Items\Launchables.xml") - t.Columns.Add(MakeColumn("launchableIndex", "Launchable", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "usItemClass = 256 or usItemClass = 512", , , "szLongItemName")) - t.Columns.Add(MakeColumn("itemIndex", "Launcher", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "usItemClass = 16", , , "szLongItemName")) + t.Columns.Add(MakeColumn("launchableIndex", "Launchable", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "usItemClass = " & ItemClass.Grenade & " or usItemClass = " & ItemClass.Bomb, , , "szLongItemName")) + t.Columns.Add(MakeColumn("itemIndex", "Launcher", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "usItemClass = " & ItemClass.Launcher, , , "szLongItemName")) AddConstraint(t, New String() {"launchableIndex", "itemIndex"}, True) @@ -1017,8 +1014,8 @@ Public Module DatabaseCode t.ExtendedProperties.Add(TableProperty.FileName, "Items\CompatibleFaceItems.xml") t.ExtendedProperties.Add(TableProperty.TableHandlerName, "DuplicateEntryTable") - t.Columns.Add(MakeColumn("compatiblefaceitemIndex", "Face Item", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "usItemClass = 32768", , , "szLongItemName")) - t.Columns.Add(MakeColumn("itemIndex", "Face Item", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "usItemClass = 32768", , , "szLongItemName")) + t.Columns.Add(MakeColumn("compatiblefaceitemIndex", "Face Item", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "usItemClass = " & ItemClass.Face, , , "szLongItemName")) + t.Columns.Add(MakeColumn("itemIndex", "Face Item", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "usItemClass = " & ItemClass.Face, , , "szLongItemName")) AddConstraint(t, New String() {"compatiblefaceitemIndex", "itemIndex"}, True) @@ -1255,7 +1252,6 @@ Public Module DatabaseCode t.Columns.Add(MakeColumn("fBurstOnlyByFanTheHammer", "fBurstOnlyByFanTheHammer", GetType(Boolean))) ' NOTE BarrelConfiguration tags are defined in LoadData() in Weapontable.vb ' Datasets do not like multiple xml nodes with the same name inside one parent node - 't.Columns.Add(MakeColumn("BarrelConfiguration", "BarrelConfiguration", GetType(Integer), , , , , , , True)) t.Columns.Add(MakeColumn("ubNWSSCase", "ubNWSSCase", GetType(Byte), , , , , , , True)) t.Columns.Add(MakeColumn("ubNWSSLast", "ubNWSSLast", GetType(Byte), , , , , , , True)) t.Columns.Add(MakeColumn("szNWSSSound", "szNWSSSound", GetType(String), , , , , , , True)) @@ -1289,7 +1285,6 @@ Public Module DatabaseCode For i As Integer = 0 To 9 t.Columns.Add(MakeColumn("AvailableAttachmentPoint" & i, "Avail. Att. Point " & i + 1, GetType(ULong), , "AttachmentPoint", "id", "name", , , True, , "name", , , , "AvailableAttachmentPoint")) Next - 't.Columns.Add(MakeColumn("AvailableAttachmentPoint", "Avail. Att. Point", GetType(ULong), , "AttachmentPoint", "id", "name", , , True, , "name")) t.Columns.Add(MakeColumn("AttachmentPoint", "Att. Point", GetType(ULong), , "AttachmentPoint", "id", "name", , , True, , "name")) t.Columns.Add(MakeColumn("AttachToPointAPCost", "Att. AP Cost", GetType(Integer), , , , , , , True)) t.Columns.Add(MakeColumn("ubClassIndex", "Foreign Key", GetType(Integer), , , , , , , True)) @@ -1328,7 +1323,7 @@ Public Module DatabaseCode t.Columns.Add(MakeColumn("overheatDamageThresholdModificator", "Overheating Damage Threshold Modifier", GetType(Decimal), 0, , , , , , True)) t.Columns.Add(MakeColumn("DirtIncreaseFactor", "Dirt Increase Factor", GetType(Decimal), , , , , , , True)) t.Columns.Add(MakeColumn("RobotDamageReduction", "RobotDamageReduction", GetType(Decimal), , , , , , , True)) - t.Columns.Add(MakeColumn("DiscardedLauncherItem", "Discarded Launcher Item", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "uiIndex=0 OR usItemClass=268435456", True, , "szLongItemName")) + t.Columns.Add(MakeColumn("DiscardedLauncherItem", "Discarded Launcher Item", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "uiIndex=0 OR usItemClass=" & ItemClass.Misc, True, , "szLongItemName")) t.Columns.Add(MakeColumn("randomitem", "Random Item", GetType(Integer), , "RANDOMITEM", "uiIndex", "szName", , , True, , "szName")) t.Columns.Add(MakeColumn("buddyitem", "Buddy Item", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "uiIndex=0", True, , "szLongItemName")) t.Columns.Add(MakeColumn("usRiotShieldStrength", "Riot Shield Strength", GetType(Integer), 0, , , , , , True)) @@ -1343,7 +1338,7 @@ Public Module DatabaseCode t.Columns.Add(MakeColumn("MinRangeForAimBonus", "Min. Range For Aim Bonus", GetType(Integer), , , , , , , True)) t.Columns.Add(MakeColumn("PercentAPReduction", "% AP Reduction", GetType(Integer), , , , , , , True)) t.Columns.Add(MakeColumn("PercentStatusDrainReduction", "% Status Drain Reduction", GetType(Integer), , , , , , , True)) - t.Columns.Add(MakeColumn("BloodiedItem", "Bloodied Item", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "usItemClass = 8 OR uiIndex=0", True, , "szLongItemName")) + t.Columns.Add(MakeColumn("BloodiedItem", "Bloodied Item", GetType(Integer), , "ITEM", "uiIndex", "szLongItemName", , "usItemClass = " & ItemClass.ThrowingKnife & " OR uiIndex=0", True, , "szLongItemName")) t.Columns.Add(MakeColumn("HearingRangeBonus", "Hearing Range Bonus", GetType(Integer), , , , , , , True)) t.Columns.Add(MakeColumn("VisionRangeBonus", "Vision Range Bonus", GetType(Integer), , , , , , , True)) t.Columns.Add(MakeColumn("NightVisionRangeBonus", "Night Vision Range Bonus", GetType(Integer), , , , , , , True)) @@ -1460,8 +1455,6 @@ Public Module DatabaseCode t.Columns.Add(MakeColumn("GrenadeLauncher", "Grenade Launcher", GetType(Boolean), , , , , , , True)) t.Columns.Add(MakeColumn("Mortar", "Mortar", GetType(Boolean), , , , , , , True)) t.Columns.Add(MakeColumn("Duckbill", "Duckbill", GetType(Boolean), , , , , , , True)) - 't.Columns.Add(MakeColumn("Detonator", "Detonator", GetType(Boolean), , , , , , , True)) - 't.Columns.Add(MakeColumn("RemoteDetonator", "RemoteDetonator", GetType(Boolean), , , , , , , True)) t.Columns.Add(MakeColumn("HideMuzzleFlash", "Hide Muzzle Flash", GetType(Boolean), , , , , , , True)) t.Columns.Add(MakeColumn("RocketLauncher", "Rocket Launcher", GetType(Boolean), , , , , , , True)) 'ItemFlag2 @@ -2433,12 +2426,6 @@ Public Module DatabaseCode t.Columns.Add(MakeColumn("szName", "Name", GetType(String))) t.Columns.Add(MakeColumn("opinionevent", "Opinion Event", GetType(Boolean))) - 't.Columns.Add(MakeColumn("ubDrugTravelRate", "Travel Rate", GetType(Integer))) - 't.Columns.Add(MakeColumn("ubDrugWearoffRate", "Wear Off Rate", GetType(Integer))) - 't.Columns.Add(MakeColumn("ubDrugEffect", "Effect", GetType(Integer))) - 't.Columns.Add(MakeColumn("ubDrugSideEffect", "Side Effect", GetType(Integer))) - 't.Columns.Add(MakeColumn("ubDrugSideEffectRate", "Side Effect Rate", GetType(Integer))) - Dim pk(0) As DataColumn pk(0) = t.Columns("uiIndex") t.PrimaryKey = pk diff --git a/BackEnd/ErrorHandler.vb b/BackEnd/ErrorHandler.vb index 10e7118..25ccb26 100644 --- a/BackEnd/ErrorHandler.vb +++ b/BackEnd/ErrorHandler.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Public Class ErrorHandler Protected Shared strLogFilename As String diff --git a/BackEnd/Images/ItemImageManager.vb b/BackEnd/Images/ItemImageManager.vb index 460db94..0c26d5b 100644 --- a/BackEnd/Images/ItemImageManager.vb +++ b/BackEnd/Images/ItemImageManager.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Windows.Forms Imports System.Drawing diff --git a/BackEnd/Images/STI.vb b/BackEnd/Images/STI.vb index 3830347..1bcb98a 100644 --- a/BackEnd/Images/STI.vb +++ b/BackEnd/Images/STI.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System Imports System.Drawing Imports System.Drawing.Imaging diff --git a/BackEnd/Localization.vb b/BackEnd/Localization.vb index 30a056f..7c8b554 100644 --- a/BackEnd/Localization.vb +++ b/BackEnd/Localization.vb @@ -1,4 +1,7 @@ -Public Module Localization +Option Strict On +Option Explicit On + +Public Module Localization Public Function IsLanguageSpecificFile(ByVal filename As String) As Boolean Dim langSpec = False diff --git a/BackEnd/LookupFile.vb b/BackEnd/LookupFile.vb index a20dad4..145401f 100644 --- a/BackEnd/LookupFile.vb +++ b/BackEnd/LookupFile.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class LookupFile diff --git a/GUI/App Forms/AboutForm.vb b/GUI/App Forms/AboutForm.vb index 09c02ce..cbcbf77 100644 --- a/GUI/App Forms/AboutForm.vb +++ b/GUI/App Forms/AboutForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Public NotInheritable Class AboutForm Private Sub AboutBox1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load diff --git a/GUI/App Forms/MainForm.vb b/GUI/App Forms/MainForm.vb index 3952ec8..2a2cd45 100644 --- a/GUI/App Forms/MainForm.vb +++ b/GUI/App Forms/MainForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Windows.Forms Public Class MainForm @@ -725,10 +728,6 @@ Public Class MainForm ShowDataGridForm(_activeDataSet, DisplayText.DrugTypes, Tables.DrugTypes) End Sub - 'Private Sub DrugsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles DrugsToolStripMenuItem.Click - ' ShowDataGridForm(_activeDataSet, DisplayText.Drugs, Tables.Drugs) - 'End Sub - Private Sub DrugsItemFilterToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles DrugsItemFilterToolStripMenuItem.Click ShowItemGridForm(_activeDataSet, FormatItemClassText(DisplayText.Drugs), Tables.Items.Fields.Medical & "= 1", Nothing) End Sub diff --git a/GUI/App Forms/SplashForm.vb b/GUI/App Forms/SplashForm.vb index 2acf8c9..e6de6e8 100644 --- a/GUI/App Forms/SplashForm.vb +++ b/GUI/App Forms/SplashForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Public NotInheritable Class SplashForm 'TODO: This form can easily be set as the splash screen for the application by going to the "Application" tab diff --git a/GUI/ApplicationEvents.vb b/GUI/ApplicationEvents.vb index 83eb605..7acfd14 100644 --- a/GUI/ApplicationEvents.vb +++ b/GUI/ApplicationEvents.vb @@ -1,4 +1,7 @@ -Namespace My +Option Strict On +Option Explicit On + +Namespace My ' The following events are available for MyApplication: ' Startup: Raised when the application starts, before the startup form is created. ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. diff --git a/GUI/Data Forms/BaseDataForm.vb b/GUI/Data Forms/BaseDataForm.vb index b8aadbe..f45b5e5 100644 --- a/GUI/Data Forms/BaseDataForm.vb +++ b/GUI/Data Forms/BaseDataForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class BaseDataForm diff --git a/GUI/Data Forms/ItemDataForm.vb b/GUI/Data Forms/ItemDataForm.vb index 603f8d4..9041fa2 100644 --- a/GUI/Data Forms/ItemDataForm.vb +++ b/GUI/Data Forms/ItemDataForm.vb @@ -1,5 +1,7 @@ +Option Strict On +Option Explicit On + Imports System.Data -Imports System.Diagnostics.Metrics Public Class ItemDataForm Inherits BaseDataForm @@ -257,8 +259,6 @@ Public Class ItemDataForm TempChecklistBox.SetItemChecked(ItemFlags.GrenadeLauncher, _view(0)("GrenadeLauncher")) TempChecklistBox.SetItemChecked(ItemFlags.Mortar, _view(0)("Mortar")) TempChecklistBox.SetItemChecked(ItemFlags.Duckbill, _view(0)("Duckbill")) - 'TempChecklistBox.SetItemChecked(ItemFlags.Detonator_UNUSED, _view(0)("Detonator")) - 'TempChecklistBox.SetItemChecked(ItemFlags.RemoteDetonator_UNUSED, _view(0)("RemoteDetonator")) TempChecklistBox.SetItemChecked(ItemFlags.HideMuzzleFlash, _view(0)("HideMuzzleFlash")) TempChecklistBox.SetItemChecked(ItemFlags.RocketLauncher, _view(0)("RocketLauncher")) @@ -308,20 +308,6 @@ Public Class ItemDataForm TempChecklistBox.SetItemChecked(ItemFlags2.ProvidesRobotNightVision, _view(0)("ProvidesRobotNightVision")) TempChecklistBox.SetItemChecked(ItemFlags2.ProvidesRobotLaserBonus, _view(0)("ProvidesRobotLaserBonus")) - - - ''Setting Drugs - 'Dim TempDrugFlags As UInt32 = _view(0)("DrugType") - 'Dim BitDrugFlags As String = ToBinary(TempDrugFlags).PadRight(32, "0") - - ''TODO: Dynamically create the checkboxes from the entries in table "DRUG" - - 'Dim TempDrugChecklistBox As CheckedListBox = ItemTab.TabPages("FlagsTab").Controls.Item("GroupBox65").Controls.Item("DrugsCheckedList") - 'For i As Integer = 0 To 31 - ' TempDrugChecklistBox.SetItemChecked(i, (BitDrugFlags(i).ToString.Equals("1"))) - 'Next - - SetupGrid(AttachmentGrid, Tables.Attachments.Name, Tables.Attachments.Fields.ItemID) SetupGrid(AttachmentInfoGrid, Tables.AttachmentInfo.Name, Tables.AttachmentInfo.Fields.ItemID) SetupGrid(AttachToGrid, Tables.Attachments.Name, Tables.Attachments.Fields.AttachmentID) @@ -919,8 +905,6 @@ Public Class ItemDataForm Dim multiplicator As Integer = Math.Round(maxAPs / 25, 0) Dim val As Integer = Math.Round((2 * multiplicator * 80 * 100) / ((100 + 80) * ubShotsPer4TurnsUpDown.Value), 0) - ' RoWa21: This is the simplified old formular for the 25 AP system - 'Dim val As Integer = Math.Round(89 / ubShotsPer4TurnsUpDown.Value, 0) Me.APsShots4TurnsLabel.Text = "= " & val & " APs" Else Me.APsShots4TurnsLabel.Text = "" @@ -1094,15 +1078,6 @@ Public Class ItemDataForm ''Saving Drugs - 'Dim TempDrugFlags As UInt32 = 0 - 'Dim TempDrugChecklistBox As CheckedListBox = ItemTab.TabPages("FlagsTab").Controls.Item("GroupBox65").Controls.Item("DrugsCheckedList") - 'For i As Integer = 0 To 31 - ' If TempDrugChecklistBox.GetItemChecked(i) Then - ' TempDrugFlags += 2 ^ i - ' End If - 'Next - - '_view(0)("DrugType") = TempDrugFlags _view(0).Row.AcceptChanges() AcceptGridChanges(AttachmentGrid) diff --git a/GUI/Data Forms/MercGearDataForm.vb b/GUI/Data Forms/MercGearDataForm.vb index ce6e849..cc6cc3a 100644 --- a/GUI/Data Forms/MercGearDataForm.vb +++ b/GUI/Data Forms/MercGearDataForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Public Class MercGearDataForm Inherits BaseDataForm diff --git a/GUI/Forms/BitCodeMakerForm.vb b/GUI/Forms/BitCodeMakerForm.vb index d7ed60d..96be715 100644 --- a/GUI/Forms/BitCodeMakerForm.vb +++ b/GUI/Forms/BitCodeMakerForm.vb @@ -1,4 +1,7 @@ -Imports System.Data +Option Strict On +Option Explicit On + +Imports System.Data Public Class BitCodeMakerForm Protected _dm As DataManager diff --git a/GUI/Forms/ChangeClassForm.vb b/GUI/Forms/ChangeClassForm.vb index 3766f7b..f761bfd 100644 --- a/GUI/Forms/ChangeClassForm.vb +++ b/GUI/Forms/ChangeClassForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class ChangeClassForm diff --git a/GUI/Forms/ColumnSelectForm.vb b/GUI/Forms/ColumnSelectForm.vb index 5794cd4..1507ecf 100644 --- a/GUI/Forms/ColumnSelectForm.vb +++ b/GUI/Forms/ColumnSelectForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class ColumnSelectForm diff --git a/GUI/Forms/CustomFilterForm.vb b/GUI/Forms/CustomFilterForm.vb index 6983d06..6d373aa 100644 --- a/GUI/Forms/CustomFilterForm.vb +++ b/GUI/Forms/CustomFilterForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.ComponentModel Public Class CustomFilterForm diff --git a/GUI/Forms/EnterItemIDForm.vb b/GUI/Forms/EnterItemIDForm.vb index 844f624..f8cc55e 100644 --- a/GUI/Forms/EnterItemIDForm.vb +++ b/GUI/Forms/EnterItemIDForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class EnterItemIDForm diff --git a/GUI/Forms/LoadingForm.vb b/GUI/Forms/LoadingForm.vb index 10731d1..8adbae0 100644 --- a/GUI/Forms/LoadingForm.vb +++ b/GUI/Forms/LoadingForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Public Class LoadingForm Private _saving As Boolean diff --git a/GUI/Forms/NewItemForm.vb b/GUI/Forms/NewItemForm.vb index 7c0982a..a6dad21 100644 --- a/GUI/Forms/NewItemForm.vb +++ b/GUI/Forms/NewItemForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class NewItemForm diff --git a/GUI/Forms/SimpleFormBase.vb b/GUI/Forms/SimpleFormBase.vb index dd3953f..33c4175 100644 --- a/GUI/Forms/SimpleFormBase.vb +++ b/GUI/Forms/SimpleFormBase.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Public Class SimpleFormBase Protected _dm As DataManager diff --git a/GUI/GUI.vbproj b/GUI/GUI.vbproj index ea8dc8b..34a72fd 100644 --- a/GUI/GUI.vbproj +++ b/GUI/GUI.vbproj @@ -26,11 +26,9 @@ true true 40 - J:\JA2 1.13 SVN\xml-editor-vb\Backup\GUI\ 2.0 - ..\..\..\..\Game\JA2 1.13 EN %28Actual%29\ XML Editor.xml 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42353,42354,42355 @@ -160,23 +158,6 @@ - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - diff --git a/GUI/Grid Forms/ChildDataGridForm.vb b/GUI/Grid Forms/ChildDataGridForm.vb index 5ab792c..ca64449 100644 --- a/GUI/Grid Forms/ChildDataGridForm.vb +++ b/GUI/Grid Forms/ChildDataGridForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class ChildDataGridForm diff --git a/GUI/Grid Forms/DataGridForm.vb b/GUI/Grid Forms/DataGridForm.vb index db1cf72..e8a012b 100644 --- a/GUI/Grid Forms/DataGridForm.vb +++ b/GUI/Grid Forms/DataGridForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class DataGridForm diff --git a/GUI/Grid Forms/GridForm.vb b/GUI/Grid Forms/GridForm.vb index df9628f..1a1c6f9 100644 --- a/GUI/Grid Forms/GridForm.vb +++ b/GUI/Grid Forms/GridForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Imports GUI.GUI Imports System.ComponentModel diff --git a/GUI/Grid Forms/GridUtility.vb b/GUI/Grid Forms/GridUtility.vb index 7979dce..d47582a 100644 --- a/GUI/Grid Forms/GridUtility.vb +++ b/GUI/Grid Forms/GridUtility.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Module GridUtility diff --git a/GUI/Grid Forms/ItemGridForm.vb b/GUI/Grid Forms/ItemGridForm.vb index cd627b8..e172036 100644 --- a/GUI/Grid Forms/ItemGridForm.vb +++ b/GUI/Grid Forms/ItemGridForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class ItemGridForm diff --git a/GUI/Grid Forms/LookupGridForm.vb b/GUI/Grid Forms/LookupGridForm.vb index 8929d1d..b0961dc 100644 --- a/GUI/Grid Forms/LookupGridForm.vb +++ b/GUI/Grid Forms/LookupGridForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class LookupGridForm diff --git a/GUI/Grid Forms/MercGearGridForm.vb b/GUI/Grid Forms/MercGearGridForm.vb index f776811..ba701be 100644 --- a/GUI/Grid Forms/MercGearGridForm.vb +++ b/GUI/Grid Forms/MercGearGridForm.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Data Public Class MercGearGridForm diff --git a/GUI/IniFile.vb b/GUI/IniFile.vb index 93af43c..64f5c4a 100644 --- a/GUI/IniFile.vb +++ b/GUI/IniFile.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Public Class IniFile Protected Const MaxDataDir As Integer = 9 Protected Shared dataDir(MaxDataDir) As String diff --git a/GUI/Main.vb b/GUI/Main.vb index 84451cc..b04be03 100644 --- a/GUI/Main.vb +++ b/GUI/Main.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports System.Globalization Imports GUI.GUI Imports System.Threading @@ -14,7 +17,10 @@ Module Main Public Splash As SplashForm Public Sub Main() - If CheckForDuplicateProcess(My.Application.Info.AssemblyName) Then End + If CheckForDuplicateProcess(My.Application.Info.AssemblyName) Then + Application.Exit() + Return + End If Try AddHandler ErrorHandler.FatalError, AddressOf ExitDueToError @@ -90,7 +96,8 @@ Module Main End Sub Private Sub ExitDueToError() - End + Application.Exit() + Environment.Exit(1) End Sub diff --git a/GUI/SettingsUtility.vb b/GUI/SettingsUtility.vb index db9cedf..42a621a 100644 --- a/GUI/SettingsUtility.vb +++ b/GUI/SettingsUtility.vb @@ -1,3 +1,6 @@ +Option Strict On +Option Explicit On + Imports GUI.My Imports Microsoft.VisualBasic.CompilerServices Imports System