Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion game/ui/dialogmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ DialogMenu::~DialogMenu() {
void DialogMenu::setupSettings() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing alignment for both lines in this function

dlgAnimation = Gothic::settingsGetI("GAME","animatedWindows");
showSubtitles = Gothic::settingsGetI("GAME","subTitles");
showSubtitlesAmbient = Gothic::settingsGetI("GAME","subTitlesAmbient");
showSubtitlesPlayer = Gothic::settingsGetI("GAME","subTitlesPlayer");
showSubtitlesNoise = Gothic::settingsGetI("GAME","subTitlesNoise");
}

void DialogMenu::tick(uint64_t dt) {
Expand Down Expand Up @@ -374,7 +376,30 @@ bool DialogMenu::haveToWaitOutput() const {
}

bool DialogMenu::haveToShowSubtitles(bool isPl) const {
return showSubtitles && (showSubtitlesPlayer || !isPl);
if(!showSubtitles){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-style: { } have to be similar to other code. No need to wrap single-lines into backets

return false;
}
if(isPl){
return showSubtitlesPlayer;
} else if(other != nullptr) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else after return

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should I set a variable in the if else block and return it at the end?

switch (other->processPolicy()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you check on how those option are function in vanilla? processPolicy is only for large distances, what is not a thing in original game.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not sure how to check that. Using the processPolicy was my best guess, since I did not see any other flag that would distinguish ambient talks and surroundings npc ambient infos and talks.
If you could point me to the right direction I can have another look.

Also I just realized in the Issue you wrote:

subTitlesAmbient=1
; ... set to 1 if you dont want to have subtitles for ambient talks (default: 1) [disabled if subTitles is off]

and I implemented it the other way around (0 is off, 1 is on). Should I change this behavior? It just feels weird that this one is the only one where 1 means off.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you could point me to the right direction I can have another look

You need to check how this option affect the base game. Intuitively, it probably about npc-to-npc dialogs. Maybe also about throw-away phrases, such as "Thief!!", "I shall get you!!" and such.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??
you can remove else and wont change anything in how this code works

case(NpcProcessPolicy::AiNormal):
return showSubtitlesAmbient;

case(NpcProcessPolicy::AiFar):
case(NpcProcessPolicy::AiFar2):
return showSubtitlesNoise;

case(NpcProcessPolicy::Player):
// since other is the player, this is considered player subtitles again
return showSubtitlesPlayer;

default:
return false;
}
} else {
return false;
}
}

void DialogMenu::startTrade() {
Expand Down
10 changes: 6 additions & 4 deletions game/ui/dialogmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ class DialogMenu : public Tempest::Widget {
PScreen printMsg[MAX_PRINT];
uint64_t remPrint=0;

bool dlgAnimation = true;
bool showSubtitles = true;
bool showSubtitlesPlayer = true;
uint64_t choiceAnimTime = 0;
bool dlgAnimation = true;
bool showSubtitles = true;
bool showSubtitlesAmbient = true;
bool showSubtitlesPlayer = true;
bool showSubtitlesNoise = false;
uint64_t choiceAnimTime = 0;
};