Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO]Custom options checkbox


Golf
 Share

Recommended Posts

Hello,

this is simple tutorial about custom checkboxes in options.

At the end of tutorial it should look like this(You can set custom images):

![](http://i.imgur.com/Xb6QcfG.png)

We will edit only client side.

LET'S START

First in **\data files\graphics\gui **add two images **check_true.bmp**(True checkbox - on) and **check_false.bmp**(False checkbox - off).

Now open client source and in **frmMain** , **picOptions** remove **optMOn,optMOff,optSOn & optSOff.**

Add two images in picOptions : **img_check_music** & **img_check_sound .**

Open **img_check_music** code and paste:

```
Dim MusicFile As String
'Check if it's false or true
If Options.Music = 0 Then
Options.Music = 1
' start music playing
MusicFile = Trim$(Map.Music)
If Not MusicFile = "None." Then
PlayMidi MusicFile
Else
StopMidi
End If
' save to config.ini
SaveOptions
'Change image
img_check_music.Picture = LoadPicture(App.Path & "\data files\graphics\gui\check_true.bmp")
Else
Options.Music = 0
' stop music playing
StopMidi
' save to config.ini
SaveOptions
'Change image
img_check_music.Picture = LoadPicture(App.Path & "\data files\graphics\gui\check_false.bmp")
End If

```
Now open **img_check_sound** code and paste:

```
If Options.Sound = 0 Then
Options.Sound = 1
' save to config.ini
SaveOptions
img_check_sound.Picture = LoadPicture(App.Path & "\data files\graphics\gui\check_true.bmp")
Else
Options.Sound = 0
' save to config.ini
SaveOptions
img_check_sound.Picture = LoadPicture(App.Path & "\data files\graphics\gui\check_false.bmp")
End If

```
Now in **modDatabase** in sub **loadOptions** replace :

```
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

```
With:

```
If Options.Music = 0 Then
frmMain.img_check_music.Picture = LoadPicture(App.Path & "\data files\graphics\gui\check_false.bmp")
Else
frmMain.img_check_music.Picture = LoadPicture(App.Path & "\data files\graphics\gui\check_true.bmp")
End If

If Options.Sound = 0 Then
frmMain.img_check_sound.Picture = LoadPicture(App.Path & "\data files\graphics\gui\check_false.bmp")
Else
frmMain.img_check_sound.Picture = LoadPicture(App.Path & "\data files\graphics\gui\check_true.bmp")
End If

```
**THATS ALL!  **
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...