View topic - Widget Handler Implementation



All times are UTC + 1 hour


Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 29 Dec 2009, 05:12 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
I'm looking at the widget handler and trying to figure out how it works so that I can implement something similar in other projects

As I understand it so far widget loading goes along the following lines, please correct em if Im wrong or miss out a vital step

A new table is created that holds the widget, it's filled in with some functions that act as default callbacks, and a reference to the widget handler is inserted

This widget is then set in it's own environment using setfenv, and then the widget file loaded into a variable is then passed to pcall, filling in Widget with all the methods and variables, as well as executing any lines of code.

The widget table is then added to the main list and sorted into the right order.

Is that correct? Am I missing any important steps? Is there a better ideal way that we don't use because we already have this setup? I assume the gadget handler works the same way?


Top
 Offline Profile  
 
PostPosted: 29 Dec 2009, 15:19 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
don't try to learn from the current widgetHandler, it's very very bad code.

First the way widgets are managed is very inefficient, and then the way callins are handled is very very very inefficient. It needs a totally new implementation, trepan already did parts of such a recode for bzFlag, but I didn't checked it yet.


Top
 Online Profile  
 
PostPosted: 29 Dec 2009, 15:25 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
hmmm so what exactly would you suggest?


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.