HomeNewsFeaturesLicensingDownloadsScreenshotsFAQRoadmap Contact Us
Search:
8 Online

Community

Discussion Topics Recent Postings User Contributions General Articles Example Documentation Credits

Licensed Developer

Programmer's Manual Artists Manual Tutorials and Articles

Programming: Game Code

Game Code Overview Server Side Game Code Client Side Game Code

Programming: System

Alphabetical Function List Renderer File System Collision & Ray Casting Low Level Audio Game Audio The Console Console Variable List Multiplayer Localisation Maths Library Memory Manager Model File Formats Texture Formats

Art: Overviews

Specifications Shaders Particle Systems Lens Flares Cipher console Cipher file types Tutorials Reference

Art: Tools

Shader Designer Particle Designer 3dsmax tools Model Conversion Font Generator

Cipher Engine
Game Development Search Engine
GameDev.net
You are not signed in - [sign in] [register]

listvars console command w/autocomplete style matching

Overview

Author: crusherfred
Date Submitted: 2004-07-16 01:01:45
Downloads: listvar.c

Source Code

#define SIZE_FOUND_LISTVAR_BUFFER   2048    // size this buffer to your needs

void cvar_ListVars_f(void)
{
    if (cmd_Argc() == 2)
    {   // additional characters specified, so use for autocomplete input
        tchar_t list[SIZE_FOUND_LISTVAR_BUFFER], *s = list;
        int count = cvar_AutoComplete(cmd_Argv(1), list, SIZE_FOUND_LISTVAR_BUFFER);

        // walk the found cvar list and print
        for (;count > 0; --count)
        {
            cvarhandle_t    hvar = cvar_Find(s);

            if (hvar)
                cvar_Print(hvar);

            s += com_strlen(s) + 1;
        }
    }
    else
    {   // walk over the list of cvars 
        int i;
        for (i=1; i<cvar_list.size; i++)
            cvar_Print(i);
    }
}


Description

In the console, I always thought it would be nice to type something like "listvars r_" and get a listing of all r_* cvars. This simple replacement for cvar_ListVars_f() allows for cvar listings using the cvar autocomplete function. Try it - you'll like it!


Another solution would be to register a new console command from your app, but I figured this feature would be worth modifying Cipher for.

[Recent Contributions] [Recent Source Code]

User Contributed Comments

ebrownlee 19th July, 2004 23:53
I like it. Nice contribution.

- Ernest


JTilo 20th July, 2004 00:14
"Try it - you'll like it!"

Your right, Thanks crusherfred!


bane 20th July, 2004 07:59
Great idea.
Thanks!




Register and Sign In to discuss this article