Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): Add a message log filter to hide less important entries #9997

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

TomGoodIdea
Copy link
Member

@TomGoodIdea TomGoodIdea commented Apr 17, 2024

Feature

Summary

It's now possible to hide all messages of Low and High importances (including most hails and autopilot messages) on the message log panel. The filter can be toggled by clicking the selection box (see screenshots below) or by pressing I. With the filter enabled, only Highest (orange), Info (green), and Daily (blue) entries are displayed.

To prevent accidental closing when trying to switch the filter, I removed the ability to close the panel with a mouse click outside the log area (maybe a "Done" button should be added instead, but idk where to place it).

Also changed importance of some messages to Highest to better reflect their purpose.

Screenshots

Screenshots

disabled
enabled

Testing Done

Tested on 100 (even) and 110 (odd) zoom levels, everything works.

Save File

N/A

Artwork Checklist

Performance Impact

N/A

@TomGoodIdea TomGoodIdea added the UI Everything related to the User Interface & Design (both artwork and code) label Apr 17, 2024
Comment on lines +86 to +98

// Draw the filter box.
const Sprite *filterBack = SpriteSet::Get("ui/message log key");
pos = Screen::BottomLeft() + Point(width + 40., 0.);
SpriteShader::Draw(filterBack, pos + Point(.5 * filterBack->Width(), -.5 * filterBack->Height()));
const Color color[2] = {*GameData::Colors().Get("medium"), *GameData::Colors().Get("bright")};
const Sprite *box[2] = {SpriteSet::Get("ui/unchecked"), SpriteSet::Get("ui/checked")};
pos += Point(30., -30.);
SpriteShader::Draw(box[importantOnly], pos);
Point off = Point(10., -.5 * font.Height());
font.Draw("Hide less _important", pos + off, color[importantOnly]);
font.Draw("messages", pos + off + Point(0., 20.), color[importantOnly]);
AddZone(Rectangle(pos + Point(64., 10.), Point(140., 40.)), [this](){ importantOnly = !importantOnly; });
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't most/all of this be done through an interface?

Copy link
Member Author

Choose a reason for hiding this comment

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

I figured out that currently using an interface here would require really hacky methods and I'm waiting for a response on 6424. I was thinking of adding extensive interface support to all conversation-like panels anyway, so I'll just leave this hardcoded for now.

@@ -73,13 +73,29 @@ void MessageLogPanel::Draw()
Point pos = Screen::BottomLeft() + Point(PAD, scroll);
for(const auto &it : messages)
{
if(importantOnly && (it.second == Messages::Importance::Low || it.second == Messages::Importance::High))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why exclude "High" importance?
Skipping message of "High" importance because the user asked for "only important" messages seems a bit strange.
I'm not sure I'd consider the messages that currently get "Info" or "Daily" more important than "High" importance messages, though some "High" importance messages might deserve demotion.

It might be better to have a wider range of categories available here, or perhaps we should look at changing how the existing categories are assigned, to allow more meaningful filtering.

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently, the only real difference between Low and High is how duplicates are handled. IIRC the only messages that use the Low importance are some autopilot ones.

Copy link
Contributor

@warp-core warp-core Apr 27, 2024

Choose a reason for hiding this comment

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

Here's a breakdown of what sorts of messages are given each importance:

Highest:

  • Failure of the flagship to follow a jump or land command.
  • Your ship has overheated.
  • Raid fleet incoming.
  • Mission failed.
  • Don't scan me.
  • Your ship was destroyed.

High:

  • Failure to send a hail.
  • Hailing a wormhole.
  • Unable to dock with a ship while cloaked.
  • Flagship responding to your commands (engaging autopilot to jump or land, stopping, cloaking, carried ship deployment/recall.)
  • Turret tracking or escort ammo usage mode changes.
  • Escorts following your orders.
  • Some escorts couldn't dock with a carrier.
  • One of your ships was scanned.
  • Help messages.
  • Bribing a ship government or planet.
  • You received a map.
  • Outfits or ships were given or taken by an event.
  • (Semi-)automated hiring or firing of crew.
  • Target self-destructing.
  • Flotsam collection.
  • Dumping cargo.
  • Money (taken, received, profit or loss from cargo sale.)
  • Ships requesting or thanking you for assistance in combat.
  • Random hails.

Low:

  • Your ships lack crew.
  • You started a scan.
  • Someone started a scan of your ship.
  • Ships announcing they are dumping cargo to appease foes.

Info:

  • Mission objective landables in the next system.

Daily:

  • Entering a new system (and the date).

I think things like "failure to send a hail" or "failure to dock (due to cloaking) are probably more important than "Entering the <system> system on <today>." This can probably be addressed by promoting those to highest importance, though.

For this PR, I'm not sure why the "Daily" messages aren't considered "less important" for this filter.

Full list:

Highest:

  • "The authorities on this <landable> refuse to clear you to land here."
  • "There are no planets in this system that you can land on."
  • "You do not have a hyperdrive installed."
  • "You cannot jump to the selected system."
  • "You do not have enough fuel to make a hyperspace jump."
  • "You cannot jump while landing."
  • "Your ship has overheated."
  • "Your fleet has attracted the attention of a <government> raiding party."
  • "The authorities on <landable name> refuse to let you land."
  • Mission failed (because a ship carrying mission cargo was destroyed or boarded or mission passengers was destroyed.)
  • "Mission failed." (Because of something that happened to an NPC in it.)
  • "You failed to meet the deadline for hte mission <mission>."
  • "Mission <mission> aborted because you do not have <space>."
  • "Please refrain from scanning us or we will be forced to take action."
  • "Your ship <name> has been destroyed."

High:

  • "Deployed carried ships."
  • "Recalled carried ships."
  • "Disengaging autopilot."
  • "Coming to a stop."
  • "Engaging cloaking device."
  • "Disengaging cloaking device."
  • "Switching landing targets. Now landing on <landable name>."
  • "You can land on more than one <landable> in this system. Landing on <landable name>."
  • "Landing on <landable name>."
  • "Landing on a local wormhole to navigate to the <system name> system."
  • "Engaging fleet autopilot to jump to the <system name> system. Your fleet will jump when ready."
  • "Engaging autopilot to jump to the <system name> system."
  • "Autopilot: landing on <planet name>."
  • Help message "basics 1".
  • Help message "basics 2".
  • You or one of your escorts picked up some flotsam. "<tons> free space remaining."
  • "You received a map of nearby systems."
  • Outfits were given or taken by a game action.
  • "You bribed a <government> ship <credits> to refrain from attacking you today."
  • "You bribed the authorities on <planet name> <credits> to permit you to land."
  • "Turret tracking mode set to <mode>."
  • "Your escorts will now expend ammo: <type>."
  • "Unable to send hail. Your flagship is entering hyperspace."
  • "Unable to send hail. Your flagship is cloaked."
  • "Unable to hail target <name>."
  • "Unable to send hail: <target> is entering hyperspace."
  • wormhole hail phrase.
  • "Unable to send hail: <planet> is not inhabited."
  • "Unable to send hail. No target selected."
  • "You hire <number> extra crew member(s) to fill your now-empty bunks."
  • "You fired <crew members> to free up <bunks> for <passengers>."
  • "You fired <crew members> because you have no <bunks> for them."
  • "<Some escorts were> unable to dock with a carrier."
  • "The <thing> completed its <scan> of your <ship>( with no useful results)."
  • "You cannot board a ship while cloaked."
  • "The <target> has activated its self-destruct mechanism."
  • "You jettisoned <credits> worth of cargo."
  • Ships were given or taken by a game action.
  • "You sold cargo for <profit or loss>."
  • Income from salaries, tribute payments, and outfits and ships.
  • Paying and/or missing salaries, maintenance, mortgages, and fines.
  • Selling excess cargo.
  • Your escorts reacting to your orders.
  • "Thank you for your assistance, Captain <last>."
  • Requests for assistance in dealing with a hostile ship.
  • Random hails.

Low:

  • Announcements of appeasement: "Please, just take my cargo and leave me alone." - regardless of who it is being appeased.
  • "Attempting to scan the selected <thing>."
  • "The <thing> is attempting to scan your <ships>."
  • One of your ships is moving erratically because there are not enough crew to pilot it.

Info:

  • "Note: you have (a) mission(s) that require landing on (a) planet(s) in the system you are jumping to."

Daily:

  • "Entering the <system name> on <today>.( No inhabited planets detected.)"

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for preparing the lists.

For this PR, I'm not sure why the "Daily" messages aren't considered "less important" for this filter.

Daily messages tell you when other messages were posted. That's often a helpful info, especially if you consider reloading a previous save. And since Daily entries have a different color, they don't make the log unreadable.

I think things like "failure to send a hail" or "failure to dock (due to cloaking) are probably more important than "Entering the system on ." This can probably be addressed by promoting those to highest importance, though.

Marking those messages as Highest makes sense, given that the jump failure messages already have this importance.

Copy link
Member Author

Choose a reason for hiding this comment

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

done, let me know if there's any other message you feel needs moving to Highest category

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Everything related to the User Interface & Design (both artwork and code)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants