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?
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
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?
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
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
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
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
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.
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.
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
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
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
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.
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.
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
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.
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.
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?