mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
change in topmenu and some fixes
This commit is contained in:
@@ -84,6 +84,9 @@ void UIAnchorLayout::removeWidget(const UIWidgetPtr& widget)
|
||||
void UIAnchorLayout::updateWidget(const UIWidgetPtr& widget, UIAnchorGroup& anchorGroup)
|
||||
{
|
||||
UIWidgetPtr parentWidget = getParentWidget();
|
||||
if(!parentWidget)
|
||||
return;
|
||||
|
||||
Rect newRect = widget->getRect();
|
||||
bool verticalMoved = false;
|
||||
bool horizontalMoved = false;
|
||||
|
@@ -38,6 +38,8 @@ void UIHorizontalLayout::applyStyle(const OTMLNodePtr& styleNode)
|
||||
void UIHorizontalLayout::internalUpdate()
|
||||
{
|
||||
UIWidgetPtr parentWidget = getParentWidget();
|
||||
if(!parentWidget)
|
||||
return;
|
||||
UIWidgetList widgets = parentWidget->getChildren();
|
||||
|
||||
if(m_alignRight)
|
||||
|
@@ -37,6 +37,9 @@ void UIVerticalLayout::applyStyle(const OTMLNodePtr& styleNode)
|
||||
void UIVerticalLayout::internalUpdate()
|
||||
{
|
||||
UIWidgetPtr parentWidget = getParentWidget();
|
||||
if(!parentWidget)
|
||||
return;
|
||||
|
||||
UIWidgetList widgets = parentWidget->getChildren();
|
||||
|
||||
if(m_alignBottom)
|
||||
|
@@ -639,6 +639,9 @@ void UIWidget::setVisible(bool visible)
|
||||
parent->focusPreviousChild(Fw::ActiveFocusReason);
|
||||
}
|
||||
|
||||
// visibility can change can change parent layout
|
||||
updateParentLayout();
|
||||
|
||||
updateState(Fw::ActiveState);
|
||||
updateState(Fw::HoverState);
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ char Fw::utf8CharToLatin1(uchar *utf8, int *read)
|
||||
{
|
||||
char c = '?';
|
||||
uchar opt1 = utf8[0];
|
||||
*read = 1;
|
||||
if(opt1 == 0xc3) {
|
||||
*read = 2;
|
||||
uchar opt2 = utf8[1];
|
||||
@@ -39,7 +40,6 @@ char Fw::utf8CharToLatin1(uchar *utf8, int *read)
|
||||
if(opt2 > 0xa1 && opt2 < 0xbb)
|
||||
c = opt2;
|
||||
} else if(opt1 < 0xc2) {
|
||||
*read = 1;
|
||||
c = opt1;
|
||||
}
|
||||
return c;
|
||||
@@ -49,7 +49,7 @@ std::string Fw::utf8StringToLatin1(uchar *utf8) {
|
||||
std::string out;
|
||||
int len = strlen((char*)utf8);
|
||||
for(int i=0; i<len;) {
|
||||
int read;
|
||||
int read = 0;
|
||||
uchar *utf8char = &utf8[i];
|
||||
out += Fw::utf8CharToLatin1(utf8char, &read);
|
||||
i += read;
|
||||
|
@@ -385,7 +385,6 @@ int Game::getThingStackpos(const ThingPtr& thing)
|
||||
{
|
||||
// thing is at map
|
||||
if(thing->getPos().x != 65535) {
|
||||
dump << thing->getPos();
|
||||
TilePtr tile = g_map.getTile(thing->getPos());
|
||||
if(tile)
|
||||
return tile->getThingStackpos(thing);
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
Item::Item() : Thing()
|
||||
{
|
||||
m_data = 0;
|
||||
m_data = 1;
|
||||
}
|
||||
|
||||
ItemPtr Item::create(int id)
|
||||
|
@@ -37,7 +37,7 @@ public:
|
||||
MAP_SIZE_Z = 8,
|
||||
MAX_WIDTH = 24,
|
||||
MAX_HEIGHT = 24,
|
||||
MAX_Z = 15,
|
||||
MAX_Z = 16,
|
||||
NUM_TILE_PIXELS = 32
|
||||
};
|
||||
|
||||
|
@@ -133,6 +133,7 @@ void OTClient::registerLuaFunctions()
|
||||
|
||||
g_lua.registerClass<Item, Thing>();
|
||||
g_lua.bindClassStaticFunction<Item>("create", &Item::create);
|
||||
g_lua.bindClassMemberFunction<Item>("getData", &Item::getData);
|
||||
|
||||
g_lua.registerClass<Effect, Thing>();
|
||||
g_lua.registerClass<Missile, Thing>();
|
||||
|
Reference in New Issue
Block a user