Page 2 of 2

Re: UI how to start ?

Posted: 15 Jun 2011, 22:06
by EatMyShrapnel
ok always caps problem i renamed :
  • Controls
    Handlers
    Skins
    Headers
    Themes
in
  • /home/user/.spring/LuaUI/Widgets/chili
some chili stuff works some other don't :

Code: Select all

[f=0001499] Loading:  LuaUI/Widgets/gui_chili_facbar.lua
[f=0001499] false
[f=0001499] Error in Initialize(): [string "LuaUI/Widgets/gui_chili_facbar.lua"]:281: attempt to call field 'GetBuildIconFrame' (a nil value)
[f=0001499] Removed widget: Chili FactoryBar
[f=0001593] Loading:  LuaUI/Widgets/gui_chili_minimap.lua
[f=0001593] false
[f=0001593] Error in Initialize(): [string "LuaUI/Widgets/gui_chili_minimap.lua"]:125: attempt to index field 'crude' (a nil value)
[f=0001593] Removed widget: Chili Minimap

Re: UI how to start ?

Posted: 15 Jun 2011, 23:37
by EatMyShrapnel
I found a way to work ChiliFactory Bar by replacing

Code: Select all

file2 = WG.GetBuildIconFrame(ud),
with

Code: Select all

file2 = 'LuaUI/Images/nested_buildmenu/frame_Fac.png',
in gui_chili_facbar.lua like someone did in gui_chili_radial_buildmenu.lua

i commented from line 120 to line 126 in gui_chili_minimap.lua and Chiliminimap works but not properly :
Image
As you can see I don't have comands menu...

Re: UI how to start ?

Posted: 16 Jun 2011, 00:08
by luckywaldo7
You will need a lot of stuff from 'zk/LuaUI/Images', maybe just copy the whole folder maybe to (You will probably end up using mostly your images in the end anyway).

There is also some necessary files in 'zk/LuaUI/Configs', just take whatever mentions chili.

Not things needed by the chili framework itself but by the various chili widgets that zk packages.

Re: UI how to start ?

Posted: 16 Jun 2011, 00:16
by EatMyShrapnel
i think you right, moreover after scrolling in infologs, i saw that i need luarules too. Now I have other errors... well i take a break! :mrgreen: horror movie & coffee time

Re: UI how to start ?

Posted: 16 Jun 2011, 02:10
by EatMyShrapnel
Well, i just saw that some lua files use a directory called images and some other use a directory called Images such things should not hapen! I know that windows don't take care about sensitive but linux does! so you should take a decision about caps or not and respect it every where.

Re: UI how to start ?

Posted: 16 Jun 2011, 02:57
by EatMyShrapnel
EatMyShrapnel wrote:I found a way to work ChiliFactory Bar by replacing

Code: Select all

file2 = WG.GetBuildIconFrame(ud),
about that i just read :

Code: Select all

NOTE FOR OTHER GAME DEVS:
	ZK uses WG.GetBuildIconFrame to draw the unit type border around buildpics.
	If you're not using them (likely), remove all lines containing that function.

Re: Chili exploration

Posted: 16 Jun 2011, 04:15
by EatMyShrapnel
many things works now :
Image
I had to change several stuffs.

Now I have some problem with tooltip if someone can explains to me what do these lines in gui_chili_tip.lua:

Code: Select all

local function GetUnitIcon(ud)

	if not ud then return false end

	return icontypes 

		and	icontypes[(ud and ud.iconType or "default")].bitmap

		or 	'icons/'.. ud.iconType ..iconFormat

end
that can maybe help me. Here the error msg in infologs.txt :

Code: Select all

[f=0040418] Loading:  LuaUI/Widgets/gui_chili_selections_and_cursortip.lua
[f=0040566] false
[f=0040566] Error in Update(): [string "LuaUI/Widgets/gui_chili_tip.lua"]:872: attempt to index field '?' (a nil value)
[f=0040566] Removed widget: Chili Cursor Tip 3
Other problem, when I start the game some chili widgets are in yellow in the widget selector, if i click on to activate them they works. In infologs.txt I have no information about any error or stop. They appear loaded at the start in infolog.txt
another coffee & horror movie break

Re: Chili exploration

Posted: 16 Jun 2011, 04:46
by luckywaldo7
That looks like it gets the strategic icon of the unit to use in the tooltip:
screen00032.png
screen00032.png (70.74 KiB) Viewed 4418 times

Re: Chili exploration

Posted: 16 Jun 2011, 05:45
by EatMyShrapnel
thx, with your help i fixed the problem :
Image

when I start the game some chili widgets are in yellow in the widget selector, if i click on to activate them they works. In infologs.txt I have no information about any error or stop. They appear loaded at the start in infolog.txt. I did some interesting test :
if I load any chili widget before Chili framework, the widget don't work, this is correct. I think I have to load the framework beofre any widget, but I don't know how to do that

Re: Chili exploration

Posted: 16 Jun 2011, 06:47
by jK
EatMyShrapnel wrote:when I start the game some chili widgets are in yellow in the widget selector, if i click on to activate them they works. In infologs.txt I have no information about any error or stop. They appear loaded at the start in infolog.txt. I did some interesting test :
if I load any chili widget before Chili framework, the widget don't work, this is correct. I think I have to load the framework beofre any widget, but I don't know how to do that
That's why chili needs currently a modified widgetHandler. Chili defines `api=true` in its GetInfo() and CA/ZK's widgetHandler loads those before all others.

(BTW the new widgetHandler will support a much more selective dependency method, similar to the one in gentoo's init.d scripts)

Re: Chili exploration

Posted: 16 Jun 2011, 19:54
by EatMyShrapnel
I see :

Code: Select all

[f=0000000] Loaded API widget:  Shared Functions    <api_shared_functions.lua>
[f=0000000] Loaded API widget:  Modular Comm Info   <api_modularcomms.lua>
[f=0000000] Loaded API widget:  Chili Framework     <api_chili.lua>
[f=0000000] Loaded API widget:  Lups                <lups_wrapper.lua>
[f=0000000] Set UnitIconDist to 250
[f=0000000] Ground decals are enabled
[f=0000000] Advanced shading enabled
[f=0000000] Set maximum particles to: 20000
[f=0000000] Loaded widget:  EPIC Menu           <gui_epicmenu.lua>
but infologs doesn't tell me from which file you specify to load the framework before other widget. I tried to find api_chili.lua in any file but I failed. So please tell me how to say to spring to load the framework before widget

Re: Chili exploration

Posted: 17 Jun 2011, 00:24
by jK
I did.

Re: Chili exploration

Posted: 17 Jun 2011, 01:52
by EatMyShrapnel
if you mean i have to add api=true, it's already did since i copied the files from ZK, but that's not solve my problem. Maybe my english skill isn't good enough, so tell me more.

where can I follow the work on the new widget handler ? where can I get information on it, (like a doxygen). It's painfull to explore chili, no documentation, no readme, and as I said you must respect the sensitive case of files and folders names for linux users.

Re: UI how to start ?

Posted: 18 Jun 2011, 12:23
by sunspot
EatMyShrapnel wrote:Guys,

first, please give me a link where I can found this ChiliUI. Even S44 don't want chili, for me that's can be a good start to see how stuff works. I search how to start an UI, I found threads related to ICEui, here people said forget it and use Chili, now you speak about new widgethandler.

second, tell me more about the new widgethandler, where i can get information, like a TODO, where i can get documentation how to use it (Doxygen or something like),...

third, it would be cool for people who can to write tutorials in the wiki :
- Hello world
- adding picture
- adding button
- link basic command to a button
- etc.
I'll write a tutorial once I have a firm grasp on how the stuff works i'm almost there !

Re: Chili exploration

Posted: 18 Jun 2011, 22:32
by CarRepairer
Hi. If you want a nice laugh, here is an old version of S44 when it briefly had some really oldskool Chili. Mixed up with some IceUI in there as well.

Image

Re: Chili exploration

Posted: 19 Jun 2011, 02:38
by FLOZi
Makes my eyes cry. Worst thing is, much of it hasn't moved on graphically since then.

Re: Chili exploration

Posted: 19 Jun 2011, 19:18
by sunspot
basic tutorial is written btw

http://springrts.com/wiki/UI:Development

Re: Chili exploration

Posted: 19 Jun 2011, 21:57
by smoth
good on ya sunspot.

Re: Chili exploration

Posted: 26 Jun 2011, 21:26
by sunspot
I've created the final lesson to create buttons for commands hope you find it usefull

http://springrts.com/wiki/UI:Development