fixes: localization cannot overwrite text input field value; sprite drawrectanim serialize fix;
This commit is contained in:
@@ -1412,6 +1412,8 @@ namespace wi::gui
|
||||
|
||||
font_description.params = font.params;
|
||||
font_description.params.h_align = wi::font::WIFALIGN_RIGHT;
|
||||
|
||||
SetLocalizationEnabled(wi::gui::LocalizationEnabled::Tooltip); // disable localization of text because that can come from user input and musn't be overwritten!
|
||||
}
|
||||
void TextInputField::SetValue(const std::string& newValue)
|
||||
{
|
||||
|
||||
@@ -217,6 +217,20 @@ namespace wi
|
||||
maskName = dir + maskName;
|
||||
maskResource = wi::resourcemanager::Load(maskName);
|
||||
}
|
||||
|
||||
if (anim.drawRectAnim.frameCount > 1 && textureResource.IsValid())
|
||||
{
|
||||
// Immediately enable params of draw rect anim, otherwise it could be lost when duplicating animated sprite because of management of originalDrawRect:
|
||||
const TextureDesc& desc = textureResource.GetTexture().GetDesc();
|
||||
XMFLOAT4 rect = XMFLOAT4(0, 0, 0, 0);
|
||||
int horizontal_frame_count = std::max(1, anim.drawRectAnim.horizontalFrameCount);
|
||||
int vertical_frame_count = anim.drawRectAnim.frameCount / horizontal_frame_count;
|
||||
rect.z = float(desc.width) / float(horizontal_frame_count);
|
||||
rect.w = float(desc.height) / float(vertical_frame_count);
|
||||
anim.drawRectAnim.originalDrawRect = rect;
|
||||
params.enableDrawRect(rect);
|
||||
anim.drawRectAnim.restart();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wi::version
|
||||
// minor features, major updates, breaking compatibility changes
|
||||
const int minor = 71;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 611;
|
||||
const int revision = 612;
|
||||
|
||||
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user