DIRECTOR: Start to draw editable text widgets

This commit is contained in:
Eugene Sandulenko
2020-04-25 00:47:24 +02:00
parent dafacc4998
commit 22ec4b60ae
2 changed files with 9 additions and 3 deletions
+6
View File
@@ -22,6 +22,7 @@
#include "common/substream.h"
#include "graphics/surface.h"
#include "graphics/macgui/maceditabletext.h"
#include "image/image_decoder.h"
#include "director/director.h"
@@ -292,6 +293,11 @@ void TextCast::setText(const char *text) {
_ptext = _ftext = text;
_cachedMacText->forceDirty();
if (_widget) {
((Graphics::MacEditableText *)_widget)->clearText();
((Graphics::MacEditableText *)_widget)->appendTextDefault(_ftext);
}
}
ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
+3 -3
View File
@@ -886,10 +886,10 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
return;
}
if (sprite->_editable && 0) {
if (sprite->_editable) {
if (!textCast->_widget) {
textCast->_widget = new Graphics::MacEditableText(score->_window, x, y, width, height, g_director->_wm, "", new Graphics::MacFont(), sprite->_foreColor, sprite->_backColor);
warning("Created MacEditableText");
textCast->_widget = new Graphics::MacEditableText(score->_window, x, y, width, height, g_director->_wm, textCast->_ftext, new Graphics::MacFont(), sprite->_foreColor, sprite->_backColor);
warning("Created MacEditableText with '%s'", textCast->_ftext.c_str());
}
textCast->_widget->draw();