diff --git a/tools/SOCEdit/Global.bas b/tools/SOCEdit/Global.bas deleted file mode 100644 index 77bf3df2b..000000000 --- a/tools/SOCEdit/Global.bas +++ /dev/null @@ -1,96 +0,0 @@ -Attribute VB_Name = "Module1" -Option Explicit -Public SOCFile As String -Public SOCTemp As String -Public SourcePath As String - -Public Function FirstToken(ByVal line As String) - Dim index As Integer - - index = InStr(line, " ") - 1 - - If index < 1 Then - index = Len(line) - End If - - FirstToken = TrimComplete(Left(line, index)) -End Function - -Public Function SecondToken(ByVal line As String) - Dim startclip As Integer - Dim endclip As Integer - - startclip = InStr(line, " ") - - startclip = startclip + 1 - - SecondToken = TrimComplete(Mid(line, startclip, Len(line))) -End Function - -Public Function SecondTokenEqual(ByVal line As String) - Dim startclip As Integer - Dim endclip As Integer - - startclip = InStr(line, "=") - - startclip = startclip + 2 - - line = Mid(line, startclip, Len(line)) - - SecondTokenEqual = TrimComplete(line) -End Function - -Public Function TrimComplete(ByVal sValue As String) As String - Dim sAns As String - Dim sWkg As String - Dim sChar As String - Dim lLen As Long - Dim lCtr As Long - - sAns = sValue - lLen = Len(sValue) - - If lLen > 0 Then - 'Ltrim - For lCtr = 1 To lLen - sChar = Mid(sAns, lCtr, 1) - If Asc(sChar) > 32 Then Exit For - Next - - sAns = Mid(sAns, lCtr) - lLen = Len(sAns) - - 'Rtrim - If lLen > 0 Then - For lCtr = lLen To 1 Step -1 - sChar = Mid(sAns, lCtr, 1) - If Asc(sChar) > 32 Then Exit For - Next - End If - sAns = Left$(sAns, lCtr) - End If - - TrimComplete = sAns -End Function - -Public Function RTrimComplete(ByVal sValue As String) As String - Dim sAns As String - Dim sWkg As String - Dim sChar As String - Dim lLen As Long - Dim lCtr As Long - - sAns = sValue - lLen = Len(sValue) - - 'Rtrim - If lLen > 0 Then - For lCtr = lLen To 1 Step -1 - sChar = Mid(sAns, lCtr, 1) - If Asc(sChar) > 32 Then Exit For - Next - End If - sAns = Left$(sAns, lCtr) - - RTrimComplete = sAns -End Function diff --git a/tools/SOCEdit/SOCEdit.vbp b/tools/SOCEdit/SOCEdit.vbp deleted file mode 100644 index 90af0095a..000000000 --- a/tools/SOCEdit/SOCEdit.vbp +++ /dev/null @@ -1,53 +0,0 @@ -Type=Exe -Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\WINNT\system32\stdole2.tlb#OLE Automation -Reference=*\G{420B2830-E718-11CF-893D-00A0C9054228}#1.0#0#..\..\..\WINNT\system32\scrrun.dll#Microsoft Scripting Runtime -Form=Things.frm -Module=Module1; Global.bas -Form=frmStateEdit.frm -Form=frmLevelHeader.frm -Form=frmHub.frm -Form=frmMaincfg.frm -Form=frmUnlockablesEdit.frm -Form=frmEmblemEdit.frm -Form=frmSoundEdit.frm -Form=frmCharacterEdit.frm -Form=frmCutsceneEdit.frm -Form=frmHelp.frm -Form=frmHUDEdit.frm -IconForm="frmThingEdit" -Startup="frmHub" -HelpFile="" -Title="SOC Editor" -ExeName32="SOCEdit.exe" -Path32="..\..\..\srb2demo2\SOCEdit" -Command32="" -Name="SOCEditor" -HelpContextID="0" -CompatibleMode="0" -MajorVer=0 -MinorVer=7 -RevisionVer=7 -AutoIncrementVer=0 -ServerSupportFiles=0 -VersionComments="http://www.srb2.org/" -VersionCompanyName="Sonic Team Junior" -VersionFileDescription="For SRB2 v1.09.4" -CompilationType=0 -OptimizationType=0 -FavorPentiumPro(tm)=0 -CodeViewDebugInfo=0 -NoAliasing=0 -BoundsCheck=0 -OverflowCheck=0 -FlPointCheck=0 -FDIVCheck=0 -UnroundedFP=0 -StartMode=0 -Unattended=0 -Retained=0 -ThreadPerObject=0 -MaxNumberOfThreads=1 -DebugStartupOption=0 - -[MS Transaction Server] -AutoRefresh=1 diff --git a/tools/SOCEdit/Things.frm b/tools/SOCEdit/Things.frm deleted file mode 100644 index f95b6afb7..000000000 --- a/tools/SOCEdit/Things.frm +++ /dev/null @@ -1,1895 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmThingEdit - Caption = "Thing Edit" - ClientHeight = 5745 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 11880 - Icon = "Things.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 5745 - ScaleWidth = 11880 - StartUpPosition = 3 'Windows Default - Begin VB.CommandButton cmdCopy - Caption = "&Copy Thing" - Height = 615 - Left = 6600 - TabIndex = 77 - Top = 4920 - Width = 975 - End - Begin VB.CommandButton cmdLoadDefault - Caption = "&Load Code Default" - Height = 615 - Left = 4440 - Style = 1 'Graphical - TabIndex = 76 - Top = 4920 - Width = 975 - End - Begin VB.CommandButton cmdDelete - Caption = "&Delete Thing from SOC" - Height = 615 - Left = 3240 - Style = 1 'Graphical - TabIndex = 74 - Top = 4920 - Width = 1095 - End - Begin VB.CommandButton cmdSave - Caption = "&Save" - Height = 615 - Left = 5520 - TabIndex = 73 - Top = 4920 - Width = 975 - End - Begin VB.Frame frmFlags - Caption = "Flags" - Height = 3735 - Left = 7680 - TabIndex = 45 - Top = 1920 - Width = 4095 - Begin VB.CheckBox chkFlags - Caption = "MF_FIRE" - Height = 255 - Index = 26 - Left = 2040 - TabIndex = 72 - Tag = "4194304" - ToolTipText = "Fire object. Doesn't harm if you have red shield." - Top = 2160 - Width = 1695 - End - Begin VB.CheckBox chkFlags - Caption = "MF_NOCLIPTHING" - Height = 255 - Index = 25 - Left = 2040 - TabIndex = 71 - Tag = "1073741824" - ToolTipText = "Don't be blocked by things (partial clipping)" - Top = 3120 - Width = 1815 - End - Begin VB.CheckBox chkFlags - Caption = "MF_SCENERY" - Height = 255 - Index = 24 - Left = 2040 - TabIndex = 70 - Tag = "33554432" - ToolTipText = "Scenery (uses scenery thinker). Uses less CPU than a standard object, but generally can't move, etc." - Top = 2880 - Width = 1455 - End - Begin VB.CheckBox chkFlags - Caption = "MF_ENEMY" - Height = 255 - Index = 23 - Left = 2040 - TabIndex = 69 - Tag = "16777216" - ToolTipText = "This mobj is an enemy!" - Top = 2640 - Width = 1335 - End - Begin VB.CheckBox chkFlags - Caption = "MF_COUNTITEM" - Height = 255 - Index = 22 - Left = 2040 - TabIndex = 68 - Tag = "8388608" - ToolTipText = "On picking up, count this item object towards intermission item total." - Top = 2400 - Width = 1695 - End - Begin VB.CheckBox chkFlags - Caption = "MF_NOTHINK" - Height = 255 - Index = 21 - Left = 2040 - TabIndex = 67 - Tag = "2097152" - ToolTipText = "Don't run this thing's thinker." - Top = 1920 - Width = 1695 - End - Begin VB.CheckBox chkFlags - Caption = "MF_MONITOR" - Height = 255 - Index = 20 - Left = 2040 - TabIndex = 66 - Tag = "1048576" - ToolTipText = "Item box" - Top = 1680 - Width = 1575 - End - Begin VB.CheckBox chkFlags - Caption = "MF_HIRES" - Height = 255 - Index = 19 - Left = 2040 - TabIndex = 65 - Tag = "524288" - ToolTipText = "Object uses a high-resolution sprite" - Top = 1440 - Width = 1215 - End - Begin VB.CheckBox chkFlags - Caption = "MF_BOUNCE" - Height = 255 - Index = 18 - Left = 2040 - TabIndex = 64 - Tag = "262144" - ToolTipText = "Bounce off walls and things." - Top = 1200 - Width = 1335 - End - Begin VB.CheckBox chkFlags - Caption = "MF_SPRING" - Height = 255 - Index = 17 - Left = 2040 - TabIndex = 63 - Tag = "131072" - ToolTipText = "Item is a spring." - Top = 960 - Width = 1575 - End - Begin VB.CheckBox chkFlags - Caption = "MF_MISSILE" - Height = 255 - Index = 16 - Left = 2040 - TabIndex = 62 - Tag = "65536" - ToolTipText = "Any kind of projectile currently flying through the air, waiting to hit something" - Top = 720 - Width = 1335 - End - Begin VB.CheckBox chkFlags - Caption = "MF_BOXICON" - Height = 255 - Index = 15 - Left = 2040 - TabIndex = 61 - Tag = "32768" - ToolTipText = "Monitor powerup icon. These rise a bit." - Top = 480 - Width = 1815 - End - Begin VB.CheckBox chkFlags - Caption = "MF_FLOAT" - Height = 255 - Index = 14 - Left = 2040 - TabIndex = 60 - Tag = "16384" - ToolTipText = "Allow moves to any height, no gravity. For active floaters." - Top = 240 - Width = 1215 - End - Begin VB.CheckBox chkFlags - Caption = "MF_SPECIALFLAGS" - Height = 255 - Index = 13 - Left = 120 - TabIndex = 59 - Tag = "8192" - ToolTipText = "This object does not adhere to regular flag/z properties for object placing." - Top = 3360 - Width = 1815 - End - Begin VB.CheckBox chkFlags - Caption = "MF_NOCLIP" - Height = 255 - Index = 12 - Left = 120 - TabIndex = 58 - Tag = "4096" - ToolTipText = "Don't clip against objects, walls, etc." - Top = 3120 - Width = 1335 - End - Begin VB.CheckBox chkFlags - Caption = "MF_SLIDEME" - Height = 255 - Index = 11 - Left = 120 - TabIndex = 57 - Tag = "2048" - ToolTipText = "Slide this object when it hits a wall." - Top = 2880 - Width = 1335 - End - Begin VB.CheckBox chkFlags - Caption = "MF_AMBIENT" - Height = 255 - Index = 10 - Left = 120 - TabIndex = 56 - Tag = "1024" - ToolTipText = "This object is an ambient sound." - Top = 2640 - Width = 1695 - End - Begin VB.CheckBox chkFlags - Caption = "MF_NOGRAVITY" - Height = 255 - Index = 9 - Left = 120 - TabIndex = 55 - Tag = "512" - ToolTipText = "Don't apply gravity" - Top = 2400 - Width = 1695 - End - Begin VB.CheckBox chkFlags - Caption = "MF_SPAWNCEILING" - Height = 255 - Index = 8 - Left = 120 - TabIndex = 54 - Tag = "256" - ToolTipText = "On level spawning (initial position), hang from ceiling instead of stand on floor." - Top = 2160 - Width = 1935 - End - Begin VB.CheckBox chkFlags - Caption = "MF_BOSS" - Height = 255 - Index = 7 - Left = 120 - TabIndex = 53 - Tag = "128" - ToolTipText = "Object is a boss." - Top = 1920 - Width = 1575 - End - Begin VB.CheckBox chkFlags - Caption = "MF_PUSHABLE" - Height = 255 - Index = 6 - Left = 120 - TabIndex = 52 - Tag = "64" - ToolTipText = "You can push this object. It can activate switches and things by pushing it on top." - Top = 1680 - Width = 1575 - End - Begin VB.CheckBox chkFlags - Caption = "MF_AMBUSH" - Height = 255 - Index = 5 - Left = 120 - TabIndex = 51 - Tag = "32" - ToolTipText = "Special attributes" - Top = 1440 - Width = 1455 - End - Begin VB.CheckBox chkFlags - Caption = "MF_NOBLOCKMAP" - Height = 255 - Index = 4 - Left = 120 - TabIndex = 50 - Tag = "16" - ToolTipText = "Don't use the blocklinks (inert but displayable)" - Top = 1200 - Width = 1815 - End - Begin VB.CheckBox chkFlags - Caption = "MF_NOSECTOR" - Height = 255 - Index = 3 - Left = 120 - TabIndex = 49 - Tag = "8" - ToolTipText = "Don't use the sector links (invisible but touchable)." - Top = 960 - Width = 1575 - End - Begin VB.CheckBox chkFlags - Caption = "MF_SHOOTABLE" - Height = 255 - Index = 2 - Left = 120 - TabIndex = 48 - Tag = "4" - ToolTipText = "Can be hit." - Top = 720 - Width = 1695 - End - Begin VB.CheckBox chkFlags - Caption = "MF_SOLID" - Height = 255 - Index = 1 - Left = 120 - TabIndex = 47 - Tag = "2" - ToolTipText = "Blocks." - Top = 480 - Width = 1335 - End - Begin VB.CheckBox chkFlags - Caption = "MF_SPECIAL" - Height = 255 - Index = 0 - Left = 120 - TabIndex = 46 - Tag = "1" - ToolTipText = "Call P_TouchSpecialThing when touched." - Top = 240 - Width = 1455 - End - End - Begin VB.ComboBox cmbRaisestate - Height = 315 - Left = 4320 - TabIndex = 43 - Text = "cmbRaisestate" - Top = 4440 - Width = 3300 - End - Begin VB.ComboBox cmbActivesound - Height = 315 - Left = 4320 - TabIndex = 41 - Text = "cmbActivesound" - Top = 4080 - Width = 3300 - End - Begin VB.TextBox txtDamage - Height = 285 - Left = 10680 - TabIndex = 39 - Text = "0" - Top = 1200 - Width = 1095 - End - Begin VB.TextBox txtMass - Height = 285 - Left = 10680 - TabIndex = 37 - Text = "0" - Top = 840 - Width = 1095 - End - Begin VB.TextBox txtHeight - Height = 285 - Left = 10680 - TabIndex = 35 - Text = "0" - Top = 480 - Width = 1095 - End - Begin VB.TextBox txtRadius - Height = 285 - Left = 10680 - TabIndex = 33 - Text = "0" - Top = 120 - Width = 1095 - End - Begin VB.TextBox txtSpeed - Height = 285 - Left = 8760 - TabIndex = 31 - Text = "0" - Top = 1560 - Width = 1095 - End - Begin VB.ComboBox cmbDeathsound - Height = 315 - Left = 4320 - TabIndex = 29 - Text = "cmbDeathsound" - Top = 3720 - Width = 3300 - End - Begin VB.ComboBox cmbXdeathstate - Height = 315 - Left = 4320 - TabIndex = 27 - Text = "cmbXdeathstate" - Top = 3360 - Width = 3300 - End - Begin VB.ComboBox cmbDeathstate - Height = 315 - Left = 4320 - TabIndex = 25 - Text = "cmbDeathstate" - Top = 3000 - Width = 3300 - End - Begin VB.ComboBox cmbMissilestate - Height = 315 - Left = 4320 - TabIndex = 23 - Text = "cmbMissilestate" - Top = 2640 - Width = 3300 - End - Begin VB.ComboBox cmbMeleestate - Height = 315 - Left = 4320 - TabIndex = 21 - Text = "cmbMeleestate" - Top = 2280 - Width = 3300 - End - Begin VB.ComboBox cmbPainsound - Height = 315 - Left = 4320 - TabIndex = 19 - Text = "cmbPainsound" - Top = 1920 - Width = 3300 - End - Begin VB.TextBox txtPainchance - Height = 285 - Left = 8760 - TabIndex = 17 - Text = "0" - Top = 1200 - Width = 1095 - End - Begin VB.ComboBox cmbPainstate - Height = 315 - Left = 4320 - TabIndex = 15 - Text = "cmbPainstate" - Top = 1560 - Width = 3300 - End - Begin VB.ComboBox cmbAttacksound - Height = 315 - Left = 4320 - TabIndex = 13 - Text = "cmbAttacksound" - Top = 1200 - Width = 3300 - End - Begin VB.TextBox txtReactiontime - Height = 285 - Left = 8760 - TabIndex = 11 - Text = "0" - Top = 840 - Width = 1095 - End - Begin VB.ComboBox cmbSeesound - Height = 315 - Left = 4320 - TabIndex = 9 - Text = "cmbSeesound" - Top = 840 - Width = 3300 - End - Begin VB.ComboBox cmbSeestate - Height = 315 - Left = 4320 - TabIndex = 7 - Text = "cmbSeestate" - Top = 480 - Width = 3300 - End - Begin VB.TextBox txtSpawnhealth - Height = 285 - Left = 8760 - TabIndex = 6 - Text = "0" - Top = 480 - Width = 1095 - End - Begin VB.ComboBox cmbSpawnstate - Height = 315 - Left = 4320 - TabIndex = 3 - Text = "cmbSpawnstate" - Top = 120 - Width = 3300 - End - Begin VB.TextBox txtDoomednum - Height = 285 - Left = 8760 - TabIndex = 1 - Text = "0" - Top = 120 - Width = 1095 - End - Begin VB.ListBox lstThings - Height = 5520 - ItemData = "Things.frx":0442 - Left = 120 - List = "Things.frx":0444 - TabIndex = 0 - Top = 120 - Width = 3015 - End - Begin VB.Label lblStatusInfo - Alignment = 2 'Center - Caption = "Idle" - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 375 - Left = 9960 - TabIndex = 75 - Top = 1560 - Width = 1815 - End - Begin VB.Label lblRaisestate - Alignment = 1 'Right Justify - Caption = "Raisestate:" - Height = 255 - Left = 3360 - TabIndex = 44 - Top = 4440 - Width = 855 - End - Begin VB.Label lblActivesound - Alignment = 1 'Right Justify - Caption = "Activesound:" - Height = 255 - Left = 3240 - TabIndex = 42 - Top = 4080 - Width = 975 - End - Begin VB.Label lblDamage - Alignment = 1 'Right Justify - Caption = "Damage:" - Height = 255 - Left = 9840 - TabIndex = 40 - Top = 1200 - Width = 735 - End - Begin VB.Label lblMass - Alignment = 1 'Right Justify - Caption = "Mass:" - Height = 255 - Left = 9960 - TabIndex = 38 - Top = 840 - Width = 615 - End - Begin VB.Label lblHeight - Alignment = 1 'Right Justify - Caption = "Height:" - Height = 255 - Left = 9960 - TabIndex = 36 - Top = 480 - Width = 615 - End - Begin VB.Label lblRadius - Alignment = 1 'Right Justify - Caption = "Radius:" - Height = 255 - Left = 9960 - TabIndex = 34 - Top = 120 - Width = 615 - End - Begin VB.Label lblSpeed - Alignment = 1 'Right Justify - Caption = "Speed:" - Height = 255 - Left = 7680 - TabIndex = 32 - Top = 1560 - Width = 975 - End - Begin VB.Label lblDeathsound - Alignment = 1 'Right Justify - Caption = "Deathsound:" - Height = 255 - Left = 3240 - TabIndex = 30 - Top = 3720 - Width = 975 - End - Begin VB.Label lblXdeathstate - Alignment = 1 'Right Justify - Caption = "Xdeathstate:" - Height = 255 - Left = 3240 - TabIndex = 28 - Top = 3360 - Width = 975 - End - Begin VB.Label lblDeathstate - Alignment = 1 'Right Justify - Caption = "Deathstate:" - Height = 255 - Left = 3240 - TabIndex = 26 - Top = 3000 - Width = 975 - End - Begin VB.Label lblMissilestate - Alignment = 1 'Right Justify - Caption = "Missilestate:" - Height = 255 - Left = 3240 - TabIndex = 24 - Top = 2640 - Width = 975 - End - Begin VB.Label lblMeleestate - Alignment = 1 'Right Justify - Caption = "Meleestate:" - Height = 255 - Left = 3240 - TabIndex = 22 - Top = 2280 - Width = 975 - End - Begin VB.Label lblPainsound - Alignment = 1 'Right Justify - Caption = "Painsound:" - Height = 255 - Left = 3240 - TabIndex = 20 - Top = 1920 - Width = 975 - End - Begin VB.Label lblPainchance - Alignment = 1 'Right Justify - Caption = "Painchance:" - Height = 255 - Left = 7680 - TabIndex = 18 - Top = 1200 - Width = 975 - End - Begin VB.Label lblPainstate - Alignment = 1 'Right Justify - Caption = "Painstate:" - Height = 255 - Left = 3240 - TabIndex = 16 - Top = 1560 - Width = 975 - End - Begin VB.Label lblAttacksound - Alignment = 1 'Right Justify - Caption = "Attacksound:" - Height = 255 - Left = 3240 - TabIndex = 14 - Top = 1200 - Width = 975 - End - Begin VB.Label lblReactiontime - Alignment = 1 'Right Justify - Caption = "Reactiontime:" - Height = 255 - Left = 7680 - TabIndex = 12 - Top = 840 - Width = 975 - End - Begin VB.Label lblSeesound - Alignment = 1 'Right Justify - Caption = "Seesound:" - Height = 255 - Left = 3240 - TabIndex = 10 - Top = 840 - Width = 975 - End - Begin VB.Label lblSeestate - Alignment = 1 'Right Justify - Caption = "Seestate:" - Height = 255 - Left = 3240 - TabIndex = 8 - Top = 480 - Width = 975 - End - Begin VB.Label lblSpawnhealth - Alignment = 1 'Right Justify - Caption = "Spawnhealth:" - Height = 255 - Left = 7680 - TabIndex = 5 - Top = 480 - Width = 975 - End - Begin VB.Label lblSpawnstate - Alignment = 1 'Right Justify - Caption = "Spawnstate:" - Height = 255 - Left = 3240 - TabIndex = 4 - Top = 120 - Width = 975 - End - Begin VB.Label lblDoomednum - Alignment = 1 'Right Justify - Caption = "Thing Map #:" - Height = 255 - Left = 7680 - TabIndex = 2 - Top = 120 - Width = 975 - End -End -Attribute VB_Name = "frmThingEdit" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmdCopy_Click() - Dim Response As String - - Response$ = InputBox("Copy state to #:", "Copy State") - - If Response = "" Then Exit Sub - - Response = TrimComplete(Response) - - Call WriteThing(False, Val(Response)) - - MsgBox "Thing copied to #" & Val(Response) -End Sub - -Private Sub cmdDelete_Click() - Call WriteThing(True, lstThings.ListIndex) -End Sub - -Private Sub cmdLoadDefault_Click() - Call ClearForm - If InStr(lstThings.List(lstThings.ListIndex), "MT_FREESLOT") = 0 Then - LoadObjectInfo (lstThings.ListIndex) - Else - MsgBox "Free slots do not have a code default." - End If -End Sub - -Private Sub cmdSave_Click() - Call WriteThing(False, lstThings.ListIndex) -End Sub - -Private Sub Form_Load() - Call Reload -End Sub - -Private Sub ClearForm() - Dim i As Integer - cmbSpawnstate.Text = "" - cmbSeestate.Text = "" - cmbSeesound.Text = "" - cmbAttacksound.Text = "" - cmbPainstate.Text = "" - cmbPainsound.Text = "" - cmbMeleestate.Text = "" - cmbMissilestate.Text = "" - cmbDeathstate.Text = "" - cmbXdeathstate.Text = "" - cmbDeathsound.Text = "" - cmbActivesound.Text = "" - cmbRaisestate.Text = "" - txtDoomednum.Text = "" - txtSpawnhealth.Text = "" - txtReactiontime.Text = "" - txtPainchance.Text = "" - txtSpeed.Text = "" - txtRadius.Text = "" - txtHeight.Text = "" - txtMass.Text = "" - txtDamage.Text = "" - - For i = 0 To 26 - chkFlags(i).Value = 0 - Next -End Sub - -Private Sub Reload() - lblStatusInfo.Caption = "Loading Sounds Info..." - DoEvents - LoadSounds - lblStatusInfo.Caption = "Loading Things Info..." - DoEvents - LoadThings - lblStatusInfo.Caption = "Loading States Info..." - DoEvents - LoadStates - lblStatusInfo.Caption = "Idle" - lstThings.ListIndex = 0 -End Sub - -Private Sub LoadSounds() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim addstring As String - Dim i As Integer, numfreeslots As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("sounds.h", ForReading, False) - - Do While InStr(ts.ReadLine, "List of sounds (don't modify this comment!)") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - cmbSeesound.Clear - cmbAttacksound.Clear - cmbPainsound.Clear - cmbDeathsound.Clear - cmbActivesound.Clear - - Do While InStr(line, "sfx_freeslot0") = 0 - startclip = InStr(line, "sfx_") - If InStr(line, "sfx_") <> 0 Then - endclip = InStr(line, ",") - line = Mid(line, startclip, endclip - startclip) - addstring = number & " - " & line - cmbSeesound.AddItem addstring - cmbAttacksound.AddItem addstring - cmbPainsound.AddItem addstring - cmbDeathsound.AddItem addstring - cmbActivesound.AddItem addstring - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - Set myFSO = Nothing - - 'Populate the free slots! - numfreeslots = 800 - - For i = 1 To numfreeslots - If i < 10 Then - addstring = number & " - " & "sfx_fre00" & i & " (free slot)" - ElseIf i < 100 Then - addstring = number & " - " & "sfx_fre0" & i & " (free slot)" - Else - addstring = number & " - " & "sfx_fre" & i & " (free slot)" - End If - cmbSeesound.AddItem addstring - cmbAttacksound.AddItem addstring - cmbPainsound.AddItem addstring - cmbDeathsound.AddItem addstring - cmbActivesound.AddItem addstring - number = number + 1 - Next -End Sub -Private Sub LoadStates() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim addstring As String - Dim i As Integer - Dim numfreeslots As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("info.h", ForReading, False) - - Do While InStr(ts.ReadLine, "Object states (don't modify this comment!)") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - cmbSpawnstate.Clear - cmbSeestate.Clear - cmbPainstate.Clear - cmbMeleestate.Clear - cmbMissilestate.Clear - cmbDeathstate.Clear - cmbXdeathstate.Clear - cmbRaisestate.Clear - - Do While InStr(line, "S_FIRSTFREESLOT") = 0 - startclip = InStr(line, "S_") - If InStr(line, "S_") <> 0 Then - endclip = InStr(line, ",") - line = Mid(line, startclip, endclip - startclip) - addstring = number & " - " & line - cmbSpawnstate.AddItem addstring - cmbSeestate.AddItem addstring - cmbPainstate.AddItem addstring - cmbMeleestate.AddItem addstring - cmbMissilestate.AddItem addstring - cmbDeathstate.AddItem addstring - cmbXdeathstate.AddItem addstring - cmbRaisestate.AddItem addstring - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - - 'Populate the free slots! - Set ts = myFSO.OpenTextFile("info.h", ForReading, False) - - line = ts.ReadLine - Do While InStr(line, "#define NUMMOBJFREESLOTS") = 0 - line = ts.ReadLine - Loop - - startclip = InStr(line, "SLOTS ") + 6 - numfreeslots = Val(Mid(line, startclip, Len(line) - startclip + 1)) * 6 - - For i = 1 To numfreeslots - addstring = number & " - " & "S_FREESLOT" & i - cmbSpawnstate.AddItem addstring - cmbSeestate.AddItem addstring - cmbPainstate.AddItem addstring - cmbMeleestate.AddItem addstring - cmbMissilestate.AddItem addstring - cmbDeathstate.AddItem addstring - cmbXdeathstate.AddItem addstring - cmbRaisestate.AddItem addstring - number = number + 1 - Next - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub LoadThings() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim numfreeslots As Integer, i As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("info.h", ForReading, False) - - Do While InStr(ts.ReadLine, "Little flag for SOC editor (don't change this comment!)") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - lstThings.Clear - - Do While InStr(line, "MT_FIRSTFREESLOT") = 0 - startclip = InStr(line, "MT_") - If InStr(line, "MT_") <> 0 Then - endclip = InStr(line, ",") - line = Mid(line, startclip, endclip - startclip) - lstThings.AddItem number & " - " & line - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - - 'Populate the free slots! - Set ts = myFSO.OpenTextFile("info.h", ForReading, False) - - line = ts.ReadLine - Do While InStr(line, "#define NUMMOBJFREESLOTS") = 0 - line = ts.ReadLine - Loop - - startclip = InStr(line, "SLOTS ") + 6 - numfreeslots = Val(Mid(line, startclip, Len(line) - startclip + 1)) - - For i = 1 To numfreeslots - lstThings.AddItem number & " - " & "MT_FREESLOT" & i - number = number + 1 - Next - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub LoadObjectInfo(ThingNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("info.c", ForReading, False) - - Do While InStr(ts.ReadLine, "mobjinfo[NUMMOBJTYPES] =") = 0 - Loop - - number = 0 - - Do While number <> ThingNum - Do While InStr(ts.ReadLine, "}") = 0 - Loop - number = number + 1 - Loop - - Do While InStr(line, "doomednum") = 0 - line = ts.ReadLine - Loop - - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - 'Check for *FRACUNIT values - endclip = InStr(line, "*FRACUNIT") - If endclip <> 0 Then - line = Left(line, endclip - 1) - line = Val(line) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - line = FindThingNum(line) & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - line = FindPowerNum(line) & " - " & line - End If - txtDoomednum.Text = line - - line = ts.ReadLine - Do While InStr(line, "spawnstate") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbSpawnstate, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbSpawnstate.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbSpawnstate.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "spawnhealth") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - 'Check for *FRACUNIT values - endclip = InStr(line, "*FRACUNIT") - If endclip <> 0 Then - line = Left(line, endclip - 1) - line = Val(line) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - line = FindThingNum(line) & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - line = FindPowerNum(line) & " - " & line - End If - txtSpawnhealth.Text = line - - line = ts.ReadLine - Do While InStr(line, "seestate") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbSeestate, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbSeestate.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbSeestate.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "seesound") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbSeesound, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbSeesound.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbSeesound.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "reactiontime") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - 'Check for *FRACUNIT values - endclip = InStr(line, "*FRACUNIT") - If endclip <> 0 Then - line = Left(line, endclip - 1) - line = Val(line) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - line = FindThingNum(line) & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - line = FindPowerNum(line) & " - " & line - End If - txtReactiontime.Text = line - - line = ts.ReadLine - Do While InStr(line, "attacksound") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbAttacksound, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbAttacksound.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbAttacksound.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "painstate") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbPainstate, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbPainstate.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbPainstate.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "painchance") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - 'Check for *FRACUNIT values - endclip = InStr(line, "*FRACUNIT") - If endclip <> 0 Then - line = Left(line, endclip - 1) - line = Val(line) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - line = FindThingNum(line) & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - line = FindPowerNum(line) & " - " & line - End If - txtPainchance.Text = line - - line = ts.ReadLine - Do While InStr(line, "painsound") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbPainsound, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbPainsound.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbPainsound.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "meleestate") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbMeleestate, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbMeleestate.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbMeleestate.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "missilestate") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbMissilestate, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbMissilestate.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbMissilestate.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "deathstate") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbDeathstate, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbDeathstate.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbDeathstate.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "xdeathstate") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbXdeathstate, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbXdeathstate.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbXdeathstate.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "deathsound") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbDeathsound, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbDeathsound.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbDeathsound.Text = number & " - " & line - End If - - - line = ts.ReadLine - Do While InStr(line, "speed") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - 'Check for *FRACUNIT values - endclip = InStr(line, "*FRACUNIT") - If endclip <> 0 Then - line = Left(line, endclip - 1) - line = Val(line) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - line = FindThingNum(line) & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - line = FindPowerNum(line) & " - " & line - End If - txtSpeed.Text = line - - line = ts.ReadLine - Do While InStr(line, "radius") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - 'Check for *FRACUNIT values - endclip = InStr(line, "*FRACUNIT") - If endclip <> 0 Then - line = Left(line, endclip - 1) - line = Val(line) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - line = FindThingNum(line) & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - line = FindPowerNum(line) & " - " & line - End If - txtRadius.Text = line - - line = ts.ReadLine - Do While InStr(line, "height") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - 'Check for *FRACUNIT values - endclip = InStr(line, "*FRACUNIT") - If endclip <> 0 Then - line = Left(line, endclip - 1) - line = Val(line) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - line = FindThingNum(line) & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - line = FindPowerNum(line) & " - " & line - End If - txtHeight.Text = line - - line = ts.ReadLine 'Display order offset (add support, please!) - - line = ts.ReadLine - Do While InStr(line, "mass") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - 'Check for *FRACUNIT values - endclip = InStr(line, "*FRACUNIT") - If endclip <> 0 Then - line = Left(line, endclip - 1) - line = Val(line) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - line = FindThingNum(line) & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - line = FindPowerNum(line) & " - " & line - End If - txtMass.Text = line - - line = ts.ReadLine - Do While InStr(line, "damage") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - 'Check for *FRACUNIT values - endclip = InStr(line, "*FRACUNIT") - If endclip <> 0 Then - line = Left(line, endclip - 1) - line = Val(line) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - line = FindThingNum(line) & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - line = FindPowerNum(line) & " - " & line - End If - txtDamage.Text = line - - line = ts.ReadLine - Do While InStr(line, "activesound") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbActivesound, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbActivesound.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbActivesound.Text = number & " - " & line - End If - - line = ts.ReadLine - Do While InStr(line, "flags") = 0 - Loop - endclip = InStr(line, ",") - line = Left(line, endclip - 1) - line = TrimComplete(line) - ProcessFlags (line) - - line = ts.ReadLine - Do While InStr(line, "raisestate") = 0 - Loop - endclip = InStr(line, "//") - line = Left(line, endclip - 1) - line = TrimComplete(line) - Call FindComboIndex(cmbRaisestate, line) - 'Check for crazy-odd MT_ usage - endclip = InStr(line, "MT_") - If endclip <> 0 Then - number = FindThingNum(line) - cmbRaisestate.Text = number & " - " & line - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(line, "pw_") - If endclip <> 0 Then - number = FindPowerNum(line) - cmbRaisestate.Text = number & " - " & line - End If - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub ProcessFlags(flags As String) - Dim FlagList(32) As String - Dim endpoint As Integer - Dim ListCount As Integer - Dim FlagString As String - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim j As Integer, i As Integer - Dim number As Long - Dim startclip As Integer, endclip As Integer - - For j = 0 To 26 - chkFlags(j).Value = 0 - Next j - - FlagString = flags - - flags = flags & "||" - - ListCount = 0 - - Do While Len(flags) > 3 - endpoint = InStr(flags, "|") - FlagString = Left(flags, endpoint - 1) - flags = Right(flags, Len(flags) - endpoint) - FlagList(ListCount) = FlagString - ListCount = ListCount + 1 - Loop - - ChDir SourcePath - - For i = 0 To ListCount - 1 - Set ts = myFSO.OpenTextFile("p_mobj.h", ForReading, False) - - line = ts.ReadLine - - Do While Not ts.AtEndOfStream - line = ts.ReadLine - If InStr(line, FlagList(i)) Then - If InStr(line, "//") = 0 Or (InStr(line, "//") > InStr(line, FlagList(i))) Then - Exit Do - End If - End If - Loop - - If InStr(line, FlagList(i)) Then - startclip = InStr(line, "0x") - endclip = InStr(line, ",") - line = Mid(line, startclip + 2, endclip - 1) - line = "&H" & line - TrimComplete (line) - line = Left(line, Len(line) - 1) - number = CLng(line) - - For j = 0 To 26 - If chkFlags(j).Tag = number Then - chkFlags(j).Value = 1 - End If - Next j - End If - ts.Close - Next i - - Set myFSO = Nothing -End Sub - -Private Sub FindComboIndex(ByRef Box As ComboBox, line As String) - Dim i As Integer - - For i = 0 To Box.ListCount - If InStr(Box.List(i), line) Then - Box.ListIndex = i - Exit For - End If - Next -End Sub - -Private Sub lstThings_Click() - lblStatusInfo.Caption = "Loading thing info..." - DoEvents - Call ClearForm - If InStr(lstThings.List(lstThings.ListIndex), "MT_FREESLOT") = 0 Then - LoadObjectInfo (lstThings.ListIndex) - End If - LoadSOCObjectInfo (lstThings.ListIndex) - lblStatusInfo.Caption = "Idle" -End Sub - -Private Sub LoadSOCObjectInfo(ThingNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim j As Integer - Dim temp As Long - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "THING" And Val(word2) = ThingNum Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondTokenEqual(line)) - - If word = "MAPTHINGNUM" Then - txtDoomednum.Text = Val(word2) - ElseIf word = "SPAWNSTATE" Then - cmbSpawnstate.ListIndex = Val(word2) - ElseIf word = "SPAWNHEALTH" Then - txtSpawnhealth.Text = Val(word2) - ElseIf word = "SEESTATE" Then - cmbSeestate.ListIndex = Val(word2) - ElseIf word = "SEESOUND" Then - cmbSeesound.ListIndex = Val(word2) - ElseIf word = "REACTIONTIME" Then - txtReactiontime.Text = Val(word2) - ElseIf word = "ATTACKSOUND" Then - cmbAttacksound.ListIndex = Val(word2) - ElseIf word = "PAINSTATE" Then - cmbPainstate.ListIndex = Val(word2) - ElseIf word = "PAINCHANCE" Then - txtPainchance.Text = Val(word2) - ElseIf word = "PAINSOUND" Then - cmbPainsound.ListIndex = Val(word2) - ElseIf word = "MELEESTATE" Then - cmbMeleestate.ListIndex = Val(word2) - ElseIf word = "MISSILESTATE" Then - cmbMissilestate.ListIndex = Val(word2) - ElseIf word = "DEATHSTATE" Then - cmbDeathstate.ListIndex = Val(word2) - ElseIf word = "DEATHSOUND" Then - cmbDeathsound.ListIndex = Val(word2) - ElseIf word = "XDEATHSTATE" Then - cmbXdeathstate.ListIndex = Val(word2) - ElseIf word = "SPEED" Then - txtSpeed.Text = Val(word2) - ElseIf word = "RADIUS" Then - txtRadius.Text = Val(word2) - ElseIf word = "HEIGHT" Then - txtHeight.Text = Val(word2) - ElseIf word = "MASS" Then - txtMass.Text = Val(word2) - ElseIf word = "DAMAGE" Then - txtDamage.Text = Val(word2) - ElseIf word = "ACTIVESOUND" Then - cmbActivesound.ListIndex = Val(word2) - ElseIf word = "FLAGS" Then - For j = 0 To 26 - temp = Val(word2) - If temp And chkFlags(j).Tag Then - chkFlags(j).Value = 1 - Else - chkFlags(j).Value = 0 - End If - Next j - ElseIf word = "RAISESTATE" Then - cmbRaisestate.ListIndex = Val(word2) - ElseIf Len(line) > 0 And Left(line, 1) <> "#" Then - MsgBox "Error in SOC!" & vbCrLf & "Unknown line: " & line - End If - Loop - Exit Do - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Function FindThingNum(ThingName As String) As Integer - Dim i As Integer - Dim temp As String - Dim startpoint As Integer - Dim endpoint As Integer - - For i = 0 To lstThings.ListCount - 1 - temp = lstThings.List(i) - startpoint = InStr(temp, "-") + 2 - endpoint = Len(temp) - startpoint + 1 - temp = Mid(temp, startpoint, endpoint) - If temp = ThingName Then - FindThingNum = Val(lstThings.List(i)) - Exit For - End If - Next -End Function - -Private Function FindPowerNum(PowerName As String) As Integer - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("d_player.h", ForReading, False) - - Do While InStr(ts.ReadLine, "Player powers. (don't edit this comment)") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - Do While InStr(line, "NUMPOWERS") = 0 - startclip = InStr(line, PowerName) - If startclip <> 0 Then - FindPowerNum = number - Exit Do - End If - number = number + 1 - line = ts.ReadLine - Loop - - ts.Close - Set myFSO = Nothing -End Function - -Private Sub WriteThing(Remove As Boolean, num As Integer) - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim flags As Long - Dim thingfound As Boolean - Dim i As Integer - - thingfound = False - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - 'If the current thing exists in the SOC, delete it. - If word = "THING" And Val(word2) = num Then - thingfound = True - Do While Len(TrimComplete(tsSource.ReadLine)) > 0 And Not (tsSource.AtEndOfStream) - Loop - Else - tsTarget.WriteLine line - End If - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If Remove = False Then - If line <> "" Then tsTarget.WriteLine "" - tsTarget.WriteLine "Thing " & num - txtDoomednum.Text = TrimComplete(txtDoomednum.Text) - cmbSpawnstate.Text = TrimComplete(cmbSpawnstate.Text) - txtSpawnhealth.Text = TrimComplete(txtSpawnhealth.Text) - cmbSeestate.Text = TrimComplete(cmbSeestate.Text) - cmbSeesound.Text = TrimComplete(cmbSeesound.Text) - txtReactiontime.Text = TrimComplete(txtReactiontime.Text) - cmbAttacksound.Text = TrimComplete(cmbAttacksound.Text) - cmbPainstate.Text = TrimComplete(cmbPainstate.Text) - txtPainchance.Text = TrimComplete(txtPainchance.Text) - cmbPainsound.Text = TrimComplete(cmbPainsound.Text) - cmbMeleestate.Text = TrimComplete(cmbMeleestate.Text) - cmbMissilestate.Text = TrimComplete(cmbMissilestate.Text) - cmbDeathstate.Text = TrimComplete(cmbDeathstate.Text) - cmbDeathsound.Text = TrimComplete(cmbDeathsound.Text) - cmbXdeathstate.Text = TrimComplete(cmbXdeathstate.Text) - txtSpeed.Text = TrimComplete(txtSpeed.Text) - txtRadius.Text = TrimComplete(txtRadius.Text) - txtHeight.Text = TrimComplete(txtHeight.Text) - txtMass.Text = TrimComplete(txtMass.Text) - txtDamage.Text = TrimComplete(txtDamage.Text) - cmbActivesound.Text = TrimComplete(cmbActivesound.Text) - cmbRaisestate.Text = TrimComplete(cmbRaisestate.Text) - flags = 0 - ' Only 31 bits can be used, because VB is stupid. - For i = 0 To 26 - If chkFlags(i).Value = 1 Then flags = flags + Val(chkFlags(i).Tag) - Next - If txtDoomednum.Text <> "" Then tsTarget.WriteLine "MAPTHINGNUM = " & Val(txtDoomednum.Text) - If cmbSpawnstate.Text <> "" Then tsTarget.WriteLine "SPAWNSTATE = " & Val(cmbSpawnstate.Text) - If txtSpawnhealth.Text <> "" Then tsTarget.WriteLine "SPAWNHEALTH = " & Val(txtSpawnhealth.Text) - If cmbSeestate.Text <> "" Then tsTarget.WriteLine "SEESTATE = " & Val(cmbSeestate.Text) - If cmbSeesound.Text <> "" Then tsTarget.WriteLine "SEESOUND = " & Val(cmbSeesound.Text) - If txtReactiontime.Text <> "" Then tsTarget.WriteLine "REACTIONTIME = " & Val(txtReactiontime.Text) - If cmbAttacksound.Text <> "" Then tsTarget.WriteLine "ATTACKSOUND = " & Val(cmbAttacksound.Text) - If cmbPainstate.Text <> "" Then tsTarget.WriteLine "PAINSTATE = " & Val(cmbPainstate.Text) - If txtPainchance.Text <> "" Then tsTarget.WriteLine "PAINCHANCE = " & Val(txtPainchance.Text) - If cmbPainsound.Text <> "" Then tsTarget.WriteLine "PAINSOUND = " & Val(cmbPainsound.Text) - If cmbMeleestate.Text <> "" Then tsTarget.WriteLine "MELEESTATE = " & Val(cmbMeleestate.Text) - If cmbMissilestate.Text <> "" Then tsTarget.WriteLine "MISSILESTATE = " & Val(cmbMissilestate.Text) - If cmbDeathstate.Text <> "" Then tsTarget.WriteLine "DEATHSTATE = " & Val(cmbDeathstate.Text) - If cmbDeathsound.Text <> "" Then tsTarget.WriteLine "DEATHSOUND = " & Val(cmbDeathsound.Text) - If cmbXdeathstate.Text <> "" Then tsTarget.WriteLine "XDEATHSTATE = " & Val(cmbXdeathstate.Text) - If txtSpeed.Text <> "" Then tsTarget.WriteLine "SPEED = " & Val(txtSpeed.Text) - If txtRadius.Text <> "" Then tsTarget.WriteLine "RADIUS = " & Val(txtRadius.Text) - If txtHeight.Text <> "" Then tsTarget.WriteLine "HEIGHT = " & Val(txtHeight.Text) - If txtMass.Text <> "" Then tsTarget.WriteLine "MASS = " & Val(txtMass.Text) - If txtDamage.Text <> "" Then tsTarget.WriteLine "DAMAGE = " & Val(txtDamage.Text) - If cmbActivesound.Text <> "" Then tsTarget.WriteLine "ACTIVESOUND = " & Val(cmbActivesound.Text) - If cmbRaisestate.Text <> "" Then tsTarget.WriteLine "RAISESTATE = " & Val(cmbRaisestate.Text) - tsTarget.WriteLine "FLAGS = " & flags - End If - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - If Remove = True Then - If thingfound = True Then - MsgBox "Thing removed from SOC." - Else - MsgBox "Thing not found in SOC." - End If - Else - MsgBox "Thing Saved." - End If -End Sub diff --git a/tools/SOCEdit/Things.frx b/tools/SOCEdit/Things.frx deleted file mode 100644 index 980538679..000000000 Binary files a/tools/SOCEdit/Things.frx and /dev/null differ diff --git a/tools/SOCEdit/frmCharacterEdit.frm b/tools/SOCEdit/frmCharacterEdit.frm deleted file mode 100644 index 415fcbb0f..000000000 --- a/tools/SOCEdit/frmCharacterEdit.frm +++ /dev/null @@ -1,320 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmCharacterEdit - Caption = "Character Edit" - ClientHeight = 3345 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 4680 - Icon = "frmCharacterEdit.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 3345 - ScaleWidth = 4680 - Begin VB.CommandButton cmdExample - Caption = "Show Me An &Example" - Height = 495 - Left = 1320 - Style = 1 'Graphical - TabIndex = 14 - Top = 2400 - Width = 975 - End - Begin VB.CheckBox chkEnabled - Caption = "Enable this player selection." - Height = 495 - Left = 1080 - TabIndex = 13 - Top = 1560 - Width = 1455 - End - Begin VB.CommandButton cmdDelete - Caption = "&Delete from SOC" - Height = 495 - Left = 120 - Style = 1 'Graphical - TabIndex = 12 - Top = 2760 - Width = 855 - End - Begin VB.CommandButton cmdSave - Caption = "&Save" - Height = 495 - Left = 120 - TabIndex = 11 - Top = 2160 - Width = 855 - End - Begin VB.TextBox txtSkinname - Height = 285 - Left = 3240 - TabIndex = 9 - Top = 1200 - Width = 1335 - End - Begin VB.TextBox txtPicname - Height = 285 - Left = 3240 - MaxLength = 8 - TabIndex = 7 - Top = 840 - Width = 1095 - End - Begin VB.TextBox txtMenuposition - Height = 285 - Left = 3240 - MaxLength = 3 - TabIndex = 5 - Top = 480 - Width = 495 - End - Begin VB.TextBox txtPlayername - Height = 285 - Left = 3240 - MaxLength = 64 - TabIndex = 3 - Top = 120 - Width = 1335 - End - Begin VB.TextBox txtPlayertext - Height = 1455 - Left = 2640 - MultiLine = -1 'True - TabIndex = 1 - Top = 1800 - Width = 1935 - End - Begin VB.ListBox lstPlayers - Height = 1815 - ItemData = "frmCharacterEdit.frx":0442 - Left = 120 - List = "frmCharacterEdit.frx":0461 - TabIndex = 0 - Top = 240 - Width = 855 - End - Begin VB.Label lblSkinname - Caption = "Name of player (skin) to use:" - Height = 255 - Left = 1080 - TabIndex = 10 - Top = 1200 - Width = 2055 - End - Begin VB.Label lblPicname - Alignment = 1 'Right Justify - Caption = "Picture to display:" - Height = 255 - Left = 1560 - TabIndex = 8 - Top = 840 - Width = 1575 - End - Begin VB.Label lblMenuposition - Alignment = 1 'Right Justify - Caption = "Vertical menu position:" - Height = 255 - Left = 1320 - TabIndex = 6 - Top = 480 - Width = 1815 - End - Begin VB.Label lblPlayername - Alignment = 1 'Right Justify - Caption = "Displayed name of player:" - Height = 255 - Left = 1320 - TabIndex = 4 - Top = 120 - Width = 1815 - End - Begin VB.Label lblPlayertext - Caption = "Short Description:" - Height = 255 - Left = 2640 - TabIndex = 2 - Top = 1560 - Width = 1455 - End -End -Attribute VB_Name = "frmCharacterEdit" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmdDelete_Click() - Call WriteCharacter(True) -End Sub - -Private Sub cmdExample_Click() - txtPlayername.Text = "SONIC" - txtMenuposition.Text = "20" - txtPicname.Text = "SONCCHAR" - txtSkinname.Text = "SONIC" - chkEnabled.Value = 1 - txtPlayertext.Text = " Fastest" & vbCrLf & " Speed Thok" & vbCrLf & " Not a good pick" & vbCrLf & "for starters, but when" & vbCrLf & "controlled properly," & vbCrLf & "Sonic is the most" & vbCrLf & "powerful of the three." -End Sub - -Private Sub cmdSave_Click() - Call WriteCharacter(False) -End Sub - -Private Sub ClearForm() - txtPlayername.Text = "" - txtMenuposition.Text = "" - txtPicname.Text = "" - txtSkinname.Text = "" - chkEnabled.Value = 0 - txtPlayertext.Text = "" -End Sub - -Private Sub ReadSOCPlayer(num As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "CHARACTER" And Val(word2) = num Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondTokenEqual(line)) - - If word = "PLAYERTEXT" Then - Dim startclip As Integer, endclip As Integer - startclip = InStr(line, "=") - - startclip = startclip + 2 - - line = Mid(line, startclip, Len(line)) - - txtPlayertext.Text = line & vbCrLf - - Do While InStr(line, "#") = 0 And Not ts.AtEndOfStream - line = ts.ReadLine & vbCrLf - txtPlayertext.Text = txtPlayertext.Text & line - Loop - - txtPlayertext.Text = RTrimComplete(txtPlayertext.Text) - If Right(txtPlayertext.Text, 1) = "#" Then - txtPlayertext.Text = Left(txtPlayertext.Text, Len(txtPlayertext.Text) - 1) - End If - ElseIf word = "PLAYERNAME" Then - txtPlayername.Text = word2 - ElseIf word = "MENUPOSITION" Then - txtMenuposition.Text = Val(word2) - ElseIf word = "PICNAME" Then - txtPicname.Text = word2 - ElseIf word = "STATUS" Then - If Val(word2) = 32 Then - chkEnabled.Value = 1 - Else - chkEnabled.Value = 0 - End If - ElseIf word = "SKINNAME" Then - txtSkinname.Text = word2 - ElseIf Len(line) > 0 And Left(line, 1) <> "#" Then - MsgBox "Error in SOC!" & vbCrLf & "Unknown line: " & line - End If - Loop - Exit Do - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub lstPlayers_Click() - Call ClearForm - Call ReadSOCPlayer(lstPlayers.ListIndex) -End Sub - -Private Sub WriteCharacter(Remove As Boolean) - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim charfound As Boolean - - charfound = False - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - 'If the current character exists in the SOC, delete it. - If word = "CHARACTER" And Val(word2) = lstPlayers.ListIndex Then - charfound = True - Do While Len(TrimComplete(tsSource.ReadLine)) > 0 And Not (tsSource.AtEndOfStream) - Loop - Else - tsTarget.WriteLine line - End If - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If Remove = False Then - If line <> "" Then tsTarget.WriteLine "" - - tsTarget.WriteLine "CHARACTER " & lstPlayers.ListIndex - txtPlayername.Text = TrimComplete(txtPlayername.Text) - txtMenuposition.Text = TrimComplete(txtMenuposition.Text) - txtPicname.Text = TrimComplete(txtPicname.Text) - txtSkinname.Text = TrimComplete(txtSkinname.Text) - If txtPlayername.Text <> "" Then tsTarget.WriteLine "PLAYERNAME = " & txtPlayername.Text - If txtMenuposition.Text <> "" Then tsTarget.WriteLine "MENUPOSITION = " & Val(txtMenuposition.Text) - If txtPicname.Text <> "" Then tsTarget.WriteLine "PICNAME = " & txtPicname.Text - If txtSkinname.Text <> "" Then tsTarget.WriteLine "SKINNAME = " & txtSkinname.Text - If chkEnabled.Value = 1 Then - tsTarget.WriteLine "STATUS = 32" - Else - tsTarget.WriteLine "STATUS = 0" - End If - If txtPlayertext.Text <> "" Then tsTarget.WriteLine "PLAYERTEXT = " & txtPlayertext.Text & "#" - End If - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - If Remove = True Then - If charfound = True Then - MsgBox "Player choice removed from SOC." - Else - MsgBox "Player choice not found in SOC." - End If - Else - MsgBox "Character Saved." - End If -End Sub - diff --git a/tools/SOCEdit/frmCharacterEdit.frx b/tools/SOCEdit/frmCharacterEdit.frx deleted file mode 100644 index 5e767f4ab..000000000 Binary files a/tools/SOCEdit/frmCharacterEdit.frx and /dev/null differ diff --git a/tools/SOCEdit/frmCutsceneEdit.frm b/tools/SOCEdit/frmCutsceneEdit.frm deleted file mode 100644 index 7fb18feed..000000000 --- a/tools/SOCEdit/frmCutsceneEdit.frm +++ /dev/null @@ -1,1365 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmCutsceneEdit - Caption = "Cutscene Edit" - ClientHeight = 6495 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 10410 - Icon = "frmCutsceneEdit.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 6495 - ScaleWidth = 10410 - StartUpPosition = 3 'Windows Default - Begin VB.TextBox txtNumScenes - Height = 285 - Left = 3480 - MaxLength = 3 - TabIndex = 97 - Top = 240 - Width = 615 - End - Begin VB.ListBox lstScene - Height = 450 - ItemData = "frmCutsceneEdit.frx":0442 - Left = 3360 - List = "frmCutsceneEdit.frx":0444 - TabIndex = 94 - Top = 600 - Width = 735 - End - Begin VB.ComboBox cmbMusicslot - Height = 315 - Left = 8760 - TabIndex = 93 - Top = 1680 - Width = 1575 - End - Begin VB.Frame frmPic1 - Caption = "Picture 8:" - Height = 1335 - Index = 7 - Left = 7440 - TabIndex = 80 - Top = 5040 - Width = 2895 - Begin VB.TextBox txtPicycoord - Height = 285 - Index = 7 - Left = 600 - MaxLength = 3 - TabIndex = 85 - Top = 960 - Width = 495 - End - Begin VB.TextBox txtPicXcoord - Height = 285 - Index = 7 - Left = 600 - MaxLength = 3 - TabIndex = 84 - Top = 600 - Width = 495 - End - Begin VB.TextBox txtPicduration - Height = 285 - Index = 7 - Left = 2040 - MaxLength = 5 - TabIndex = 83 - Top = 600 - Width = 735 - End - Begin VB.TextBox txtPicname - Height = 285 - Index = 7 - Left = 1320 - TabIndex = 82 - Top = 240 - Width = 1455 - End - Begin VB.CheckBox chkPichires - Caption = "High-Resolution" - Height = 255 - Index = 7 - Left = 1320 - TabIndex = 81 - Top = 960 - Width = 1455 - End - Begin VB.Label lblPicycoord - Alignment = 1 'Right Justify - Caption = "Y:" - Height = 255 - Index = 7 - Left = 240 - TabIndex = 89 - Top = 960 - Width = 255 - End - Begin VB.Label lblPicxcoord - Alignment = 1 'Right Justify - Caption = "X:" - Height = 255 - Index = 7 - Left = 240 - TabIndex = 88 - Top = 600 - Width = 255 - End - Begin VB.Label lblPicduration - Alignment = 1 'Right Justify - Caption = "Duration:" - Height = 255 - Index = 7 - Left = 1200 - TabIndex = 87 - Top = 600 - Width = 735 - End - Begin VB.Label lblPicname - Alignment = 1 'Right Justify - Caption = "Picture Name:" - Height = 255 - Index = 7 - Left = 120 - TabIndex = 86 - Top = 240 - Width = 1095 - End - End - Begin VB.Frame frmPic1 - Caption = "Picture 7:" - Height = 1335 - Index = 6 - Left = 4440 - TabIndex = 70 - Top = 5040 - Width = 2895 - Begin VB.TextBox txtPicycoord - Height = 285 - Index = 6 - Left = 600 - MaxLength = 3 - TabIndex = 75 - Top = 960 - Width = 495 - End - Begin VB.TextBox txtPicXcoord - Height = 285 - Index = 6 - Left = 600 - MaxLength = 3 - TabIndex = 74 - Top = 600 - Width = 495 - End - Begin VB.TextBox txtPicduration - Height = 285 - Index = 6 - Left = 2040 - MaxLength = 5 - TabIndex = 73 - Top = 600 - Width = 735 - End - Begin VB.TextBox txtPicname - Height = 285 - Index = 6 - Left = 1320 - TabIndex = 72 - Top = 240 - Width = 1455 - End - Begin VB.CheckBox chkPichires - Caption = "High-Resolution" - Height = 255 - Index = 6 - Left = 1320 - TabIndex = 71 - Top = 960 - Width = 1455 - End - Begin VB.Label lblPicycoord - Alignment = 1 'Right Justify - Caption = "Y:" - Height = 255 - Index = 6 - Left = 240 - TabIndex = 79 - Top = 960 - Width = 255 - End - Begin VB.Label lblPicxcoord - Alignment = 1 'Right Justify - Caption = "X:" - Height = 255 - Index = 6 - Left = 240 - TabIndex = 78 - Top = 600 - Width = 255 - End - Begin VB.Label lblPicduration - Alignment = 1 'Right Justify - Caption = "Duration:" - Height = 255 - Index = 6 - Left = 1200 - TabIndex = 77 - Top = 600 - Width = 735 - End - Begin VB.Label lblPicname - Alignment = 1 'Right Justify - Caption = "Picture Name:" - Height = 255 - Index = 6 - Left = 120 - TabIndex = 76 - Top = 240 - Width = 1095 - End - End - Begin VB.Frame frmPic1 - Caption = "Picture 6:" - Height = 1335 - Index = 5 - Left = 7440 - TabIndex = 60 - Top = 3600 - Width = 2895 - Begin VB.TextBox txtPicycoord - Height = 285 - Index = 5 - Left = 600 - MaxLength = 3 - TabIndex = 65 - Top = 960 - Width = 495 - End - Begin VB.TextBox txtPicXcoord - Height = 285 - Index = 5 - Left = 600 - MaxLength = 3 - TabIndex = 64 - Top = 600 - Width = 495 - End - Begin VB.TextBox txtPicduration - Height = 285 - Index = 5 - Left = 2040 - MaxLength = 5 - TabIndex = 63 - Top = 600 - Width = 735 - End - Begin VB.TextBox txtPicname - Height = 285 - Index = 5 - Left = 1320 - TabIndex = 62 - Top = 240 - Width = 1455 - End - Begin VB.CheckBox chkPichires - Caption = "High-Resolution" - Height = 255 - Index = 5 - Left = 1320 - TabIndex = 61 - Top = 960 - Width = 1455 - End - Begin VB.Label lblPicycoord - Alignment = 1 'Right Justify - Caption = "Y:" - Height = 255 - Index = 5 - Left = 240 - TabIndex = 69 - Top = 960 - Width = 255 - End - Begin VB.Label lblPicxcoord - Alignment = 1 'Right Justify - Caption = "X:" - Height = 255 - Index = 5 - Left = 240 - TabIndex = 68 - Top = 600 - Width = 255 - End - Begin VB.Label lblPicduration - Alignment = 1 'Right Justify - Caption = "Duration:" - Height = 255 - Index = 5 - Left = 1200 - TabIndex = 67 - Top = 600 - Width = 735 - End - Begin VB.Label lblPicname - Alignment = 1 'Right Justify - Caption = "Picture Name:" - Height = 255 - Index = 5 - Left = 120 - TabIndex = 66 - Top = 240 - Width = 1095 - End - End - Begin VB.Frame frmPic1 - Caption = "Picture 5:" - Height = 1335 - Index = 4 - Left = 4440 - TabIndex = 50 - Top = 3600 - Width = 2895 - Begin VB.TextBox txtPicycoord - Height = 285 - Index = 4 - Left = 600 - MaxLength = 3 - TabIndex = 55 - Top = 960 - Width = 495 - End - Begin VB.TextBox txtPicXcoord - Height = 285 - Index = 4 - Left = 600 - MaxLength = 3 - TabIndex = 54 - Top = 600 - Width = 495 - End - Begin VB.TextBox txtPicduration - Height = 285 - Index = 4 - Left = 2040 - MaxLength = 5 - TabIndex = 53 - Top = 600 - Width = 735 - End - Begin VB.TextBox txtPicname - Height = 285 - Index = 4 - Left = 1320 - TabIndex = 52 - Top = 240 - Width = 1455 - End - Begin VB.CheckBox chkPichires - Caption = "High-Resolution" - Height = 255 - Index = 4 - Left = 1320 - TabIndex = 51 - Top = 960 - Width = 1455 - End - Begin VB.Label lblPicycoord - Alignment = 1 'Right Justify - Caption = "Y:" - Height = 255 - Index = 4 - Left = 240 - TabIndex = 59 - Top = 960 - Width = 255 - End - Begin VB.Label lblPicxcoord - Alignment = 1 'Right Justify - Caption = "X:" - Height = 255 - Index = 4 - Left = 240 - TabIndex = 58 - Top = 600 - Width = 255 - End - Begin VB.Label lblPicduration - Alignment = 1 'Right Justify - Caption = "Duration:" - Height = 255 - Index = 4 - Left = 1200 - TabIndex = 57 - Top = 600 - Width = 735 - End - Begin VB.Label lblPicname - Alignment = 1 'Right Justify - Caption = "Picture Name:" - Height = 255 - Index = 4 - Left = 120 - TabIndex = 56 - Top = 240 - Width = 1095 - End - End - Begin VB.Frame frmPic1 - Caption = "Picture 4:" - Height = 1335 - Index = 3 - Left = 1440 - TabIndex = 40 - Top = 3600 - Width = 2895 - Begin VB.CheckBox chkPichires - Caption = "High-Resolution" - Height = 255 - Index = 3 - Left = 1320 - TabIndex = 45 - Top = 960 - Width = 1455 - End - Begin VB.TextBox txtPicname - Height = 285 - Index = 3 - Left = 1320 - TabIndex = 44 - Top = 240 - Width = 1455 - End - Begin VB.TextBox txtPicduration - Height = 285 - Index = 3 - Left = 2040 - MaxLength = 5 - TabIndex = 43 - Top = 600 - Width = 735 - End - Begin VB.TextBox txtPicXcoord - Height = 285 - Index = 3 - Left = 600 - MaxLength = 3 - TabIndex = 42 - Top = 600 - Width = 495 - End - Begin VB.TextBox txtPicycoord - Height = 285 - Index = 3 - Left = 600 - MaxLength = 3 - TabIndex = 41 - Top = 960 - Width = 495 - End - Begin VB.Label lblPicname - Alignment = 1 'Right Justify - Caption = "Picture Name:" - Height = 255 - Index = 3 - Left = 120 - TabIndex = 49 - Top = 240 - Width = 1095 - End - Begin VB.Label lblPicduration - Alignment = 1 'Right Justify - Caption = "Duration:" - Height = 255 - Index = 3 - Left = 1200 - TabIndex = 48 - Top = 600 - Width = 735 - End - Begin VB.Label lblPicxcoord - Alignment = 1 'Right Justify - Caption = "X:" - Height = 255 - Index = 3 - Left = 240 - TabIndex = 47 - Top = 600 - Width = 255 - End - Begin VB.Label lblPicycoord - Alignment = 1 'Right Justify - Caption = "Y:" - Height = 255 - Index = 3 - Left = 240 - TabIndex = 46 - Top = 960 - Width = 255 - End - End - Begin VB.Frame frmPic1 - Caption = "Picture 3:" - Height = 1335 - Index = 2 - Left = 7440 - TabIndex = 30 - Top = 2160 - Width = 2895 - Begin VB.CheckBox chkPichires - Caption = "High-Resolution" - Height = 255 - Index = 2 - Left = 1320 - TabIndex = 35 - Top = 960 - Width = 1455 - End - Begin VB.TextBox txtPicname - Height = 285 - Index = 2 - Left = 1320 - TabIndex = 34 - Top = 240 - Width = 1455 - End - Begin VB.TextBox txtPicduration - Height = 285 - Index = 2 - Left = 2040 - MaxLength = 5 - TabIndex = 33 - Top = 600 - Width = 735 - End - Begin VB.TextBox txtPicXcoord - Height = 285 - Index = 2 - Left = 600 - MaxLength = 3 - TabIndex = 32 - Top = 600 - Width = 495 - End - Begin VB.TextBox txtPicycoord - Height = 285 - Index = 2 - Left = 600 - MaxLength = 3 - TabIndex = 31 - Top = 960 - Width = 495 - End - Begin VB.Label lblPicname - Alignment = 1 'Right Justify - Caption = "Picture Name:" - Height = 255 - Index = 2 - Left = 120 - TabIndex = 39 - Top = 240 - Width = 1095 - End - Begin VB.Label lblPicduration - Alignment = 1 'Right Justify - Caption = "Duration:" - Height = 255 - Index = 2 - Left = 1200 - TabIndex = 38 - Top = 600 - Width = 735 - End - Begin VB.Label lblPicxcoord - Alignment = 1 'Right Justify - Caption = "X:" - Height = 255 - Index = 2 - Left = 240 - TabIndex = 37 - Top = 600 - Width = 255 - End - Begin VB.Label lblPicycoord - Alignment = 1 'Right Justify - Caption = "Y:" - Height = 255 - Index = 2 - Left = 240 - TabIndex = 36 - Top = 960 - Width = 255 - End - End - Begin VB.Frame frmPic1 - Caption = "Picture 2:" - Height = 1335 - Index = 1 - Left = 4440 - TabIndex = 20 - Top = 2160 - Width = 2895 - Begin VB.CheckBox chkPichires - Caption = "High-Resolution" - Height = 255 - Index = 1 - Left = 1320 - TabIndex = 25 - Top = 960 - Width = 1455 - End - Begin VB.TextBox txtPicname - Height = 285 - Index = 1 - Left = 1320 - TabIndex = 24 - Top = 240 - Width = 1455 - End - Begin VB.TextBox txtPicduration - Height = 285 - Index = 1 - Left = 2040 - MaxLength = 5 - TabIndex = 23 - Top = 600 - Width = 735 - End - Begin VB.TextBox txtPicXcoord - Height = 285 - Index = 1 - Left = 600 - MaxLength = 3 - TabIndex = 22 - Top = 600 - Width = 495 - End - Begin VB.TextBox txtPicycoord - Height = 285 - Index = 1 - Left = 600 - MaxLength = 3 - TabIndex = 21 - Top = 960 - Width = 495 - End - Begin VB.Label lblPicname - Alignment = 1 'Right Justify - Caption = "Picture Name:" - Height = 255 - Index = 1 - Left = 120 - TabIndex = 29 - Top = 240 - Width = 1095 - End - Begin VB.Label lblPicduration - Alignment = 1 'Right Justify - Caption = "Duration:" - Height = 255 - Index = 1 - Left = 1200 - TabIndex = 28 - Top = 600 - Width = 735 - End - Begin VB.Label lblPicxcoord - Alignment = 1 'Right Justify - Caption = "X:" - Height = 255 - Index = 1 - Left = 240 - TabIndex = 27 - Top = 600 - Width = 255 - End - Begin VB.Label lblPicycoord - Alignment = 1 'Right Justify - Caption = "Y:" - Height = 255 - Index = 1 - Left = 240 - TabIndex = 26 - Top = 960 - Width = 255 - End - End - Begin VB.TextBox txtTextypos - Height = 285 - Left = 3120 - MaxLength = 3 - TabIndex = 19 - Top = 5880 - Width = 615 - End - Begin VB.TextBox txtTextxpos - Height = 285 - Left = 3120 - MaxLength = 3 - TabIndex = 18 - Top = 5520 - Width = 615 - End - Begin VB.Frame frmPic1 - Caption = "Picture 1:" - Height = 1335 - Index = 0 - Left = 1440 - TabIndex = 6 - Top = 2160 - Width = 2895 - Begin VB.TextBox txtPicycoord - Height = 285 - Index = 0 - Left = 600 - MaxLength = 3 - TabIndex = 14 - Top = 960 - Width = 495 - End - Begin VB.TextBox txtPicXcoord - Height = 285 - Index = 0 - Left = 600 - MaxLength = 3 - TabIndex = 12 - Top = 600 - Width = 495 - End - Begin VB.TextBox txtPicduration - Height = 285 - Index = 0 - Left = 2040 - MaxLength = 5 - TabIndex = 11 - Top = 600 - Width = 735 - End - Begin VB.TextBox txtPicname - Height = 285 - Index = 0 - Left = 1320 - TabIndex = 8 - Top = 240 - Width = 1455 - End - Begin VB.CheckBox chkPichires - Caption = "High-Resolution" - Height = 255 - Index = 0 - Left = 1320 - TabIndex = 7 - Top = 960 - Width = 1455 - End - Begin VB.Label lblPicycoord - Alignment = 1 'Right Justify - Caption = "Y:" - Height = 255 - Index = 0 - Left = 240 - TabIndex = 15 - Top = 960 - Width = 255 - End - Begin VB.Label lblPicxcoord - Alignment = 1 'Right Justify - Caption = "X:" - Height = 255 - Index = 0 - Left = 240 - TabIndex = 13 - Top = 600 - Width = 255 - End - Begin VB.Label lblPicduration - Alignment = 1 'Right Justify - Caption = "Duration:" - Height = 255 - Index = 0 - Left = 1200 - TabIndex = 10 - Top = 600 - Width = 735 - End - Begin VB.Label lblPicname - Alignment = 1 'Right Justify - Caption = "Picture Name:" - Height = 255 - Index = 0 - Left = 120 - TabIndex = 9 - Top = 240 - Width = 1095 - End - End - Begin VB.TextBox txtNumberofpics - Height = 285 - Left = 3840 - MaxLength = 1 - TabIndex = 5 - Top = 1800 - Width = 375 - End - Begin VB.TextBox txtScenetext - Height = 1815 - Left = 4440 - MultiLine = -1 'True - TabIndex = 3 - Top = 240 - Width = 3135 - End - Begin VB.CommandButton cmdSave - Caption = "&Save Scene" - Height = 495 - Left = 3360 - Style = 1 'Graphical - TabIndex = 1 - Top = 1200 - Width = 855 - End - Begin VB.ListBox lstCutscenes - Height = 6300 - ItemData = "frmCutsceneEdit.frx":0446 - Left = 120 - List = "frmCutsceneEdit.frx":0448 - TabIndex = 0 - Top = 120 - Width = 1215 - End - Begin VB.Label Label3 - Caption = "Note: The cutscene editor is not fully functional. Only use it to get an idea of the proper syntax to use." - BeginProperty Font - Name = "MS Sans Serif" - Size = 9.75 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 1335 - Left = 7680 - TabIndex = 98 - Top = 240 - Width = 2655 - End - Begin VB.Label Label2 - Caption = "For Scene Text:" - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 400 - Underline = -1 'True - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 1560 - TabIndex = 96 - Top = 5160 - Width = 1695 - End - Begin VB.Label Label1 - Caption = "Enter all time durations in game tics (35 = 1 second)" - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 855 - Left = 1560 - TabIndex = 95 - Top = 960 - Width = 1335 - End - Begin VB.Label lblMusicslot - Alignment = 1 'Right Justify - Caption = "Music to play:" - Height = 255 - Left = 7680 - TabIndex = 92 - Top = 1680 - Width = 975 - End - Begin VB.Label lblCurrentScene - Alignment = 1 'Right Justify - Caption = "Current Scene:" - Height = 255 - Left = 1920 - TabIndex = 91 - Top = 720 - Width = 1215 - End - Begin VB.Label lblNumScenes - Alignment = 1 'Right Justify - Caption = "Number of Scenes in this Cutscene:" - Height = 375 - Left = 1440 - TabIndex = 90 - Top = 120 - Width = 1935 - End - Begin VB.Label lblTextypos - Alignment = 1 'Right Justify - Caption = "Text Y Position:" - Height = 255 - Left = 1800 - TabIndex = 17 - Top = 5880 - Width = 1215 - End - Begin VB.Label lblTextxpos - Alignment = 1 'Right Justify - Caption = "Text X Position:" - Height = 255 - Left = 1800 - TabIndex = 16 - Top = 5520 - Width = 1215 - End - Begin VB.Label lblNumberofpics - Alignment = 1 'Right Justify - Caption = "Number of Pictures (max 8):" - Height = 255 - Left = 1560 - TabIndex = 4 - Top = 1800 - Width = 2175 - End - Begin VB.Label lblScenetext - Caption = "Scene Text:" - Height = 255 - Left = 4440 - TabIndex = 2 - Top = 0 - Width = 1215 - End -End -Attribute VB_Name = "frmCutsceneEdit" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmdSave_Click() - Call WriteScene(False) -End Sub - -Private Sub lstScene_Click() - Call ClearForm - Call LoadSOCCutscene(Val(lstCutscenes.List(lstCutscenes.ListIndex)), Val(lstScene.List(lstScene.ListIndex))) -End Sub - -Private Sub LoadMusic() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim addstring As String - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("sounds.h", ForReading, False) - - Do While InStr(ts.ReadLine, "Music list (don't edit this comment!)") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - cmbMusicslot.Clear - - Do While InStr(line, "NUMMUSIC") = 0 - startclip = InStr(line, "mus_") - If InStr(line, "mus_") <> 0 Then - endclip = InStr(line, ",") - line = Mid(line, startclip, endclip - startclip) - addstring = number & " - " & line - cmbMusicslot.AddItem addstring - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub cmdReload_Click() - Call Reload -End Sub - -Private Sub Form_Load() - Call Reload -End Sub - -Private Sub Reload() - ClearForm - Call ReadCutsceneSOCNumbers - Call LoadMusic - If lstCutscenes.ListCount > 0 Then - lstCutscenes.ListIndex = 0 - End If -End Sub - -Private Sub LoadSOCCutscene(CutNum As Integer, SceneNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim ind As Integer - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - ' WOW! This looks fun, don't it?! - If UCase(word) = "CUTSCENE" And Val(word2) = CutNum Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - If word = "NUMSCENES" Then - txtNumScenes.Text = Val(word2) - ElseIf UCase(word) = "SCENE" And Val(word2) = SceneNum Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondTokenEqual(line)) - - If word = "SCENETEXT" Then - Dim startclip As Integer, endclip As Integer - startclip = InStr(line, "=") - - startclip = startclip + 2 - - line = Mid(line, startclip, Len(line)) - - txtScenetext.Text = line & vbCrLf - - Do While InStr(line, "#") = 0 And Not ts.AtEndOfStream - line = ts.ReadLine & vbCrLf - txtScenetext.Text = txtScenetext.Text & line - Loop - - txtScenetext.Text = RTrimComplete(txtScenetext.Text) - If Right(txtScenetext.Text, 1) = "#" Then - txtScenetext.Text = Left(txtScenetext.Text, Len(txtScenetext.Text) - 1) - End If - ElseIf word = "PIC1NAME" Or word = "PIC2NAME" Or word = "PIC3NAME" Or word = "PIC4NAME" Or word = "PIC5NAME" Or word = "PIC6NAME" Or word = "PIC7NAME" Or word = "PIC8NAME" Then - ind = Val(Mid(word, 4, 1)) - 1 - txtPicname(ind).Text = word2 - ElseIf word = "PIC1HIRES" Or word = "PIC2HIRES" Or word = "PIC3HIRES" Or word = "PIC4HIRES" Or word = "PIC5HIRES" Or word = "PIC6HIRES" Or word = "PIC7HIRES" Or word = "PIC8HIRES" Then - ind = Val(Mid(word, 4, 1)) - 1 - chkPichires(ind).Value = Val(word2) - ElseIf word = "PIC1DURATION" Or word = "PIC2DURATION" Or word = "PIC3DURATION" Or word = "PIC4DURATION" Or word = "PIC5DURATION" Or word = "PIC6DURATION" Or word = "PIC7DURATION" Or word = "PIC8DURATION" Then - ind = Val(Mid(word, 4, 1)) - 1 - txtPicduration(ind).Text = Val(word2) - ElseIf word = "PIC1XCOORD" Or word = "PIC2XCOORD" Or word = "PIC3XCOORD" Or word = "PIC4XCOORD" Or word = "PIC5XCOORD" Or word = "PIC6XCOORD" Or word = "PIC7XCOORD" Or word = "PIC8XCOORD" Then - ind = Val(Mid(word, 4, 1)) - 1 - txtPicXcoord(ind).Text = Val(word2) - ElseIf word = "PIC1YCOORD" Or word = "PIC2YCOORD" Or word = "PIC3YCOORD" Or word = "PIC4YCOORD" Or word = "PIC5YCOORD" Or word = "PIC6YCOORD" Or word = "PIC7YCOORD" Or word = "PIC8YCOORD" Then - ind = Val(Mid(word, 4, 1)) - 1 - txtPicycoord(ind).Text = Val(word2) - ElseIf word = "TEXTXPOS" Then - txtTextxpos.Text = Val(word2) - ElseIf word = "TEXTYPOS" Then - txtTextypos.Text = Val(word2) - ElseIf word = "MUSICSLOT" Then - cmbMusicslot.ListIndex = Val(word2) - ElseIf word = "NUMBEROFPICS" Then - txtNumberofpics.Text = Val(word2) - ElseIf word = "SCENE" Then 'End of scene data - line = "" - ElseIf Len(line) > 0 And Left(line, 1) <> "#" Then - MsgBox "Error in SOC!" & vbCrLf & "Unknown line: " & line - End If - Loop - End If - Loop - Exit Do - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub ReadCutsceneSOCNumbers() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - - lstCutscenes.Clear - -CutsceneLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo CutsceneLoad - - If Left(line, 1) = vbCrLf Then GoTo CutsceneLoad - - If Len(line) < 1 Then GoTo CutsceneLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "CUTSCENE" Then - lstCutscenes.AddItem (Val(word2)) - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub ClearForm() - Dim i As Integer - - For i = 0 To 7 - chkPichires(i).Value = 0 - txtPicXcoord(i).Text = "" - txtPicycoord(i).Text = "" - txtPicname(i).Text = "" - txtPicduration(i).Text = "" - Next - - txtScenetext.Text = "" - txtNumberofpics.Text = "" - txtTextxpos.Text = "" - txtTextypos.Text = "" - cmbMusicslot.Text = "" -End Sub - -Private Sub lstCutscenes_Click() - Dim i As Integer - - LoadNumScenes (Val(lstCutscenes.List(lstCutscenes.ListIndex))) - - lstScene.Clear - For i = 1 To Val(txtNumScenes.Text) - lstScene.AddItem i - Next - - If Val(txtNumScenes) > 0 Then - lstScene.ListIndex = lstScene.ListCount - 1 - lstScene.ListIndex = 0 - End If -End Sub - -Private Sub LoadNumScenes(CutNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim ind As Integer - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - ' WOW! This looks fun, don't it?! - If UCase(word) = "CUTSCENE" And Val(word2) = CutNum Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - If word = "NUMSCENES" Then - txtNumScenes.Text = Val(word2) - End If - Loop - Exit Do - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub WriteScene(Remove As Boolean) - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim flags As Long - Dim i As Integer - Dim CutsceneNum As Integer - Dim InCutScene As Boolean - Dim scenefound As Boolean - Dim nevercheckagain As Boolean - - ' This whole sub is a mess, but it works, - ' so I'd better not touch it... - scenefound = False - nevercheckagain = False - - InCutScene = False - CutsceneNum = Val(lstCutscenes.List(lstCutscenes.ListIndex)) - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - If nevercheckagain = False And word = "CUTSCENE" And Val(word2) = CutsceneNum Then - InCutScene = True - tsTarget.WriteLine "CUTSCENE " & Val(lstCutscenes.List(lstCutscenes.ListIndex)) - tsTarget.WriteLine "NUMSCENES " & Val(txtNumScenes.Text) - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - If word = "NUMSCENES" Then - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - End If - End If - - 'If the current scene exists in the SOC, delete it. - If nevercheckagain = False And InCutScene = True And word = "SCENE" And Val(word2) = Val(lstScene.List(lstScene.ListIndex)) Then - scenefound = True - line = tsSource.ReadLine - Do While (Left(UCase(line), 6) <> "SCENE " And Len(TrimComplete(line)) > 0) And Not (tsSource.AtEndOfStream) - line = tsSource.ReadLine - Loop - If Remove = False Then - tsTarget.WriteLine "SCENE " & Val(lstScene.List(lstScene.ListIndex)) - txtNumberofpics.Text = TrimComplete(txtNumberofpics.Text) - txtTextxpos.Text = TrimComplete(txtTextxpos.Text) - txtTextypos.Text = TrimComplete(txtTextypos.Text) - cmbMusicslot.Text = TrimComplete(cmbMusicslot.Text) - - For i = 0 To 7 - txtPicname(i).Text = TrimComplete(txtPicname(i).Text) - txtPicXcoord(i).Text = TrimComplete(txtPicXcoord(i).Text) - txtPicycoord(i).Text = TrimComplete(txtPicycoord(i).Text) - txtPicduration(i).Text = TrimComplete(txtPicduration(i).Text) - Next - - If txtNumberofpics.Text <> "" Then tsTarget.WriteLine "NUMBEROFPICS = " & Val(txtNumberofpics.Text) - If txtTextxpos.Text <> "" Then tsTarget.WriteLine "TEXTXPOS = " & Val(txtTextxpos.Text) - If txtTextypos.Text <> "" Then tsTarget.WriteLine "TEXTYPOS = " & Val(txtTextypos.Text) - If cmbMusicslot.Text <> "" Then tsTarget.WriteLine "MUSICSLOT = " & Val(cmbMusicslot.Text) - - For i = 0 To 7 - If txtPicname(i).Text <> "" Then tsTarget.WriteLine "PIC" & (i + 1) & "NAME = " & txtPicname(i).Text - - If chkPichires(i).Value = 1 Then tsTarget.WriteLine "PIC" & (i + 1) & "HIRES = 1" - - If txtPicXcoord(i).Text <> "" Then tsTarget.WriteLine "PIC" & (i + 1) & "XCOORD = " & Val(txtPicXcoord(i).Text) - If txtPicycoord(i).Text <> "" Then tsTarget.WriteLine "PIC" & (i + 1) & "YCOORD = " & Val(txtPicycoord(i).Text) - If txtPicduration(i).Text <> "" Then tsTarget.WriteLine "PIC" & (i + 1) & "DURATION = " & Val(txtPicduration(i).Text) - Next - If txtScenetext.Text <> "" Then tsTarget.WriteLine "SCENETEXT = " & txtScenetext.Text & "#" - End If - InCutScene = False - nevercheckagain = True - End If - tsTarget.WriteLine line - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If Remove = False And scenefound = False Then - If line <> "" Then tsTarget.WriteLine "" - - tsTarget.WriteLine "CUTSCENE " & Val(lstCutscenes.List(lstCutscenes.ListIndex)) - tsTarget.WriteLine "NUMSCENES " & Val(txtNumScenes.Text) - tsTarget.WriteLine "SCENE " & Val(lstScene.List(lstScene.ListIndex)) - txtNumberofpics.Text = TrimComplete(txtNumberofpics.Text) - txtScenetext.Text = TrimComplete(txtScenetext.Text) - txtTextxpos.Text = TrimComplete(txtTextxpos.Text) - txtTextypos.Text = TrimComplete(txtTextypos.Text) - cmbMusicslot.Text = TrimComplete(cmbMusicslot.Text) - - For i = 0 To 7 - txtPicname(i).Text = TrimComplete(txtPicname(i).Text) - txtPicXcoord(i).Text = TrimComplete(txtPicXcoord(i).Text) - txtPicycoord(i).Text = TrimComplete(txtPicycoord(i).Text) - txtPicduration(i).Text = TrimComplete(txtPicduration(i).Text) - Next - - If txtNumberofpics.Text <> "" Then tsTarget.WriteLine "NUMBEROFPICS = " & Val(txtNumberofpics.Text) - If txtScenetext.Text <> "" Then tsTarget.WriteLine "SCENETEXT = " & txtScenetext.Text & "#" - If txtTextxpos.Text <> "" Then tsTarget.WriteLine "TEXTXPOS = " & Val(txtTextxpos.Text) - If txtTextypos.Text <> "" Then tsTarget.WriteLine "TEXTYPOS = " & Val(txtTextypos.Text) - If cmbMusicslot.Text <> "" Then tsTarget.WriteLine "MUSICSLOT = " & Val(cmbMusicslot.Text) - - For i = 0 To 7 - If txtPicname(i).Text <> "" Then tsTarget.WriteLine "PIC" & (i + 1) & "NAME = " & txtPicname(i).Text - - If chkPichires(i).Value = 1 Then tsTarget.WriteLine "PIC" & (i + 1) & "HIRES = 1" - - If txtPicXcoord(i).Text <> "" Then tsTarget.WriteLine "PIC" & (i + 1) & "XCOORD = " & Val(txtPicXcoord(i).Text) - If txtPicycoord(i).Text <> "" Then tsTarget.WriteLine "PIC" & (i + 1) & "YCOORD = " & Val(txtPicycoord(i).Text) - If txtPicduration(i).Text <> "" Then tsTarget.WriteLine "PIC" & (i + 1) & "DURATION = " & Val(txtPicduration(i).Text) - Next - End If - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - If Remove = True Then - If scenefound = True Then - MsgBox "Scene removed from SOC." - Else - MsgBox "Scene not found in SOC." - End If - Else - MsgBox "Scene Saved." - End If -End Sub diff --git a/tools/SOCEdit/frmCutsceneEdit.frx b/tools/SOCEdit/frmCutsceneEdit.frx deleted file mode 100644 index 6f844e643..000000000 Binary files a/tools/SOCEdit/frmCutsceneEdit.frx and /dev/null differ diff --git a/tools/SOCEdit/frmEmblemEdit.frm b/tools/SOCEdit/frmEmblemEdit.frm deleted file mode 100644 index f94255b9c..000000000 --- a/tools/SOCEdit/frmEmblemEdit.frm +++ /dev/null @@ -1,384 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmEmblemEdit - Caption = "Emblem Edit" - ClientHeight = 2865 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 5160 - Icon = "frmEmblemEdit.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 2865 - ScaleWidth = 5160 - StartUpPosition = 3 'Windows Default - Begin VB.CommandButton cmdDelete - Caption = "&Delete Last Emblem" - Height = 735 - Left = 1560 - Style = 1 'Graphical - TabIndex = 17 - Top = 600 - Width = 855 - End - Begin VB.CommandButton cmdAdd - Caption = "&Add" - Height = 375 - Left = 1560 - TabIndex = 16 - Top = 120 - Width = 855 - End - Begin VB.CommandButton cmdSave - Caption = "&Save Emblem" - Height = 495 - Left = 4200 - Style = 1 'Graphical - TabIndex = 13 - Top = 2280 - Width = 855 - End - Begin VB.CommandButton cmdReload - Caption = "&Reload" - Height = 495 - Left = 3120 - TabIndex = 12 - Top = 2280 - Width = 975 - End - Begin VB.TextBox txtPlayernum - Height = 285 - Left = 4320 - MaxLength = 3 - TabIndex = 9 - Top = 1800 - Width = 735 - End - Begin VB.TextBox txtMapnum - Height = 285 - Left = 4320 - MaxLength = 4 - TabIndex = 7 - Top = 1320 - Width = 735 - End - Begin VB.TextBox txtZ - Height = 285 - Left = 4320 - MaxLength = 5 - TabIndex = 3 - Top = 960 - Width = 735 - End - Begin VB.TextBox txtY - Height = 285 - Left = 4320 - MaxLength = 5 - TabIndex = 2 - Top = 600 - Width = 735 - End - Begin VB.TextBox txtX - Height = 285 - Left = 4320 - MaxLength = 5 - TabIndex = 1 - Top = 240 - Width = 735 - End - Begin VB.ListBox lstEmblems - Height = 2400 - Left = 120 - TabIndex = 0 - Top = 120 - Width = 1335 - End - Begin VB.Label Label1 - Caption = "Emblem #s must be linear, sorry!" - Height = 495 - Left = 1560 - TabIndex = 18 - Top = 2400 - Width = 1455 - End - Begin VB.Label lblNumEmblems - Caption = "# of Emblems:" - Height = 255 - Left = 120 - TabIndex = 15 - Top = 2520 - Width = 1335 - End - Begin VB.Label lblNote2 - Caption = "Don't forget to set Game Data file and # of Emblems in Global Game Settings!" - Height = 855 - Left = 1560 - TabIndex = 14 - Top = 1440 - Width = 1575 - End - Begin VB.Label lblNote - Appearance = 0 'Flat - BorderStyle = 1 'Fixed Single - Caption = "Note: Enter map coordinates, not game coordinates. (I.e., 128, not 8388608)" - ForeColor = &H80000008& - Height = 1095 - Left = 2640 - TabIndex = 11 - Top = 120 - Width = 1335 - End - Begin VB.Label lblPlayernum - Caption = "Player # (255 for all players):" - Height = 495 - Left = 3240 - TabIndex = 10 - Top = 1680 - Width = 1095 - End - Begin VB.Label lblMapnum - Alignment = 1 'Right Justify - Caption = "Map #:" - Height = 255 - Left = 3600 - TabIndex = 8 - Top = 1320 - Width = 615 - End - Begin VB.Label lblZ - Alignment = 1 'Right Justify - Caption = "Z:" - Height = 255 - Left = 3960 - TabIndex = 6 - Top = 960 - Width = 255 - End - Begin VB.Label lblY - Alignment = 1 'Right Justify - Caption = "Y:" - Height = 255 - Left = 3960 - TabIndex = 5 - Top = 600 - Width = 255 - End - Begin VB.Label lblX - Alignment = 1 'Right Justify - Caption = "X:" - Height = 255 - Left = 3960 - TabIndex = 4 - Top = 240 - Width = 255 - End -End -Attribute VB_Name = "frmEmblemEdit" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmdAdd_Click() - lstEmblems.AddItem "Emblem " & lstEmblems.ListCount + 1 - lstEmblems.ListIndex = lstEmblems.ListCount - 1 - lblNumEmblems.Caption = "# of Emblems: " & lstEmblems.ListCount - txtX.Text = 0 - txtY.Text = 0 - txtZ.Text = 0 - txtPlayernum.Text = 255 - txtMapnum.Text = 1 -End Sub - -Private Sub cmdDelete_Click() - Call WriteEmblem(True) - lstEmblems.RemoveItem lstEmblems.ListCount - 1 - lstEmblems.ListIndex = lstEmblems.ListCount - 1 - lblNumEmblems.Caption = "# of Emblems: " & lstEmblems.ListCount -End Sub - -Private Sub cmdReload_Click() - Call Reload -End Sub - -Private Sub Reload() - lstEmblems.Clear - txtX.Text = "" - txtY.Text = "" - txtZ.Text = "" - txtMapnum.Text = "" - txtPlayernum.Text = "" - lblNumEmblems.Caption = "# of Emblems: " & lstEmblems.ListCount - Call ReadSOCEmblems -End Sub - -Private Sub cmdSave_Click() - If lstEmblems.ListCount <= 0 Then - MsgBox "You have no emblems to save!" - Else - Call WriteEmblem(False) - End If -End Sub - -Private Sub Form_Load() - Call Reload -End Sub - -Private Sub ReadSOCEmblems() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - - lstEmblems.Clear - -EmblemLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo EmblemLoad - - If Left(line, 1) = vbCrLf Then GoTo EmblemLoad - - If Len(line) < 1 Then GoTo EmblemLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "EMBLEM" Then - lstEmblems.AddItem ("Emblem " & Val(word2)) - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub ReadSOCEmblemNum(num As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -EmblemLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo EmblemLoad - - If Left(line, 1) = vbCrLf Then GoTo EmblemLoad - - If Len(line) < 1 Then GoTo EmblemLoad - - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - If word = "EMBLEM" Then - If Val(word2) = num Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondTokenEqual(line)) - - If word = "X" Then - txtX.Text = Val(word2) - ElseIf word = "Y" Then - txtY.Text = Val(word2) - ElseIf word = "Z" Then - txtZ.Text = Val(word2) - ElseIf word = "PLAYERNUM" Then - txtPlayernum.Text = Val(word2) - ElseIf word = "MAPNUM" Then - txtMapnum.Text = Val(word2) - ElseIf Len(line) > 0 And Left(line, 1) <> "#" Then - MsgBox "Error in SOC with Emblem " & num & vbCrLf & "Unknown line: " & line - End If - Loop - Exit Do - End If - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub lstEmblems_Click() - Dim i As Integer - - i = InStr(lstEmblems.List(lstEmblems.ListIndex), " ") + 1 - - i = Mid(lstEmblems.List(lstEmblems.ListIndex), i, Len(lstEmblems.List(lstEmblems.ListIndex)) - i + 1) - i = Val(i) - Call ReadSOCEmblemNum(i) -End Sub - -Private Sub WriteEmblem(Remove As Boolean) - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim i As Integer - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - i = InStr(lstEmblems.List(lstEmblems.ListIndex), " ") + 1 - - i = Mid(lstEmblems.List(lstEmblems.ListIndex), i, Len(lstEmblems.List(lstEmblems.ListIndex)) - i + 1) - i = Val(i) - - 'If the current emblem exists in the SOC, delete it. - If word = "EMBLEM" And Val(word2) = i Then - Do While Len(TrimComplete(tsSource.ReadLine)) > 0 And Not (tsSource.AtEndOfStream) - Loop - Else - tsTarget.WriteLine line - End If - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If Remove = False Then - If line <> "" Then tsTarget.WriteLine "" - - tsTarget.WriteLine UCase(lstEmblems.List(lstEmblems.ListIndex)) - txtX.Text = TrimComplete(txtX.Text) - txtY.Text = TrimComplete(txtY.Text) - txtZ.Text = TrimComplete(txtZ.Text) - txtMapnum.Text = TrimComplete(txtMapnum.Text) - txtPlayernum.Text = TrimComplete(txtPlayernum.Text) - If txtX.Text <> "" Then tsTarget.WriteLine "X = " & Val(txtX.Text) - If txtY.Text <> "" Then tsTarget.WriteLine "Y = " & Val(txtY.Text) - If txtZ.Text <> "" Then tsTarget.WriteLine "Z = " & Val(txtZ.Text) - If txtMapnum.Text <> "" Then tsTarget.WriteLine "MAPNUM = " & Val(txtMapnum.Text) - If txtPlayernum.Text <> "" Then tsTarget.WriteLine "PLAYERNUM = " & Val(txtPlayernum.Text) - End If - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - If Remove = True Then - MsgBox "Emblem deleted." - Else - MsgBox "Emblem Saved." - End If -End Sub diff --git a/tools/SOCEdit/frmEmblemEdit.frx b/tools/SOCEdit/frmEmblemEdit.frx deleted file mode 100644 index 2ae367330..000000000 Binary files a/tools/SOCEdit/frmEmblemEdit.frx and /dev/null differ diff --git a/tools/SOCEdit/frmHUDEdit.frm b/tools/SOCEdit/frmHUDEdit.frm deleted file mode 100644 index 2b267b79b..000000000 --- a/tools/SOCEdit/frmHUDEdit.frm +++ /dev/null @@ -1,315 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmHUDEdit - Caption = "HUD Edit" - ClientHeight = 2505 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 5160 - Icon = "frmHUDEdit.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 2505 - ScaleWidth = 5160 - StartUpPosition = 3 'Windows Default - Begin VB.CommandButton cmdCodeDefault - Caption = "&Load Code Default" - Height = 375 - Left = 3480 - TabIndex = 9 - Top = 1080 - Width = 1575 - End - Begin VB.CommandButton cmdDelete - Caption = "&Delete from SOC" - Height = 375 - Left = 3480 - TabIndex = 7 - Top = 2040 - Width = 1575 - End - Begin VB.CommandButton cmdSave - Caption = "&Save Changes" - Height = 375 - Left = 3480 - TabIndex = 6 - Top = 1560 - Width = 1575 - End - Begin VB.TextBox txtY - Height = 285 - Left = 4080 - MaxLength = 3 - TabIndex = 3 - Top = 720 - Width = 615 - End - Begin VB.TextBox txtX - Height = 285 - Left = 4080 - MaxLength = 3 - TabIndex = 2 - Top = 360 - Width = 615 - End - Begin VB.ListBox lstHUD - Height = 2010 - Left = 120 - TabIndex = 0 - Top = 360 - Width = 3255 - End - Begin VB.Label lblNote - Caption = "HUD items are placed on a 320x200 grid." - Height = 255 - Left = 1680 - TabIndex = 8 - Top = 120 - Width = 3015 - End - Begin VB.Label lblY - Alignment = 1 'Right Justify - Caption = "Y:" - Height = 255 - Left = 3600 - TabIndex = 5 - Top = 720 - Width = 375 - End - Begin VB.Label lblX - Alignment = 1 'Right Justify - Caption = "X:" - Height = 255 - Left = 3720 - TabIndex = 4 - Top = 360 - Width = 255 - End - Begin VB.Label lblHUDItems - Caption = "HUD Items:" - Height = 255 - Left = 120 - TabIndex = 1 - Top = 120 - Width = 975 - End -End -Attribute VB_Name = "frmHUDEdit" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmdCodeDefault_Click() - LoadHUDInfo (lstHUD.ListIndex) -End Sub - -Private Sub cmdDelete_Click() - Call WriteHUDItem(True) -End Sub - -Private Sub cmdSave_Click() - Call WriteHUDItem(False) -End Sub - -Private Sub Form_Load() - Call Reload -End Sub - -Private Sub Reload() - txtX.Text = "" - txtY.Text = "" - Call LoadCode - lstHUD.ListIndex = 0 -End Sub - -Private Sub LoadCode() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim addstring As String - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("st_stuff.h", ForReading, False) - - Do While ts.ReadLine <> "/** HUD location information (don't move this comment)" - Loop - - ts.ReadLine ' */ - ts.ReadLine ' typedef struct - ts.ReadLine ' { - ts.ReadLine ' int x, y; - ts.ReadLine ' } hudinfo_t; - ts.ReadLine ' - ts.ReadLine ' typedef enum - ts.ReadLine ' { - - line = ts.ReadLine - number = 0 - - lstHUD.Clear - - Do While InStr(line, "NUMHUDITEMS") = 0 - startclip = InStr(line, "HUD_") - If InStr(line, "HUD_") <> 0 Then - endclip = InStr(line, ",") - line = Mid(line, startclip, endclip - startclip) - addstring = number & " - " & line - lstHUD.AddItem addstring - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub lstHUD_Click() - LoadHUDInfo (lstHUD.ListIndex) - Call ReadSOC(lstHUD.ListIndex) -End Sub - -Private Sub LoadHUDInfo(HUDNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("st_stuff.c", ForReading, False) - - Do While InStr(ts.ReadLine, "hudinfo[NUMHUDITEMS] =") = 0 - Loop - - ts.SkipLine ' { - line = ts.ReadLine ' First HUD item - - number = 0 - - Do While number <> HUDNum - line = ts.ReadLine - number = number + 1 - Loop - - startclip = InStr(line, "{") + 1 - endclip = InStr(line, ",") - - txtX.Text = TrimComplete(Mid(line, startclip, endclip - startclip)) - - startclip = endclip + 2 - endclip = InStr(startclip, line, "}") - 1 - - txtY.Text = TrimComplete(Mid(line, startclip, endclip - startclip)) - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub ReadSOC(HUDNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "HUDITEM" And Val(word2) = HUDNum Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondTokenEqual(line)) - - If word = "X" Then - txtX.Text = Val(word2) - ElseIf word = "Y" Then - txtY.Text = Val(word2) - ElseIf Len(line) > 0 And Left(line, 1) <> "#" Then - MsgBox "Error in SOC!" & vbCrLf & "Unknown line: " & line - End If - Loop - Exit Do - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub WriteHUDItem(Remove As Boolean) - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim hudremoved As Boolean - - hudremoved = False - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - 'If the current item exists in the SOC, delete it. - If word = "HUDITEM" And Val(word2) = lstHUD.ListIndex Then - hudremoved = True - Do While Len(TrimComplete(tsSource.ReadLine)) > 0 And Not tsSource.AtEndOfStream - Loop - Else - tsTarget.WriteLine line - End If - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If Remove = False Then - If line <> "" Then tsTarget.WriteLine "" - - tsTarget.WriteLine "HUDITEM " & lstHUD.ListIndex - txtX.Text = TrimComplete(txtX.Text) - txtY.Text = TrimComplete(txtY.Text) - If txtX.Text <> "" Then tsTarget.WriteLine "X = " & Val(txtX.Text) - If txtY.Text <> "" Then tsTarget.WriteLine "Y = " & Val(txtY.Text) - End If - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - If Remove = True Then - If hudremoved = True Then - MsgBox "HUD Item deleted from SOC." - Else - MsgBox "Couldn't find HUD Item in SOC." - End If - Else - MsgBox "HUD Item Saved." - End If -End Sub diff --git a/tools/SOCEdit/frmHUDEdit.frx b/tools/SOCEdit/frmHUDEdit.frx deleted file mode 100644 index 2ae367330..000000000 Binary files a/tools/SOCEdit/frmHUDEdit.frx and /dev/null differ diff --git a/tools/SOCEdit/frmHelp.frm b/tools/SOCEdit/frmHelp.frm deleted file mode 100644 index acf991057..000000000 --- a/tools/SOCEdit/frmHelp.frm +++ /dev/null @@ -1,213 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmHelp - BorderStyle = 3 'Fixed Dialog - Caption = "Getting Started" - ClientHeight = 7395 - ClientLeft = 45 - ClientTop = 330 - ClientWidth = 6360 - Icon = "frmHelp.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - MinButton = 0 'False - ScaleHeight = 7395 - ScaleWidth = 6360 - ShowInTaskbar = 0 'False - StartUpPosition = 1 'CenterOwner - Begin VB.CommandButton cmdOK - Caption = "&OK, I know what I'm doing now." - Height = 495 - Left = 1920 - Style = 1 'Graphical - TabIndex = 8 - Top = 6840 - Width = 2535 - End - Begin VB.Line Line9 - X1 = 120 - X2 = 6120 - Y1 = 4800 - Y2 = 4800 - End - Begin VB.Line Line7 - X1 = 120 - X2 = 6120 - Y1 = 5400 - Y2 = 5400 - End - Begin VB.Label Label12 - Caption = $"frmHelp.frx":0442 - Height = 615 - Left = 120 - TabIndex = 12 - Top = 4800 - Width = 6015 - End - Begin VB.Line Line6 - X1 = 120 - X2 = 6120 - Y1 = 4200 - Y2 = 4200 - End - Begin VB.Label Label11 - Caption = $"frmHelp.frx":04F8 - Height = 615 - Left = 120 - TabIndex = 11 - Top = 4200 - Width = 6015 - End - Begin VB.Line Line8 - X1 = 120 - X2 = 6120 - Y1 = 6360 - Y2 = 6360 - End - Begin VB.Line Line5 - X1 = 120 - X2 = 6120 - Y1 = 3720 - Y2 = 3720 - End - Begin VB.Line Line4 - X1 = 120 - X2 = 6120 - Y1 = 2880 - Y2 = 2880 - End - Begin VB.Line Line3 - X1 = 120 - X2 = 6120 - Y1 = 2400 - Y2 = 2400 - End - Begin VB.Line Line2 - X1 = 120 - X2 = 6120 - Y1 = 1800 - Y2 = 1800 - End - Begin VB.Line Line1 - X1 = 120 - X2 = 6120 - Y1 = 1200 - Y2 = 1200 - End - Begin VB.Label Label10 - Caption = $"frmHelp.frx":05EC - Height = 495 - Left = 120 - TabIndex = 10 - Top = 3720 - Width = 6135 - End - Begin VB.Label Label9 - Caption = $"frmHelp.frx":068F - Height = 615 - Left = 120 - TabIndex = 9 - Top = 1200 - Width = 6135 - End - Begin VB.Label Label8 - Caption = $"frmHelp.frx":0772 - Height = 495 - Left = 120 - TabIndex = 7 - Top = 6360 - Width = 6135 - End - Begin VB.Label Label7 - Caption = "However, if you have these settings in the SOC you are using, don't worry - the editor will not erase them from your file." - Height = 495 - Left = 120 - TabIndex = 6 - Top = 5880 - Width = 6135 - End - Begin VB.Label Label6 - Caption = $"frmHelp.frx":0816 - Height = 495 - Left = 120 - TabIndex = 5 - Top = 5400 - Width = 6135 - End - Begin VB.Label Label5 - Caption = $"frmHelp.frx":08A9 - BeginProperty Font - Name = "MS Sans Serif" - Size = 8.25 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 855 - Left = 120 - TabIndex = 4 - Top = 2880 - Width = 6135 - End - Begin VB.Label Label4 - Caption = $"frmHelp.frx":09B1 - Height = 495 - Left = 120 - TabIndex = 3 - Top = 2400 - Width = 6135 - End - Begin VB.Label Label3 - Caption = $"frmHelp.frx":0A5A - Height = 495 - Left = 120 - TabIndex = 2 - Top = 1920 - Width = 6135 - End - Begin VB.Label Label2 - Caption = "Finally! A way to easily edit SOC files! I know you're anxious to get started, but here are some things you should know first:" - BeginProperty Font - Name = "MS Sans Serif" - Size = 9.75 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 495 - Left = 120 - TabIndex = 1 - Top = 600 - Width = 6135 - End - Begin VB.Label Label1 - Caption = "How To Use This Program" - BeginProperty Font - Name = "MS Sans Serif" - Size = 13.5 - Charset = 0 - Weight = 700 - Underline = -1 'True - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 495 - Left = 120 - TabIndex = 0 - Top = 120 - Width = 3855 - End -End -Attribute VB_Name = "frmHelp" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmdOK_Click() - frmHelp.Hide -End Sub diff --git a/tools/SOCEdit/frmHelp.frx b/tools/SOCEdit/frmHelp.frx deleted file mode 100644 index 25004fe29..000000000 Binary files a/tools/SOCEdit/frmHelp.frx and /dev/null differ diff --git a/tools/SOCEdit/frmHub.frm b/tools/SOCEdit/frmHub.frm deleted file mode 100644 index 3672c62b0..000000000 --- a/tools/SOCEdit/frmHub.frm +++ /dev/null @@ -1,429 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmHub - Caption = "SOC Editor" - ClientHeight = 6960 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 4920 - Icon = "frmHub.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 6960 - ScaleWidth = 4920 - StartUpPosition = 3 'Windows Default - Begin VB.CommandButton cmdCreateBlank - Caption = "Make a &Blank SOC" - Height = 255 - Left = 240 - TabIndex = 22 - Top = 2520 - Width = 2055 - End - Begin VB.CommandButton cmdUnlockables - Caption = "Edit &Unlockables" - Enabled = 0 'False - Height = 495 - Left = 2760 - Style = 1 'Graphical - TabIndex = 21 - Top = 6360 - Width = 1095 - End - Begin VB.CommandButton cmdAuthor - Caption = "Enter &Author Info" - Enabled = 0 'False - Height = 495 - Left = 120 - Style = 1 'Graphical - TabIndex = 19 - Top = 3960 - Width = 1215 - End - Begin VB.CommandButton cmdHelp - Caption = "Getting Starte&d / READ ME FIRST!" - Height = 495 - Left = 480 - TabIndex = 18 - Top = 2880 - Width = 1575 - End - Begin VB.CommandButton cmdEditCutscenes - Caption = "Edit C&utscenes" - Enabled = 0 'False - Height = 495 - Left = 120 - TabIndex = 17 - Top = 6360 - Width = 1215 - End - Begin VB.CommandButton cmdCharacterEdit - Caption = "Edit &Character Select Screen" - Enabled = 0 'False - Height = 495 - Left = 120 - Style = 1 'Graphical - TabIndex = 16 - Top = 5760 - Width = 1215 - End - Begin VB.PictureBox Picture1 - Height = 1965 - Left = 2760 - Picture = "frmHub.frx":0442 - ScaleHeight = 1905 - ScaleWidth = 1905 - TabIndex = 15 - Top = 3960 - Width = 1965 - End - Begin VB.CommandButton cmdSoundEdit - Caption = "Edit &Sounds" - Enabled = 0 'False - Height = 495 - Left = 120 - TabIndex = 14 - Top = 5160 - Width = 1215 - End - Begin VB.CommandButton cmdEmblemEdit - Caption = "Edit &Emblem Locations" - Enabled = 0 'False - Height = 495 - Left = 120 - Style = 1 'Graphical - TabIndex = 13 - Top = 4560 - Width = 1215 - End - Begin VB.CommandButton cmdHUDEdit - Caption = "Edit &HUD Coordinates" - Enabled = 0 'False - Height = 495 - Left = 1440 - Style = 1 'Graphical - TabIndex = 12 - Top = 3960 - Width = 1215 - End - Begin VB.CommandButton cmdMaincfg - Caption = "Edit &Global Game Settings" - Enabled = 0 'False - Height = 495 - Left = 1440 - Style = 1 'Graphical - TabIndex = 11 - Top = 4560 - Width = 1215 - End - Begin VB.DriveListBox Drive2 - Height = 315 - Left = 2640 - TabIndex = 9 - Top = 360 - Width = 2175 - End - Begin VB.DirListBox Dir2 - Height = 1665 - Left = 2520 - TabIndex = 8 - Top = 720 - Width = 2295 - End - Begin VB.FileListBox File1 - Height = 1455 - Left = 2520 - Pattern = "*.soc" - TabIndex = 7 - Top = 2400 - Width = 2295 - End - Begin VB.DriveListBox Drive1 - Height = 315 - Left = 120 - TabIndex = 6 - Top = 360 - Width = 2295 - End - Begin VB.DirListBox Dir1 - Height = 1665 - Left = 120 - TabIndex = 4 - Top = 720 - Width = 2295 - End - Begin VB.CommandButton cmdAbout - Caption = "&About" - Height = 375 - Left = 3960 - TabIndex = 3 - Top = 6000 - Width = 735 - End - Begin VB.CommandButton cmdStateEdit - Caption = "Edit St&ates" - Enabled = 0 'False - Height = 495 - Left = 1440 - TabIndex = 2 - Top = 6360 - Width = 1215 - End - Begin VB.CommandButton cmdLevelHeader - Caption = "Edit &Level Headers" - Enabled = 0 'False - Height = 495 - Left = 1440 - Style = 1 'Graphical - TabIndex = 1 - Top = 5160 - Width = 1215 - End - Begin VB.CommandButton cmdThingEdit - Caption = "Edit &Things" - Enabled = 0 'False - Height = 495 - Left = 1440 - TabIndex = 0 - Top = 5760 - Width = 1215 - End - Begin VB.Label lblAuthor - Caption = "Modification By:" - Height = 495 - Left = 120 - TabIndex = 20 - Top = 3480 - Width = 2295 - End - Begin VB.Label lblSOCFile - Caption = "SOC File to use (double click):" - Height = 255 - Left = 2640 - TabIndex = 10 - Top = 120 - Width = 2175 - End - Begin VB.Label lblSourcePath - Caption = "Path to SRB2 Source Code:" - Height = 255 - Left = 120 - TabIndex = 5 - Top = 120 - Width = 2175 - End -End -Attribute VB_Name = "frmHub" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmdAbout_Click() - MsgBox App.Title & " v" & App.Major & "." & App.Minor & "." & App.Revision & vbCrLf & "By " & App.CompanyName & vbCrLf & "(SSNTails)" & vbCrLf & App.Comments & vbCrLf & App.FileDescription -End Sub - -Private Sub cmdAuthor_Click() - Dim Response As String - - Response$ = InputBox("Enter name to appear on credits (type in NOBODY to delete):", "Modification By", GetAuthor) - - If Response = "" Then Exit Sub - - Response = TrimComplete(Response) - - If UCase(Response) = "NOBODY" Then - Call WriteAuthor(True, Response) - lblAuthor.Caption = "Modification By: " - Else - Call WriteAuthor(False, Response) - lblAuthor.Caption = "Modification By: " & Response - End If -End Sub - -Private Sub cmdCharacterEdit_Click() - frmCharacterEdit.Show vbModal, Me -End Sub - -Private Sub cmdCreateBlank_Click() - Dim socname As String - - socname = InputBox("This file will be created in the directory you have selected on the main window." & vbCrLf & vbCrLf & "Enter the filename you want (do not include .SOC at the end):", "Make A Blank SOC") - Trim (socname) - - If InStr(LCase(socname), ".soc") > 0 Then - MsgBox "The thing says not to include the .SOC at the end, stupid.", vbOKOnly, "You goofed!" - Exit Sub - End If - - If Len(socname) > 0 Then - socname = socname & ".soc" - - Dim myFSOSOC As New Scripting.FileSystemObject - Dim tsSOC As TextStream - - Set tsSOC = myFSOSOC.OpenTextFile(File1.Path & "\" & socname, ForWriting, True) - tsSOC.Close - Set myFSOSOC = Nothing - - MsgBox "Blank SOC named " & socname & " created in " & File1.Path, vbOKOnly, "Success!" - End If -End Sub - -Private Sub cmdEditCutscenes_Click() - frmCutsceneEdit.Show vbModal, Me -End Sub - -Private Sub cmdEmblemEdit_Click() - frmEmblemEdit.Show vbModal, Me -End Sub - -Private Sub cmdHelp_Click() - frmHelp.Show vbModal, Me -End Sub - -Private Sub cmdHUDEdit_Click() - frmHUDEdit.Show vbModal, Me -End Sub - -Private Sub cmdLevelHeader_Click() - frmLevelHeader.Show vbModal, Me -End Sub - -Private Sub cmdMaincfg_Click() - frmMaincfg.Show vbModal, Me -End Sub - -Private Sub cmdSoundEdit_Click() - frmSoundEdit.Show vbModal, Me -End Sub - -Private Sub cmdStateEdit_Click() - frmStateEdit.Show vbModal, Me -End Sub - -Private Sub cmdThingEdit_Click() - frmThingEdit.Show vbModal, Me -End Sub - -Private Sub cmdUnlockables_Click() - frmUnlockablesEdit.Show vbModal, Me -End Sub - -Private Sub Dir1_Change() - SourcePath = Dir1.Path -End Sub - -Private Sub Dir2_Change() - File1.Path = Dir2.Path -End Sub - -Private Sub Drive1_Change() - Dir1.Path = Drive1.Drive -End Sub - -Private Sub Drive2_Change() - Dir2.Path = Drive2.Drive -End Sub - -Private Sub File1_DblClick() - SOCTemp = File1.Path & "\" & "socedit.tmp" - SOCFile = File1.Path & "\" & File1.List(File1.ListIndex) - MsgBox "You are now using the file: " & vbCrLf & SOCFile - cmdLevelHeader.Enabled = True - cmdThingEdit.Enabled = True - cmdStateEdit.Enabled = True - cmdHUDEdit.Enabled = True - cmdMaincfg.Enabled = True - cmdEmblemEdit.Enabled = True - cmdSoundEdit.Enabled = True - cmdCharacterEdit.Enabled = True - cmdEditCutscenes.Enabled = True - cmdAuthor.Enabled = True - cmdUnlockables.Enabled = True - lblAuthor.Caption = "Modification By: " & GetAuthor -End Sub - -Private Sub Form_Load() - SourcePath = App.Path - Dir1.Path = SourcePath -End Sub - -Private Function GetAuthor() As String - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "MODBY" Then - GetAuthor = word2 - Exit Do - End If - Loop - - ts.Close - Set myFSO = Nothing -End Function - -Private Sub WriteAuthor(Remove As Boolean, ModderName As String) - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - 'If the entry exists in the SOC, delete it. - If word <> "MODBY" Then - tsTarget.WriteLine line - End If - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If Remove = False Then - If line <> "" Then tsTarget.WriteLine "" - - tsTarget.WriteLine "ModBy " & ModderName - End If - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - If Remove = True Then - MsgBox "Name removed." - Else - MsgBox "Name Saved." - End If -End Sub - diff --git a/tools/SOCEdit/frmHub.frx b/tools/SOCEdit/frmHub.frx deleted file mode 100644 index 176491ab6..000000000 Binary files a/tools/SOCEdit/frmHub.frx and /dev/null differ diff --git a/tools/SOCEdit/frmLevelHeader.frm b/tools/SOCEdit/frmLevelHeader.frm deleted file mode 100644 index e30acd581..000000000 --- a/tools/SOCEdit/frmLevelHeader.frm +++ /dev/null @@ -1,839 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmLevelHeader - Caption = "Level Header Info" - ClientHeight = 5250 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 7650 - Icon = "frmLevelHeader.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 5250 - ScaleWidth = 7650 - StartUpPosition = 3 'Windows Default - Begin VB.TextBox txtRunSOC - Height = 285 - Left = 6240 - MaxLength = 8 - TabIndex = 49 - Top = 4680 - Width = 1215 - End - Begin VB.CheckBox chkLevelSelect - Caption = "Show on Host Game selection menu" - Height = 375 - Left = 1680 - TabIndex = 48 - Top = 4800 - Width = 1935 - End - Begin VB.CheckBox chkTimeAttack - Caption = "Include in Time Attack calculations" - Height = 255 - Left = 1680 - TabIndex = 47 - Top = 4440 - Width = 2775 - End - Begin VB.CheckBox chkNoReload - Caption = "Retain level state when player dies." - Height = 255 - Left = 1680 - TabIndex = 46 - Top = 4080 - Width = 2895 - End - Begin VB.CommandButton cmdSave - Caption = "&Save Map" - Height = 735 - Left = 120 - Style = 1 'Graphical - TabIndex = 45 - Top = 4440 - Width = 1215 - End - Begin VB.CommandButton cmdRename - Caption = "&Rename Map" - Height = 375 - Left = 120 - TabIndex = 44 - Top = 3960 - Width = 1215 - End - Begin VB.CommandButton cmdDelete - Caption = "&Delete Map" - Height = 375 - Left = 120 - TabIndex = 43 - Top = 3480 - Width = 1215 - End - Begin VB.CommandButton cmdAddMap - Caption = "&Add Map" - Height = 375 - Left = 120 - TabIndex = 42 - Top = 3000 - Width = 1215 - End - Begin VB.CheckBox chkNossmusic - Caption = "Disable Super Sonic music changes" - Height = 255 - Left = 4560 - TabIndex = 29 - Top = 1200 - Width = 2895 - End - Begin VB.CheckBox chkHidden - Caption = "Don't show on level selection menu" - Height = 255 - Left = 4560 - TabIndex = 28 - Top = 480 - Width = 2895 - End - Begin VB.TextBox txtCountdown - Height = 285 - Left = 6360 - MaxLength = 3 - TabIndex = 26 - Top = 840 - Width = 735 - End - Begin VB.TextBox txtCutscenenum - Height = 285 - Left = 4440 - MaxLength = 3 - TabIndex = 25 - Top = 3720 - Width = 495 - End - Begin VB.TextBox txtPrecutscenenum - Height = 285 - Left = 2640 - MaxLength = 3 - TabIndex = 22 - Top = 3720 - Width = 495 - End - Begin VB.CheckBox chkScriptislump - Caption = "Script is a lump in WAD, not a file" - Height = 255 - Left = 1680 - TabIndex = 21 - Top = 3360 - Width = 2775 - End - Begin VB.TextBox txtScriptname - Height = 285 - Left = 2640 - MaxLength = 191 - TabIndex = 19 - Top = 3000 - Width = 1455 - End - Begin VB.TextBox txtSkynum - Height = 285 - Left = 2640 - MaxLength = 4 - TabIndex = 17 - Top = 2640 - Width = 495 - End - Begin VB.ComboBox cmbWeather - Height = 315 - ItemData = "frmLevelHeader.frx":0442 - Left = 2640 - List = "frmLevelHeader.frx":0458 - TabIndex = 15 - Top = 2280 - Width = 2295 - End - Begin VB.TextBox txtForcecharacter - Height = 285 - Left = 2640 - MaxLength = 2 - TabIndex = 13 - Top = 1920 - Width = 495 - End - Begin VB.ComboBox cmbMusicslot - Height = 315 - Left = 2640 - TabIndex = 11 - Top = 1560 - Width = 1815 - End - Begin VB.TextBox txtNextlevel - Height = 285 - Left = 2640 - MaxLength = 4 - TabIndex = 9 - Top = 1200 - Width = 615 - End - Begin VB.Frame frmTypeOfLevel - Caption = "Type of Level" - Height = 2775 - Left = 5040 - TabIndex = 8 - Top = 1680 - Width = 2535 - Begin VB.CheckBox chkTypeoflevel - Caption = "Christmas" - Height = 255 - Index = 11 - Left = 1440 - TabIndex = 41 - Tag = "1024" - Top = 960 - Width = 975 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "2D" - Height = 255 - Index = 10 - Left = 1440 - TabIndex = 40 - Tag = "512" - Top = 720 - Width = 735 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "Mario" - Height = 255 - Index = 9 - Left = 120 - TabIndex = 39 - Tag = "256" - Top = 2400 - Width = 1455 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "Sonic Adventure" - Height = 255 - Index = 8 - Left = 120 - TabIndex = 38 - Tag = "128" - Top = 2160 - Width = 1575 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "NiGHTS" - Height = 255 - Index = 7 - Left = 120 - TabIndex = 37 - Tag = "64" - Top = 1920 - Width = 1335 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "Chaos" - Height = 255 - Index = 6 - Left = 120 - TabIndex = 36 - Tag = "32" - Top = 1680 - Width = 1455 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "Capture the Flag" - Height = 255 - Index = 5 - Left = 120 - TabIndex = 35 - Tag = "16" - Top = 1440 - Width = 1695 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "Tag" - Height = 255 - Index = 4 - Left = 120 - TabIndex = 34 - Tag = "8" - Top = 1200 - Width = 1215 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "Match" - Height = 255 - Index = 3 - Left = 120 - TabIndex = 33 - Tag = "4" - Top = 960 - Width = 855 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "Race" - Height = 255 - Index = 2 - Left = 120 - TabIndex = 32 - Tag = "2" - Top = 720 - Width = 855 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "Cooperative" - Height = 255 - Index = 1 - Left = 120 - TabIndex = 31 - Tag = "1" - Top = 480 - Width = 1215 - End - Begin VB.CheckBox chkTypeoflevel - Caption = "Single Player" - Height = 255 - Index = 0 - Left = 120 - TabIndex = 30 - Tag = "4096" - Top = 240 - Width = 1215 - End - End - Begin VB.CheckBox chkNozone - Caption = "Don't show ""ZONE"" after Level Name" - Height = 255 - Left = 4560 - TabIndex = 7 - Top = 120 - Width = 3015 - End - Begin VB.TextBox txtAct - Height = 285 - Left = 2640 - MaxLength = 2 - TabIndex = 5 - Top = 840 - Width = 495 - End - Begin VB.TextBox txtInterscreen - Height = 285 - Left = 2640 - MaxLength = 8 - TabIndex = 3 - Top = 480 - Width = 1335 - End - Begin VB.ListBox lstMaps - Height = 2790 - Left = 120 - Sorted = -1 'True - TabIndex = 2 - Top = 120 - Width = 1215 - End - Begin VB.TextBox txtLevelName - Height = 285 - Left = 2640 - MaxLength = 32 - TabIndex = 0 - Top = 120 - Width = 1815 - End - Begin VB.Label lblRunSOC - Alignment = 1 'Right Justify - Caption = "Run SOC at level load (lump name):" - Height = 495 - Left = 4440 - TabIndex = 50 - Top = 4560 - Width = 1695 - End - Begin VB.Label lblCountdown - Alignment = 1 'Right Justify - Caption = "Level Timer (seconds):" - Height = 255 - Left = 4560 - TabIndex = 27 - Top = 840 - Width = 1695 - End - Begin VB.Label lblCutscenenum - Alignment = 1 'Right Justify - Caption = "Cutscene to play after level:" - Height = 495 - Left = 3240 - TabIndex = 24 - Top = 3600 - Width = 1095 - End - Begin VB.Label lblPrecutscenenum - Alignment = 1 'Right Justify - Caption = "Cutscene to play before level:" - Height = 375 - Left = 1320 - TabIndex = 23 - Top = 3600 - Width = 1215 - End - Begin VB.Label lblScriptName - Alignment = 1 'Right Justify - Caption = "Script Name:" - Height = 255 - Left = 1440 - TabIndex = 20 - Top = 3000 - Width = 1095 - End - Begin VB.Label lblSkynum - Alignment = 1 'Right Justify - Caption = "Sky #:" - Height = 255 - Left = 1800 - TabIndex = 18 - Top = 2640 - Width = 735 - End - Begin VB.Label Label1 - Alignment = 1 'Right Justify - Caption = "Weather:" - Height = 255 - Left = 1680 - TabIndex = 16 - Top = 2280 - Width = 855 - End - Begin VB.Label lblForcecharacter - Caption = "Force Character #:" - Height = 375 - Left = 1440 - TabIndex = 14 - Top = 1800 - Width = 1095 - End - Begin VB.Label lblMusicslot - Alignment = 1 'Right Justify - Caption = "Music:" - Height = 255 - Left = 1800 - TabIndex = 12 - Top = 1560 - Width = 735 - End - Begin VB.Label lblNextlevel - Alignment = 1 'Right Justify - Caption = "Next Level:" - Height = 255 - Left = 1440 - TabIndex = 10 - Top = 1200 - Width = 1095 - End - Begin VB.Label lblAct - Alignment = 1 'Right Justify - Caption = "Act:" - Height = 255 - Left = 2040 - TabIndex = 6 - Top = 840 - Width = 495 - End - Begin VB.Label lblInterscreen - Alignment = 1 'Right Justify - Caption = "Intermission BG:" - Height = 255 - Left = 1320 - TabIndex = 4 - Top = 480 - Width = 1215 - End - Begin VB.Label lblLevelName - Alignment = 1 'Right Justify - Caption = "Level Name:" - Height = 255 - Left = 1560 - TabIndex = 1 - Top = 120 - Width = 975 - End -End -Attribute VB_Name = "frmLevelHeader" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmdAddMap_Click() - Dim Response As String - Dim NewNum As Integer - - Response$ = InputBox("Enter the new level (NUMBER ONLY):") - - If Response = "" Then - Exit Sub - End If - - NewNum = Val(TrimComplete(Response)) - - lstMaps.AddItem "Level " & NewNum - lstMaps.ListIndex = lstMaps.ListCount - 1 -End Sub - -Private Sub cmdDelete_Click() - Dim i As Integer - - If MsgBox("Delete this level header?", vbYesNo) = vbNo Then - Exit Sub - End If - - i = InStr(lstMaps.List(lstMaps.ListIndex), " ") + 1 - - i = Mid(lstMaps.List(lstMaps.ListIndex), i, Len(lstMaps.List(lstMaps.ListIndex)) - i + 1) - i = Val(i) - Call WriteLevel(True, i) - lstMaps.RemoveItem lstMaps.ListIndex - - If lstMaps.ListCount > 0 Then - lstMaps.ListIndex = 0 - End If -End Sub - -Private Sub cmdRename_Click() - Dim Response As String - Dim NewNum As Integer - Dim i As Integer - - Response$ = InputBox("Rename level to (NUMBER ONLY):") - - If Response = "" Then - Exit Sub - End If - - NewNum = Val(TrimComplete(Response)) - - i = InStr(lstMaps.List(lstMaps.ListIndex), " ") + 1 - - i = Mid(lstMaps.List(lstMaps.ListIndex), i, Len(lstMaps.List(lstMaps.ListIndex)) - i + 1) - i = Val(i) - Call WriteLevel(True, i) - lstMaps.List(lstMaps.ListIndex) = "Level " & NewNum - Call cmdSave_Click -End Sub - -Private Sub cmdSave_Click() - Dim i As Integer - - i = InStr(lstMaps.List(lstMaps.ListIndex), " ") + 1 - - i = Val(Mid(lstMaps.List(lstMaps.ListIndex), i, Len(lstMaps.List(lstMaps.ListIndex)) - i + 1)) - Call WriteLevel(False, i) -End Sub - -Private Sub Form_Load() - Call LoadMusic - Call LoadSOCMaps - If lstMaps.ListCount > 0 Then lstMaps.ListIndex = 0 -End Sub - -Private Sub LoadSOCMaps() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - - lstMaps.Clear - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "LEVEL" Then - lstMaps.AddItem ("Level " & Val(word2)) - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub LoadMusic() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim addstring As String - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("sounds.h", ForReading, False) - - Do While InStr(ts.ReadLine, "Music list (don't edit this comment!)") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - cmbMusicslot.Clear - - Do While InStr(line, "NUMMUSIC") = 0 - startclip = InStr(line, "mus_") - If InStr(line, "mus_") <> 0 Then - endclip = InStr(line, ",") - line = Mid(line, startclip, endclip - startclip) - addstring = number & " - " & line - cmbMusicslot.AddItem addstring - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub ClearForm() - Dim j As Integer - - txtLevelName.Text = "" - txtInterscreen.Text = "" - txtAct.Text = "" - txtNextlevel.Text = "" - cmbMusicslot.Text = "" - txtForcecharacter.Text = "" - cmbWeather.Text = "" - txtSkynum.Text = "" - txtScriptname.Text = "" - chkScriptislump.Value = 0 - txtPrecutscenenum.Text = "" - txtCutscenenum.Text = "" - txtRunSOC.Text = "" - chkNozone.Value = 0 - chkHidden.Value = 0 - txtCountdown.Text = "" - chkNossmusic.Value = 0 - chkNoReload.Value = 0 - chkTimeAttack.Value = 0 - chkLevelSelect = 0 - - For j = 0 To 11 - chkTypeoflevel(j).Value = 0 - Next j -End Sub - -Private Sub lstMaps_Click() - Dim startclip As Integer - Call ClearForm - startclip = InStr(lstMaps.List(lstMaps.ListIndex), " ") - Call LoadSOCMapInfo(Val(Mid(lstMaps.List(lstMaps.ListIndex), startclip + 1, Len(lstMaps.List(lstMaps.ListIndex))))) -End Sub - -Private Sub LoadSOCMapInfo(num As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - If word = "LEVEL" Then - If Val(word2) = num Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondTokenEqual(line)) - - If word = "LEVELNAME" Then - txtLevelName.Text = word2 - ElseIf word = "INTERSCREEN" Then - txtInterscreen.Text = word2 - ElseIf word = "ACT" Then - txtAct.Text = Val(word2) - ElseIf word = "NOZONE" Then - chkNozone.Value = Val(word2) - ElseIf word = "TYPEOFLEVEL" Then - ProcessMapFlags (Val(word2)) - ElseIf word = "NEXTLEVEL" Then - txtNextlevel.Text = Val(word2) - ElseIf word = "MUSICSLOT" Then - cmbMusicslot.ListIndex = Val(word2) - ElseIf word = "FORCECHARACTER" Then - txtForcecharacter.Text = Val(word2) - ElseIf word = "WEATHER" Then - cmbWeather.ListIndex = Val(word2) - ElseIf word = "SKYNUM" Then - txtSkynum.Text = Val(word2) - ElseIf word = "SCRIPTNAME" Then - txtScriptname.Text = word2 - ElseIf word = "SCRIPTISLUMP" Then - chkScriptislump.Value = Val(word2) - ElseIf word = "PRECUTSCENENUM" Then - txtPrecutscenenum.Text = Val(word2) - ElseIf word = "CUTSCENENUM" Then - txtCutscenenum.Text = Val(word2) - ElseIf word = "COUNTDOWN" Then - txtCountdown.Text = Val(word2) - ElseIf word = "HIDDEN" Then - chkHidden.Value = Val(word2) - ElseIf word = "NOSSMUSIC" Then - chkNossmusic.Value = Val(word2) - ElseIf word = "NORELOAD" Then - chkNoReload.Value = Val(word2) - ElseIf word = "TIMEATTACK" Then - chkTimeAttack.Value = Val(word2) - ElseIf word = "LEVELSELECT" Then - chkLevelSelect.Value = Val(word2) - ElseIf word = "RUNSOC" Then - txtRunSOC.Text = word2 - ElseIf Len(line) > 0 And Left(line, 1) <> "#" Then - MsgBox "Error in SOC!" & vbCrLf & "Unknown line: " & line - End If - Loop - Exit Do - End If - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub ProcessMapFlags(flags As Long) - Dim j As Integer - - For j = 0 To 11 - If flags And chkTypeoflevel(j).Tag Then - chkTypeoflevel(j).Value = 1 - Else - chkTypeoflevel(j).Value = 0 - End If - Next j -End Sub - -Private Sub WriteLevel(Remove As Boolean, Mapnum As Integer) - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim flags As Long - Dim i As Integer - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - i = InStr(lstMaps.List(lstMaps.ListIndex), " ") + 1 - - i = Mid(lstMaps.List(lstMaps.ListIndex), i, Len(lstMaps.List(lstMaps.ListIndex)) - i + 1) - i = Val(i) - 'If the current level exists in the SOC, delete it. - If word = "LEVEL" And Val(word2) = i Then - Do While Len(TrimComplete(tsSource.ReadLine)) > 0 And Not (tsSource.AtEndOfStream) - Loop - Else - tsTarget.WriteLine line - End If - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If Remove = False Then - If line <> "" Then tsTarget.WriteLine "" - - tsTarget.WriteLine UCase(lstMaps.List(lstMaps.ListIndex)) - txtLevelName.Text = TrimComplete(txtLevelName.Text) - txtInterscreen.Text = TrimComplete(txtInterscreen.Text) - txtAct.Text = TrimComplete(txtAct.Text) - txtNextlevel.Text = TrimComplete(txtNextlevel.Text) - cmbMusicslot.Text = TrimComplete(cmbMusicslot.Text) - txtForcecharacter.Text = TrimComplete(txtForcecharacter.Text) - cmbWeather.Text = TrimComplete(cmbWeather.Text) - txtSkynum.Text = TrimComplete(txtSkynum.Text) - txtScriptname.Text = TrimComplete(txtScriptname.Text) - txtPrecutscenenum.Text = TrimComplete(txtPrecutscenenum.Text) - txtCutscenenum.Text = TrimComplete(txtCutscenenum.Text) - txtCountdown.Text = TrimComplete(txtCountdown.Text) - txtRunSOC.Text = TrimComplete(txtRunSOC.Text) - - If txtLevelName.Text <> "" Then tsTarget.WriteLine "LEVELNAME = " & txtLevelName.Text - If txtInterscreen.Text <> "" Then tsTarget.WriteLine "INTERSCREEN = " & txtInterscreen.Text - If txtAct.Text <> "" Then tsTarget.WriteLine "ACT = " & Val(txtAct.Text) - If txtNextlevel.Text <> "" Then tsTarget.WriteLine "NEXTLEVEL = " & Val(txtNextlevel.Text) - If cmbMusicslot.Text <> "" Then tsTarget.WriteLine "MUSICSLOT = " & cmbMusicslot.ListIndex - If txtForcecharacter.Text <> "" Then tsTarget.WriteLine "FORCECHARACTER = " & Val(txtForcecharacter.Text) - If cmbWeather.Text <> "" Then tsTarget.WriteLine "WEATHER = " & cmbWeather.ListIndex - If txtSkynum.Text <> "" Then tsTarget.WriteLine "SKYNUM = " & Val(txtSkynum.Text) - If txtScriptname.Text <> "" Then tsTarget.WriteLine "SCRIPTNAME = " & txtScriptname.Text - If txtPrecutscenenum.Text <> "" Then tsTarget.WriteLine "PRECUTSCENENUM = " & Val(txtPrecutscenenum.Text) - If txtCutscenenum.Text <> "" Then tsTarget.WriteLine "CUTSCENENUM = " & Val(txtCutscenenum.Text) - If txtCountdown.Text <> "" Then tsTarget.WriteLine "COUNTDOWN = " & Val(txtCountdown.Text) - If chkScriptislump.Value = 1 Then tsTarget.WriteLine "SCRIPTISLUMP = 1" - If chkNozone.Value = 1 Then tsTarget.WriteLine "NOZONE = 1" - If chkHidden.Value = 1 Then tsTarget.WriteLine "HIDDEN = 1" - If chkNossmusic.Value = 1 Then tsTarget.WriteLine "NOSSMUSIC = 1" - If chkNoReload.Value = 1 Then tsTarget.WriteLine "NORELOAD = 1" - If chkTimeAttack.Value = 1 Then tsTarget.WriteLine "TIMEATTACK = 1" - If chkLevelSelect.Value = 1 Then tsTarget.WriteLine "LEVELSELECT = 1" - If txtRunSOC.Text <> "" Then tsTarget.WriteLine "RUNSOC = " & txtRunSOC.Text - - flags = 0 - For i = 0 To 11 - If chkTypeoflevel(i).Value = 1 Then - flags = flags + Val(chkTypeoflevel(i).Tag) - End If - Next - - If flags > 0 Then tsTarget.WriteLine "TYPEOFLEVEL = " & flags - End If - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - If Remove = True Then - MsgBox "Level Deleted." - Else - MsgBox "Level Saved." - End If -End Sub - diff --git a/tools/SOCEdit/frmLevelHeader.frx b/tools/SOCEdit/frmLevelHeader.frx deleted file mode 100644 index fe81f4413..000000000 Binary files a/tools/SOCEdit/frmLevelHeader.frx and /dev/null differ diff --git a/tools/SOCEdit/frmMaincfg.frm b/tools/SOCEdit/frmMaincfg.frm deleted file mode 100644 index 3efca74a8..000000000 --- a/tools/SOCEdit/frmMaincfg.frm +++ /dev/null @@ -1,644 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmMaincfg - Caption = "Global Game Settings" - ClientHeight = 5295 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 9360 - Icon = "frmMaincfg.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 5295 - ScaleWidth = 9360 - StartUpPosition = 3 'Windows Default - Begin VB.Frame frmReset - Caption = "Reset Data (Be sure this is at the TOP of your SOC)" - Height = 975 - Left = 4800 - TabIndex = 43 - Top = 4200 - Width = 4455 - Begin VB.CheckBox chkReset - Caption = "Thing Properties" - Height = 255 - Index = 2 - Left = 1680 - TabIndex = 46 - Tag = "4" - Top = 240 - Width = 1575 - End - Begin VB.CheckBox chkReset - Caption = "States" - Height = 255 - Index = 1 - Left = 240 - TabIndex = 45 - Tag = "2" - Top = 600 - Width = 1335 - End - Begin VB.CheckBox chkReset - Caption = "Sprite Names" - Height = 255 - Index = 0 - Left = 240 - TabIndex = 44 - Tag = "1" - Top = 240 - Width = 1575 - End - End - Begin VB.CheckBox chkDisableSpeedAdjust - Caption = "Disable speed adjustment of player animations depending on how fast they are moving." - Height = 375 - Left = 1080 - TabIndex = 42 - Top = 4200 - Width = 3615 - End - Begin VB.TextBox txtTitleScrollSpeed - Height = 285 - Left = 4080 - TabIndex = 41 - Top = 1920 - Width = 495 - End - Begin VB.CheckBox chkLoopTitle - Caption = "Loop the title screen music?" - Height = 195 - Left = 1080 - TabIndex = 39 - Top = 3840 - Width = 2415 - End - Begin VB.TextBox txtCreditsCutscene - Height = 285 - Left = 4080 - TabIndex = 37 - Top = 1560 - Width = 495 - End - Begin VB.CommandButton cmdSave - Caption = "&Save" - Height = 495 - Left = 120 - TabIndex = 36 - Top = 3120 - Width = 735 - End - Begin VB.CommandButton cmdReload - Caption = "&Reload" - Height = 495 - Left = 120 - TabIndex = 35 - Top = 2520 - Width = 735 - End - Begin VB.TextBox txtNumemblems - Height = 285 - Left = 4080 - MaxLength = 2 - TabIndex = 33 - Top = 3360 - Width = 495 - End - Begin VB.TextBox txtGamedata - Height = 285 - Left = 3240 - MaxLength = 64 - TabIndex = 31 - Top = 2880 - Width = 1335 - End - Begin VB.TextBox txtExeccfg - Height = 285 - Left = 3240 - TabIndex = 9 - Top = 2400 - Width = 1335 - End - Begin VB.Frame frmTimers - Caption = "Timers (35 = 1 second)" - Height = 3975 - Left = 4800 - TabIndex = 8 - Top = 120 - Width = 4455 - Begin VB.TextBox txtGameovertics - Height = 285 - Left = 3000 - TabIndex = 29 - Top = 3480 - Width = 1335 - End - Begin VB.TextBox txtHelpertics - Height = 285 - Left = 3000 - TabIndex = 27 - Top = 3120 - Width = 1335 - End - Begin VB.TextBox txtParalooptics - Height = 285 - Left = 3000 - TabIndex = 25 - Top = 2760 - Width = 1335 - End - Begin VB.TextBox txtExtralifetics - Height = 285 - Left = 3000 - TabIndex = 23 - Top = 2400 - Width = 1335 - End - Begin VB.TextBox txtSpacetimetics - Height = 285 - Left = 3000 - TabIndex = 21 - Top = 2040 - Width = 1335 - End - Begin VB.TextBox txtUnderwatertics - Height = 285 - Left = 3000 - TabIndex = 19 - Top = 1680 - Width = 1335 - End - Begin VB.TextBox txtTailsflytics - Height = 285 - Left = 3000 - TabIndex = 17 - Top = 1320 - Width = 1335 - End - Begin VB.TextBox txtFlashingtics - Height = 285 - Left = 3000 - TabIndex = 15 - Top = 960 - Width = 1335 - End - Begin VB.TextBox txtSneakertics - Height = 285 - Left = 3000 - TabIndex = 13 - Top = 600 - Width = 1335 - End - Begin VB.TextBox txtInvulntics - Height = 285 - Left = 3000 - TabIndex = 11 - Top = 240 - Width = 1335 - End - Begin VB.Label lblGameovertics - Alignment = 1 'Right Justify - Caption = "Game Over Screen Time:" - Height = 255 - Left = 960 - TabIndex = 30 - Top = 3480 - Width = 1935 - End - Begin VB.Label lblHelpertics - Alignment = 1 'Right Justify - Caption = "NiGHTS Nightopian Helper Time:" - Height = 255 - Left = 240 - TabIndex = 28 - Top = 3120 - Width = 2655 - End - Begin VB.Label lblParalooptics - Alignment = 1 'Right Justify - Caption = "NiGHTS Paraloop Powerup Time:" - Height = 255 - Left = 360 - TabIndex = 26 - Top = 2760 - Width = 2535 - End - Begin VB.Label lblExtralifetics - Alignment = 1 'Right Justify - Caption = "Extra Life Music Duration:" - Height = 255 - Left = 960 - TabIndex = 24 - Top = 2400 - Width = 1935 - End - Begin VB.Label lblSpacetimetics - Alignment = 1 'Right Justify - Caption = "Space Breath Timeout:" - Height = 255 - Left = 1200 - TabIndex = 22 - Top = 2040 - Width = 1695 - End - Begin VB.Label lblUnderwatertics - Alignment = 1 'Right Justify - Caption = "Underwater Breath Timeout:" - Height = 255 - Left = 840 - TabIndex = 20 - Top = 1680 - Width = 2055 - End - Begin VB.Label lblTailsflytics - Alignment = 1 'Right Justify - Caption = "Tails Flying Time:" - Height = 255 - Left = 1440 - TabIndex = 18 - Top = 1320 - Width = 1455 - End - Begin VB.Label lblFlashingtics - Alignment = 1 'Right Justify - Caption = "Flashing Time After Being Hit:" - Height = 255 - Left = 360 - TabIndex = 16 - Top = 960 - Width = 2535 - End - Begin VB.Label lblSneakertics - Alignment = 1 'Right Justify - Caption = "Super Sneakers Time:" - Height = 255 - Left = 240 - TabIndex = 14 - Top = 600 - Width = 2655 - End - Begin VB.Label lblInvulntics - Alignment = 1 'Right Justify - Caption = "Invincibility Time:" - Height = 255 - Left = 360 - TabIndex = 12 - Top = 240 - Width = 2535 - End - End - Begin VB.TextBox txtIntrotoplay - Height = 285 - Left = 4080 - TabIndex = 6 - Top = 1200 - Width = 495 - End - Begin VB.TextBox txtRacestage_start - Height = 285 - Left = 4080 - MaxLength = 4 - TabIndex = 4 - Top = 840 - Width = 495 - End - Begin VB.TextBox txtSpstage_start - Height = 285 - Left = 4080 - MaxLength = 4 - TabIndex = 2 - Top = 480 - Width = 495 - End - Begin VB.TextBox txtSstage_start - Height = 285 - Left = 4080 - MaxLength = 4 - TabIndex = 0 - Top = 120 - Width = 495 - End - Begin VB.Label lblTitleScrollSpeed - Alignment = 1 'Right Justify - Caption = "Scroll speed of title background:" - Height = 255 - Left = 1560 - TabIndex = 40 - Top = 1920 - Width = 2415 - End - Begin VB.Label lblCreditsCutscene - Alignment = 1 'Right Justify - Caption = "Cutscene # to replace credits with:" - Height = 255 - Left = 1080 - TabIndex = 38 - Top = 1560 - Width = 2895 - End - Begin VB.Label lblNumemblems - Alignment = 1 'Right Justify - Caption = "# of LEVEL Emblems (Gamedata field must also be filled out):" - Height = 375 - Left = 1440 - TabIndex = 34 - Top = 3240 - Width = 2535 - End - Begin VB.Label lblGamedata - Alignment = 1 'Right Justify - Caption = "Gamedata file (to save mod emblems and time data):" - Height = 375 - Left = 960 - TabIndex = 32 - Top = 2760 - Width = 2175 - End - Begin VB.Label lblExeccfg - Alignment = 1 'Right Justify - Caption = "CFG file to instantly execute upon loading this SOC:" - Height = 495 - Left = 960 - TabIndex = 10 - Top = 2280 - Width = 2175 - End - Begin VB.Label lblIntrotoplay - Alignment = 1 'Right Justify - Caption = "Cutscene # to use for introduction:" - Height = 255 - Left = 1440 - TabIndex = 7 - Top = 1200 - Width = 2535 - End - Begin VB.Label lblRacestage_start - Alignment = 1 'Right Justify - Caption = "Racing mode starts/loops back to this map #:" - Height = 255 - Left = 720 - TabIndex = 5 - Top = 840 - Width = 3255 - End - Begin VB.Label lblSpstage_start - Alignment = 1 'Right Justify - Caption = "Single Player Game Starts on this map #:" - Height = 255 - Left = 1080 - TabIndex = 3 - Top = 480 - Width = 2895 - End - Begin VB.Label lblSstage_start - Alignment = 1 'Right Justify - Caption = "First Special Stage Map #:" - Height = 255 - Left = 2040 - TabIndex = 1 - Top = 120 - Width = 1935 - End -End -Attribute VB_Name = "frmMaincfg" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Private Sub cmdReload_Click() - Call Reload -End Sub - -Private Sub cmdSave_Click() - Call WriteSettings -End Sub - -Private Sub Form_Load() - Call Reload -End Sub - -Private Sub ClearForm() - Dim i As Integer - - txtSstage_start.Text = "" - txtSpstage_start.Text = "" - txtRacestage_start.Text = "" - txtIntrotoplay.Text = "" - txtExeccfg.Text = "" - txtGamedata.Text = "" - txtNumemblems.Text = "" - txtInvulntics.Text = "" - txtSneakertics.Text = "" - txtFlashingtics.Text = "" - txtTailsflytics.Text = "" - txtUnderwatertics.Text = "" - txtSpacetimetics.Text = "" - txtExtralifetics.Text = "" - txtParalooptics.Text = "" - txtHelpertics.Text = "" - txtGameovertics.Text = "" - txtCreditsCutscene.Text = "" - txtTitleScrollSpeed.Text = "" - chkLoopTitle.Value = 0 - chkDisableSpeedAdjust.Value = 0 - - For i = 0 To 2 - chkReset(i).Value = 0 - Next i -End Sub - -Private Sub Reload() - Call ClearForm - Call ReadSOCMaincfg -End Sub - -Private Sub ReadSOCMaincfg() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "MAINCFG" Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondTokenEqual(line)) - - If word = "SSTAGE_START" Then - txtSstage_start.Text = Val(word2) - ElseIf word = "SPSTAGE_START" Then - txtSpstage_start.Text = Val(word2) - ElseIf word = "RACESTAGE_START" Then - txtRacestage_start.Text = Val(word2) - ElseIf word = "INVULNTICS" Then - txtInvulntics.Text = Val(word2) - ElseIf word = "SNEAKERTICS" Then - txtSneakertics.Text = Val(word2) - ElseIf word = "FLASHINGTICS" Then - txtFlashingtics.Text = Val(word2) - ElseIf word = "TAILSFLYTICS" Then - txtTailsflytics.Text = Val(word2) - ElseIf word = "UNDERWATERTICS" Then - txtUnderwatertics.Text = Val(word2) - ElseIf word = "SPACETIMETICS" Then - txtSpacetimetics.Text = Val(word2) - ElseIf word = "EXTRALIFETICS" Then - txtExtralifetics.Text = Val(word2) - ElseIf word = "PARALOOPTICS" Then - txtParalooptics.Text = Val(word2) - ElseIf word = "HELPERTICS" Then - txtHelpertics.Text = Val(word2) - ElseIf word = "GAMEOVERTICS" Then - txtGameovertics.Text = Val(word2) - ElseIf word = "INTROTOPLAY" Then - txtIntrotoplay.Text = Val(word2) - ElseIf word = "CREDITSCUTSCENE" Then - txtCreditsCutscene.Text = Val(word2) - ElseIf word = "TITLESCROLLSPEED" Then - txtTitleScrollSpeed.Text = Val(word2) - ElseIf word = "LOOPTITLE" Then - chkLoopTitle.Value = Val(word2) - ElseIf word = "DISABLESPEEDADJUST" Then - chkDisableSpeedAdjust.Value = Val(word2) - ElseIf word = "GAMEDATA" Then - txtGamedata.Text = word2 - ElseIf word = "NUMEMBLEMS" Then - txtNumemblems.Text = Val(word2) - ElseIf word = "RESETDATA" Then - Dim resetflags As Integer - Dim z As Integer - - resetflags = Val(word2) - - For z = 0 To 2 - If resetflags And chkReset(z).Tag Then - chkReset(z).Value = 1 - Else - chkReset(z).Value = 0 - End If - Next z - ElseIf Len(line) > 0 And Left(line, 1) <> "#" Then - MsgBox "Error in SOC!" & vbCrLf & "Unknown line: " & line - End If - Loop - Exit Do - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub WriteSettings() - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim flags As Long - Dim i As Integer - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - 'If the category exists in the SOC, delete it. - If word = "MAINCFG" Then - Do While Len(TrimComplete(tsSource.ReadLine)) > 0 And Not (tsSource.AtEndOfStream) - Loop - Else - tsTarget.WriteLine line - End If - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If line <> "" Then tsTarget.WriteLine "" - - tsTarget.WriteLine "MAINCFG CATEGORY" - txtSstage_start.Text = TrimComplete(txtSstage_start.Text) - txtSpstage_start.Text = TrimComplete(txtSpstage_start.Text) - txtRacestage_start.Text = TrimComplete(txtRacestage_start.Text) - txtIntrotoplay.Text = TrimComplete(txtIntrotoplay.Text) - txtCreditsCutscene.Text = TrimComplete(txtCreditsCutscene.Text) - txtExeccfg.Text = TrimComplete(txtExeccfg.Text) - txtGamedata.Text = TrimComplete(txtGamedata.Text) - txtNumemblems.Text = TrimComplete(txtNumemblems.Text) - txtInvulntics.Text = TrimComplete(txtInvulntics.Text) - txtSneakertics.Text = TrimComplete(txtSneakertics.Text) - txtFlashingtics.Text = TrimComplete(txtFlashingtics.Text) - txtTailsflytics.Text = TrimComplete(txtTailsflytics.Text) - txtUnderwatertics.Text = TrimComplete(txtUnderwatertics.Text) - txtSpacetimetics.Text = TrimComplete(txtSpacetimetics.Text) - txtExtralifetics.Text = TrimComplete(txtExtralifetics.Text) - txtParalooptics.Text = TrimComplete(txtParalooptics.Text) - txtHelpertics.Text = TrimComplete(txtHelpertics.Text) - txtGameovertics.Text = TrimComplete(txtGameovertics.Text) - txtTitleScrollSpeed.Text = TrimComplete(txtTitleScrollSpeed.Text) - - If txtSstage_start.Text <> "" Then tsTarget.WriteLine "SSTAGE_START = " & Val(txtSstage_start.Text) - If txtSpstage_start.Text <> "" Then tsTarget.WriteLine "SPSTAGE_START = " & Val(txtSpstage_start.Text) - If txtRacestage_start.Text <> "" Then tsTarget.WriteLine "RACESTAGE_START = " & Val(txtRacestage_start.Text) - If txtIntrotoplay.Text <> "" Then tsTarget.WriteLine "INTROTOPLAY = " & Val(txtIntrotoplay.Text) - If txtCreditsCutscene.Text <> "" Then tsTarget.WriteLine "CREDITSCUTSCENE = " & Val(txtCreditsCutscene.Text) - If txtExeccfg.Text <> "" Then tsTarget.WriteLine "EXECCFG = " & txtExeccfg.Text - If txtGamedata.Text <> "" Then tsTarget.WriteLine "GAMEDATA = " & txtGamedata.Text - If txtNumemblems.Text <> "" Then - tsTarget.WriteLine "NUMEMBLEMS = " & Val(txtNumemblems.Text) - EditedNumemblems = True - End If - If txtInvulntics.Text <> "" Then tsTarget.WriteLine "INVULNTICS = " & Val(txtInvulntics.Text) - If txtSneakertics.Text <> "" Then tsTarget.WriteLine "SNEAKERTICS = " & Val(txtSneakertics.Text) - If txtFlashingtics.Text <> "" Then tsTarget.WriteLine "FLASHINGTICS = " & Val(txtFlashingtics.Text) - If txtTailsflytics.Text <> "" Then tsTarget.WriteLine "TAILSFLYTICS = " & Val(txtTailsflytics.Text) - If txtUnderwatertics.Text <> "" Then tsTarget.WriteLine "UNDERWATERTICS = " & Val(txtUnderwatertics.Text) - If txtSpacetimetics.Text <> "" Then tsTarget.WriteLine "SPACETIMETICS = " & Val(txtSpacetimetics.Text) - If txtExtralifetics.Text <> "" Then tsTarget.WriteLine "EXTRALIFETICS = " & Val(txtExtralifetics.Text) - If txtParalooptics.Text <> "" Then tsTarget.WriteLine "PARALOOPTICS = " & Val(txtParalooptics.Text) - If txtHelpertics.Text <> "" Then tsTarget.WriteLine "HELPERTICS = " & Val(txtHelpertics.Text) - If txtGameovertics.Text <> "" Then tsTarget.WriteLine "GAMEOVERTICS = " & Val(txtGameovertics.Text) - If txtTitleScrollSpeed.Text <> "" Then tsTarget.WriteLine "TITLESCROLLSPEED = " & Val(txtTitleScrollSpeed.Text) - If chkLoopTitle.Value = 1 Then tsTarget.WriteLine "LOOPTITLE = " & chkLoopTitle.Value - If chkDisableSpeedAdjust.Value = 1 Then tsTarget.WriteLine "DISABLESPEEDADJUST = " & chkDisableSpeedAdjust.Value - - flags = 0 - For i = 0 To 2 - If chkReset(i).Value = 1 Then - flags = flags + Val(chkReset(i).Tag) - End If - Next - - If flags > 0 Then tsTarget.WriteLine "RESETDATA = " & flags - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - MsgBox "Settings Saved." -End Sub - diff --git a/tools/SOCEdit/frmMaincfg.frx b/tools/SOCEdit/frmMaincfg.frx deleted file mode 100644 index 2ae367330..000000000 Binary files a/tools/SOCEdit/frmMaincfg.frx and /dev/null differ diff --git a/tools/SOCEdit/frmSoundEdit.frm b/tools/SOCEdit/frmSoundEdit.frm deleted file mode 100644 index c91d84ed8..000000000 --- a/tools/SOCEdit/frmSoundEdit.frm +++ /dev/null @@ -1,485 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmSoundEdit - Caption = "Sound Edit" - ClientHeight = 4995 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 6180 - Icon = "frmSoundEdit.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 4995 - ScaleWidth = 6180 - StartUpPosition = 3 'Windows Default - Begin VB.CommandButton cmdDelete - Caption = "&Delete sound from SOC" - Height = 495 - Left = 5040 - Style = 1 'Graphical - TabIndex = 13 - Top = 4320 - Width = 1095 - End - Begin VB.CommandButton cmdSave - Caption = "&Save" - Height = 495 - Left = 3840 - TabIndex = 6 - Top = 4320 - Width = 1095 - End - Begin VB.CommandButton cmdReload - Caption = "&Load Code Default" - Height = 495 - Left = 2640 - Style = 1 'Graphical - TabIndex = 5 - Top = 4320 - Width = 1095 - End - Begin VB.Frame frmSpecial - Caption = "Special Properties" - Height = 3375 - Left = 2640 - TabIndex = 4 - Top = 840 - Width = 3495 - Begin VB.CheckBox chkTotallySingle - Caption = "Make sure only one sound of this is playing at a time on any sound channel." - Height = 615 - Left = 120 - TabIndex = 12 - Tag = "1" - Top = 2640 - Width = 3255 - End - Begin VB.CheckBox chkEightEx - Caption = "Sound can be heard across 8x the distance" - Height = 375 - Left = 120 - TabIndex = 10 - Tag = "16" - Top = 2160 - Width = 2295 - End - Begin VB.CheckBox chkOutside - Caption = "Volume dependent on how close you are to outside" - Height = 375 - Left = 120 - TabIndex = 9 - Tag = "4" - Top = 360 - Width = 2295 - End - Begin VB.CheckBox chkFourEx - Caption = "Sound can be heard across 4x the distance" - Height = 375 - Left = 120 - TabIndex = 8 - Tag = "8" - Top = 1560 - Width = 2055 - End - Begin VB.CheckBox chkMultiple - Caption = "More than one of this sound can be played per object at a time (i.e., thunder)" - Height = 615 - Left = 120 - TabIndex = 7 - Tag = "2" - Top = 840 - Width = 2535 - End - Begin VB.Label Label1 - Caption = "Combine for 32x" - Height = 495 - Left = 2760 - TabIndex = 11 - Top = 1800 - Width = 615 - End - Begin VB.Line Line4 - X1 = 2400 - X2 = 2640 - Y1 = 2400 - Y2 = 2400 - End - Begin VB.Line Line2 - X1 = 2400 - X2 = 2640 - Y1 = 1800 - Y2 = 1800 - End - Begin VB.Line Line1 - X1 = 2640 - X2 = 2640 - Y1 = 2400 - Y2 = 1800 - End - End - Begin VB.ComboBox cmbPriority - Height = 315 - ItemData = "frmSoundEdit.frx":0442 - Left = 3360 - List = "frmSoundEdit.frx":0444 - TabIndex = 2 - Top = 120 - Width = 855 - End - Begin VB.CheckBox chkSingularity - Caption = "Only one can be played at a time per object." - Height = 255 - Left = 2640 - TabIndex = 1 - Top = 480 - Width = 3495 - End - Begin VB.ListBox lstSounds - Height = 4740 - Left = 120 - TabIndex = 0 - Top = 120 - Width = 2415 - End - Begin VB.Line Line3 - X1 = 0 - X2 = 720 - Y1 = 0 - Y2 = 0 - End - Begin VB.Label lblPriority - Alignment = 1 'Right Justify - Caption = "Priority:" - Height = 255 - Left = 2640 - TabIndex = 3 - Top = 120 - Width = 615 - End -End -Attribute VB_Name = "frmSoundEdit" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmdDelete_Click() - Call WriteSound(True) -End Sub - -Private Sub cmdReload_Click() - Call ClearForm - If InStr(lstSounds.List(lstSounds.ListIndex), "(free slot)") = 0 Then - Call LoadSoundInfo(lstSounds.ListIndex) - Else - MsgBox "Free slots do not have a code default." - End If -End Sub - -Private Sub cmdSave_Click() - Call WriteSound(False) -End Sub - -Private Sub Form_Load() - Call Reload -End Sub - -Private Sub ClearForm() - cmbPriority.Text = "" - chkSingularity.Value = 0 - chkOutside.Value = 0 - chkMultiple.Value = 0 - chkFourEx.Value = 0 - chkEightEx.Value = 0 - chkTotallySingle.Value = 0 -End Sub - -Private Sub Reload() - Call ClearForm - Call LoadCode - lstSounds.ListIndex = 0 -End Sub - -Private Sub LoadCode() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim addstring As String - Dim i As Integer, numfreeslots As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("sounds.h", ForReading, False) - - Do While InStr(ts.ReadLine, "List of sounds (don't modify this comment!)") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - lstSounds.Clear - - Do While InStr(line, "sfx_freeslot0") = 0 - startclip = InStr(line, "sfx_") - If InStr(line, "sfx_") <> 0 Then - endclip = InStr(line, ",") - line = Mid(line, startclip, endclip - startclip) - addstring = number & " - " & line - lstSounds.AddItem addstring - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - Set myFSO = Nothing - -'Populate the free slots! - numfreeslots = 800 - - For i = 1 To numfreeslots - If i < 10 Then - addstring = number & " - " & "sfx_fre00" & i & " (free slot)" - ElseIf i < 100 Then - addstring = number & " - " & "sfx_fre0" & i & " (free slot)" - Else - addstring = number & " - " & "sfx_fre" & i & " (free slot)" - End If - lstSounds.AddItem addstring - number = number + 1 - Next - - For i = 0 To 127 - cmbPriority.AddItem i - Next -End Sub - -Private Sub lstSounds_Click() - Call ClearForm - If InStr(lstSounds.List(lstSounds.ListIndex), "(free slot)") = 0 Then - Call LoadSoundInfo(lstSounds.ListIndex) - End If - Call LoadSOCSoundInfo(lstSounds.ListIndex) -End Sub - -Private Sub LoadSOCSoundInfo(SoundNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "SOUND" And Val(word2) = SoundNum Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondTokenEqual(line)) - - If word = "SINGULAR" Then - If Val(word2) = 1 Then - chkSingularity.Value = 1 - Else - chkSingularity.Value = 0 - End If - ElseIf word = "PRIORITY" Then - cmbPriority.Text = Val(word2) - ElseIf word = "FLAGS" Then - ProcessSoundFlags (Val(word2)) - ElseIf Len(line) > 0 And Left(line, 1) <> "#" Then - MsgBox "Error in SOC!" & vbCrLf & "Unknown line: " & line - End If - Loop - Exit Do - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub LoadSoundInfo(StateNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim token As String - Dim frame As Long - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("sounds.c", ForReading, False) - - Do While InStr(ts.ReadLine, "S_sfx[0] needs to be a dummy for odd reasons.") = 0 - Loop - - number = 0 - - Do While number <> StateNum - Do While InStr(ts.ReadLine, """") = 0 - Loop - number = number + 1 - Loop - - Do While InStr(line, """") = 0 - line = ts.ReadLine - Loop - - startclip = InStr(line, """") + 1 - line = Mid(line, startclip, Len(line) - startclip) - endclip = InStr(line, """") - 1 - token = TrimComplete(Left(line, endclip)) - - 'txtName.Text = line - - startclip = InStr(line, ",") + 1 - line = Mid(line, startclip, Len(line) - startclip) - endclip = InStr(line, ",") - 1 - token = TrimComplete(Left(line, endclip)) - - If token = "true" Then - chkSingularity.Value = 1 - Else - chkSingularity.Value = 0 - End If - - startclip = InStr(line, ",") + 1 - line = Mid(line, startclip, Len(line) - startclip) - endclip = InStr(line, ",") - 1 - token = TrimComplete(Left(line, endclip)) - cmbPriority.Text = token - - startclip = InStr(line, ",") + 1 - line = Mid(line, startclip, Len(line) - startclip) - endclip = InStr(line, ",") - 1 - token = TrimComplete(Left(line, endclip)) - - ProcessSoundFlags (Val(token)) - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub ProcessSoundFlags(flags As Long) - - chkTotallySingle.Value = 0 - chkMultiple.Value = 0 - chkOutside.Value = 0 - chkFourEx.Value = 0 - chkEightEx.Value = 0 - - If flags = -1 Then - Exit Sub - End If - - If flags And 1 Then - chkTotallySingle.Value = 1 - End If - - If flags And 2 Then - chkMultiple.Value = 1 - End If - - If flags And 4 Then - chkOutside.Value = 1 - End If - - If flags And 8 Then - chkFourEx.Value = 1 - End If - - If flags And 16 Then - chkEightEx.Value = 1 - End If - -End Sub - -Private Sub WriteSound(Remove As Boolean) - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim flags As Long - Dim soundfound As Boolean - - soundfound = False - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - 'If the current sound exists in the SOC, delete it. - If word = "SOUND" And Val(word2) = lstSounds.ListIndex Then - soundfound = True - Do While Len(TrimComplete(tsSource.ReadLine)) > 0 And Not (tsSource.AtEndOfStream) - Loop - Else - tsTarget.WriteLine line - End If - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If Remove = False Then - If line <> "" Then tsTarget.WriteLine "" - - tsTarget.WriteLine "SOUND " & lstSounds.ListIndex - cmbPriority.Text = TrimComplete(cmbPriority.Text) - If cmbPriority.Text <> "" Then tsTarget.WriteLine "PRIORITY = " & Val(cmbPriority.Text) - If chkSingularity.Value = 1 Then tsTarget.WriteLine "SINGULAR = 1" - - flags = 0 - - If chkOutside.Value = 1 Then flags = flags + Val(chkOutside.Tag) - If chkMultiple.Value = 1 Then flags = flags + Val(chkMultiple.Tag) - If chkFourEx.Value = 1 Then flags = flags + Val(chkFourEx.Tag) - If chkEightEx.Value = 1 Then flags = flags + Val(chkEightEx.Tag) - If chkTotallySingle.Value = 1 Then flags = flags + Val(chkTotallySingle.Tag) - - If flags > 0 Then tsTarget.WriteLine "FLAGS = " & flags - End If - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - If Remove = True Then - If soundfound = True Then - MsgBox "Sound removed from SOC." - Else - MsgBox "Sound not found in SOC." - End If - Else - MsgBox "Sound Saved." - End If -End Sub - diff --git a/tools/SOCEdit/frmSoundEdit.frx b/tools/SOCEdit/frmSoundEdit.frx deleted file mode 100644 index 980538679..000000000 Binary files a/tools/SOCEdit/frmSoundEdit.frx and /dev/null differ diff --git a/tools/SOCEdit/frmStateEdit.frm b/tools/SOCEdit/frmStateEdit.frm deleted file mode 100644 index 4eca5a1bc..000000000 --- a/tools/SOCEdit/frmStateEdit.frm +++ /dev/null @@ -1,940 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmStateEdit - Caption = "State Edit" - ClientHeight = 6750 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 8970 - Icon = "frmStateEdit.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 6750 - ScaleWidth = 8970 - StartUpPosition = 3 'Windows Default - Begin VB.TextBox lblVar2Desc - Height = 495 - Left = 4440 - Locked = -1 'True - MultiLine = -1 'True - ScrollBars = 2 'Vertical - TabIndex = 25 - Top = 3000 - Width = 4455 - End - Begin VB.TextBox lblVar1Desc - Height = 495 - Left = 4440 - Locked = -1 'True - MultiLine = -1 'True - ScrollBars = 2 'Vertical - TabIndex = 24 - Top = 2400 - Width = 4455 - End - Begin VB.TextBox lblActionDesc - Height = 735 - Left = 4440 - Locked = -1 'True - MultiLine = -1 'True - ScrollBars = 2 'Vertical - TabIndex = 23 - Top = 1560 - Width = 4455 - End - Begin VB.ListBox lstThings - Height = 450 - ItemData = "frmStateEdit.frx":0442 - Left = 7440 - List = "frmStateEdit.frx":0444 - TabIndex = 22 - Top = 6120 - Visible = 0 'False - Width = 975 - End - Begin VB.TextBox txtFuncVar2 - Height = 285 - Left = 7200 - TabIndex = 19 - Top = 3600 - Width = 1215 - End - Begin VB.TextBox txtFuncVar1 - Height = 285 - Left = 5520 - TabIndex = 18 - Top = 3600 - Width = 1095 - End - Begin VB.CommandButton cmdCopy - Caption = "&Copy state to..." - Height = 495 - Left = 6120 - Style = 1 'Graphical - TabIndex = 17 - Top = 6120 - Width = 1095 - End - Begin VB.CommandButton cmdDelete - Caption = "&Delete State from SOC" - Height = 495 - Left = 6120 - Style = 1 'Graphical - TabIndex = 16 - Top = 5520 - Width = 1095 - End - Begin VB.CommandButton cmdReload - Caption = "&Load Code Default" - Height = 495 - Left = 4920 - Style = 1 'Graphical - TabIndex = 15 - Top = 5520 - Width = 1095 - End - Begin VB.CommandButton cmdSave - Caption = "&Save" - Height = 495 - Left = 7320 - TabIndex = 14 - Top = 5520 - Width = 1095 - End - Begin VB.ComboBox cmbTranslucency - Height = 315 - ItemData = "frmStateEdit.frx":0446 - Left = 6720 - List = "frmStateEdit.frx":045C - TabIndex = 12 - Top = 5040 - Width = 1695 - End - Begin VB.CheckBox chkFullbright - Caption = "Make sprite full-brightness (unaffected by lighting)" - Height = 495 - Left = 6240 - TabIndex = 11 - Top = 4440 - Width = 2175 - End - Begin VB.ComboBox cmbNextstate - Height = 315 - Left = 6120 - TabIndex = 9 - Top = 3960 - Width = 2295 - End - Begin VB.ComboBox cmbAction - Height = 315 - Left = 6000 - TabIndex = 7 - Top = 1200 - Width = 2295 - End - Begin VB.TextBox txtTics - Height = 285 - Left = 7800 - TabIndex = 5 - Top = 720 - Width = 495 - End - Begin VB.TextBox txtFrame - Height = 285 - Left = 5880 - MaxLength = 2 - TabIndex = 3 - Top = 720 - Width = 495 - End - Begin VB.ComboBox cmbSprite - Height = 315 - Left = 5880 - TabIndex = 1 - Top = 120 - Width = 2415 - End - Begin VB.ListBox lstStates - Height = 6495 - Left = 120 - TabIndex = 0 - Top = 120 - Width = 4215 - End - Begin VB.Label lblFuncVar2 - Alignment = 1 'Right Justify - Caption = "Var2:" - Height = 255 - Left = 6600 - TabIndex = 21 - Top = 3600 - Width = 495 - End - Begin VB.Label lblFuncVar1 - Alignment = 1 'Right Justify - Caption = "Var1:" - Height = 255 - Left = 4920 - TabIndex = 20 - Top = 3600 - Width = 495 - End - Begin VB.Label lblTranslucency - Alignment = 1 'Right Justify - Caption = "Translucency:" - Height = 255 - Left = 5520 - TabIndex = 13 - Top = 5040 - Width = 1095 - End - Begin VB.Label lblNextstate - Alignment = 1 'Right Justify - Caption = "Next State:" - Height = 255 - Left = 5160 - TabIndex = 10 - Top = 3960 - Width = 855 - End - Begin VB.Label lblAction - Alignment = 1 'Right Justify - Caption = "Function to Call:" - Height = 375 - Left = 5040 - TabIndex = 8 - Top = 1080 - Width = 855 - End - Begin VB.Label lblTics - Alignment = 1 'Right Justify - Caption = "Tics (-1 for infinite duration):" - Height = 495 - Left = 6480 - TabIndex = 6 - Top = 600 - Width = 1215 - End - Begin VB.Label lblFrame - Alignment = 1 'Right Justify - Caption = "Frame:" - Height = 255 - Left = 5160 - TabIndex = 4 - Top = 720 - Width = 615 - End - Begin VB.Label lblSprite - Alignment = 1 'Right Justify - Caption = "Sprite:" - Height = 255 - Left = 5160 - TabIndex = 2 - Top = 120 - Width = 615 - End -End -Attribute VB_Name = "frmStateEdit" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmbAction_Click() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim index As Integer - Dim ActionName As String - - ActionName = cmbAction.List(cmbAction.ListIndex) - - If cmbAction.ListIndex = 0 Then - lblActionDesc.Text = "" - lblVar1Desc.Text = "" - lblVar2Desc.Text = "" - Exit Sub - End If - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("p_enemy.c", ForReading, False) - - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Mid(line, 4, 9) = "Function:" And InStr(line, ActionName) > 0 Then - ts.ReadLine ' // - line = ts.ReadLine ' // Description: - index = InStr(line, ":") - lblActionDesc.Text = Mid(line, index + 2, Len(line) - (index + 1)) - - ts.ReadLine ' // - line = ts.ReadLine ' // var1 = - If InStr(line, "var1:") Then - lblVar1Desc.Text = Mid(line, 4, Len(line) - 3) - line = ts.ReadLine - Do While Left(line, 7) <> "// var2" - lblVar1Desc.Text = lblVar1Desc.Text & vbCrLf & TrimComplete(Mid(line, 4, Len(line) - 3)) - line = ts.ReadLine - Loop - Else - lblVar1Desc.Text = Mid(line, 4, Len(line) - 3) - End If - - If Left(line, 7) <> "// var2" Then - line = ts.ReadLine ' // var2 = - End If - - If InStr(line, "var2:") Then - lblVar2Desc.Text = Mid(line, 4, Len(line) - 3) - line = ts.ReadLine - Do While Len(line) > 4 - lblVar2Desc.Text = lblVar2Desc.Text & vbCrLf & TrimComplete(Mid(line, 4, Len(line) - 3)) - line = ts.ReadLine - Loop - Else - lblVar2Desc.Text = Mid(line, 4, Len(line) - 3) - End If - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub cmdCopy_Click() - Dim Response As String - - Response$ = InputBox("Copy state to #:", "Copy State") - - If Response = "" Then Exit Sub - - Response = TrimComplete(Response) - - Call WriteState(False, Val(Response)) - - MsgBox "State copied to #" & Val(Response) -End Sub - -Private Sub cmdDelete_Click() - Call WriteState(True, lstStates.ListIndex) -End Sub - -Private Sub cmdReload_Click() - Call ClearForm - - If InStr(lstStates.List(lstStates.ListIndex), "S_FREESLOT") = 0 Then - LoadStateInfo (lstStates.ListIndex) - Else - MsgBox "Free slots do not have a code default." - End If -End Sub - -Private Sub cmdSave_Click() - If TrimComplete(txtFrame.Text) = "" And (chkFullbright.Value = 1 Or cmbTranslucency.ListIndex > 0) Then - MsgBox "ERROR: Frame field required for fullbright/translucency." - Exit Sub - End If - Call WriteState(False, lstStates.ListIndex) -End Sub - -Private Sub Form_Load() - Call Reload - lstStates.ListIndex = 0 -End Sub - -Private Sub ClearForm() - cmbNextstate.Text = "" - cmbSprite.Text = "" - txtFrame.Text = "" - cmbAction.Text = "" - txtFuncVar1.Text = "" - txtFuncVar2.Text = "" - lblActionDesc.Text = "" - lblVar1Desc.Text = "" - lblVar2Desc.Text = "" - chkFullbright.Value = False - cmbTranslucency.ListIndex = 0 -End Sub - -Private Sub Reload() - LoadStates - LoadSprites - LoadActions -End Sub - -Private Sub LoadStates() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim addstring As String - Dim numfreeslots As Integer, i As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("info.h", ForReading, False) - - Do While InStr(ts.ReadLine, "Object states (don't modify this comment!)") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - lstStates.Clear - - Do While InStr(line, "S_FIRSTFREESLOT") = 0 - startclip = InStr(line, "S_") - If InStr(line, "S_") <> 0 Then - endclip = InStr(line, ",") - line = Mid(line, startclip, endclip - startclip) - addstring = number & " - " & line - lstStates.AddItem addstring - cmbNextstate.AddItem addstring - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - - 'Populate the free slots! - Set ts = myFSO.OpenTextFile("info.h", ForReading, False) - - line = ts.ReadLine - Do While InStr(line, "#define NUMMOBJFREESLOTS") = 0 - line = ts.ReadLine - Loop - - startclip = InStr(line, "SLOTS ") + 6 - numfreeslots = Val(Mid(line, startclip, Len(line) - startclip + 1)) * 6 - - For i = 1 To numfreeslots - addstring = number & " - " & "S_FREESLOT" & i - lstStates.AddItem addstring - cmbNextstate.AddItem addstring - number = number + 1 - Next - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub LoadSprites() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim addstring As String - Dim numfreeslots As Integer, i As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("info.h", ForReading, False) - - Do While InStr(ts.ReadLine, "Hey, moron! If you change this table, don't forget about") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - cmbSprite.Clear - - Do While InStr(line, "SPR_FIRSTFREESLOT") = 0 - startclip = InStr(line, "SPR_") - If InStr(line, "SPR_") <> 0 Then - endclip = InStr(line, ",") - line = Mid(line, startclip, endclip - startclip) - addstring = number & " - " & line - cmbSprite.AddItem addstring - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - - 'Populate the free slots! - Set ts = myFSO.OpenTextFile("info.h", ForReading, False) - - line = ts.ReadLine - Do While InStr(line, "#define NUMMOBJFREESLOTS") = 0 - line = ts.ReadLine - Loop - - startclip = InStr(line, "SLOTS ") + 6 - numfreeslots = Val(Mid(line, startclip, Len(line) - startclip + 1)) - - For i = 1 To numfreeslots - If i < 10 Then - addstring = number & " - " & "SPR_F00" & i & " (Free slot)" - ElseIf i < 100 Then - addstring = number & " - " & "SPR_F0" & i & " (Free slot)" - Else - addstring = number & " - " & "SPR_F" & i & " (Free slot)" - End If - - cmbSprite.AddItem addstring - number = number + 1 - Next - - ts.Close - - Set myFSO = Nothing -End Sub - -Private Sub LoadActions() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim addstring As String - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("dehacked.c", ForReading, False) - - Do While InStr(ts.ReadLine, "actionpointer_t actionpointers[]") = 0 - Loop - - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - cmbAction.Clear - - cmbAction.AddItem "None" - - Do While InStr(line, "NULL") = 0 - startclip = InStr(line, "A_") - If InStr(line, "A_") <> 0 Then - endclip = InStr(line, "}") - line = Mid(line, startclip, endclip - startclip) - cmbAction.AddItem line - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub lstStates_Click() - Call ClearForm - - If InStr(lstStates.List(lstStates.ListIndex), "S_FREESLOT") = 0 Then - LoadStateInfo (lstStates.ListIndex) - End If - - LoadSOCStateInfo (lstStates.ListIndex) -End Sub - -Private Sub LoadSOCStateInfo(StateNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim frameNum As Long - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "FRAME" And Val(word2) = StateNum Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondTokenEqual(line)) - - If word = "SPRITENUMBER" Then - cmbSprite.ListIndex = Val(word2) - ElseIf word = "SPRITESUBNUMBER" Then - frameNum = Val(word2) - - If frameNum >= 327680 Then ' 5 << 16 - cmbTranslucency.ListIndex = 5 - frameNum = frameNum And Not 327680 - ElseIf frameNum >= 262144 Then ' 4 << 16 - cmbTranslucency.ListIndex = 4 - frameNum = frameNum And Not 262144 - ElseIf frameNum >= 196608 Then ' 3 << 16 - cmbTranslucency.ListIndex = 3 - frameNum = frameNum And Not 196608 - ElseIf frameNum >= 131072 Then ' 2 << 16 - cmbTranslucency.ListIndex = 2 - frameNum = frameNum And Not 131072 - ElseIf frameNum >= 65536 Then ' 1 << 16 - cmbTranslucency.ListIndex = 1 - frameNum = frameNum And Not 65536 - End If - - If frameNum >= 32768 Then - chkFullbright.Value = 1 - frameNum = frameNum And Not 32768 - Else - chkFullbright.Value = 0 - End If - - txtFrame.Text = frameNum - ElseIf word = "DURATION" Then - txtTics.Text = Val(word2) - ElseIf word = "NEXT" Then - cmbNextstate.ListIndex = Val(word2) - ElseIf word = "ACTION" Then - Call FindComboIndex(cmbAction, UCase(SecondToken(line))) - ElseIf word = "VAR1" Then - txtFuncVar1.Text = Val(word2) - ElseIf word = "VAR2" Then - txtFuncVar2.Text = Val(word2) - ElseIf Len(line) > 0 And Left(line, 1) <> "#" Then - MsgBox "Error in SOC!" & vbCrLf & "Unknown line: " & line - End If - Loop - Exit Do - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub LoadStateInfo(StateNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim token As String - Dim frame As Long - Dim templine As String - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("info.c", ForReading, False) - - Do While InStr(ts.ReadLine, "Keep this comment directly above S_NULL") = 0 - Loop - - number = 0 - - Do While number <> StateNum - Do While InStr(ts.ReadLine, "SPR_") = 0 - Loop - number = number + 1 - Loop - - Do While InStr(line, "SPR_") = 0 - line = ts.ReadLine - Loop - - startclip = InStr(line, "SPR_") - line = Mid(line, startclip, Len(line) - startclip) - endclip = InStr(line, ",") - 1 - token = Left(line, endclip) - Call FindComboIndex(cmbSprite, token) - - startclip = InStr(line, ",") + 1 - line = TrimComplete(Mid(line, startclip, Len(line) - startclip)) - endclip = InStr(line, ",") - 1 - frame = Val(Left(line, endclip)) - - If frame >= 32768 Then - chkFullbright.Value = 1 - frame = frame - 32768 - Else - chkFullbright.Value = 0 - End If - - txtFrame.Text = frame - - cmbTranslucency.ListIndex = 0 - - startclip = InStr(line, ",") + 1 - line = TrimComplete(Mid(line, startclip, Len(line) - startclip)) - endclip = InStr(line, ",") - 1 - txtTics.Text = Val(Left(line, endclip)) - - startclip = InStr(line, "{") + 1 - line = TrimComplete(Mid(line, startclip, Len(line) - startclip)) - endclip = InStr(line, "}") - 1 - cmbAction.Text = TrimComplete(Left(line, endclip)) - If cmbAction.Text = "NULL" Then cmbAction.Text = "None" - - startclip = InStr(line, ",") + 1 - line = TrimComplete(Mid(line, startclip, Len(line) - startclip)) - endclip = InStr(line, ",") - 1 - templine = Left(line, endclip) - - templine = TrimComplete(templine) - 'Check for *FRACUNIT values - endclip = InStr(templine, "*FRACUNIT") - If endclip <> 0 Then - templine = Left(templine, endclip - 1) - templine = Val(templine) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(templine, "MT_") - If endclip <> 0 Then - templine = FindThingNum(templine) & " - " & templine - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(templine, "pw_") - If endclip <> 0 Then - templine = FindPowerNum(templine) & " - " & templine - End If - txtFuncVar1.Text = templine - - startclip = InStr(line, ",") + 1 - line = TrimComplete(Mid(line, startclip, Len(line) - startclip)) - endclip = InStr(line, ",") - 1 - templine = Left(line, endclip) - - templine = TrimComplete(templine) - 'Check for *FRACUNIT values - endclip = InStr(templine, "*FRACUNIT") - If endclip <> 0 Then - templine = Left(templine, endclip - 1) - templine = Val(templine) * 65536 - End If - 'Check for crazy-odd MT_ usage - endclip = InStr(templine, "MT_") - If endclip <> 0 Then - templine = FindThingNum(templine) & " - " & templine - End If - 'Check for crazy-odd pw_ usage - endclip = InStr(templine, "pw_") - If endclip <> 0 Then - templine = FindPowerNum(templine) & " - " & templine - End If - txtFuncVar2.Text = templine - - startclip = InStr(line, ",") + 1 - line = TrimComplete(Mid(line, startclip, Len(line) - startclip)) - endclip = InStr(line, "}") - 1 - Call FindComboIndex(cmbNextstate, TrimComplete(Left(line, endclip))) - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub FindComboIndex(ByRef Box As ComboBox, line As String) - Dim i As Integer - - For i = 0 To Box.ListCount - If InStr(UCase(Box.List(i)), UCase(line)) Then - Box.ListIndex = i - Exit For - End If - Next -End Sub - -Private Sub WriteState(Remove As Boolean, num As Integer) - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim flags As Long - Dim statefound As Boolean - - statefound = False - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - 'If the current sound exists in the SOC, delete it. - If word = "FRAME" And Val(word2) = num Then - statefound = True - Do While Len(TrimComplete(tsSource.ReadLine)) > 0 And Not (tsSource.AtEndOfStream) - Loop - Else - tsTarget.WriteLine line - End If - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If Remove = False Then - If line <> "" Then tsTarget.WriteLine "" - - tsTarget.WriteLine "FRAME " & num - cmbSprite.Text = TrimComplete(cmbSprite.Text) - txtFrame.Text = TrimComplete(txtFrame.Text) - txtTics.Text = TrimComplete(txtTics.Text) - cmbAction.Text = TrimComplete(cmbAction.Text) - txtFuncVar1.Text = TrimComplete(txtFuncVar1.Text) - txtFuncVar2.Text = TrimComplete(txtFuncVar2.Text) - cmbNextstate.Text = TrimComplete(cmbNextstate.Text) - cmbTranslucency.Text = TrimComplete(cmbTranslucency.Text) - - If cmbSprite.Text <> "" Then tsTarget.WriteLine "SPRITENUMBER = " & cmbSprite.ListIndex - - flags = Val(txtFrame.Text) - If chkFullbright.Value = 1 Then flags = flags + 32768 - - ' Grrr VB doesn't have bitshifts!! - If cmbTranslucency.Text <> "" Then - flags = flags + cmbTranslucency.ListIndex * 65536 - End If - - If txtFrame.Text <> "" Then tsTarget.WriteLine "SPRITESUBNUMBER = " & flags - If txtTics.Text <> "" Then tsTarget.WriteLine "DURATION = " & Val(txtTics.Text) - If cmbNextstate.Text <> "" Then tsTarget.WriteLine "NEXT = " & cmbNextstate.ListIndex - If cmbAction.Text <> "" Then tsTarget.WriteLine "ACTION " & cmbAction.Text - If txtFuncVar1.Text <> "" Then tsTarget.WriteLine "VAR1 = " & Val(txtFuncVar1.Text) - If txtFuncVar2.Text <> "" Then tsTarget.WriteLine "VAR2 = " & Val(txtFuncVar2.Text) - End If - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - If Remove = True Then - If statefound = True Then - MsgBox "State removed from SOC." - Else - MsgBox "State not found in SOC." - End If - Else - MsgBox "State Saved." - End If -End Sub - -Private Sub LoadThings() - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer, endclip As Integer - Dim numfreeslots As Integer, i As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("info.h", ForReading, False) - - Do While InStr(ts.ReadLine, "Little flag for SOC editor (don't change this comment!)") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - lstThings.Clear - - Do While InStr(line, "MT_FIRSTFREESLOT") = 0 - startclip = InStr(line, "MT_") - If InStr(line, "MT_") <> 0 Then - endclip = InStr(line, ",") - line = Mid(line, startclip, endclip - startclip) - lstThings.AddItem number & " - " & line - number = number + 1 - End If - line = ts.ReadLine - Loop - - ts.Close - - 'Populate the free slots! - Set ts = myFSO.OpenTextFile("info.h", ForReading, False) - - line = ts.ReadLine - Do While InStr(line, "#define NUMMOBJFREESLOTS") = 0 - line = ts.ReadLine - Loop - - startclip = InStr(line, "SLOTS ") + 6 - numfreeslots = Val(Mid(line, startclip, Len(line) - startclip + 1)) - - For i = 1 To numfreeslots - lstThings.AddItem number & " - " & "MT_FREESLOT" & i - number = number + 1 - Next - - ts.Close - Set myFSO = Nothing -End Sub - -Private Function FindThingNum(ThingName As String) As Integer - Dim i As Integer - Dim temp As String - Dim startpoint As Integer - Dim endpoint As Integer - - lstThings.Clear - LoadThings - - For i = 0 To lstThings.ListCount - 1 - temp = lstThings.List(i) - startpoint = InStr(temp, "-") + 2 - endpoint = Len(temp) - startpoint + 1 - temp = Mid(temp, startpoint, endpoint) - If temp = ThingName Then - FindThingNum = Val(lstThings.List(i)) - Exit For - End If - Next -End Function - -Private Function FindPowerNum(PowerName As String) As Integer - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim number As Integer - Dim startclip As Integer - - ChDir SourcePath - Set ts = myFSO.OpenTextFile("d_player.h", ForReading, False) - - Do While InStr(ts.ReadLine, "Player powers. (don't edit this comment)") = 0 - Loop - - ts.SkipLine ' typedef enum - ts.SkipLine ' { - - line = ts.ReadLine - number = 0 - - Do While InStr(line, "NUMPOWERS") = 0 - startclip = InStr(line, PowerName) - If startclip <> 0 Then - FindPowerNum = number - Exit Do - End If - number = number + 1 - line = ts.ReadLine - Loop - - ts.Close - Set myFSO = Nothing -End Function diff --git a/tools/SOCEdit/frmStateEdit.frx b/tools/SOCEdit/frmStateEdit.frx deleted file mode 100644 index 8069c37e0..000000000 Binary files a/tools/SOCEdit/frmStateEdit.frx and /dev/null differ diff --git a/tools/SOCEdit/frmUnlockablesEdit.frm b/tools/SOCEdit/frmUnlockablesEdit.frm deleted file mode 100644 index f43209a78..000000000 --- a/tools/SOCEdit/frmUnlockablesEdit.frm +++ /dev/null @@ -1,391 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmUnlockablesEdit - Caption = "Unlockables Edit" - ClientHeight = 3675 - ClientLeft = 60 - ClientTop = 345 - ClientWidth = 8130 - Icon = "frmUnlockablesEdit.frx":0000 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 3675 - ScaleWidth = 8130 - StartUpPosition = 3 'Windows Default - Begin VB.CheckBox chkGrade - Caption = "Must have beaten Ultimate" - Height = 255 - Index = 4 - Left = 5400 - TabIndex = 20 - Tag = "1024" - Top = 2160 - Width = 2655 - End - Begin VB.CheckBox chkGrade - Caption = "Must have beaten Very Hard" - Height = 255 - Index = 3 - Left = 5400 - TabIndex = 19 - Tag = "128" - Top = 1800 - Width = 2655 - End - Begin VB.CheckBox chkGrade - Caption = "Must have all emblems" - Height = 255 - Index = 2 - Left = 5400 - TabIndex = 18 - Tag = "16" - Top = 1440 - Width = 2055 - End - Begin VB.CheckBox chkGrade - Caption = "Must have gotten all 7 emeralds" - Height = 255 - Index = 1 - Left = 5400 - TabIndex = 17 - Tag = "8" - Top = 1080 - Width = 2655 - End - Begin VB.CheckBox chkGrade - Caption = "Game must be completed" - Height = 255 - Index = 0 - Left = 5400 - TabIndex = 16 - Tag = "1" - Top = 720 - Width = 2175 - End - Begin VB.TextBox txtVar - Height = 285 - Left = 4320 - TabIndex = 14 - Top = 2640 - Width = 615 - End - Begin VB.ComboBox cmbType - Height = 315 - ItemData = "frmUnlockablesEdit.frx":0442 - Left = 3360 - List = "frmUnlockablesEdit.frx":044C - TabIndex = 12 - Top = 2160 - Width = 1575 - End - Begin VB.TextBox txtNeededTime - Height = 285 - Left = 4080 - TabIndex = 10 - Top = 1680 - Width = 855 - End - Begin VB.TextBox txtNeededEmblems - Height = 285 - Left = 4440 - TabIndex = 9 - Top = 1200 - Width = 495 - End - Begin VB.TextBox txtObjective - Height = 285 - Left = 3240 - TabIndex = 7 - Top = 720 - Width = 1695 - End - Begin VB.TextBox txtName - Height = 285 - Left = 3240 - TabIndex = 5 - Top = 240 - Width = 1695 - End - Begin VB.CommandButton cmdDelete - Caption = "&Delete from SOC" - Height = 375 - Left = 3480 - TabIndex = 3 - Top = 3120 - Width = 1575 - End - Begin VB.CommandButton cmdSave - Caption = "&Save Changes" - Height = 375 - Left = 1800 - TabIndex = 2 - Top = 3120 - Width = 1575 - End - Begin VB.ListBox lstUnlockables - Height = 2985 - ItemData = "frmUnlockablesEdit.frx":046A - Left = 120 - List = "frmUnlockablesEdit.frx":049B - TabIndex = 0 - Top = 480 - Width = 1215 - End - Begin VB.Label lblNote - Caption = "Note: All requirements are combinable." - Height = 495 - Left = 6000 - TabIndex = 22 - Top = 2760 - Width = 1695 - End - Begin VB.Label lblOtherReqs - Caption = "Other Requirements:" - Height = 255 - Left = 5400 - TabIndex = 21 - Top = 360 - Width = 1935 - End - Begin VB.Label lblVar - Alignment = 1 'Right Justify - Caption = "Map # to warp to:" - Height = 255 - Left = 2880 - TabIndex = 15 - Top = 2640 - Width = 1335 - End - Begin VB.Label lblType - Alignment = 1 'Right Justify - Caption = "Type of Unlockable:" - Height = 255 - Left = 1800 - TabIndex = 13 - Top = 2160 - Width = 1455 - End - Begin VB.Label lblNeededTime - Alignment = 1 'Right Justify - Caption = "Needed time on Time Attack rank (in seconds):" - Height = 375 - Left = 1440 - TabIndex = 11 - Top = 1560 - Width = 2535 - End - Begin VB.Label lblNeededEmblems - Alignment = 1 'Right Justify - Caption = "# of Emblems Needed:" - Height = 255 - Left = 2640 - TabIndex = 8 - Top = 1200 - Width = 1695 - End - Begin VB.Label lblObjective - Alignment = 1 'Right Justify - Caption = "Objective:" - Height = 255 - Left = 2400 - TabIndex = 6 - Top = 720 - Width = 735 - End - Begin VB.Label lblName - Alignment = 1 'Right Justify - Caption = "Name:" - Height = 255 - Left = 2640 - TabIndex = 4 - Top = 240 - Width = 495 - End - Begin VB.Label lblHUDItems - Caption = "Unlockables:" - Height = 255 - Left = 120 - TabIndex = 1 - Top = 240 - Width = 975 - End -End -Attribute VB_Name = "frmUnlockablesEdit" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Private Sub cmdDelete_Click() - Call WriteUnlockableItem(True) -End Sub - -Private Sub cmdSave_Click() - Call WriteUnlockableItem(False) -End Sub - -Private Sub Form_Load() - Call Reload -End Sub - -Private Sub Reload() - txtName.Text = "" - txtObjective.Text = "" - txtNeededEmblems.Text = "" - txtNeededTime.Text = "" - cmbType.Text = "" - txtVar.Text = "" - - Dim i As Integer - - For i = 0 To chkGrade.Count - 1 - chkGrade(i).Value = 0 - Next i - - lstUnlockables.ListIndex = 0 -End Sub - -Private Sub lstUnlockables_Click() - Call ReadSOC(lstUnlockables.ListIndex + 1) -End Sub - -Private Sub ReadSOC(UnlockableNum As Integer) - Dim myFSO As New Scripting.FileSystemObject - Dim ts As TextStream - Dim line As String - Dim word As String - Dim word2 As String - - Set ts = myFSO.OpenTextFile(SOCFile, ForReading, False) - -SOCLoad: - Do While Not ts.AtEndOfStream - line = ts.ReadLine - - If Left(line, 1) = "#" Then GoTo SOCLoad - - If Left(line, 1) = vbCrLf Then GoTo SOCLoad - - If Len(line) < 1 Then GoTo SOCLoad - - word = FirstToken(line) - word2 = SecondToken(line) - - If UCase(word) = "UNLOCKABLE" And Val(word2) = UnlockableNum Then - Do While Len(line) > 0 And Not ts.AtEndOfStream - line = ts.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondTokenEqual(line)) - - If word = "NAME" Then - txtName.Text = word2 - ElseIf word = "OBJECTIVE" Then - txtObjective.Text = word2 - ElseIf word = "NEEDEDEMBLEMS" Then - txtNeededEmblems.Text = Val(word2) - ElseIf word = "NEEDEDTIME" Then - txtNeededTime.Text = Val(word2) - ElseIf word = "TYPE" Then - cmbType.ListIndex = Val(word2) - ElseIf word = "VAR" Then - txtVar.Text = Val(word2) - ElseIf word = "NEEDEDGRADE" Then - Dim i As Integer - - For i = 0 To chkGrade.Count - 1 - If Val(word2) And chkGrade(i).Tag Then - chkGrade(i).Tag = True - End If - Next i - ElseIf Len(line) > 0 And Left(line, 1) <> "#" Then - MsgBox "Error in SOC!" & vbCrLf & "Unknown line: " & line - End If - Loop - Exit Do - End If - Loop - - ts.Close - Set myFSO = Nothing -End Sub - -Private Sub WriteUnlockableItem(Remove As Boolean) - Dim myFSOSource As New Scripting.FileSystemObject - Dim tsSource As TextStream - Dim myFSOTarget As New Scripting.FileSystemObject - Dim tsTarget As TextStream - Dim line As String - Dim word As String - Dim word2 As String - Dim unlockableremoved As Boolean - - unlockableremoved = False - - Set tsSource = myFSOSource.OpenTextFile(SOCFile, ForReading, False) - Set tsTarget = myFSOTarget.OpenTextFile(SOCTemp, ForWriting, True) - - Do While Not tsSource.AtEndOfStream - line = tsSource.ReadLine - word = UCase(FirstToken(line)) - word2 = UCase(SecondToken(line)) - - 'If the current item exists in the SOC, delete it. - If word = "UNLOCKABLE" And Val(word2) = lstUnlockables.ListIndex + 1 Then - unlockableremoved = True - Do While Len(TrimComplete(tsSource.ReadLine)) > 0 And Not tsSource.AtEndOfStream - Loop - Else - tsTarget.WriteLine line - End If - Loop - - tsSource.Close - Set myFSOSource = Nothing - - If Remove = False Then - If line <> "" Then tsTarget.WriteLine "" - - tsTarget.WriteLine "UNLOCKABLE " & lstUnlockables.ListIndex + 1 - txtName.Text = TrimComplete(txtName.Text) - txtObjective.Text = TrimComplete(txtObjective.Text) - txtNeededEmblems.Text = TrimComplete(txtNeededEmblems.Text) - txtNeededTime.Text = TrimComplete(txtNeededTime.Text) - txtVar.Text = TrimComplete(txtVar.Text) - - If txtName.Text <> "" Then tsTarget.WriteLine "NAME = " & txtName.Text - If txtObjective.Text <> "" Then tsTarget.WriteLine "OBJECTIVE = " & txtObjective.Text - If txtNeededEmblems.Text <> "" Then tsTarget.WriteLine "NEEDEDEMBLEMS = " & txtNeededEmblems.Text - If txtNeededTime.Text <> "" Then tsTarget.WriteLine "NEEDEDTIME = " & txtNeededTime.Text - If cmbType.ListIndex <> -1 Then tsTarget.WriteLine "TYPE = " & cmbType.ListIndex - If txtVar.Text <> "" Then tsTarget.WriteLine "VAR = " & txtVar.Text - - Dim writegrade As Long - Dim i As Integer - writegrade = 0 - - For i = 0 To chkGrade.Count - 1 - If chkGrade(i).Value = 1 Then - writegrade = writegrade + chkGrade(i).Tag - End If - Next i - - If writegrade > 0 Then tsTarget.WriteLine "NEEDEDGRADE = " & writegrade - End If - - tsTarget.Close - Set myFSOTarget = Nothing - - FileCopy SOCTemp, SOCFile - - Kill SOCTemp - - If Remove = True Then - If unlockableremoved = True Then - MsgBox "Unlockable deleted from SOC." - Else - MsgBox "Couldn't find Unlockable in SOC." - End If - Else - MsgBox "Unlockable Saved." - End If -End Sub diff --git a/tools/SOCEdit/frmUnlockablesEdit.frx b/tools/SOCEdit/frmUnlockablesEdit.frx deleted file mode 100644 index d9d464d4e..000000000 Binary files a/tools/SOCEdit/frmUnlockablesEdit.frx and /dev/null differ diff --git a/tools/SOCEdit/icon1.ico b/tools/SOCEdit/icon1.ico deleted file mode 100644 index 1ea9d1005..000000000 Binary files a/tools/SOCEdit/icon1.ico and /dev/null differ