Merge pull request #7269 from abcdefg30/general-polish

Some general polish
This commit is contained in:
Oliver Brakmann
2015-01-04 16:54:37 +01:00
6 changed files with 20 additions and 11 deletions

View File

@@ -147,8 +147,8 @@ namespace OpenRA.Graphics
var bounds = actor.Bounds;
bounds.Offset(screenPos.X, screenPos.Y);
var start = new float2(bounds.Left, bounds.Top);
var end = new float2(bounds.Right, bounds.Top);
var start = new float2(bounds.Left + 1, bounds.Top);
var end = new float2(bounds.Right - 1, bounds.Top);
DrawHealthBar(wr, health, start, end);
DrawExtraBars(wr, start, end);

View File

@@ -150,6 +150,7 @@ namespace OpenRA.Traits
public void Dispose()
{
if (onActorExited != null)
foreach (var a in currentActors)
onActorExited(a);
}

View File

@@ -572,6 +572,9 @@ namespace OpenRA.Mods.Common.Server
{ "difficulty",
s =>
{
if (!server.Map.Options.Difficulties.Any())
return true;
if (!client.IsAdmin)
{
server.SendOrderTo(conn, "Message", "Only the host can set that option.");

View File

@@ -387,23 +387,28 @@ namespace OpenRA.Mods.Common.UtilityCommands
try
{
var parts = s.Value.Split(',');
var loc = Exts.ParseIntegerInvariant(parts[3]);
if (parts[0] == "")
parts[0] = "Neutral";
if (!players.Contains(parts[0]))
players.Add(parts[0]);
var loc = Exts.ParseIntegerInvariant(parts[3]);
var health = float.Parse(parts[2], NumberFormatInfo.InvariantInfo) / 256;
var facing = (section == "INFANTRY") ? Exts.ParseIntegerInvariant(parts[6]) : Exts.ParseIntegerInvariant(parts[4]);
var actor = new ActorReference(parts[1].ToLowerInvariant())
{
new LocationInit(new CPos(loc % mapSize, loc / mapSize)),
new OwnerInit(parts[0]),
new HealthInit(float.Parse(parts[2], NumberFormatInfo.InvariantInfo) / 256),
new FacingInit((section == "INFANTRY")
? Exts.ParseIntegerInvariant(parts[6])
: Exts.ParseIntegerInvariant(parts[4])),
};
var initDict = actor.InitDict;
if (health != 1)
initDict.Add(new HealthInit(health));
if (facing != 0)
initDict.Add(new FacingInit(facing));
if (section == "INFANTRY")
actor.Add(new SubCellInit(Exts.ParseIntegerInvariant(parts[4])));

View File

@@ -507,7 +507,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
disconnectButton.OnClick = () => { CloseWindow(); onExit(); };
if (skirmishMode)
disconnectButton.Text = "Cancel";
disconnectButton.Text = "Back";
chatLabel = lobby.Get<LabelWidget>("LABEL_CHATTYPE");
var chatTextField = lobby.Get<TextFieldWidget>("CHAT_TEXTFIELD");

View File

@@ -294,7 +294,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
menuType = MenuType.None;
Game.OpenWindow("SERVER_LOBBY", new WidgetArgs
{
{ "onExit", () => { Game.Disconnect(); menuType = MenuType.Main; } },
{ "onExit", () => { Game.Disconnect(); menuType = MenuType.Singleplayer; } },
{ "onStart", RemoveShellmapUI },
{ "skirmishMode", true }
});