Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/CGUI.cpp
Show First 20 Lines • Show All 602 Lines • ▼ Show 20 Lines | if (WordWrapping && i > pos_last_img) | ||||
CSize size = icon.m_Size; | CSize size = icon.m_Size; | ||||
Image.SetupSpriteCall((j == CGUIString::SFeedback::Left), SpriteCall, Width, _y, size, icon.m_SpriteName, BufferZone, icon.m_CellID); | Image.SetupSpriteCall((j == CGUIString::SFeedback::Left), SpriteCall, Width, _y, size, icon.m_SpriteName, BufferZone, icon.m_CellID); | ||||
// Check if image is the lowest thing. | // Check if image is the lowest thing. | ||||
Text.m_Size.cy = std::max(Text.m_Size.cy, Image.m_YTo); | Text.m_Size.cy = std::max(Text.m_Size.cy, Image.m_YTo); | ||||
Images[j].push_back(Image); | Images[j].push_back(Image); | ||||
Text.m_SpriteCalls.push_back(SpriteCall); | Text.m_SpriteCalls.push_back(std::move(SpriteCall)); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
pos_last_img = std::max(pos_last_img, i); | pos_last_img = std::max(pos_last_img, i); | ||||
x += Feedback.m_Size.cx; | x += Feedback.m_Size.cx; | ||||
prelim_line_height = std::max(prelim_line_height, Feedback.m_Size.cy); | prelim_line_height = std::max(prelim_line_height, Feedback.m_Size.cy); | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | if ((WordWrapping && (x > Width-BufferZone || Feedback.m_NewLine)) || i == (int)string.m_Words.size()-2) | ||||
if (WordWrapping) // only if word-wrapping is applicable | if (WordWrapping) // only if word-wrapping is applicable | ||||
{ | { | ||||
if (Feedback2.m_NewLine) | if (Feedback2.m_NewLine) | ||||
{ | { | ||||
from = j+1; | from = j+1; | ||||
// Sprite call can exist within only a newline segment, | // Sprite call can exist within only a newline segment, | ||||
// therefore we need this. | // therefore we need this. | ||||
Text.m_SpriteCalls.insert(Text.m_SpriteCalls.end(), Feedback2.m_SpriteCalls.begin(), Feedback2.m_SpriteCalls.end()); | Text.m_SpriteCalls.insert( | ||||
Text.m_SpriteCalls.end(), | |||||
std::make_move_iterator(Feedback2.m_SpriteCalls.begin()), | |||||
std::make_move_iterator(Feedback2.m_SpriteCalls.end())); | |||||
break; | break; | ||||
} | } | ||||
else if (x > width_range[To] && j == temp_from) | else if (x > width_range[To] && j == temp_from) | ||||
{ | { | ||||
from = j+1; | from = j+1; | ||||
// do not break, since we want it to be added to m_TextCalls | // do not break, since we want it to be added to m_TextCalls | ||||
} | } | ||||
else if (x > width_range[To]) | else if (x > width_range[To]) | ||||
{ | { | ||||
from = j; | from = j; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
// Add the whole Feedback2.m_TextCalls to our m_TextCalls. | // Add the whole Feedback2.m_TextCalls to our m_TextCalls. | ||||
Text.m_TextCalls.insert(Text.m_TextCalls.end(), Feedback2.m_TextCalls.begin(), Feedback2.m_TextCalls.end()); | Text.m_TextCalls.insert( | ||||
Text.m_SpriteCalls.insert(Text.m_SpriteCalls.end(), Feedback2.m_SpriteCalls.begin(), Feedback2.m_SpriteCalls.end()); | Text.m_TextCalls.end(), | ||||
std::make_move_iterator(Feedback2.m_TextCalls.begin()), | |||||
std::make_move_iterator(Feedback2.m_TextCalls.end())); | |||||
Text.m_SpriteCalls.insert( | |||||
Text.m_SpriteCalls.end(), | |||||
std::make_move_iterator(Feedback2.m_SpriteCalls.begin()), | |||||
std::make_move_iterator(Feedback2.m_SpriteCalls.end())); | |||||
if (j == (int)string.m_Words.size()-2) | if (j == (int)string.m_Words.size()-2) | ||||
done = true; | done = true; | ||||
} | } | ||||
// Reset X | // Reset X | ||||
x = BufferZone; | x = BufferZone; | ||||
▲ Show 20 Lines • Show All 859 Lines • ▼ Show 20 Lines | for (XMBAttribute attr : Element.GetAttributes()) | ||||
else if (attr_name == "sprite_bar_vertical") | else if (attr_name == "sprite_bar_vertical") | ||||
scrollbar.m_SpriteBarVertical = attr_value; | scrollbar.m_SpriteBarVertical = attr_value; | ||||
else if (attr_name == "sprite_bar_vertical_over") | else if (attr_name == "sprite_bar_vertical_over") | ||||
scrollbar.m_SpriteBarVerticalOver = attr_value; | scrollbar.m_SpriteBarVerticalOver = attr_value; | ||||
else if (attr_name == "sprite_bar_vertical_pressed") | else if (attr_name == "sprite_bar_vertical_pressed") | ||||
scrollbar.m_SpriteBarVerticalPressed = attr_value; | scrollbar.m_SpriteBarVerticalPressed = attr_value; | ||||
} | } | ||||
m_ScrollBarStyles[name] = scrollbar; | m_ScrollBarStyles[name] = std::move(scrollbar); | ||||
} | } | ||||
void CGUI::Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile) | void CGUI::Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile) | ||||
{ | { | ||||
SGUIIcon icon; | SGUIIcon icon; | ||||
CStr name; | CStr name; | ||||
for (XMBAttribute attr : Element.GetAttributes()) | for (XMBAttribute attr : Element.GetAttributes()) | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator