[Scummvm-git-logs] scummvm master -> fd98a423000fede425502ee26673c39b817dec59

whiterandrek noreply at scummvm.org
Mon Feb 7 21:16:01 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
fd98a42300 PETKA: fix outline color and text color for dialog options


Commit: fd98a423000fede425502ee26673c39b817dec59
    https://github.com/scummvm/scummvm/commit/fd98a423000fede425502ee26673c39b817dec59
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2022-02-07T23:15:56+02:00

Commit Message:
PETKA: fix outline color and text color for dialog options
bugs #12063

Changed paths:
    engines/petka/interfaces/dialog_interface.cpp
    engines/petka/interfaces/main.cpp
    engines/petka/interfaces/main.h
    engines/petka/objects/text.cpp
    engines/petka/objects/text.h


diff --git a/engines/petka/interfaces/dialog_interface.cpp b/engines/petka/interfaces/dialog_interface.cpp
index 84ab5ea927d..6d4f8c64ea7 100644
--- a/engines/petka/interfaces/dialog_interface.cpp
+++ b/engines/petka/interfaces/dialog_interface.cpp
@@ -243,7 +243,10 @@ void DialogInterface::onMenuOpcode() {
 
 	Common::Array<Common::U32String> choices;
 	_dialog->getMenuChoices(choices);
-	_qsys->_mainInterface->setTextChoice(choices, 0xFFFF, g_system->getScreenFormat().RGBToColor(0xFF, 0, 0));
+	_qsys->_mainInterface->setTextChoice(choices,
+										 g_system->getScreenFormat().RGBToColor(0xFF, 0xFF, 0xFF),
+										 g_system->getScreenFormat().RGBToColor(0xA, 0xA, 0xA),
+										 g_system->getScreenFormat().RGBToColor(0, 0, 0xFF));
 
 	_qsys->getCursor()->_isShown = true;
 	_state = kMenu;
diff --git a/engines/petka/interfaces/main.cpp b/engines/petka/interfaces/main.cpp
index 3ae8fd7f72c..4daf91f67d9 100644
--- a/engines/petka/interfaces/main.cpp
+++ b/engines/petka/interfaces/main.cpp
@@ -253,10 +253,10 @@ void InterfaceMain::onMouseMove(Common::Point p) {
 	}
 }
 
-void InterfaceMain::setTextChoice(const Common::Array<Common::U32String> &choices, uint16 color, uint16 selectedColor) {
+void InterfaceMain::setTextChoice(const Common::Array<Common::U32String> &choices, uint16 color, uint16 outlineColor, uint16 selectedColor) {
 	removeTexts();
 	_objUnderCursor = nullptr;
-	_objs.push_back(new QTextChoice(choices, color, selectedColor));
+	_objs.push_back(new QTextChoice(choices, color, outlineColor, selectedColor));
 }
 
 void InterfaceMain::setTextDescription(const Common::U32String &text, int frame) {
diff --git a/engines/petka/interfaces/main.h b/engines/petka/interfaces/main.h
index a51c045665e..db3aabb7327 100644
--- a/engines/petka/interfaces/main.h
+++ b/engines/petka/interfaces/main.h
@@ -54,7 +54,7 @@ public:
 	void onRightButtonDown(Common::Point p) override;
 	void onMouseMove(Common::Point p) override;
 
-	void setTextChoice(const Common::Array<Common::U32String> &choices, uint16 color, uint16 selectedColor);
+	void setTextChoice(const Common::Array<Common::U32String> &choices, uint16 color, uint16 outlineColor, uint16 selectedColor);
 	void setTextDescription(const Common::U32String &text, int frame);
 
 	void removeTextDescription();
diff --git a/engines/petka/objects/text.cpp b/engines/petka/objects/text.cpp
index d379b2fabf8..e3bf99c9194 100644
--- a/engines/petka/objects/text.cpp
+++ b/engines/petka/objects/text.cpp
@@ -170,9 +170,10 @@ void QTextDescription::draw() {
 	}
 }
 
-QTextChoice::QTextChoice(const Common::Array<Common::U32String> &choices, uint16 color, uint16 selectedColor) {
+QTextChoice::QTextChoice(const Common::Array<Common::U32String> &choices, uint16 color, uint16 outlineColor, uint16 selectedColor) {
 	_activeChoice = 0;
 	_choiceColor = color;
+	_outlineColor = outlineColor;
 	_selectedColor = selectedColor;
 	_choices = choices;
 
@@ -201,6 +202,7 @@ QTextChoice::QTextChoice(const Common::Array<Common::U32String> &choices, uint16
 		_rects[i].moveTo(0, y);
 		y += _rects[i].height();
 	}
+	drawOutline(s, outlineColor);
 }
 
 void QTextChoice::onMouseMove(Common::Point p) {
@@ -222,7 +224,7 @@ void QTextChoice::onMouseMove(Common::Point p) {
 			uint color = (i == newChoice) ? _selectedColor : _choiceColor;
 			drawText(*s, _rects[i].top, 630, _choices[i], color, *font);
 		}
-
+		drawOutline(s, _outlineColor);
 		_activeChoice = newChoice;
 	}
 }
diff --git a/engines/petka/objects/text.h b/engines/petka/objects/text.h
index 6c0f3222d8b..d2a75255a51 100644
--- a/engines/petka/objects/text.h
+++ b/engines/petka/objects/text.h
@@ -77,7 +77,7 @@ public:
 
 class QTextChoice : public QText {
 public:
-	QTextChoice(const Common::Array<Common::U32String> &choices, uint16 color, uint16 selectedColor);
+	QTextChoice(const Common::Array<Common::U32String> &choices, uint16 color, uint16 outlineColor, uint16 selectedColor);
 
 	void onMouseMove(Common::Point p) override;
 	void onClick(Common::Point p) override;
@@ -87,6 +87,7 @@ private:
 	Common::Array<Common::Rect> _rects;
 	Common::Array<Common::U32String> _choices;
 	uint _activeChoice;
+	uint16 _outlineColor;
 	uint16 _choiceColor;
 	uint16 _selectedColor;
 };




More information about the Scummvm-git-logs mailing list