2015-12-15 21:53:15 +00:00
|
|
|
#ifndef SPECTER_MODAL_WINDOW_HPP
|
|
|
|
#define SPECTER_MODAL_WINDOW_HPP
|
|
|
|
|
|
|
|
#include <Specter/View.hpp>
|
|
|
|
#include <Specter/MultiLineTextView.hpp>
|
|
|
|
|
|
|
|
namespace Specter
|
|
|
|
{
|
|
|
|
class ModalWindow : public View
|
|
|
|
{
|
2015-12-23 00:25:46 +00:00
|
|
|
int m_frame = 0;
|
|
|
|
int m_contentStartFrame = 0;
|
2015-12-15 21:53:15 +00:00
|
|
|
float m_lineTime = 0.0;
|
|
|
|
|
|
|
|
enum class Phase
|
|
|
|
{
|
|
|
|
BuildIn,
|
|
|
|
ResWait,
|
|
|
|
Showing,
|
|
|
|
BuildOut,
|
|
|
|
Done
|
|
|
|
} m_phase = Phase::BuildIn;
|
|
|
|
|
|
|
|
int m_width = 0;
|
|
|
|
int m_height = 0;
|
2015-12-20 04:39:09 +00:00
|
|
|
RectangleConstraint m_constraint;
|
2015-12-15 21:53:15 +00:00
|
|
|
|
|
|
|
Zeus::CColor m_windowBg;
|
|
|
|
Zeus::CColor m_windowBgClear;
|
|
|
|
Zeus::CColor m_line1;
|
|
|
|
Zeus::CColor m_line2;
|
2015-12-23 00:25:46 +00:00
|
|
|
Zeus::CColor m_line2Clear;
|
2015-12-15 21:53:15 +00:00
|
|
|
|
|
|
|
ViewBlock m_viewBlock;
|
|
|
|
boo::IGraphicsBufferD* m_viewBlockBuf;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
SolidShaderVert lineVerts[22];
|
|
|
|
SolidShaderVert fillVerts[16];
|
|
|
|
} m_verts;
|
|
|
|
|
|
|
|
void setLineVerts(int width, int height, float pf, float t);
|
2015-12-23 00:25:46 +00:00
|
|
|
void setLineVertsOut(int width, int height, float pf, float t);
|
2015-12-15 21:53:15 +00:00
|
|
|
void setLineColors(float t);
|
2015-12-23 00:25:46 +00:00
|
|
|
void setLineColorsOut(float t);
|
2015-12-15 21:53:15 +00:00
|
|
|
void setFillVerts(int width, int height, float pf);
|
|
|
|
void setFillColors(float t);
|
|
|
|
|
|
|
|
boo::IGraphicsBufferD* m_vertsBuf;
|
|
|
|
boo::IVertexFormat* m_vertsVtxFmt; /* OpenGL only */
|
|
|
|
boo::IShaderDataBinding* m_vertsShaderBinding;
|
|
|
|
|
2015-12-18 03:26:10 +00:00
|
|
|
boo::GraphicsDataToken m_windowGfxData;
|
2015-12-15 21:53:15 +00:00
|
|
|
|
|
|
|
std::unique_ptr<TextView> m_cornersOutline[4];
|
|
|
|
std::unique_ptr<TextView> m_cornersFilled[4];
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void updateContentOpacity(float opacity) {}
|
2016-01-03 02:42:52 +00:00
|
|
|
RectangleConstraint& constraint() {return m_constraint;}
|
2015-12-15 21:53:15 +00:00
|
|
|
|
|
|
|
public:
|
2016-01-02 23:07:40 +00:00
|
|
|
ModalWindow(ViewResources& res, View& parentView, const RectangleConstraint& constraint, const Zeus::CColor& bgColor);
|
2015-12-20 04:39:09 +00:00
|
|
|
ModalWindow(ViewResources& res, View& parentView, const RectangleConstraint& constraint);
|
2015-12-15 21:53:15 +00:00
|
|
|
void think();
|
|
|
|
bool skipBuildInAnimation();
|
2015-12-23 00:25:46 +00:00
|
|
|
void close();
|
|
|
|
bool closed() const {return m_phase >= Phase::BuildOut;}
|
2015-12-15 21:53:15 +00:00
|
|
|
|
|
|
|
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
|
|
|
|
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // SPECTER_MODAL_WINDOW_HPP
|