Added (inactive) code to show level pictures on worldmap
[supertux.git] / src / console.hpp
index 1194a7f..a128d60 100644 (file)
@@ -51,6 +51,7 @@ public:
   void backspace(); /**< delete last character sent to the input stream */
   void scroll(int offset); /**< scroll console text up or down by @c offset lines */
   void autocomplete(); /**< autocomplete current command */
+  void show_history(int offset); /**< move @c offset lines forward through history; Negative offset moves backward */
 
   void draw(DrawingContext& context); /**< draw the console in a DrawingContext */
   void update(float elapsed_time);
@@ -85,13 +86,15 @@ public:
   }
 
 private:
-  std::list<std::string> lines; /**< backbuffer of lines sent to the console */
+  std::list<std::string> history; /**< command history. New lines get added to back. */
+  std::list<std::string>::iterator history_position; /**< item of command history that is currently displayed */
+  std::list<std::string> lines; /**< backbuffer of lines sent to the console. New lines get added to front. */
   std::map<std::string, std::list<ConsoleCommandReceiver*> > commands; /**< map of console commands and a list of associated ConsoleCommandReceivers */
   
   std::auto_ptr<Surface> background; /**< console background image */
   std::auto_ptr<Surface> background2; /**< second, moving console background image */
 
-  HSQUIRRELVM vm; /**< squirrel thread for the console (with custom roottable */
+  HSQUIRRELVM vm; /**< squirrel thread for the console (with custom roottable) */
   HSQOBJECT vm_object;
   
   int backgroundOffset; /**< current offset of scrolling background image */
@@ -107,9 +110,13 @@ private:
   static ConsoleStreamBuffer inputBuffer; /**< stream buffer used by input stream */
   static ConsoleStreamBuffer outputBuffer; /**< stream buffer used by output stream */
 
+  void addLines(std::string s); /**< display a string of (potentially) multiple lines in the console */
   void addLine(std::string s); /**< display a line in the console */
   void parse(std::string s); /**< react to a given command */
-    
+   
+  /** ready a virtual machine instance, creating a new thread and loading default .nut files if needed */
+  void ready_vm();
+
   /** execute squirrel script and output result */
   void execute_script(const std::string& s);