mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 04:27:42 +00:00
Added progress bars to extract tool
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -45,6 +44,9 @@ public:
|
||||
#define BOLD "\033[1m"
|
||||
#define NORMAL "\033[0m"
|
||||
|
||||
#define HIDE_CURSOR "\033[?25l"
|
||||
#define SHOW_CURSOR "\033[?25h"
|
||||
|
||||
#define WRAP_INDENT 4
|
||||
|
||||
extern bool XTERM_COLOR;
|
||||
@@ -119,21 +121,8 @@ private:
|
||||
public:
|
||||
|
||||
HelpOutput(HelpFunc helpFunc)
|
||||
: m_sout(NULL), m_helpFunc(helpFunc)
|
||||
{
|
||||
#if _WIN32
|
||||
CONSOLE_SCREEN_BUFFER_INFO info;
|
||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info);
|
||||
m_lineWidth = info.dwSize.X;
|
||||
#else
|
||||
struct winsize w;
|
||||
m_lineWidth = 80;
|
||||
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1)
|
||||
m_lineWidth = w.ws_col;
|
||||
#endif
|
||||
if (m_lineWidth < 10)
|
||||
m_lineWidth = 10;
|
||||
}
|
||||
: m_sout(NULL), m_helpFunc(helpFunc), m_lineWidth(HECL::ConsoleWidth())
|
||||
{}
|
||||
|
||||
void go()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user