Hey guys I'm trying to figure out how to add more dip switches to for some table options. I basically copied the scripts for the menu option structure from Cirqus Voltaire Platium Ed. I've used this in the past, but I only had a couple options and it works fine. It piggy backs the default F6 dip switch menu.
The problem is I don't understand the "registry locations" addresses for the constants. Here are what I did to try keep it simple.
Const optOpenAtStart = &H00000001 Const optBear = &H00000010 Const optFester = &H00000100 Const optBox = &H00001000 Const optCousinItt = &H00010000 Const optBooks = &H00100000 Const optBetas = &H01000000 Const optSwLight = &H00000002 Const optCVLight = &H00000004
The first 4 work fine, but the all the last ones seem to end up causing conflicts with the first ones in someway. Also some with show as check boxes instead of radio buttons.
Here is the whole section:
'REGISTERY LOCATIONS ***************************************************************************************************************************************
Const optOpenAtStart = &H00000001
Const optBear = &H00000010
Const optFester = &H00000100
Const optBox = &H00001000
Const optCousinItt = &H00010000
Const optBooks = &H00100000
Const optBetas = &H01000000
Const optSwLight = &H00000002
Const optCVLight = &H00000004
'OPTIONS MENU *********************************************************************************************************************************************
Dim TableOptions, TableOptions2, TableName
Private vpmShowDips1, vpmDips1, vpmDips2
Sub InitializeOptions
TableName="TAF_VPX" 'Replace with your descriptive table name, it will be used to save settings in VPReg.stg file
Set vpmShowDips1 = vpmShowDips 'Reassigns vpmShowDips to vpmShowDips1 to allow usage of default dips menu
Set vpmShowDips = GetRef("TableShowDips") 'Assigns new sub to vmpShowDips
TableOptions = LoadValue(TableName,"Options") 'Load saved table options
' TableOptions2 = LoadValue(TableName,"Options2") 'Load saved table options
Set Controller = CreateObject("VPinMAME.Controller") 'Load vpm controller temporarily so options menu can be loaded if needed
' If TableOptions2 = "" Then TableOptions2 = 0
If TableOptions = "" Or optReset Then 'If no existing options, reset to default through optReset, then open Options menu
TableOptions = DefaultOptions 'clear any existing settings and set table options to default options
TableShowOptions
ElseIf (TableOptions And optOpenAtStart) Then 'If Enable Next Start was selected then
TableOptions = TableOptions - optOpenAtStart 'clear setting to avoid future executions
TableShowOptions
Else
TableSetOptions
End If
' TableSetOptions2
Set Controller = Nothing 'Unload vpm controller so selected controller can be loaded
End Sub
Private Sub TableShowDips
vpmShowDips1 'Show original Dips menu
TableShowOptions 'Show new options menu
'TableShowOptions2 'Add more options menus...
End Sub
Private Sub TableShowOptions 'New options menu, additional menus can be added as well, just follow similar format and add call to TableShowDips
Dim oldOptions : oldOptions = TableOptions
If Not IsObject(vpmDips1) Then 'If creating an additional menus, need to declare additional vpmDips variables above (ex. vpmDips2 and TableOptions2, etc.)
Set vpmDips1 = New cvpmDips
With vpmDips1
.AddForm 700, 500, "TABLE OPTIONS MENU"
.AddFrameExtra 0,0,155,"Bear Toy",3*optBear, Array("Rug", 0*optBear, "Head", 1*optBear, "None", 2*optBear)
.AddFrameExtra 0,65,155,"Thing Box",3*optBox, Array("Black Vinyl", 0*optBox, "Default", 1*optBox)
.AddFrameExtra 0,120,155,"Chair Options",3*optFester, Array("with Uncle Fester", 0*optFester, "No Fester", 1*optFester)
.AddFrameExtra 0,185,155,"Swamp Lighting", 3*SwLight, Array("Enable Green Light", 0*OptSwlight, "Disabled", 1*optSwlight)
.AddFrameExtra 175,0,155,"Coustin Itt",3*optCousinItt, Array("Enabled", 0*optCousinItt, "Disabled", 1*optCousinItt)
.AddFrameExtra 175,65,155,"Bookshelf",3*Books, Array("Bookcase Mod", 0*OptBooks, "Default", 1*optBooks)
.AddFrameExtra 175,120,155,"Beta Plastics", 3*Betas, Array("Show Beta Plastics", 0*OptBetas, "No Beta Plastics", 1*optBetas)
.AddFrameExtra 175,185,155,"Chair/Vault Lighting", 3*CVLight, Array("Enabled", 0*OptCVLight, "Disabled", 1*optCVLight)
.AddLabel 0,240,175,30,"* Restart To Apply Settings"
.AddChkExtra 180,240,135, Array("Enable Menu Next Start", optOpenAtStart)
End With
End If
TableOptions = vpmDips1.ViewDipsExtra(TableOptions)
SaveValue TableName,"Options",TableOptions
TableSetOptions
End Sub
Dim Bear, Fester, Box, CousinItt, Books, Betas, CVLight, SwLight
Sub TableSetOptions 'defines required settings before table is run
Bear = ((TableOptions And (3*optBear))\optBear)
Fester = ((TableOptions And (3*optFester))\optFester)
Box = ((TableOptions And (3*optBox))\optBox)
CousinItt = ((TableOptions And (3*optCousinItt))\optCousinItt)
Books = ((TableOptions And (3*optBooks))\optBooks)
Betas = ((TableOptions And (3*optBetas))\optBetas)
CVLight = ((TableOptions And (3*optCVLight))\optCVLight)
SwLight = ((TableOptions And (3*optSwLight))\optSwLight)
SaveValue TableName,"Options",TableOptions
End Sub
Any help is appreciated.
Thanks
-Mike




Top
Contributor








are all trademarks of VPFORUMS.