mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Messaging improvements + Added auto show dialogs in classic console mode
This commit is contained in:
parent
c0d983272b
commit
7f2a71f9fe
5 changed files with 20 additions and 2 deletions
|
|
@ -45,6 +45,8 @@ public static class DialogFormatter
|
|||
builder.AppendLine(string.Format(Translations.dialog_render_action, action.Index, action.Label, DescribeAction(action.Action)));
|
||||
}
|
||||
|
||||
builder.AppendLine();
|
||||
builder.AppendLine("§o" + Translations.dialog_render_help_hint + "§r");
|
||||
builder.Append(border);
|
||||
return builder.ToString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3440,13 +3440,15 @@ namespace MinecraftClient
|
|||
public void OnDialogShown(DialogDefinition dialog, DialogPhase phase)
|
||||
{
|
||||
var instance = Dialogs.Show(dialog, phase);
|
||||
Tui.DialogTuiHost.TryOpen(this, instance, force: phase == DialogPhase.Configuration);
|
||||
if (!Tui.DialogTuiHost.TryOpen(this, instance, force: phase == DialogPhase.Configuration))
|
||||
ConsoleIO.WriteLineFormatted(DialogFormatter.Render(instance), acceptnewlines: true);
|
||||
}
|
||||
|
||||
public void OnDialogRegistryReferenceShown(int protocolId, DialogPhase phase)
|
||||
{
|
||||
var instance = Dialogs.ShowRegistryReference(protocolId, phase);
|
||||
Tui.DialogTuiHost.TryOpen(this, instance, force: phase == DialogPhase.Configuration);
|
||||
if (!Tui.DialogTuiHost.TryOpen(this, instance, force: phase == DialogPhase.Configuration))
|
||||
ConsoleIO.WriteLineFormatted(DialogFormatter.Render(instance), acceptnewlines: true);
|
||||
}
|
||||
|
||||
public void OnDialogCleared()
|
||||
|
|
|
|||
|
|
@ -8121,5 +8121,9 @@ namespace MinecraftClient {
|
|||
get { return ResourceManager.GetString("dialog.input_kind.unknown", resourceCulture); }
|
||||
}
|
||||
|
||||
internal static string dialog_render_help_hint {
|
||||
get { return ResourceManager.GetString("dialog.render.help_hint", resourceCulture); }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3067,4 +3067,7 @@ see item details.</value>
|
|||
<data name="dialog.input_kind.unknown" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
</data>
|
||||
<data name="dialog.render.help_hint" xml:space="preserve">
|
||||
<value>Use /dialog help for a list of commands.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
|
|||
|
|
@ -174,6 +174,13 @@ internal sealed class DialogView : Border, IOverlayCloseHandler
|
|||
});
|
||||
}
|
||||
|
||||
main.Children.Add(new TextBlock
|
||||
{
|
||||
Text = Translations.dialog_render_help_hint,
|
||||
Foreground = new SolidColorBrush(Color.FromRgb(120, 120, 120)),
|
||||
TextWrapping = TextWrapping.Wrap
|
||||
});
|
||||
|
||||
main.Children.Add(_status);
|
||||
scroll.Content = main;
|
||||
root.Children.Add(scroll);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue