Skip to content

Commit

Permalink
xrUICore/Static/UIStatic.h: returned some deleted script export
Browse files Browse the repository at this point in the history
Now you can launch Clear Sky (only main menu for now)
  • Loading branch information
Xottab-DUTY committed Jan 5, 2019
1 parent a742810 commit 544d6d8
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
29 changes: 29 additions & 0 deletions src/xrUICore/Static/UIStatic.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,34 @@ class XRUICORE_API CUIStatic : public CUIWindow, public ITextureOwner, public CU
virtual void Update();
virtual void OnFocusLost();

virtual pcstr GetText() { return TextItemControl()->GetText(); }
virtual void SetText(pcstr txt) { TextItemControl()->SetText(txt); }
virtual void SetTextST(pcstr txt) { TextItemControl()->SetTextST(txt); }

void SetTextColor_script(int a, int r, int g, int b)
{
TextItemControl()->SetTextColor(color_argb(a, r, g, b));
}

u32 GetTextAlign_script()
{
return static_cast<u32>(TextItemControl()->GetTextAlignment());
}

void SetTextAlign_script(u32 align)
{
TextItemControl()->SetTextAlignment((CGameFont::EAligment)align);
TextItemControl()->GetFont()->SetAligment((CGameFont::EAligment)align);
}

virtual void SetTextX(float text_x) { TextItemControl()->m_TextOffset.x = text_x; }
virtual void SetTextY(float text_y) { TextItemControl()->m_TextOffset.y = text_y; }
virtual float GetTextX() { return TextItemControl()->m_TextOffset.x; }
virtual float GetTextY() { return TextItemControl()->m_TextOffset.y; }

virtual void SetColor(u32 color) { m_UIStaticItem.SetColor(color); }
virtual u32 GetColor() const { return m_UIStaticItem.GetColor(); }

virtual void CreateShader(LPCSTR tex, LPCSTR sh = "hud" DELIMITER "default");
ui_shader& GetShader() { return m_UIStaticItem.GetShader(); };
virtual void SetTextureColor(u32 color) { m_UIStaticItem.SetTextureColor(color); }
Expand Down Expand Up @@ -73,6 +101,7 @@ class XRUICORE_API CUIStatic : public CUIWindow, public ITextureOwner, public CU
CUIStaticItem& GetUIStaticItem() { return m_UIStaticItem; }
void SetStretchTexture(bool stretch_texture) { m_bStretchTexture = stretch_texture; }
bool GetStretchTexture() { return m_bStretchTexture; }
void SetEllipsis(int pos, int indent) { TextItemControl()->SetEllipsis(pos != 0); }
void SetHeading(float f) { m_fHeading = f; };
float GetHeading() { return m_fHeading; }
bool Heading() { return m_bHeading; }
Expand Down
40 changes: 39 additions & 1 deletion src/xrUICore/Static/UIStatic_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,50 @@ SCRIPT_EXPORT(CUIStatic, (CUIWindow),
[
class_<CUIStatic, CUIWindow>("CUIStatic")
.def(constructor<>())

.def("TextControl", &CUIStatic::TextItemControl)

.def("SetText", (void (CUIStatic::*)(LPCSTR)) (&CUIStatic::SetText))
.def("SetTextST", (void (CUIStatic::*)(LPCSTR)) (&CUIStatic::SetTextST))

.def("GetText", &CUIStatic::GetText)

.def("SetTextX", &CUIStatic::SetTextX)
.def("SetTextY", &CUIStatic::SetTextY)
.def("GetTextX", &CUIStatic::GetTextX)
.def("GetTextY", &CUIStatic::GetTextY)

.def("SetColor", &CUIStatic::SetColor)
.def("GetColor", &CUIStatic::GetColor)

.def("SetTextColor", &CUIStatic::SetTextColor_script)

.def("InitTexture", &CUIStatic::InitTexture)
.def("InitTextureEx", &CUIStatic::InitTextureEx)

.def("SetTextureOffset", &CUIStatic::SetTextureOffset)

.def("SetTextureRect", &CUIStatic::SetTextureRect_script)
.def("SetStretchTexture", &CUIStatic::SetStretchTexture)
.def("GetTextureRect", &CUIStatic::GetTextureRect_script)

.def("SetOriginalRect", &CUIStatic::SetTextureRect_script)
.def("GetOriginalRect", &CUIStatic::GetTextureRect_script)

.def("SetStretchTexture", &CUIStatic::SetStretchTexture)
.def("GetStretchTexture", &CUIStatic::GetStretchTexture)

.def("SetTextAlign", &CUIStatic::SetTextAlign_script)
.def("GetTextAlign", &CUIStatic::GetTextAlign_script)

.def("SetHeading", &CUIStatic::SetHeading)
.def("GetHeading", &CUIStatic::GetHeading)

//.def("ClipperOn", &CUIStatic::ClipperOn)
//.def("ClipperOff", (void(CUIStatic::*)(void))&CUIStatic::ClipperOff)

//.def("GetClipperState", &CUIStatic::GetClipperState)

.def("SetElipsis", &CUIStatic::SetEllipsis)
];
});

Expand Down

1 comment on commit 544d6d8

@Xottab-DUTY
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to #382 and #392

Please sign in to comment.