TWIN BLADEZ Posted September 8, 2011 Author Share Posted September 8, 2011 I need some help guys! I Have made two check boxes in the options picture box and coded in what they are meant to do. But now there's one thing which is stopping me in completing my edit and that is the ability to save the check boxes once they been checked.I looked through the other check boxes and ran into this code:```Options.Sound = 1 ' save to config.ini SaveOptions ```I already know what this code does and i know i will have to change the "Option.Sound" bit to something like "Option.TwinBladez".So i was wondering which mod i will have to edit and what i will have to put in to the mod to be able to add the option to the config.ini.Thank in advance :) Link to comment Share on other sites More sharing options...
PD Posted September 9, 2011 Share Posted September 9, 2011 Just simply open up modTypes and add a variable to OptionsRec, so here's an example:```Private Type OptionsRec Game_Name As String SavePass As Byte Password As String * NAME_LENGTH Username As String * ACCOUNT_LENGTH IP As String Port As Long MenuMusic As String Music As Byte Sound As Byte Debug As Byte TwinBlade As Byte ' Newly added variableEnd Type```Next you add this code to the Click event for the check box:```Options.TwinBlade = 1 ' save to config.ini SaveOptions```Next look into modDatabase and find the Sub SaveOptions and below the:```Call PutVar(fileName, "Options", "Debug", Str(Options.Debug))```Add this:```Call PutVar(fileName, "Options", "TwinBlade", Str(Options.TwinBlade))```Next you must change the LoadOptions sub. So change this part of the sub```If Not FileExist(fileName, True) Then Options.Game_Name = "Eclipse Origins" Options.Password = vbNullString Options.SavePass = 0 Options.Username = vbNullString Options.IP = "127.0.0.1" Options.Port = 7001 Options.MenuMusic = vbNullString Options.Music = 1 Options.Sound = 1 Options.Debug = 0 SaveOptions Else Options.Game_Name = GetVar(fileName, "Options", "Game_Name") Options.Username = GetVar(fileName, "Options", "Username") Options.Password = GetVar(fileName, "Options", "Password") Options.SavePass = Val(GetVar(fileName, "Options", "SavePass")) Options.IP = GetVar(fileName, "Options", "IP") Options.Port = Val(GetVar(fileName, "Options", "Port")) Options.MenuMusic = GetVar(fileName, "Options", "MenuMusic") Options.Music = GetVar(fileName, "Options", "Music") Options.Sound = GetVar(fileName, "Options", "Sound") Options.Debug = GetVar(fileName, "Options", "Debug") End If```TO:```If Not FileExist(fileName, True) Then Options.Game_Name = "Eclipse Origins" Options.Password = vbNullString Options.SavePass = 0 Options.Username = vbNullString Options.IP = "127.0.0.1" Options.Port = 7001 Options.MenuMusic = vbNullString Options.Music = 1 Options.Sound = 1 Options.Debug = 0 Options.TwinBlade = 0 ' 0 for unticked and 1 for ticked SaveOptions Else Options.Game_Name = GetVar(fileName, "Options", "Game_Name") Options.Username = GetVar(fileName, "Options", "Username") Options.Password = GetVar(fileName, "Options", "Password") Options.SavePass = Val(GetVar(fileName, "Options", "SavePass")) Options.IP = GetVar(fileName, "Options", "IP") Options.Port = Val(GetVar(fileName, "Options", "Port")) Options.MenuMusic = GetVar(fileName, "Options", "MenuMusic") Options.Music = GetVar(fileName, "Options", "Music") Options.Sound = GetVar(fileName, "Options", "Sound") Options.Debug = GetVar(fileName, "Options", "Debug") Options.TwinBlade = GetVar(fileName, "Options", "TwinBlade") ' this loads the saved value for the checkbox End If```Now finally just change this code```' show in GUI If Options.Music = 0 Then frmMain.optMOff.Value = True Else frmMain.optMOn.Value = True End If If Options.Sound = 0 Then frmMain.optSOff.Value = True Else frmMain.optSOn.Value = True End If```TO:```' show in GUI If Options.Music = 0 Then frmMain.optMOff.Value = True Else frmMain.optMOn.Value = True End If If Options.Sound = 0 Then frmMain.optSOff.Value = True Else frmMain.optSOn.Value = True End If If Options.TwinBlade = 0 Then frmMain.CHECKBOXNAME_OFF.Value = True Else frmMain.CHECKBOXNAME_ON.Value = True End If```And that is it just save and run and it should work fine ;D For any other options you decide to add just use the above example to add them in, enjoy :P Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now