Fix items draw inside uiitem
This commit is contained in:
parent
644241badb
commit
2aeec22ef8
|
@ -86,3 +86,9 @@ function autoReloadModule(name)
|
||||||
reloadEvent()
|
reloadEvent()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function createDebugUIItem(id)
|
||||||
|
local uiitem = g_ui.createWidget('Item', rootWidget)
|
||||||
|
uiitem:setPosition({x= 200, y = 200 })
|
||||||
|
uiitem:setItemId(id)
|
||||||
|
uiitem:show()
|
||||||
|
end
|
||||||
|
|
|
@ -65,12 +65,6 @@ void Item::draw(const Point& dest, float scaleFactor, bool animate, LightView *l
|
||||||
|
|
||||||
// determine animation phase
|
// determine animation phase
|
||||||
int animationPhase = calculateAnimationPhase(animate);
|
int animationPhase = calculateAnimationPhase(animate);
|
||||||
if(getAnimationPhases() > 1) {
|
|
||||||
if(animate)
|
|
||||||
animationPhase = (g_clock.millis() % (Otc::ITEM_TICKS_PER_FRAME * getAnimationPhases())) / Otc::ITEM_TICKS_PER_FRAME;
|
|
||||||
else
|
|
||||||
animationPhase = getAnimationPhases()-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// determine x,y,z patterns
|
// determine x,y,z patterns
|
||||||
int xPattern = 0, yPattern = 0, zPattern = 0;
|
int xPattern = 0, yPattern = 0, zPattern = 0;
|
||||||
|
@ -359,12 +353,9 @@ int Item::calculateAnimationPhase(bool animate)
|
||||||
|
|
||||||
int Item::getExactSize(int layer, int xPattern, int yPattern, int zPattern, int animationPhase)
|
int Item::getExactSize(int layer, int xPattern, int yPattern, int zPattern, int animationPhase)
|
||||||
{
|
{
|
||||||
int exactSize = 0;
|
|
||||||
calculatePatterns(xPattern, yPattern, zPattern);
|
calculatePatterns(xPattern, yPattern, zPattern);
|
||||||
animationPhase = calculateAnimationPhase(true);
|
animationPhase = calculateAnimationPhase(true);
|
||||||
for(layer = 0; layer < getLayers(); ++layer)
|
return Thing::getExactSize(0, xPattern, yPattern, zPattern, animationPhase);
|
||||||
exactSize = std::max(exactSize, Thing::getExactSize(layer, xPattern, yPattern, zPattern, animationPhase));
|
|
||||||
return exactSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ThingTypePtr& Item::getThingType()
|
const ThingTypePtr& Item::getThingType()
|
||||||
|
|
Loading…
Reference in New Issue