mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
DIRECTOR: Start to draw editable text widgets
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user