Fix RCS1205

This commit is contained in:
RoosterDragon
2023-03-18 13:16:05 +00:00
committed by Gustas
parent 25cb3728ca
commit 498c6e3d8b
8 changed files with 27 additions and 24 deletions

View File

@@ -1097,6 +1097,9 @@ dotnet_diagnostic.RCS1199.severity = warning
# Use EventArgs.Empty.
dotnet_diagnostic.RCS1204.severity = warning
# Order named arguments according to the order of parameters.
dotnet_diagnostic.RCS1205.severity = warning
# Order type parameter constraints.
dotnet_diagnostic.RCS1209.severity = warning

View File

@@ -936,8 +936,8 @@ namespace OpenRA.Mods.Common.Pathfinder
using (var fromDest = GetLocalPathSearch(
self, new[] { target }, source, customCost, ignoreActor, check, laneBias, null, heuristicWeightPercentage,
heuristic: Heuristic(forwardAbstractSearch, estimatedSearchSize, null, null),
recorder: pathFinderOverlay?.RecordLocalEdges(self),
inReverse: true))
inReverse: true,
recorder: pathFinderOverlay?.RecordLocalEdges(self)))
return PathSearch.FindBidiPath(fromDest, fromSrc);
}
}

View File

@@ -24,10 +24,10 @@ namespace OpenRA.Mods.Common.Widgets
Dictionary<string, object> titleArguments = null,
Dictionary<string, object> textArguments = null,
Action onConfirm = null,
Action onCancel = null,
Action onOther = null,
string confirmText = null,
Action onCancel = null,
string cancelText = null,
Action onOther = null,
string otherText = null)
{
var promptName = onOther != null ? "THREEBUTTON_PROMPT" : "TWOBUTTON_PROMPT";

View File

@@ -250,13 +250,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
ConfirmationDialogs.ButtonPrompt(modData,
title: OverwriteMapFailedTitle,
text: OverwriteMapFailedPrompt,
confirmText: OverwriteMapFailedConfirm,
onConfirm: () =>
{
saveMap(combinedPath);
if (actionManager != null)
actionManager.SaveFailed = false;
},
confirmText: OverwriteMapFailedConfirm,
onCancel: () =>
{
if (actionManager != null)
@@ -278,13 +278,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
ConfirmationDialogs.ButtonPrompt(modData,
title: OverwriteMapOutsideEditTitle,
text: OverwriteMapOutsideEditPrompt,
confirmText: SaveMapMapOutsideConfirm,
onConfirm: () =>
{
saveMap(combinedPath);
if (actionManager != null)
actionManager.SaveFailed = false;
},
confirmText: SaveMapMapOutsideConfirm,
onCancel: () =>
{
if (actionManager != null)

View File

@@ -158,8 +158,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
ConfirmationDialogs.ButtonPrompt(modData,
title: VoteKickTitle,
titleArguments: Translation.Arguments("player", client.Name),
text: botsCount > 0 ? VoteKickPromptBreakBots : VoteKickPrompt,
titleArguments: Translation.Arguments("player", client.Name),
textArguments: Translation.Arguments("bots", botsCount),
onConfirm: () =>
{
@@ -174,8 +174,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
ConfirmationDialogs.ButtonPrompt(modData,
title: VoteKickTitle,
titleArguments: Translation.Arguments("player", client.Name),
text: botsCount > 0 ? VoteKickPromptBreakBots : VoteKickPrompt,
titleArguments: Translation.Arguments("player", client.Name),
textArguments: Translation.Arguments("bots", botsCount),
onConfirm: () =>
{
@@ -184,6 +184,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
closeMenu();
},
confirmText: VoteKickVoteFor,
onCancel: () => hideMenu(false),
cancelText: VoteKickVoteCancel,
onOther: () =>
{
Ui.CloseWindow();
@@ -191,16 +193,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
hideMenu(false);
closeMenu();
},
otherText: VoteKickVoteAgainst,
onCancel: () => hideMenu(false),
cancelText: VoteKickVoteCancel);
otherText: VoteKickVoteAgainst);
}
else
{
ConfirmationDialogs.ButtonPrompt(modData,
title: KickTitle,
titleArguments: Translation.Arguments("player", client.Name),
text: KickPrompt,
titleArguments: Translation.Arguments("player", client.Name),
onConfirm: () =>
{
orderManager.IssueOrder(Order.Command($"kick {client.Index} {false}"));

View File

@@ -322,8 +322,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
title: LeaveMissionTitle,
text: LeaveMissionPrompt,
onConfirm: () => { OnQuit(world); leaving = true; },
onCancel: ShowMenu,
confirmText: LeaveMissionAccept,
onCancel: ShowMenu,
cancelText: LeaveMissionCancel);
};
}
@@ -358,8 +358,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
title: RestartMissionTitle,
text: RestartMissionPrompt,
onConfirm: OnRestart,
onCancel: ShowMenu,
confirmText: RestartMissionAccept,
onCancel: ShowMenu,
cancelText: RestartMissionCancel);
};
}
@@ -384,8 +384,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
title: SurrenderTitle,
text: SurrenderPrompt,
onConfirm: OnSurrender,
onCancel: ShowMenu,
confirmText: SurrenderAccept,
onCancel: ShowMenu,
cancelText: SurrenderCancel);
};
}
@@ -591,8 +591,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
title: ExitToMapEditorTitle,
text: ExitToMapEditorPrompt,
onConfirm: OnConfirm,
onCancel: ShowMenu,
confirmText: ExitToMapEditorConfirm,
onCancel: ShowMenu,
cancelText: ExitToMapEditorCancel);
};
}
@@ -617,8 +617,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
ConfirmationDialogs.ButtonPrompt(modData,
title: ExitMapEditorTitle,
text: deletedOrUnavailable ? ExitMapEditorPromptDeleted : ExitMapEditorPromptUnsaved,
confirmText: deletedOrUnavailable ? ExitMapEditorAnywayConfirm : ExitMapEditorConfirm,
onConfirm: () => { onSuccess(); leaving = true; },
confirmText: deletedOrUnavailable ? ExitMapEditorAnywayConfirm : ExitMapEditorConfirm,
onCancel: ShowMenu);
}
else

View File

@@ -438,8 +438,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
ConfirmationDialogs.ButtonPrompt(modData,
title: NoVideoTitle,
text: NoVideoPrompt,
cancelText: NoVideoCancel,
onCancel: () => { });
onCancel: () => { },
cancelText: NoVideoCancel);
}
else
{
@@ -455,8 +455,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
ConfirmationDialogs.ButtonPrompt(modData,
title: CantPlayTitle,
text: CantPlayPrompt,
cancelText: CantPlayCancel,
onCancel: () => { });
onCancel: () => { },
cancelText: CantPlayCancel);
}
else
{

View File

@@ -124,8 +124,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
title: RestartTitle,
text: RestartPrompt,
onConfirm: () => Game.SwitchToExternalMod(external, null, NoRestart),
onCancel: CloseAndExit,
confirmText: RestartAccept,
onCancel: CloseAndExit,
cancelText: RestartCancel);
}
else
@@ -142,11 +142,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
ConfirmationDialogs.ButtonPrompt(modData,
title: ResetTitle,
titleArguments: Translation.Arguments("panel", panels[activePanel]),
text: ResetPrompt,
titleArguments: Translation.Arguments("panel", panels[activePanel]),
onConfirm: Reset,
onCancel: () => { },
confirmText: ResetAccept,
onCancel: () => { },
cancelText: ResetCancel);
};
}