13 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/day_z_book.layout");
14 Class.
CastTo(m_content, layoutRoot.FindAnyWidget(
"HtmlWidget"));
15 Class.
CastTo(m_author, layoutRoot.FindAnyWidget(
"Author"));
16 Class.
CastTo(m_title, layoutRoot.FindAnyWidget(
"Title"));
17 Class.
CastTo(m_page, layoutRoot.FindAnyWidget(
"Page"));
20 m_content.GetScreenSize(
width, m_page_height);
26 m_content.LoadFile(
book.ConfigGetString(
"file"));
27 m_author.SetText(
book.ConfigGetString(
"author"));
28 m_title.SetText(
book.ConfigGetString(
"title"));
29 m_content_total_height = m_content.GetContentHeight();
38 switch (
w.GetUserID())
57 m_content_pos = m_content_pos + m_page_height;
59 m_content_pos = m_content_pos - m_page_height;
62 if (m_content_total_height > m_page_height)
63 maxOffset = m_content_total_height - m_page_height;
65 if (m_content_pos < 0)
71 m_content.SetContentOffset(m_content_pos,
true);
Super root of all classes in Enforce script.
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Round(float f)
Returns mathematical round of value.
static proto float Ceil(float f)
Returns ceil of value.
const int IDC_BOOK_VIEWER_PREV
const int IDC_BOOK_VIEWER_NEXT