Load Volume from somewhere else

ok so i noticed that almost all games here only do the On/Off thing…I personally hate that since it gets really annoying at times…

Anyways,

Go to ModSound and Look for


Public Const DefaultVolume As Long = 80

Change that to


Public DefaultVolume As Long

After that, go into the LoadOptions and add


DefaultVolume = GetVar(filename, "OPTIONS", "DefaultVolume")

And after that, put a scrollbar on the picOptions and set the min to 1 and Max to 100

Add a label, Name it lblVolume and the caption: "Volume: "

in the scroll bar code,


lblVolume.Caption = "Volume: " & scrlVolume.Value

DefaultVolume = scrlVolume.Value

After that, in the options.ini add


Volume= 80

and ur finished!

You can do the saveoptions thing if you want.

EDIT: i fixed a certain part of the code

You have something about this that makes it a little inconvenient… You should add to the bottom area of the LoadOptions to change the value of lblVolume and scrlVolume to what was found in the ini… Otherwise they can load the old volume, but they have to change it again and dont know the old value without just going back to the ini.

This was posted years ago m8, A lot of my tutorials are crap by now. but thankyou for noticing that.

Log in to reply