Sauerworld Forum

RGB Gui Menu

Salatiel

  • ***
  • 114
  • +25/-1
    • Projects by Salatiel
RGB Gui Menu
« on: March 12, 2017, 09:58:05 PM »
Well, its a simple Gui Menu of Vcolors and Valpha, with a little feature of Fast Gradient Effect...

I want to add more things later, i just need ideas.

If you're too lazy to type commands to add some vcolor, that will be useful.   ::)

(Sorry for the  ̶b̶a̶d̶ ̶a̶r̶t̶ ̶o̶f̶ ̶t̶h̶e̶ ̶m̶e̶n̶u̶, and the organization of the script, was a mixture of tests.)

22/03/2017
Show Cube Info have been added.



14/03/2017
Clouds and Skybox settings have been added







12/03/2017















Code: [Select]
//RgbGui by Salatiel
//Thanks MysteryCube for 'divf' and '+f' commands!


//Some Variables
simpositivonegativo = ""
naopositivonegativo = ""
vcolorr = 0.0
vcolorg = 0.0
vcolorb = 0.0
skycolorr = 0
skycolorg = 0
skycolorb = 0
outlinecolourr = 0
outlinecolourg = 0
outlinecolourb = 0
fogcolourr = 0
fogcolourg = 0
fogcolourb = 0
waternum = 1
vcolorkey = ""
valpha_1 = "-1"
nada = ""
gradienteffect = [(+ $vcolorr 2)(+ $vcolorg 2) (+ $vcolorb 2)]
rgbgui = [if (= $getmode 1)[showgui rgbgui][echo "^f7operation only allowed in edit mode"]]
//

newgui rgbgui [
guilist [
guitext "^f4    || " 0 ;
guititle "^f0RGB GUI" ; guitext "^f4 ||" 0 ;
]

guititle "^f1Main Menu"
guitext "^f7---------------------------------" 0
guitext " " 0

guibutton "^f0VColor / Alpha" [showgui rgbguivcolours]
guibutton "^f0Map / Edition Colours" [showgui rgbguimapeditioncolours]
guibutton "^f0Clouds Settings" [showgui rgbguicloudssettings]

guibutton "^f3close" [cleargui]


]0

newgui rgbguihelp [
guilist [
guititle "^f7------------------------------"; guitext "^f3||" 0; guititle "^f7------------------------------";
 guitext "^f3||" 0; guititle "^f7------------------------------" ; guitext "^f3||" 0; guititle "^f7-------------"; guitext "^f3||" 0
]
guititle "^f0Hmm, you dont need help lel, its easy to use!"
guilist [
guitext "^f3Warning:" 0; guitext "  " 0; guititle "^f0 Be careful about the flood, for example in skyboxcolour color change"
]

]0

newgui rgbguivcolours [
guistayopen [
//Some IF'
if (< $valpha_1 0)[valphalvl = "..."]
if (= $valpha_1 0)[valphalvl = "Fake NoAlpha"]
if (>= $valpha_1 1)[valphalvl = "Invisible Alpha"]
if (>= $valpha_1 50)[valphalvl = "Medium Alpha"]
if (>= $valpha_1 100)[valphalvl = "Less Alpha"]
if (>= $valpha_1 200)[valphalvl = "Fake NoAlpha"]
if (>= $vcolorg 250)[vcolorg = 255 ; ]
if (>= $vcolorb 250)[vcolorb = 255 ; ]
if (>= $vcolorr 250)[vcolorr = 255 ; ]
//

guititle "^f1Vcolor / Alpha"
guitext "^f7------------------------------------------------------------------" 0
guitext " " 0

guilist [
guitext "^f7Vcolor:" 0;
guitext " " 0;
guicolor (+ (* (+ (* $vcolorr 256) $vcolorg) 256) $vcolorb)
]

guislider "vcolorr" 0 255 [vcolor (divf $vcolorr 250) (divf $vcolorg 250) (divf $vcolorb 250)]
guislider "vcolorg" 0 255 [vcolor (divf $vcolorr 250) (divf $vcolorg 250) (divf $vcolorb 250)]
guislider "vcolorb" 0 255 [vcolor (divf $vcolorr 250) (divf $vcolorg 250) (divf $vcolorb 250)]

guilist [
guititle "^f7Show in HUD:";
guitext " " 0;

guibutton "^f1Yes" [
simpositivonegativo = "^f0<" ;
naopositivonegativo = "" ;

edithud = [
        edithud = [
        format "%4 ^f7%5 R: %1 / G: %2 / B: %3. /" $vcolorr $vcolorg $vcolorb]
]

] 0 ;

guitext " " 0;
guitext $simpositivonegativo 0;
guitext " " 0;

guibutton "^f3No" [

naopositivonegativo = "^f0<" ;
simpositivonegativo = " " ;
edithud = [ ]
] 0 ;

guitext " " 0;
guititle "^f0" $naopositivonegativo ;
guitext " " 0;
]

guilist [

guitext "^f7EditBind to Gradient Effect:" 0;
guitext " " 0;
guifield vcolorkey -5 [ echo "^f7New key:" $vcolorkey];
guitext " "0 ;
guibutton "^f0<<Save" [showgui editbindconfirmation]0 ;

]

guibar

guilist [
guitext "^f7Valpha:" 0; guitext " " 0; guititle "^f1" $valphalvl ;
]
guislider "valpha_1" 0 255 [valpha (divf $valpha_1 250)]
//vcolor $vcolorr $vcolorg $vcolorb)


guitext " " 0

guibutton "^f3Back" [showgui rgbgui]

]]0


newgui rgbguimapeditioncolours [
guistayopen [

guititle "^f1Map / Edition Colours"
guitext "^f7------------------------------------------------------------------" 0
guitext " " 0

guilist [
guitext "^f7SkyboxColour:" 0;
guitext " " 0;
guicolor (+ (* (+ (* $skycolorr 256) $skycolorg) 256) $skycolorb)
]

guislider "skycolorr" 0 255 [skyboxcolour ($skycolorr 250) ($skycolorg 250) ($skycolorb 250)]
guislider "skycolorg" 0 255 [skyboxcolour ($skycolorr 250) ($skycolorg 250) ($skycolorb 250)]
guislider "skycolorb" 0 255 [skyboxcolour ($skycolorr 250) ($skycolorg 250) ($skycolorb 250)]


guilist [
guitext "^f7OutlineColour:" 0;
guitext " " 0;
//guifield waternum -5
//guitext " " 0;
guicolor (+ (* (+ (* $outlinecolourr 256) $outlinecolourg) 256) $outlinecolourb)
]

guislider "outlinecolourr" 0 255 [outlinecolour ($outlinecolourr 250) ($outlinecolourg 250) ($outlinecolourb 250)]
guislider "outlinecolourg" 0 255 [outlinecolour ($outlinecolourr 250) ($outlinecolourg 250) ($outlinecolourb 250)]
guislider "outlinecolourb" 0 255 [outlinecolour ($outlinecolourr 250) ($outlinecolourg 250) ($outlinecolourb 250)]



guilist [
guitext "^f7FogColour:" 0;
guitext " " 0;
//guifield waternum -5
//guitext " " 0;
guicolor (+ (* (+ (* $fogcolourr 256) $fogcolourg) 256) $fogcolourb)
]

guislider "fogcolourr" 0 255 [fogcolour ($fogcolourr 250) ($fogcolourg 250) ($fogcolourb 250)]
guislider "fogcolourg" 0 255 [fogcolour ($fogcolourr 250) ($fogcolourg 250) ($fogcolourb 250)]
guislider "fogcolourb" 0 255 [fogcolour ($fogcolourr 250) ($fogcolourg 250) ($fogcolourb 250)]
guitext "^f7Fog" 0;
guislider "fog" 16 1500 [fog $fog]

guitext " " 0

guibutton "^f3Back" [showgui rgbgui]

]]0


newgui rgbguicloudssettings [
guistayopen [
guititle "^f1Clouds Settings"
guitext "^f7------------------------------------------------------------------" 0

guilist [

guitext "^f7Cloudlayer:" 0;
guitext " " 0;
guibutton "^f0clouds01" [cloudlayer skyboxes/clouds01] 0; guitext " " 0;
guibutton "^f0clouds02" [cloudlayer skyboxes/clouds02] 0; guitext " " 0;
guibutton "^f0clouds03" [cloudlayer skyboxes/clouds03] 0;
]

guitext " " 0;

guitext "^f1CloudScale" 0;
guislider "cloudscale" 0 64 [cloudscale (+f $cloudscale 0.1)]
guitext " " 0;

guilist [
guitext "^f1ScrollX:" 0; guitext " " 0; guibutton "^f0Stop" [cloudscrollx 0] 0 ;
]
guislider "cloudscrollx" -16.0 16.0 [cloudscrollx (+f $cloudscrollx 0.1)];

guilist [
guitext "^f1ScrollY:" 0; guitext " " 0; guibutton "^f0Stop" [cloudscrolly 0] 0 ;
]
guislider "cloudscrolly" -16.0 16.0 [cloudscrolly (+f $cloudscrolly 0.1)];


guitext " " 0

guibutton "^f3Back" [showgui rgbgui]
]]0



newgui editbindconfirmation [
guititle "^f7 Hi" $getname we need ur confirmation here.
guititle " "
guitext "the following settings have changed:"
guititle " "
guilist [
guitext "^f1" 0; guititle "^f7editbind" $vcolorkey = ;
guitext "^f7 [" 0 ;
guititle "^f1" (geteditbind $vcolorkey) ;
guitext "^f7 ] " 0 ;
]
guititle " "
guititle " "
guititle " "
guititle "^f7TO"
guititle " "
guilist [
guitext "^f1" 0; guititle "^f7editbind" $vcolorkey = ;
guitext "^f7 [" 0 ;
guititle "^f1" Gradient Effect ;
guitext "^f7 ] " 0;
]
guibar
guitext "apply changes now?"

guibutton "yes" [
editbind $vcolorkey [vcolor $vcolorr $vcolorg $vcolorb ;
vcolorr = (+f $vcolorr 0.1);
vcolorg = (+f $vcolorg 0.1);
vcolorb = (+f $vcolorb 0.1)];


echo Done, new bind added, key: $vcolorkey | command: (geteditbind $vcolorkey) |; showgui rgbgui]
guibutton "no" [cleargui; echo "^f3Finish."]
]"^f7Vcolor/Valpha"
//RgbGui by Salatiel
//Thanks MysteryCube for 'divf' and '+f' commands!


//Some Variables
simpositivonegativo = ""
naopositivonegativo = ""
vcolorr = 0.0
vcolorg = 0.0
vcolorb = 0.0
skycolorr = 0
skycolorg = 0
skycolorb = 0
outlinecolourr = 0
outlinecolourg = 0
outlinecolourb = 0
fogcolourr = 0
fogcolourg = 0
fogcolourb = 0
waternum = 1
vcolorkey = ""
valpha_1 = "-1"
nada = ""
gradienteffect = [(+ $vcolorr 2)(+ $vcolorg 2) (+ $vcolorb 2)]
rgbgui = [if (= $getmode 1)[showgui rgbgui][echo "^f7operation only allowed in edit mode"]]
//

newgui rgbgui [
guilist [
guitext "^f4    || " 0 ;
guititle "^f0RGB GUI" ; guitext "^f4 ||" 0 ;
]

guititle "^f1Main Menu"
guitext "^f7---------------------------------" 0
guitext " " 0

guibutton "^f0VColor / Alpha" [showgui rgbguivcolours]
guibutton "^f0Map / Edition Colours" [showgui rgbguimapeditioncolours]
guibutton "^f0Clouds Settings" [showgui rgbguicloudssettings]

guibutton "^f3close" [cleargui]


]0

newgui rgbguihelp [
guilist [
guititle "^f7------------------------------"; guitext "^f3||" 0; guititle "^f7------------------------------";
 guitext "^f3||" 0; guititle "^f7------------------------------" ; guitext "^f3||" 0; guititle "^f7-------------"; guitext "^f3||" 0
]
guititle "^f0Hmm, you dont need help lel, its easy to use!"
guilist [
guitext "^f3Warning:" 0; guitext "  " 0; guititle "^f0 Be careful about the flood, for example in skyboxcolour color change"
]

]0

newgui rgbguivcolours [
guistayopen [
//Some IF'
if (< $valpha_1 0)[valphalvl = "..."]
if (= $valpha_1 0)[valphalvl = "Fake NoAlpha"]
if (>= $valpha_1 1)[valphalvl = "Invisible Alpha"]
if (>= $valpha_1 50)[valphalvl = "Medium Alpha"]
if (>= $valpha_1 100)[valphalvl = "Less Alpha"]
if (>= $valpha_1 200)[valphalvl = "Fake NoAlpha"]
if (>= $vcolorg 250)[vcolorg = 255 ; ]
if (>= $vcolorb 250)[vcolorb = 255 ; ]
if (>= $vcolorr 250)[vcolorr = 255 ; ]
//

guititle "^f1Vcolor / Alpha"
guitext "^f7------------------------------------------------------------------" 0
guitext " " 0

guilist [
guitext "^f7Vcolor:" 0;
guitext " " 0;
guicolor (+ (* (+ (* $vcolorr 256) $vcolorg) 256) $vcolorb)
]

guislider "vcolorr" 0 255 [vcolor (divf $vcolorr 250) (divf $vcolorg 250) (divf $vcolorb 250)]
guislider "vcolorg" 0 255 [vcolor (divf $vcolorr 250) (divf $vcolorg 250) (divf $vcolorb 250)]
guislider "vcolorb" 0 255 [vcolor (divf $vcolorr 250) (divf $vcolorg 250) (divf $vcolorb 250)]

guilist [
guititle "^f7Show in HUD:";
guitext " " 0;

guibutton "^f1Yes" [
simpositivonegativo = "^f0<" ;
naopositivonegativo = "" ;

edithud = [
        edithud = [
        format "%4 ^f7%5 R: %1 / G: %2 / B: %3. /" $vcolorr $vcolorg $vcolorb]
]

] 0 ;

guitext " " 0;
guitext $simpositivonegativo 0;
guitext " " 0;

guibutton "^f3No" [

naopositivonegativo = "^f0<" ;
simpositivonegativo = " " ;
edithud = [ ]
] 0 ;

guitext " " 0;
guititle "^f0" $naopositivonegativo ;
guitext " " 0;
]

guilist [

guitext "^f7EditBind to Gradient Effect:" 0;
guitext " " 0;
guifield vcolorkey -5 [ echo "^f7New key:" $vcolorkey];
guitext " "0 ;
guibutton "^f0<<Save" [showgui editbindconfirmation]0 ;

]

guibar

guilist [
guitext "^f7Valpha:" 0; guitext " " 0; guititle "^f1" $valphalvl ;
]
guislider "valpha_1" 0 255 [valpha (divf $valpha_1 250)]
//vcolor $vcolorr $vcolorg $vcolorb)


guitext " " 0

guibutton "^f3Back" [showgui rgbgui]

]]0


newgui rgbguimapeditioncolours [
guistayopen [

guititle "^f1Map / Edition Colours"
guitext "^f7------------------------------------------------------------------" 0
guitext " " 0

guilist [
guitext "^f7SkyboxColour:" 0;
guitext " " 0;
guicolor (+ (* (+ (* $skycolorr 256) $skycolorg) 256) $skycolorb)
]

guislider "skycolorr" 0 255 [skyboxcolour ($skycolorr 250) ($skycolorg 250) ($skycolorb 250)]
guislider "skycolorg" 0 255 [skyboxcolour ($skycolorr 250) ($skycolorg 250) ($skycolorb 250)]
guislider "skycolorb" 0 255 [skyboxcolour ($skycolorr 250) ($skycolorg 250) ($skycolorb 250)]


guilist [
guitext "^f7OutlineColour:" 0;
guitext " " 0;
//guifield waternum -5
//guitext " " 0;
guicolor (+ (* (+ (* $outlinecolourr 256) $outlinecolourg) 256) $outlinecolourb)
]

guislider "outlinecolourr" 0 255 [outlinecolour ($outlinecolourr 250) ($outlinecolourg 250) ($outlinecolourb 250)]
guislider "outlinecolourg" 0 255 [outlinecolour ($outlinecolourr 250) ($outlinecolourg 250) ($outlinecolourb 250)]
guislider "outlinecolourb" 0 255 [outlinecolour ($outlinecolourr 250) ($outlinecolourg 250) ($outlinecolourb 250)]



guilist [
guitext "^f7FogColour:" 0;
guitext " " 0;
//guifield waternum -5
//guitext " " 0;
guicolor (+ (* (+ (* $fogcolourr 256) $fogcolourg) 256) $fogcolourb)
]

guislider "fogcolourr" 0 255 [fogcolour ($fogcolourr 250) ($fogcolourg 250) ($fogcolourb 250)]
guislider "fogcolourg" 0 255 [fogcolour ($fogcolourr 250) ($fogcolourg 250) ($fogcolourb 250)]
guislider "fogcolourb" 0 255 [fogcolour ($fogcolourr 250) ($fogcolourg 250) ($fogcolourb 250)]
guitext "^f7Fog" 0;
guislider "fog" 16 1500 [fog $fog]

guitext " " 0

guibutton "^f3Back" [showgui rgbgui]

]]0


newgui rgbguicloudssettings [
guistayopen [
guititle "^f1Clouds Settings"
guitext "^f7------------------------------------------------------------------" 0

guilist [

guitext "^f7Cloudlayer:" 0;
guitext " " 0;
guibutton "^f0clouds01" [cloudlayer skyboxes/clouds01] 0; guitext " " 0;
guibutton "^f0clouds02" [cloudlayer skyboxes/clouds02] 0; guitext " " 0;
guibutton "^f0clouds03" [cloudlayer skyboxes/clouds03] 0;
]

guitext " " 0;

guitext "^f1CloudScale" 0;
guislider "cloudscale" 0 64 [cloudscale (+f $cloudscale 0.1)]
guitext " " 0;

guilist [
guitext "^f1ScrollX:" 0; guitext " " 0; guibutton "^f0Stop" [cloudscrollx 0] 0 ;
]
guislider "cloudscrollx" -16.0 16.0 [cloudscrollx (+f $cloudscrollx 0.1)];

guilist [
guitext "^f1ScrollY:" 0; guitext " " 0; guibutton "^f0Stop" [cloudscrolly 0] 0 ;
]
guislider "cloudscrolly" -16.0 16.0 [cloudscrolly (+f $cloudscrolly 0.1)];


guitext " " 0

guibutton "^f3Back" [showgui rgbgui]
]]0



newgui editbindconfirmation [
guititle "^f7 Hi" $getname we need ur confirmation here.
guititle " "
guitext "the following settings have changed:"
guititle " "
guilist [
guitext "^f1" 0; guititle "^f7editbind" $vcolorkey = ;
guitext "^f7 [" 0 ;
guititle "^f1" (geteditbind $vcolorkey) ;
guitext "^f7 ] " 0 ;
]
guititle " "
guititle " "
guititle " "
guititle "^f7TO"
guititle " "
guilist [
guitext "^f1" 0; guititle "^f7editbind" $vcolorkey = ;
guitext "^f7 [" 0 ;
guititle "^f1" Gradient Effect ;
guitext "^f7 ] " 0;
]
guibar
guitext "apply changes now?"

guibutton "yes" [
editbind $vcolorkey [vcolor $vcolorr $vcolorg $vcolorb ;
vcolorr = (+f $vcolorr 0.1);
vcolorg = (+f $vcolorg 0.1);
vcolorb = (+f $vcolorb 0.1)];


echo Done, new bind added, key: $vcolorkey | command: (geteditbind $vcolorkey) |; showgui rgbgui]
guibutton "no" [cleargui; echo "^f3Finish."]
]"^f7Vcolor/Valpha"

« Last Edit: March 22, 2017, 12:55:37 PM by Salatiel »
@Salatiel#5274

Suicizer

  • ***
  • 141
  • +6/-5
Re: RGB Gui Menu
« Reply #1 on: March 14, 2017, 08:22:36 AM »
Nice scripty.
What about adding the feature  to return command-settings as they are set?
Like knowing what parameters of vcolor has been used.

Salatiel

  • ***
  • 114
  • +25/-1
    • Projects by Salatiel
Re: RGB Gui Menu
« Reply #2 on: March 14, 2017, 02:37:47 PM »
Nice scripty.
What about adding the feature  to return command-settings as they are set?
Like knowing what parameters of vcolor has been used.

Thanks!.
 Do you mean, for example, select a block and know what value of vcolor was used in it?, the idea was exactly this at the beginning, but it does not seem possible to do... Unfortunately you can only see the name of the selected texture.
@Salatiel#5274

Suicizer

  • ***
  • 141
  • +6/-5
Re: RGB Gui Menu
« Reply #3 on: March 15, 2017, 01:14:50 PM »
Nice scripty.
What about adding the feature  to return command-settings as they are set?
Like knowing what parameters of vcolor has been used.

Thanks!.
 Do you mean, for example, select a block and know what value of vcolor was used in it?, the idea was exactly this at the beginning, but it does not seem possible to do... Unfortunately you can only see the name of the selected texture.


Exactly that idea. I know it's tough to do. That's why I'm asking do so =P.

Salatiel

  • ***
  • 114
  • +25/-1
    • Projects by Salatiel
Re: RGB Gui Menu
« Reply #4 on: March 22, 2017, 01:01:08 PM »

Quote
Exactly that idea. I know it's tough to do. That's why I'm asking do so =P.

I added something similar, "printcube". Maybe it will work.  ; )
@Salatiel#5274

RaZgRiZ

  • *
  • 12
  • +0/-1
Re: RGB Gui Menu
« Reply #5 on: March 25, 2017, 02:32:01 PM »

Salatiel

  • ***
  • 114
  • +25/-1
    • Projects by Salatiel
Re: RGB Gui Menu
« Reply #6 on: March 25, 2017, 04:05:53 PM »


Instead of just posting an image why not leave your feedback?
« Last Edit: January 21, 2020, 03:01:17 AM by Salatiel »
@Salatiel#5274

RaZgRiZ

  • *
  • 12
  • +0/-1
Re: RGB Gui Menu
« Reply #7 on: March 25, 2017, 11:07:33 PM »
Cause I don't really do any worthwhile code for sauer's GUI for years now. Thought it might be a bit inspirational to look at my iteration and perhaps gain a few ideas to expand your own skills. You seem interested in cubescript, at least to a degree, so I could teach you a thing or two if you're interested :)