fixed Issue

pushed console output 4 up
This commit is contained in:
/dev/root 2016-08-30 19:27:14 +02:00
parent a21c928364
commit f887f03231
2 changed files with 64 additions and 61 deletions

View File

@ -308,6 +308,9 @@ namespace Components
wrefresh(Console::InfoWindow); wrefresh(Console::InfoWindow);
wrefresh(Console::InputWindow); wrefresh(Console::InputWindow);
// 3 Lines do not autoscroll, 1 has a linebreak -> skip 4 lines when initializing
Console::ScrollOutput(4);
Console::RefreshOutput(); Console::RefreshOutput();
} }

View File

@ -1,63 +1,63 @@
#define OUTPUT_HEIGHT 250 #define OUTPUT_HEIGHT 250
#define OUTPUT_MAX_TOP (OUTPUT_HEIGHT - (Console::Height - 2)) #define OUTPUT_MAX_TOP (OUTPUT_HEIGHT - (Console::Height - 2))
namespace Components namespace Components
{ {
class Console : public Component class Console : public Component
{ {
public: public:
Console(); Console();
~Console(); ~Console();
#ifdef DEBUG #ifdef DEBUG
const char* GetName() { return "Console"; }; const char* GetName() { return "Console"; };
#endif #endif
private: private:
static void ToggleConsole(); static void ToggleConsole();
static char** GetAutoCompleteFileList(const char *path, const char *extension, Game::FsListBehavior_e behavior, int *numfiles, int allocTrackType); static char** GetAutoCompleteFileList(const char *path, const char *extension, Game::FsListBehavior_e behavior, int *numfiles, int allocTrackType);
private: private:
// Text-based console stuff // Text-based console stuff
static WINDOW* OutputWindow; static WINDOW* OutputWindow;
static WINDOW* InputWindow; static WINDOW* InputWindow;
static WINDOW* InfoWindow; static WINDOW* InfoWindow;
static int Width; static int Width;
static int Height; static int Height;
static int OutputTop; static int OutputTop;
static int OutBuffer; static int OutBuffer;
static int LastRefresh; static int LastRefresh;
static char LineBuffer[1024]; static char LineBuffer[1024];
static char LineBuffer2[1024]; static char LineBuffer2[1024];
static int LineBufferIndex; static int LineBufferIndex;
static bool HasConsole; static bool HasConsole;
static std::thread ConsoleThread; static std::thread ConsoleThread;
static Game::SafeArea OriginalSafeArea; static Game::SafeArea OriginalSafeArea;
static void ShowPrompt(); static void ShowPrompt();
static void RefreshStatus(); static void RefreshStatus();
static void RefreshOutput(); static void RefreshOutput();
static void ScrollOutput(int amount); static void ScrollOutput(int amount);
static const char* Input(); static const char* Input();
static void Print(const char* message); static void Print(const char* message);
static void Error(const char* format, ...); static void Error(const char* format, ...);
static void Create(); static void Create();
static void Destroy(); static void Destroy();
static void StdOutPrint(const char* message); static void StdOutPrint(const char* message);
static void StdOutError(const char* format, ...); static void StdOutError(const char* format, ...);
static void ConsoleRunner(); static void ConsoleRunner();
static void DrawSolidConsoleStub(); static void DrawSolidConsoleStub();
static void StoreSafeArea(); static void StoreSafeArea();
static void RestoreSafeArea(); static void RestoreSafeArea();
}; };
} }