71 lines
1.5 KiB
C++
71 lines
1.5 KiB
C++
#ifndef SPARROWSHELL_H
|
|
#define SPARROWSHELL_H
|
|
|
|
#include <list>
|
|
|
|
#include "system.h"
|
|
#include "scene/scenetree.h"
|
|
#include "glm/vec2.hpp"
|
|
#include "sparrowshell/shellbuffer.h"
|
|
#include "sparrowshell/shellscrollbar.h"
|
|
#include "scene/graphicalcontainernode.h"
|
|
|
|
class Input;
|
|
class MeshNode;
|
|
class TextNode;
|
|
class ShellBuffer;
|
|
|
|
namespace sf {
|
|
class Window;
|
|
}
|
|
|
|
class SparrowShell : public GraphicalContainerNode
|
|
{
|
|
private:
|
|
sf::Window* m_window;
|
|
Input* m_input;
|
|
|
|
glm::ivec2 m_position;
|
|
glm::ivec2 m_dimension;
|
|
ShellBuffer* m_buffer;
|
|
unsigned int m_index = 0;
|
|
bool m_resizeBuffer = false;
|
|
bool m_indexMoved = false;
|
|
bool m_shellEnabled = false;
|
|
//textMesh
|
|
MeshNode* m_background;
|
|
ShellScrollBar* m_scrollbar;
|
|
|
|
public:
|
|
static const unsigned int BUFFER_MAX_LENGTH;
|
|
static const unsigned int BUFFER_DISPLAYED_NUMBER;
|
|
static const unsigned int SCROLLBAR_PIXEL_WIDTH;
|
|
static const float SHELL_DEPTH;
|
|
|
|
SparrowShell(sf::Window*, Input*);
|
|
|
|
void update();
|
|
|
|
void scrollUp();
|
|
void scrollDown();
|
|
|
|
void toggleShell();
|
|
void out(std::string);
|
|
|
|
// void setSceneTree(SceneTree* tree)
|
|
// {
|
|
// GraphicalContainerNode::setSceneTree(tree);
|
|
// }
|
|
|
|
glm::ivec2 getPosition(){return m_position;}
|
|
glm::ivec2 getDimension(){return m_dimension;}
|
|
|
|
unsigned int getIndex(){return m_index;}
|
|
ShellBuffer* getBuffer(){return m_buffer;}
|
|
|
|
bool isEnabled(){return m_shellEnabled;}
|
|
bool isBufferResized(){return m_resizeBuffer;}
|
|
bool indexMoved(){return m_indexMoved;}
|
|
};
|
|
#endif // SPARROWSHELL_H
|