Tich

[Release] Simple Variable Volume Script and GUI

4 posts in this topic

This is a simple variable volume script accompanied by a GUI to look a lot nicer. 

I'm generally a well versed coder but now I am starting to learn GUI. This is one of the first I have done so I thought I'd share it with you all. It's nothing major.

Also as a side-note the it's blue not orange like it is in the video. Feel free to change it as you wish.

Features:

  • Graphical interface for volume level
  • You can alter each 10 levels of volume
  • Only works when the earplugs are inserted

          You can change the colours as you wish. Do this by altering the image files or the dialog config. 
          To make it even more flexible. Don't add the key_up override and instead append "infiSTAR_keyBinds_defaults.sqf" so players can change to whatever buttons they wish.

Controls:

  • 7 - Volume Down
  • 8 - Volume Up

Video:

Github:
https://github.com/Tich-PrecisionGaming/pg_variableVolume

Edited by Tich
  • Like 9

Share this post


Link to post
Share on other sites
On 7/5/2018 at 2:01 AM, Tich said:

This is a simple variable volume script accompanied by a GUI to look a lot nicer. 

I'm generally a well versed coder but now I am starting to learn GUI. This is one of the first I have done so I thought I'd share it with you all. It's nothing major.

Also as a side-note the it's blue not orange like it is in the video. Feel free to change it as you wish.

Features:

  • Graphical interface for volume level
  • You can alter each 10 levels of volume
  • Only works when the earplugs are inserted

          You can change the colours as you wish. Do this by altering the image files or the dialog config. 
          To make it even more flexible. Don't add the key_up override and instead append "infiSTAR_keyBinds_defaults.sqf" so players can change to whatever buttons they wish.

Controls:

  • 7 - Volume Down
  • 8 - Volume Up

Video:

Github:
https://github.com/Tich-PrecisionGaming/pg_variableVolume

I can tell you of 3 bugs that are going to happen (that i know of)

#1. the name of your function is incorrect.

You're calling the function PGClient_fnc_earplugVolume yet, the compiled version of the function is variableVolume, so you're calling a NIL function.

#2. when someone throws a grenade or something blows up, the volume will reset to 1 (Still a bug with Exile).

#3. when you put in or remove the earplugs, the "volume" modified will not resume where it left off, instead you have to push the volume up or volume down button to get back to it.

 

Please for the love of god, use the defines that exile provide us with and stop exporting all of these new defines, it causes problems.

Literally this entire pg_volumeDefines.hpp can just be:

class pg_volumeRscPicture: RscPictureKeepAspect {};

but at that point you might as well just move the contents into the pg_volumeDialog.hpp:

 

One more thing, nothing is provided for this:

On 7/5/2018 at 2:01 AM, Tich said:

To make it even more flexible. Don't add the key_up override and instead append "infiSTAR_keyBinds_defaults.sqf" so players can change to whatever buttons they wish.

 

Share this post


Link to post
Share on other sites
Advertisement
10 hours ago, StokesMagee said:

I can tell you of 3 bugs that are going to happen (that i know of)

#1. the name of your function is incorrect.

You're calling the function PGClient_fnc_earplugVolume yet, the compiled version of the function is variableVolume, so you're calling a NIL function.

#2. when someone throws a grenade or something blows up, the volume will reset to 1 (Still a bug with Exile).

#3. when you put in or remove the earplugs, the "volume" modified will not resume where it left off, instead you have to push the volume up or volume down button to get back to it.

 

Please for the love of god, use the defines that exile provide us with and stop exporting all of these new defines, it causes problems.

Literally this entire pg_volumeDefines.hpp can just be:


class pg_volumeRscPicture: RscPictureKeepAspect {};

but at that point you might as well just move the contents into the pg_volumeDialog.hpp:

 

One more thing, nothing is provided for this:

 

#1 You are right. This is setup a little different on my server so copying the code in the init was wrong. Thanks for letting me know.
#2 If the grenade thing does happen. There's not much I can do.
#3 You are correct the bug has been updated. 
 

Quote

Please for the love of god, use the defines that exile provide us with and stop exporting all of these new defines, it causes problems.

Like I said this is my first go at GUI. The defines has only one define uniquely named so i'm unsure why you are so worked up. It's there if they want to use it outside of exile. If they want to use their own define they can.
 

Quote

To make it even more flexible. Don't add the key_up override and instead append "infiSTAR_keyBinds_defaults.sqf" so players can change to whatever buttons they wish.

Because if you open that file it is very obvious what to do, but I appended it for you :)

Edit: It was slightly more than one line but it was just a copy paste from the key up.

Edited by Tich

Share this post


Link to post
Share on other sites
On 7/7/2018 at 8:30 PM, Tich said:

Like I said this is my first go at GUI. The defines has only one define uniquely named so i'm unsure why you are so worked up. It's there if they want to use it outside of exile. If they want to use their own define they can.

This is not only targeting you, it's targeting pretty much everyone in general. besides, they can do the EXACT same thing, they don't even need the exile defines, and if they're smart enough to get this working with something else, then they can sure figure out how to get the defines. :P

On 7/7/2018 at 8:30 PM, Tich said:

Because if you open that file it is very obvious what to do, but I appended it for you :)

Not for the average server owner it's not.

 

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.