-
-
Notifications
You must be signed in to change notification settings - Fork 291
Fix: Show send(cmd, true) on screen despite profile setting #7881
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
base: development
Are you sure you want to change the base?
Conversation
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
|
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.
There isn't a right and a wrong way here, as it all depends upon the perspective - do you give the control to the player (option overrides scripts), or do you give control to the scripts here (scripts can override the option)?
Moving control from the players to the script like this might backfire with some players who'd prefer not to see the commands on the screen, despite what the script wants. Some scripts could have also been written with this option in mind working the way it is now.
So this isn't necessarily fixing an issue per se, but changing how the option works from one way to the other. I'm on the fence about this for this reason, esp. since we've just had just one feedback of this, not dozens.
Thoughts from others?
Currently, the impact of "Show the text you sent" is quite broad. As a user, I would expect this setting to filter out only what I type directly, but it actually affects much more. As demonstrated in the current state (see left image), unchecking "Show the text you sent" suppresses the echo of the Would it make sense to reconsider this setting? For example, we could change it to "Text from commands sent:" and offer three scopes:
More detail:
Would this be more intuitive for users? Open to thoughts from others! |
@@ -1240,12 +1240,13 @@ QPair<QString, QString> Host::getSearchEngine() | |||
// cTelnet::sendData(...) call: | |||
void Host::send(QString cmd, bool wantPrint, bool dontExpandAliases) | |||
{ | |||
if (wantPrint && (!mIsRemoteEchoingActive) && mPrintCommand) { |
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.
👎 The "profile" setting is entirely contained within this use of mPrintCommand
- so removing it here renders everything else about the setting as dead cruft in several files.
Perhaps, the default setting of mPrintCommand
to true
- currently in the Host
constructor initialisation list but really should be moved to the header file - should be amended to false
instead - would this address the discomfort you have with this setting @mpconley?
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.
The other place this is used is TCommandLine::enterCommand(QKeyEvent* event)
for MiniConsole.
Showing what text is sent is my preferred default option for a profile, as-is. This is a nuance for sure.
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.
Sorry, you are right, my searching was flawed and didn't give me that second usage. I suppose there is an option to turn the control in the preferences into a tri-state - with the default being partially checked meaning - "go with the Lua arguments" and the other two being always/never show the send
command.
🤷
I'm wary of adding more detail to the option - and thus making it harder to use - without a good amount of impetus behind this from the playerbase. I'll ask around to see if there is a need for it! Should there be large demand, we should go with it. Otherwise, better to keep things simpler. |
I don't have an emotional tie to this PR, but I want to give the issue requester a chance, so I will present a case. A bit dramatic perhaps, but a scenario: We have a package repo now for a world of authors. A package may have something critical to tell a user from its functionality. A core dev may have reviewed that package and gave it a 👍 because it informed the user of something. The package gets deployed, used for months, and then it is found that something unwanted is occuring consistently to multiple users and no one knows why. The package author did their diligence - they sent output. The core dev did not consider this "feature" of Mudlet. The end-user did not think that would have been an effect of checking a box to not "Show the text you sent". But Mudlet scoped out the critical script output with that checkbox, and now people are scared to use packages from others anymore, the package repo dies, and people start looking for their ZMud license codes. Let's enable presenting information to people wherever we can, unless the opt-out is very clear. |
I agree with the intent of the PR here.
This was what I originally thought the preference was for as well. I would also think that any 'send command directly to the game' options would follow this setting ie., Command boxes in aliases and keybindings. I would assume that
Agreed: I manually sent a command, I need feedback that this command has been sent, otherwise lag (whether network or game imposed) may see me sending it again with disastrous consequences.
Agreed: we are trying to simplify preferences. I note in the tooltip that the server can turn this option off. How does this affect scripts with/without the patch? Is the result expected? Lastly, perhaps scripts should be using a 'best practice' with e.g.,
|
The note in the tooltip is geared toward the ECHO handling with the server, however it is possible for a script to toggle Should certain settings come with a prompt to ensure the user is OK with changing the setting? |
Great idea |
Brief overview of PR changes/additions
This PR updates the behavior of the send() function so that its showOnScreen argument consistently overrides the global "Show the text you sent" setting in both directions. Previously, send(cmd, false) would suppress echo regardless of the global setting, but send(cmd, true) would not show the text if the global setting was disabled. Now, explicitly passing true or false to showOnScreen will always control whether the sent text is echoed, making the behavior more predictable and script-friendly.
Motivation for adding to Mudlet:
Resolves inconsistent behavior reported in #6919, improving script compatibility and user control over input echoing.
Other info (issues closed, discussion etc):
Closes #6919. No changes to default behavior unless showOnScreen is explicitly set in scripts.
Left is before the PR, right is after the PR:
send(cmd, true)
send(cmd, false)
send(cmd, true)
smile
prints!send(cmd, false)
This is a video of the above in action, before the PR, after the PR:
Screen.Recording.2025-05-31.at.6.15.06.PM.mov