GUI Timeouts:
One of the many familiar features that the SDK is missing, and is great to have.
First, make a new script and name it "timeouts.fos", and paste in the following:
//On-Screen Timeouts
//By: codave
#include "_macros.fos"
#include "_client_defines.fos"
#include "_colors.fos"
#include "_msgstr.fos"
#include "_defines.fos"
import int GUI_GetActiveMainScreen() from "client_gui";
import int GUI_GetActiveScreen() from "client_gui";
void InitTimeouts()
{
if( GUI_GetActiveMainScreen() != CLIENT_MAIN_SCREEN_GAME )
return;
CritterCl@ chosen = GetChosen();
if( not valid( chosen ) )
return;
int Y=30;
int X=10;
if( chosen.Timeout[ TO_SK_LOCKPICK ] > 0 )
{
DrawText("Lockpick: "+chosen.Timeout[ TO_SK_LOCKPICK ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_SK_FIRST_AID ] > 0 )
{
DrawText("First Aid: "+chosen.Timeout[ TO_SK_FIRST_AID ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_SK_DOCTOR ] > 0 )
{
DrawText("Doctor: "+chosen.Timeout[ TO_SK_DOCTOR ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_SK_REPAIR ] > 0 )
{
DrawText("Repair: "+chosen.Timeout[ TO_SK_REPAIR ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_BATTLE ] > 0 && chosen.Timeout[ TO_BATTLE ] < 10000 )
{
DrawText("Battle: "+chosen.Timeout[ TO_BATTLE ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_REPLICATION ] > 0 )
{
DrawText("Respawn Time: "+chosen.Timeout[ TO_REPLICATION ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_SK_STEAL ] > 0 )
{
DrawText("Steal: "+chosen.Timeout[ TO_SK_STEAL ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
}
Save it in the /server/scripts folder.
Next, open up client_main.fos, and add the script we just saved to the namespace at the top, like so:
// Author: cvet, Atom
// Client main script
// Compile using fo_client.dll
#include "_client_defines.fos"
#include "_macros.fos"
#include "_msgstr.fos"
#include "sprite.fos"
#include "_colors.fos"
#include "_animation.fos"
#include "awareness.fos"
#include "timeouts.fos"
Go down a bit further into the script, and find GUI_Init();, and add "InitTimeouts();, like this:
GUI_Init();
InitNameColorizing();
InitIgnoreList();
// InitTestScreen();
InitRadioScreen();
InitChosenTabs();
InitAwarenessHead();
InitTimeouts();
#ifdef PLAYERS_3D
Init3DChaRegScreen();
#endif
Scroll down further, and find "void render_iface", and add the same Init.
if( layer == 3 )
{
InitTimeouts();
DrawChosenTabs();
GUI_Render();
}
After everything is saved, fire the server up and test it. You can easily make color/x, y, and order adjustments on the fly by clicking "Reload Client Scripts" on the Server, and your changes will show up in game after a few seconds.
Enjoy...