Giter Site home page Giter Site logo

gameconsole_xna's People

Contributors

ckx avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

gameconsole_xna's Issues

Filter output

Need a way to filter command output if the command is logged, behavior similar to piping grep in unix.

Command aliases

Map aliases to commands, for example "p" or "get" might execute a command titled "print". Aliases should be set in AddCommand.

"Skeleton" entries for Unavailable Commands

Some commands aren't usable when a game is initially launched, because they rely on members of classes which aren't instantiated yet (especially for debug stuff). I dislike that these commands are not added to the commands output, so in one game project, I wrote a helper function to add unavailable commands to the console.

            InitialConsoleCommands.Add("Scene", new List<string[]>() { new string[2] { "list_scene_entities", "Lists all entities currently in a scene." } } );
            InitialConsoleCommands.Add("DrawSystem", new List<string[]>() { new string[2] { "draw_hitboxes", "Draws all hit / hurt boxes on screen." },
                new string[2] { "draw_wireframe", "Enables wireframe mode."} });

            foreach (KeyValuePair<string, List<string[]>> kvp in InitialConsoleCommands) {
                foreach (string[] sa in kvp.Value) {
                    devConsole.AddCommand(sa[0], delegate {
                        devConsole.Log($"Unavailable command. {kvp.Key} object is required before usage.");
                    }, sa[1]);
                }
            }

This is a problem that might be better solved in the game console library. A simple "AddUnavailableCommand" would do.

  • Unavailable commands should be indicated as "Not yet usable" or something in the output of commands
  • When a new command is added to the main commands map, it should iterate over all the unavailable commands, and remove the appropriate "unavailable" element.

While doing this, consider loading commands from a data file to make the whole skeleton command process simple across different projects (and to keep command documentation out of code).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.