Page 2 of 3
Re: Update: Chili v2.1 (faster than light)
Posted: 17 Sep 2013, 06:54
by smoth
I updated to try the new version out:
1)
downloaded the latest and had many sorted issues:
[f=0000340] [Chili] Warning: You are using a custom textbox2132::DrawControl in widget "Chili Chat".
Please note that with Chili 2.1 the (self.x, self.y) translation is moved a level up and does not need to be done in DrawControl anymore.
When you adjusted your code set `drawcontrolv2 = true` in the respective control to disable this message.
is spammed so much that my game near locks up.
it does this for a few others as I was able to tell once I disabled the chili chat.
It is worth noting that I use a very old version that is modified, same for cusor tips and selections.
2) the ui elements are generally piled into heaps on the screen:

before

after
you will also notice how the transparency is odd and many other issues(including but not limited to issues with nested controls.. I tested against dev but the thing crashes before I can shut off chili chat and cursor tip before they crash. It is still just as bad as the old version(current release of spring) looks
Re: Update: Chili v2.1 (faster than light)
Posted: 17 Sep 2013, 12:27
by jK
smoth wrote:[f=0000340] [Chili] Warning: You are using a custom textbox2132::DrawControl in widget "Chili Chat".
Please note that with Chili 2.1 the (self.x, self.y) translation is moved a level up and does not need to be done in DrawControl anymore.
When you adjusted your code set `drawcontrolv2 = true` in the respective control to disable this message.
It says what you have to do. Also you use a custom skin, this needs to be adjusted, too.
Re: Update: Chili v2.1 (faster than light)
Posted: 17 Sep 2013, 16:46
by smoth
I was using the default skin, my custom skin is not being used right now.
where do I put this if not in draw control?
Re: Update: Chili v2.1 (faster than light)
Posted: 17 Sep 2013, 23:53
by gajop
I'm lazy so I'll guess: nowhere!
It's probably the parent control (or whatever method invokes it) that performs the translation.
No idea about drawcontrolv2, sorry.
Re: Update: Chili v2.1 (faster than light)
Posted: 18 Sep 2013, 01:20
by smoth
Yeah I added it to everything and suddenly stuff worked.. but that seems like a hack? why did I need to do this?
Re: Update: Chili v2.1 (faster than light)
Posted: 18 Sep 2013, 13:31
by jK
Cause the translation happens now to a different time.
Before the control was directly rendered to screen/displaylist, so DrawControl was something like "I DrawMe at (x,y)".
Now with FTL it (mostly) doesn't render to screen anymore, instead DrawControl renders to a FBO/texture with the exact dimensions of the control to draw. The translation to draw this cached texture at (x,y) happens now to a different time and place.
PS: I also added backcompability (it's what logs `drawcontrolv2`) code that counters the translation in FBO stage. It works fine in ZK, duno why it didn't for you. So I thought you are using a custom skin/theme.
Re: Update: Chili v2.1 (faster than light)
Posted: 18 Sep 2013, 17:09
by smoth
So I am not getting any of the speed boost currently by adding thebtag in my controls?
Re: Update: Chili v2.1 (faster than light)
Posted: 18 Sep 2013, 18:03
by gajop
You are.
The drawcontrolv2=true tells chili that your control is updated to FTL chili, so optimization can be performed.
Re: Update: Chili v2.1 (faster than light)
Posted: 18 Sep 2013, 18:25
by smoth
why do I have to add the tag? how do I know if my code is even utilizing it? if not, the why does it spam hard?
As in why do I add the tag, it doesn't auto make my code utilize this new feature and if it does, why even require it?
Re: Update: Chili v2.1 (faster than light)
Posted: 18 Sep 2013, 18:32
by gajop
Either you are using a custom skin or control (and there's no way knowing that got ported unless that tag is explicitly set), or there's a bug in chili. Can you try to explicitly set the skin instead, or perhaps show us some code?
Re: Update: Chili v2.1 (faster than light)
Posted: 18 Sep 2013, 18:45
by smoth
I have an svn which is acessible.
http://springrts.com/phpbb/viewtopic.php?f=9&t=28265
you can grab it and see what I mean. I cannot chat long. I am out of town and will be leaving the hotel shortly.
Re: Update: Chili v2.1 (faster than light)
Posted: 18 Sep 2013, 23:36
by gajop
Did you by chance modify chili a bit?
You have a drawcontrolv2=true in the 4th line of the Control class, as well as in the drawcontrolv2=nil in the 57th.
EDIT:
Deleting the 57th line gets rid of the messages.
I don't think you should modify the controls though (as it's a skin thing). A more natural approach would be to modify your skin.lua file instead (gskin in your case). Can jk comment on this? Exactly what (and where) should get modified?
I'm looking
at the code and it's not obvious to me. It seems that it'll trigger that message for every skin that has a DrawControl, and most do, and there's no drawcontrolv2 set anywhere else in the code, so it doesn't seem like it would work with the default skins either.
Re: Update: Chili v2.1 (faster than light)
Posted: 19 Sep 2013, 00:13
by jK
gajop wrote:Did you by chance modify chili a bit?
You have a drawcontrolv2=true in the 4th line of the Control class, as well as in the drawcontrolv2=nil in the 57th.
EDIT:
Deleting the 57th line gets rid of the messages.
I don't think you should modify the controls though (as it's a skin thing). A more natural approach would be to modify your skin.lua file instead (gskin in your case). Can jk comment on this? Exactly what (and where) should get modified?
I'm looking
at the code and it's not obvious to me. It seems that it'll trigger that message for every skin that has a DrawControl, and most do, and there's no drawcontrolv2 set anywhere else in the code, so it doesn't seem like it would work with the default skins either.
That code is ONLY triggered when there is a custom DrawControl() -> means the widget (outside of chili!) overrides the chili's default (being the result of the control itself & skin & ...) DrawControl().
An example code that will trigger the lines:
Code: Select all
Chili.Control:New{
...
DrawControl = function(self) ... end;
...
}
Re: Update: Chili v2.1 (faster than light)
Posted: 19 Sep 2013, 00:25
by jK
smoth wrote:Yeah I added it to everything and suddenly stuff worked.. but that seems like a hack? why did I need to do this?
NEVER use "it" w/o defining it ... (cause of that I was reading all your later posts in a wrong context ...)
You placed drawcontrolv2=true _where_? The message you quoted in the first post gives you an _exact_ _single_ location where to place it if _after_ you fixed the code in there! ->
Warning: You are using a custom textbox2132::DrawControl in widget "Chili Chat".
-> search for a TextBox:New{ ... DrawControl = ... } in the "Chili Chat" widget
Re: Update: Chili v2.1 (faster than light)
Posted: 19 Sep 2013, 00:42
by gajop
jK wrote:That code is ONLY triggered when there is a custom DrawControl() -> means the widget (outside of chili!) overrides the chili's default (being the result of the control itself & skin & ...) DrawControl().
Ahh, that clears things up a bit.
Btw he has drawcontrolv2=true in a couple of places (control.lua, button.lua, progressbar.lua, and some other controls), but I am not seeing (by magic of grep) DrawControl=... in any of his chili widgets. I guess this might be the result of some random chili modification or something similar.
Re: Update: Chili v2.1 (faster than light)
Posted: 19 Sep 2013, 00:50
by smoth
When you adjusted your code set `drawcontrolv2 = true` in the respective control to disable this message.
I though he meant within the control that was used.
Re: Update: Chili v2.1 (faster than light)
Posted: 19 Sep 2013, 00:52
by jK
https://github.com/jk3064/chiliui/blob/ ... t.lua#L200
your version differs there. why didn't you copied the whole chili folder to update it?
Re: Update: Chili v2.1 (faster than light)
Posted: 19 Sep 2013, 16:48
by smoth
not entirely sure. I copied it right out of the zip file link provided on the site, maybe I miss clicked on one of the overwrite prompts? even still before that time I had tried with deleting /widgets/chili folder to see if that helped.
Re: Update: Chili v2.1 (faster than light)
Posted: 19 Sep 2013, 18:12
by smoth
ok, so here is my next issue, before the panelscroll update(which doesn't seem to be working but I will try again after I can resolve this issue. All of the controls are rendering oddly. It is like some crazy blending issue:
at first I was thinking maybe I messed up my color values but then I realized it was across several other image controls and other areas as well.
but then I tried the comet catcher map
Have you noticed this? is it just me?
Re: Update: Chili v2.1 (faster than light)
Posted: 19 Sep 2013, 18:39
by jK
You are likely still not using a clean recent chili ...
- Backup your skins in some other folder
- delete your whole chili (folder + api_chili.lua)
- copy new chili folder + widget
- copy back your skins