Point to the log for long stack traces.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
c651f733a7
commit
6b04dbc210
@@ -25,11 +25,16 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
public class MapGeneratorToolLogic : ChromeLogic
|
public class MapGeneratorToolLogic : ChromeLogic
|
||||||
{
|
{
|
||||||
[FluentReference("name")]
|
[FluentReference("name")]
|
||||||
const string StrGenerated = "notification-map-generator-generated";
|
const string MapGenerated = "notification-map-generator-generated";
|
||||||
|
|
||||||
[FluentReference]
|
[FluentReference]
|
||||||
const string StrFailed = "notification-map-generator-failed";
|
const string MapGeneratorFailedTitle = "dialog-notification-map-generator-failed.title";
|
||||||
|
|
||||||
[FluentReference]
|
[FluentReference]
|
||||||
const string StrFailedCancel = "label-map-generator-failed-cancel";
|
const string MapGeneratorFailedPrompt = "dialog-notification-map-generator-failed.prompt";
|
||||||
|
|
||||||
|
[FluentReference]
|
||||||
|
const string MapGeneratorFailedCancel = "dialog-notification-map-generator-failed.cancel";
|
||||||
|
|
||||||
readonly EditorActionManager editorActionManager;
|
readonly EditorActionManager editorActionManager;
|
||||||
readonly World world;
|
readonly World world;
|
||||||
@@ -239,14 +244,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
void DisplayError(Exception e)
|
void DisplayError(Exception e)
|
||||||
{
|
{
|
||||||
// For any non-MapGenerationException, include more information for debugging purposes.
|
var message = e is MapGenerationException ? e.Message : MapGeneratorFailedPrompt;
|
||||||
var message = e is MapGenerationException ? e.Message : e.ToString();
|
|
||||||
Log.Write("debug", e);
|
Log.Write("debug", e);
|
||||||
ConfirmationDialogs.ButtonPrompt(modData,
|
ConfirmationDialogs.ButtonPrompt(modData,
|
||||||
title: StrFailed,
|
title: MapGeneratorFailedTitle,
|
||||||
text: message,
|
text: message,
|
||||||
onCancel: () => { },
|
onCancel: () => { },
|
||||||
cancelText: StrFailedCancel);
|
cancelText: MapGeneratorFailedCancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenerateMap()
|
void GenerateMap()
|
||||||
@@ -318,7 +322,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
editorActorLayer,
|
editorActorLayer,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
var description = FluentProvider.GetMessage(StrGenerated,
|
var description = FluentProvider.GetMessage(MapGenerated,
|
||||||
"name", FluentProvider.GetMessage(generator.Name));
|
"name", FluentProvider.GetMessage(generator.Name));
|
||||||
var action = new RandomMapEditorAction(editorBlit, description);
|
var action = new RandomMapEditorAction(editorBlit, description);
|
||||||
editorActionManager.Add(action);
|
editorActionManager.Add(action);
|
||||||
|
|||||||
@@ -1120,9 +1120,12 @@ keycode =
|
|||||||
.mouse5 = Mouse 5
|
.mouse5 = Mouse 5
|
||||||
|
|
||||||
## MapGeneratorToolLogic
|
## MapGeneratorToolLogic
|
||||||
label-map-generator-failed-cancel = Dismiss
|
|
||||||
notification-map-generator-generated = Generated using { $name }
|
notification-map-generator-generated = Generated using { $name }
|
||||||
notification-map-generator-failed = Map generation failed
|
|
||||||
|
dialog-notification-map-generator-failed =
|
||||||
|
.title = Map generation failed
|
||||||
|
.prompt = See debug.log for details.
|
||||||
|
.cancel = Dismiss
|
||||||
|
|
||||||
## EditorTilingPathBrush
|
## EditorTilingPathBrush
|
||||||
notification-tiling-path-started = Started tiling path
|
notification-tiling-path-started = Started tiling path
|
||||||
|
|||||||
Reference in New Issue
Block a user