New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gui] added colordiffuse attribute on texture definition #1772
Conversation
it would be nice if this gets into frodo, because without this you need two button controls to use a colordiffuse while button gets focused. |
there are 100's of things that would be nice to have in frodo :) but reality is, we're way past feature freeze and have beta1 knocking around the corner. |
@ronie i only want a statement if this could get in or not .. sorry if I seem a little impatient ;) |
No, this won't be going in for Frodo. |
@jmarshallnz is there a reason why this is rejected? |
@xhaggi |
thanks |
Now you have some time, you should look at a couple of extra things. Since I put the original PR in, the code base has moved on. The change as submitted does not allow for skin variables to be used in the texture colordiffuse attribute, whereas the control diffusecolor allows this. Also I don't think the original point with one diffuse overriding the other was the real issue, I thought it was about merging the two. The reason the borderdiffuse was rejected was because you could use a bordertexture, however this cannot be applied as an attribute - maybe you could look at this as well. |
@lemonboy999 as you can see in the main description of this PR, it is possible to use $VAR and $INFO .. so i don't know what you mean with skin variables? |
Sorry, I meant that although you can put a $VAR as the colordiffuse attribute, it will only use the value when the control is created and wont update as the $VAR changes. You need to put an extra check in the TextureBase::SetDiffuseColor routine. |
@jmarshallnz post-frodo ping. |
@@ -23,6 +23,7 @@ | |||
#include "TextureManager.h" | |||
#include "GUILargeTextureManager.h" | |||
#include "utils/MathUtils.h" | |||
#include "GUIInfoTypes.h" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
You currently don't call Update() on the CGUIInfoColor, so it won't work with $INFO or $VAR as things stand. I suggest calling it in SetDiffusedColor() would be the best place. Obviously you need to check the Update() routine's return value to return the appropriate changed status. Exactly how the control's diffuse color and the textures diffuse color interact will need defining. ATM you have the texture's diffuse color overriding the controls. This may not be what is wanted. For example, it might make sense for them to be diffused (multiplied). |
@jmarshallnz thank you for the hints .. i will change it in a few days. The main reason for this PR is to use it on button controls with |
@jmarshallnz changed up on your hints |
Looks good. Queued for next merge window (May 1->May 10). Before then, it'll need squashing down. |
would it be lot of work to also allow this for radiobutton textures? that would be great, too. |
@phil65 it work's for every texture control .. the comment was an unfortunate choise , I will update it |
Will this also work for the label / altlabel of the togglebutton? Edit: |
@MassIV only for texture controls .. no labels. |
@MartijnKaijser something wrong with this, because it was not included in the last merge window |
Nope - my fault for not hitting the button. Apologies. |
[gui] added colordiffuse attribute on texture definition
if (m_alpha != 0xFF) color = MIX_ALPHA(m_alpha, m_diffuseColor); | ||
|
||
// diffuse color | ||
color_t color = (m_info.diffuseColor) ? m_info.diffuseColor : m_diffuseColor; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Thanks - we'll keep you on :) |
This PR adds color diffuse attribute for texture definitions.
It's based on the PR #268 and gets rid of the borderdiffuse attribute. also it don't override m_diffuseColor as @jmarshallnz has suggested.
Example:
Works for all texture controls, for example textureradioon, textureradiooff, texturefocus, texturenofocus etc.