STARK: Implement the conversation log menu #1450
Conversation
7f1abd0
to
1fd4e49
Compare
@bgK The whole implementation is basically finished and it's ready for review. I find it extremely difficult to make the layout of widgets exactly the same as the original, at least not in a reasonable way. I suspect that this is due to the difference of the graphics layers. In 93327fa I did my best to make the whole layout very similar. Differences should be unnoticeable unless you put it together with the original. If you think it is not satisfactory then I think we'll need to take a deep look at the disassembly. |
engines/stark/ui/menu/dialogmenu.cpp
Outdated
Common::String name = StarkGlobal->getCharacterName(logLine.characterId); | ||
name.toUppercase(); | ||
|
||
uint color = name == "APRIL" ? _textColorApril : _textColorNormal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how this test is done in other parts of the engine:
residualvm/engines/stark/resources/speech.cpp
Line 131 in 8b5e743
bool Speech::characterIsApril() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking very good! I've added a few minor comments that need to be addressed before this can be merged.
@@ -92,7 +92,7 @@ void StaticLocationScreen::onMouseMove(const Common::Point &pos) { | |||
// The first widget is always the background. It is ignored below. | |||
|
|||
if (newHoveredWidget != _hoveredWidgetIndex) { | |||
if (_hoveredWidgetIndex > 0) { | |||
if (_hoveredWidgetIndex > 0 && _hoveredWidgetIndex < _widgets.size()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the sign / unsigned comparison warning here.
|
||
++_nextTitleIndex; | ||
|
||
if (pos.y > bottom) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the sign / unsigned comparison warning here.
engines/stark/ui/menu/dialogmenu.h
Outdated
class DialogLineText; | ||
|
||
/** | ||
* The coversation log menu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo.
engines/stark/ui/menu/dialogmenu.cpp
Outdated
} | ||
|
||
if (pos.y + height > bottom) { | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we break here the objects created above are never freed.
engines/stark/ui/menu/dialogmenu.cpp
Outdated
height = dialogLineText->getHeight(); | ||
|
||
if (pos.y + height + space > bottom) { | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we break here DialogLineText
is not freed.
It looks close enough to me. I don't think anybody will mind if it's a few pixels of the original in this case. |
@bgK If you also think it's okay, we can merge. |
This PR is corresponding to implementing the conversation log menu in TLJ.