The online racing simulator
#1 - Krayy
[CODE] Common Interface Framework (CIF) & Modules
Holy heck, it's finally here!!

This is my new and improved common look & feel interface for LFSLapper and supersedes the previously released GUI. I was going to wait unitl I had a few more modules done, but I figure that you guys can help me out with the testing and debugging.

NOTE: This addon requires Lapper 6.011 or greater and the latest community utils.lpr that is in the utils.lpr thread : http://www.lfsforum.net/showthread.php?t=71245

Just download the zip file, extract it into your includes folder (it will create the ./cif directory) and add these lines near the top of your addonsused.lpr file:


<?php 
#####################################
# CIF includes
# You can reorder these lines to change the tab order on the sub-menus
#####################################
include ("./cif/cif.lpr");    # This MUST be first to define all of the CIF globals

# CIF Admin Modules #################
include ("./cif/admin_membership.lpr"); # Membership administration

# CIF User Modules #################
include ("./cif/info_who.lpr"); # Who, replaces the who,lpr module and !who command
include ("./cif/info_handicaps.lpr"); # Player Handicap Info
include ("./cif/info_tops.lpr"); # Top output with interactive buttons, replaces tops.lpr, !top, !near, !qual, !nearqual

# CIF Help Modules #################
include ("./cif/help_general.lpr"); # General Help and !help command
include ("./cif/help_admin.lpr"); # Admin Help
include ("./cif/help_stats.lpr"); # Stats Help
include ("./cif/help_custom.lpr"); # Custom server Help
#include ("./cif/help_cruise.lpr"); # Only needed if you're running T3Charmys Cruise system
?>

You will need to comment out the following modules from the addonsused.lpr file too:
  • tops.lpr
  • who.lpr
  • gui*.lpr (anything that starts with gui)
  • handicaps.lpr
  • member_admin.lpr
  • admin_* (older admin guis stuff)
Have a look at the code for now, and I'll put some actual docs on how to create new ones later on.

Updates:
24 Jan 2011
- Big rewrite of cif.lpr module to redraw screen more efficiently
- Rewrite of info_tops.lpr to improve car selections and layout
- utils.lpr updated (see community edition thread link above)
- Handicap module rolled into 1 for Admins and Users alike - stupid having it split into the 2 different ones

02 Feb 2011
- Even bigger rewrite of how the tabs are drawn and redrawn to speed it up
- Modified display so all modules on Tab Bar now
Attached files
cif_2011-02-02.zip - 17.7 KB - 395 views
#2 - Krayy
...now with added screenies!!!

I also want to add a <<back arrow so that you can go to the main cif groupos (Info, Admin, Help, Etc) from any other acreen.
Attached images
cif_admin.jpg
cif_handicaps.jpg
cif_help.jpg
cif_top.jpg
Color me impressed, that's a great bit of programming, the GUI looks great, well done!
didn't you have alot of this already made?(i see now you updated it)... either way nice! :P ... i don't really use LFSLapper anymore but meh :P
Oehh! I love the tops module! ^^
Hope I have some time to check it out soon..

Very good work
Tim
Superb piece of work Krayy!

Been onto my Server provider (500Servers) asking if they'll update the lapper from V5.926 to newest V6 so I can start using this.

Tried it in local mode on my pc and it's great.

I especially like the !top part and how you can find out times by clicking with mouse rather than keying commands.

That's mainly how I've got my lapper; much easier seeing and pressing a button rather than trying to have to remember a specialized command, which can be different for the end user, especially if they jump between servers that may use different versions of homemade lapper scripts or even Aario.

Now for the constructive criticism!

When you invoke the !top command, the screen has the car choice buttons at bottom of the list. They're bit too far down - could do with being brought up a couple of pixels - there's plenty of space under the 18th row of the table.

Also, could do with the standard car group choices (FWD, RWD, GTR, TBO, etc). Would muck up your button display a bit unless you maybe fit on 2 rows?

Now a request.

Could something similar to tops be done for !drf command?

I don't do my list by car, but by position; e.g. 19 to 36, 37 to 55, etc, but anyway would do.
Attached images
Krayy CIF.png
Sinrs drf buttons.png
Sinrs top buttons.png
#7 - Krayy
I just posted an update for th emain cif.lpr and the tops module...see post 1 along with attachments.

As to drift stats, I would think it can be. I'd need to see your .lpr file that displays the current drift scores.

I'm looking at putting in a Grid Reordering module which will require an updated Lapper.exe file which I will post here when I get it tested.
Quote from Krayy :....As to drift stats, I would think it can be. I'd need to see your .lpr file that displays the current drift scores....

See attached.

Nothing special - just opening/closing lots of buttons the long winded way.

Not sure if i've included everything, although most of it should be, and anything missing should be obvious.
Attached files
LFSLapper_Sinanju_drf.txt - 5.9 KB - 347 views
Quote from Krayy :I just posted an update for the main cif.lpr and the tops module...see post 1 along with attachments....

Just downloaded and tried out your updates.

Couple of things.

On the Tops tab, you've removed the handy car type choice from bottom of background button.

Or it's not showing on my pc.

Also. For some reason, and even though I only have your new tops.lpr file and none of the previous tops.lpr files, if you type !top, then lapper will load the normal top listing, then delete it and overlay with your tops listing. See slo-mo movie in attached zipped file.
Attached files
tops.zip - 760.5 KB - 334 views
Quote from sinanju :Just downloaded and tried out your updates.

Couple of things.

On the Tops tab, you've removed the handy car type choice from bottom of background button.

Or it's not showing on my pc.

Also. For some reason, and even though I only have your new tops.lpr file and none of the previous tops.lpr files, if you type !top, then lapper will load the normal top listing, then delete it and overlay with your tops listing. See slo-mo movie in attached zipped file.

For the car lists, make sure you have the latest utils.lpr from the community edition thread as the car array was changed (also check your Lapper error log in the logs directory).

As for the overlay, comment out the old tops.lpr from the addonsused.lpr file.
Quote from Krayy :For the car lists, make sure you have the latest utils.lpr from the community edition thread as the car array was changed.

Whoops, silly me. Put your utils.lpr in wrong version of lapper.

Put it in my test v5.926 (which I use on online server).

Car List now working.
Quote from Krayy :As for the overlay, comment out the old tops.lpr from the addonsused.lpr file.

Don't have either the old tops.lpr file or it listed in the addonsused.lpr file.

Only happens when I type !top.
Quote from sinanju :Don't have either the old tops.lpr file or it listed in the addonsused.lpr file.

Only happens when I type !top.

You'll need to search your lpr files for anything that says something like "!top" (in quotes) to see what lapper script is already tied to the !top command.

BTW, what is in your addonsused.lpr file?
Found !top in the lfslapper.lpr file


<?php 
        
CASE "!top":
            
top$argv );
        BREAK;
?>

Removed the lines and the CIF top is working now.

Thanks.

My addonused.lpr file has


<?php 
#####################################
# CIF includes
# You can reorder these lines to change the tab order on the sub-menus
#####################################
include ("./cif/cif.lpr");    # This MUST be first to define all of the CIF globals

# CIF Admin Modules #################
include ("./cif/admin_membership.lpr"); # Membership administration
include ("./cif/admin_handicaps.lpr"); # Racer Handicap Administration

# CIF User Modules #################
include ("./cif/info_who.lpr"); # Who, replaces the who,lpr module and !who command
include ("./cif/info_handicaps.lpr"); # Player Handicap Info
include ("./cif/info_tops.lpr"); # Top output with interactive buttons, replaces tops.lpr, !top, !near, !qual, !nearqual

# CIF Help Modules #################
include ("./cif/help_general.lpr"); # General Help and !help command
include ("./cif/help_admin.lpr"); # Admin Help
include ("./cif/help_stats.lpr"); # Stats Help
include ("./cif/help_custom.lpr"); # Custom server Help
include ("./cif/help_cruise.lpr"); # Cruise Help 
              
include( "./utils.lpr");
include( 
"./myInc.lpr");
        
#### Include for splitting infos ####
include( "./pitboard.lpr");
include( 
"./pitwindow_gui.lpr");
# OR
#include( "./defPitInfo.lpr");
#####################################

#### Include for drifting infos ####
#include( "./driftdef.lpr");
# OR
include( "./driftmeter.lpr");
#####################################

include ("./debug.lpr");

include( 
"./safetycar.lpr");
include( 
"./ctrack.lpr");
include( 
"./listevent.lpr");
include( 
"./winnerflags.lpr");
?>

Rather than having individual on screen modules, would it be possible to have them amalgamated into one?
Attached images
Krayy CIF Amalgamated.png
Bug in admin_membership.lpr
Took ages to find reason why, but your admin_membership.lpr file is overwriting my normal 'welcome' message.

Your code:


<?php 
Event OnConnect
$userName # Player event
    
$NickName GetCurrentPlayerVar("NickName");
    
$Posabs GetCurrentPlayerVar("PosAbs");
    
$Groupqual GetCurrentPlayerVar("GroupQual");

    IF ( 
GetUserStoredNum("MemberType") >= $MEMBERTYPE_AFFILIATE )
    
THEN
        LoginMember
($userName);
    ELSE
        
openPrivButton"welc",25,50,150,15,12,-1,ISB_NONElangEngine ("%{main_welc1}%"$NickName ) );
        
openPrivButton"pos",25,80,150,10,8,-1,ISB_NONElangEngine ("%{main_welc2}%",$Posabs,$Posqual,$Groupqual  ) );
        
openPrivButton"clos",78,120,20,10,10,-1,ISB_DARKlangEngine ("%{main_accept}%"),OnConnectClose );
        
openPrivButton"ref",103,120,20,10,10,-1,ISB_DARKlangEngine ("%{main_deny}%"),OnConnectCloseKick );
    ENDIF
EndEvent
?>


I no longer have the main_deny event button in my message (but I'd kept the lang entry for some reason).

Think above isn't what you meant anyway, as your LANG "EN" has


<?php 
Lang 
"EN"
    
sponsor_1 "^7Welcome {0} ^7to this ^1LFSLapper ^7powered server.%nl%^2Type ^7!help ^2after leaving garage for supported commands.";
    
sponsor_2 "^7If you are not yet a member of LFSNZ, you will need to abide by our rules.%nl%Respect other players, no crashing, and obey race flags%nl%Please follow these rules or you may be banned%nl%To join LFSNZ, go to http://www.lfsnz.com and sign up.";
    
sponsor_accept "Accept";
    
sponsor_deny "Deny";
EndLang
?>


I suspect where you have the 'main_ ' text you should have had 'sponsor_ '.

If anyone else using this lapper add-on, they may want to change the 'sponsor_2' message to something more suitable for their own server.
Quote from sinanju :Rather than having individual on screen modules, would it be possible to have them amalgamated into one?

I looked at doing that but with the number of modules in the works it might overrun the display. I suppose I could do it until I get enough modules up then we can move the help files off. Good idea, will repost shortly.
Quote from sinanju :Took ages to find reason why, but your admin_membership.lpr file is overwriting my normal 'welcome' message.

That was actually by design believe it or not, as i wanted to leave the stock Lapper.lpr file and use the membership_admin.lpr as the welcome msg.

It's easy to change by just changing the Event OnConnect to CatchEvent OnConnect
Quote from Krayy :I looked at doing that but with the number of modules in the works it might overrun the display. I suppose I could do it until I get enough modules up then we can move the help files off. Good idea, will repost shortly.

Here's the rewrite. Have sped up the redraws too so that it's a lot smoother when going from module to module.

Just overwrite your existing cif folder, or see top post for new installs.
Attached images
cif_2011-02-02a.jpg
cif_2011-02-02b.jpg
Attached files
cif_2011-02-02.zip - 17.7 KB - 297 views
Your new simplified single on screen module much better now Krayy

Especially as although I run a server, I'm a one man band; don't have a team, so don't worry about other people having different levels of admin authorisation (this gets rid of Membership tab), and I don't do Cruise, so don't need these tabs, and I don't change handicaps, so don't need that tab either.

You might want to update your version number though?

500Servers (my hosting company) have now just given option to update lapper to v6, so I need to play around with my existing v5.926 lapper stuff and this CIF module to make sure no more issues (!top, welcome message, etc), then I'll start using it online.

Many thanks for the effort and making your CIF public.
info_grid.lpr
You've included a "grid" module in your download, but it's not enabled to show as a tab.

I included it in the addonused.lpr config file, but when you run lapper it comes up with OnREO (I assume meaning on reorder) errors.

Should this module be included?

If so, is there a bit of code needed to be included in the lfslapper.lpr config file?

Or does it rely on having the Handicap module enabled? Mine's disabled. Along with the Membership and Cruise modules.
mystats module
Playing around, and using/plagiarising almost all of one of Krayy's existing modules, made this MyStats module, which gives various stats about you, the driver, e.g. position in overall server track ranking, drift points, pb on server, spb, etc.

You need to add the line

<?php 
include ("./cif/help_mystats.lpr"); # MyStats Help
?>

into your addonused.lpr file.

You can either drop the "Brought to you by....." or change it to read your own server name.


EDIT
===


After a bit of thought, decided this wasn't a really a "help" module, but was in fact an "info" module, so changed module name and coding slightly.

You need to add the line

<?php 
include ("./cif/info_mystats.lpr"); # MyStats Information
?>

into your addonused.lpr file (and remove "./cif/help_mystats.lpr" if you've already got that).
Attached images
mystats.png
Attached files
help_mystats.zip - 1.3 KB - 308 views
info_mystats.zip - 1.3 KB - 335 views
Quote from sinanju :Playing around, and using/plagiarising almost all of one of Krayy's existing modules, made this MyStats module, which gives various stats about you, the driver, e.g. position in overall server track ranking, drift points, pb on server, spb, etc.

You need to add the line

<?php 
include ("./cif/help_mystats.lpr"); # MyStats Help
?>

into your addonused.lpr file.

You can either drop the "Brought to you by....." or change it to read your own server name.

Nice...I'll take that thankyou *snatch*

As to the OnREO that the grip.lpr module requires, it also needs a modified LFSLapper.exe won't work, so don't use it until I either:

a) Post it
b) Pass on the code to Gai to include in an update
For some reason, the top line when I open the CIF will display host name and the module name of the tab I'm in (e.g. Top), but if I tab around (Handicap, Stats, Membership, etc), the top line doesn't change.

It did in your first version of CIF, but doesn't appear to work this way in later version.

Or is it just me?
Quote from sinanju :For some reason, the top line when I open the CIF will display host name and the module name of the tab I'm in (e.g. Top), but if I tab around (Handicap, Stats, Membership, etc), the top line doesn't change.

It did in your first version of CIF, but doesn't appear to work this way in later version.

Or is it just me?

Nope, it's me...I have moved the line that writes the title to just above the line that adds the Close button like this:


<?php 
    
# Add the title & Close Command Button
    
openPrivButton "cMain_TabbedGuiTitle"$CifTabOrigL$CifOrigT 8$CifTabWidth $CifWidth 781, -1ISB_LEFT 2$HostName "^0 - " $cifTitle );
    
CifCmdButton0"Close"CloseCifAll );
?>

That should fix it.
1

FGED GREDG RDFGDR GSFDG