UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

adding fade to menu item

broken avatar :(
Created 8 years ago
by buttkicker845
0 Members and 1 Guest are viewing this topic.
6,884 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Signature
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
i want to add a fade to a menu button based on a the value of a dvar, so like when(dvarint(displayAllies) == 0) there would be a fade on the menu button making it look like it cant be pressed.  is this possible to do?
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
i want to add a fade to a menu button based on a the value of a dvar, so like when(dvarint(displayAllies) == 0) there would be a fade on the menu button making it look like it cant be pressed.  is this possible to do?

You would make another itemDef and adjust the visible when to that dvar. That itemdef would be the same basically except for the visible when and the forecolor. The forth digit on the forecolor controls intensity

Edit: realized you meant like a choice button. Thats like this

Code Snippet
Plaintext
			CHOICE_BUTTON_BG( 11, when(  !dvarint(gamemode) && dvarint(totalplayers)>1 ) )
CHOICE_HIGHLIGHT( 11, when(  !dvarint(gamemode) && dvarint(totalplayers)>1 ) )
CHOICE_DVARFLOATLIST_VIS( 11, "MAGIC BOX", communbox, { "^2Share Box Weapons" 0 "^1Don't Share Box Weapons" 1 }, ;, when( !dvarint( ui_multiplayer ) && !dvarint(gamemode) && dvarint(totalplayers)>1 ) ) 


I'm using two dvars to decide when it is visible. Can be done either way depending what you are trying to do.
Last Edit: March 01, 2016, 12:43:57 am by MakeCents
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
the button i have isnt really a choice button since there is only one text value, i just want the text to be faded out or fully visible based on when a dvar is set to 0 or 1 . does that make sense?
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
the button i have isnt really a choice button since there is only one text value, i just want the text to be faded out or fully visible based on when a dvar is set to 0 or 1 . does that make sense?
yes and I did something similar using the dvar itself

In the itemdef

Under it I think

Exp forcolor a ( dvarint( "" ) * 0.1 )

If memory serves

Control the dvar in gsc
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha

Exp forcolor a ( dvarint( "" ) * 0.1 )


I've not suceeded in adjusting the forecolor at all with a dvar so if you really did get this working, please let us all know how here.

Yeah editing forecolor, besides alpha, I do not think is possible. I tried exp forecolor R, G, and B and also exp forecolor C for the whole color all together, and mod builder said only 'A' for alpha works. And you cannot use dvars on anything but 'exp' and 'visible when();' so yeah the only way to change the color is making different ItemDef's which is kinda limiting.
Although you are trying to edit alpha, and here alaurence9 may be implying that it may work for only alpha, so you could try that
Code Snippet
Plaintext
exp forecolor 1 1 1 dvarint(dvar)

the button i have isnt really a choice button since there is only one text value, i just want the text to be faded out or fully visible based on when a dvar is set to 0 or 1 . does that make sense?
You should paste your code so we know what you are dealing with then I guess and then go from there. I have a few buttons that are in itemdefs. Is that what you have?

Edit: Also, I assumed this is an in game menu right, scriptmenu?
Last Edit: March 01, 2016, 02:07:04 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
I've not suceeded in adjusting the forecolor at all with a dvar so if you really did get this working, please let us all know how here.
Although you are trying to edit alpha, and here alaurence9 may be implying that it may work for only alpha, so you could try that
I already told you, you can only control alpha in the forecolor.
Code Snippet
Plaintext
exp forecolor 1 1 1 dvarint(dvar)
No, that is completely wrong. If you want to adjust alpha like that, which I used to do, you would do this:
Code Snippet
Plaintext
exp forecolor A dvarFloat( "dvar_name" )
yes and I did something similar using the dvar itself

In the itemdef

Under it I think

Exp forcolor a ( dvarint( "" ) * 0.1 )

If memory serves

Control the dvar in gsc
This is actually a really bad way to do it. If you set dvars constantly on a loop, you risk getting a game-crashing error. I used to get this error http://ugx-mods.com/forum/index.php/topic,10004.0.html . I fixed it by making all my dvar's one shot only.

I have made something that works for fading alpha in and out from 0 to 1 that is controlled in menu only using something I found in wunderfizz csc.
Code Snippet
Plaintext
exp forecolor A max( sin( milliseconds() / 325 ), 0 - sin( milliseconds() / 325 ) )
Last Edit: March 01, 2016, 10:56:33 pm by alaurenc9
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Well that was a much better explanation than before. I previously thought you were talking about the fourth digit, intensity. I may understand enough now.
Last Edit: March 02, 2016, 12:11:32 am by MakeCents
Marked as best answer by buttkicker845 8 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
using the
Code Snippet
Plaintext
exp forecolor A dvarFloat("dvar");
it worked but it didnt do what i wanted it to do because you could still press the button. i got it to work by defining the button twice, one that is full forecolor and one that was .5 forecolor and would show one or the other depending on the dvar.
edit: this is what i did to make it work
Code Snippet
Plaintext
itemDef
{
name german_button
rect 0 310 250 16 //480 420 128 16
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
text "GERMANS"
textfont UI_FONT_OBJECTIVE
textstyle ITEM_TEXTSTYLE_NORMAL
textalign ITEM_ALIGN_TOP_CENTER
textscale (TEXTSIZE_TITLE * .75)
forecolor 1 1 1 1
visible when(dvarint(displayAxis) > 0)
onfocus
{
play "mouse_over";
}
action
{
play "mouse_click";
scriptMenuResponse "axis";
close self;
}
}
itemDef
{
name german_button_dim
rect 0 310 250 16 //480 420 128 16
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
text "GERMANS"
textfont UI_FONT_OBJECTIVE
textstyle ITEM_TEXTSTYLE_NORMAL
textalign ITEM_ALIGN_TOP_CENTER
textscale (TEXTSIZE_TITLE * .75)
forecolor 1 1 1 .5
visible when(dvarint(displayAxis) < 1)
}

the only problem is when you scroll over the button it still highlights and flashes like normal. is there a way to define a an item in a menu not to use the menus focusColor?
Last Edit: March 03, 2016, 04:50:32 am by buttkicker845
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
You want to make some button that looks like it can be pressed?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
in my menu i have a few buttons and a text item as a title but the text item flashes when you hover over it just like the buttons. and i want to remove the flashing from the text item. when i get to my laptop ill post a picture better describing what i mean
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
What the fuck dude? This whole time we were trying to tell you how to make something fade, but this whole time you wanted us to tell you how to make something STOP fading? Wooow good fuckin job describing this dude, couple minutes of my life I'll never get back thanks to you.
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 9 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
What the fuck dude? This whole time we were trying to tell you how to make something fade, but this whole time you wanted us to tell you how to make something STOP fading? Wooow good fuckin job describing this dude, couple minutes of my life I'll never get back thanks to you.
I get it's frustrating when someone fails to explain a problem correctly - I deal with it all the time in IT - but you can't lose your shit and go off on people for it. Calm down.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
What the fuck dude? This whole time we were trying to tell you how to make something fade, but this whole time you wanted us to tell you how to make something STOP fading? Wooow good fuckin job describing this dude, couple minutes of my life I'll never get back thanks to you.

your right you and others WERE helping me to add fade to one item under specific contitions based on a dvar, now im wanting to remove the focuscolor on a different item. these are two different questions. im wanting to remove the flashing focus color on a different item that isnt actually a button.

originally i stated i wanted to add fade to a button in order to make it appear as thought its disabled when a dvar is false later i asked how i would remove the flash(i realized that focuscolor is a better word) on a text item that should not flash when the mouse is hovers over it

next time please completely read and fully understand what is being said before loosing your shit
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
I get it's frustrating when someone fails to explain a problem correctly - I deal with it all the time in IT - but you can't lose your shit and go off on people for it. Calm down.
Lol sorry
your right you and others WERE helping me to add fade to one item under specific contitions based on a dvar, now im wanting to remove the focuscolor on a different item. these are two different questions. im wanting to remove the flashing focus color on a different item that isnt actually a button.

originally i stated i wanted to add fade to a button in order to make it appear as thought its disabled when a dvar is false later i asked how i would remove the flash(i realized that focuscolor is a better word) on a text item that should not flash when the mouse is hovers over it

next time please completely read and fully understand what is being said before loosing your shit
Oh well when you just come out with a new question, especially looking like an answer to MakeCents about the first question, it doesn't seem that way at all. Plus your comments were very loose and un-specific so it looked like you had no idea what you were typing at the top. Anyways that is what the 'New Topic' button is for.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
your right i could have made a new topic for the question but i didnt because the solution for forcing an item in the menu to not use the focuscolor or display the focuscolor defined by the menuDef will be applied to both the title text and the buttons that the original question was being asked about.

is it possible to do this or do all three items have to be defined under a different menuDef?

 
Loading ...