Finish fixing #2136

This commit is contained in:
Chris Forbes
2012-06-26 19:24:59 +12:00
parent c122e6f54d
commit 984a498ed2
6 changed files with 103 additions and 8 deletions

View File

@@ -371,11 +371,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
kickButton.IsVisible = () => Game.IsHost && client.Index != orderManager.LocalClient.Index; kickButton.IsVisible = () => Game.IsHost && client.Index != orderManager.LocalClient.Index;
kickButton.IsDisabled = () => orderManager.LocalClient.IsReady; kickButton.IsDisabled = () => orderManager.LocalClient.IsReady;
kickButton.OnClick = () => orderManager.IssueOrder(Order.Command("kick " + client.Index)); kickButton.OnClick = () => orderManager.IssueOrder(Order.Command("kick " + client.Index));
var isadmin = template.Get<ImageWidget>("ISADMIN");
isadmin.IsVisible = () => client.IsAdmin;
} }
template.Get<ImageWidget>("ISADMIN").IsVisible = () => client != null && client.IsAdmin;
template.IsVisible = () => true; template.IsVisible = () => true;
Players.AddChild(template); Players.AddChild(template);
} }
@@ -420,11 +419,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
kickButton.IsVisible = () => Game.IsHost && c.Index != orderManager.LocalClient.Index; kickButton.IsVisible = () => Game.IsHost && c.Index != orderManager.LocalClient.Index;
kickButton.IsDisabled = () => orderManager.LocalClient.IsReady; kickButton.IsDisabled = () => orderManager.LocalClient.IsReady;
kickButton.OnClick = () => orderManager.IssueOrder(Order.Command("kick " + c.Index)); kickButton.OnClick = () => orderManager.IssueOrder(Order.Command("kick " + c.Index));
var isadmin = template.Get<ImageWidget>("ISADMIN");
isadmin.IsVisible = () => client.IsAdmin;
} }
template.Get<ImageWidget>("ISADMIN").IsVisible = () => c.IsAdmin;
template.IsVisible = () => true; template.IsVisible = () => true;
Players.AddChild(template); Players.AddChild(template);
} }

View File

@@ -450,4 +450,7 @@ order-icons: chrome.png
sell-active: 496,32,16,16 sell-active: 496,32,16,16
repair: 384,48,16,16 repair: 384,48,16,16
repair-disabled: 384,64,16,16 repair-disabled: 384,64,16,16
repair-active: 384,80,16,16 repair-active: 384,80,16,16
misc: misc.png
isadmin: 0,0,16,16

View File

@@ -61,6 +61,13 @@ Container@SERVER_LOBBY:
Height:25 Height:25
MaxLength:16 MaxLength:16
Visible:false Visible:false
Image@ISADMIN:
Width:16
Height:16
X:200
Y:4
ImageName:isadmin
ImageCollection:misc
DropDownButton@BOT_DROPDOWN: DropDownButton@BOT_DROPDOWN:
Text:Name Text:Name
Width:205 Width:205
@@ -129,6 +136,13 @@ Container@SERVER_LOBBY:
Height:25 Height:25
X:5 X:5
Y:0-1 Y:0-1
Image@ISADMIN:
Width:16
Height:16
X:200
Y:4
ImageName:isadmin
ImageCollection:misc
Button@KICK: Button@KICK:
Text:X Text:X
Width:25 Width:25
@@ -192,6 +206,13 @@ Container@SERVER_LOBBY:
X:5 X:5
Y:0-1 Y:0-1
Visible:false Visible:false
Image@ISADMIN:
Width:16
Height:16
X:200
Y:4
ImageName:isadmin
ImageCollection:misc
Button@JOIN: Button@JOIN:
Text:Play in this slot Text:Play in this slot
Font:Regular Font:Regular
@@ -211,6 +232,13 @@ Container@SERVER_LOBBY:
Width:205 Width:205
Height:25 Height:25
MaxLength:16 MaxLength:16
Image@ISADMIN:
Width:16
Height:16
X:200
Y:4
ImageName:isadmin
ImageCollection:misc
DropDownButton@COLOR: DropDownButton@COLOR:
Width:70 Width:70
Height:25 Height:25
@@ -249,6 +277,13 @@ Container@SERVER_LOBBY:
Height:25 Height:25
X:5 X:5
Y:0-1 Y:0-1
Image@ISADMIN:
Width:16
Height:16
X:200
Y:4
ImageName:isadmin
ImageCollection:misc
Button@KICK: Button@KICK:
Text:X Text:X
Width:25 Width:25

View File

@@ -539,4 +539,7 @@ scrollitem-hover: dialog.png
corner-tl: 512,0,1,1 corner-tl: 512,0,1,1
corner-tr: 594,0,1,1 corner-tr: 594,0,1,1
corner-bl: 512,82,1,1 corner-bl: 512,82,1,1
corner-br: 594,82,1,1 corner-br: 594,82,1,1
misc: misc.png
isadmin: 0,0,16,16

View File

@@ -46,6 +46,13 @@ Background@SERVER_LOBBY:
X:0 X:0
Y:0 Y:0
MaxLength:16 MaxLength:16
Image@ISADMIN:
Width:16
Height:16
X:150
Y:4
ImageName:isadmin
ImageCollection:misc
DropDownButton@BOT_DROPDOWN: DropDownButton@BOT_DROPDOWN:
Text:Name Text:Name
Width:150 Width:150
@@ -114,6 +121,13 @@ Background@SERVER_LOBBY:
Height:25 Height:25
X:5 X:5
Y:0-1 Y:0-1
Image@ISADMIN:
Width:16
Height:16
X:150
Y:4
ImageName:isadmin
ImageCollection:misc
Button@KICK: Button@KICK:
Text:X Text:X
Width:25 Width:25
@@ -172,6 +186,13 @@ Background@SERVER_LOBBY:
Height:25 Height:25
X:5 X:5
Y:0-1 Y:0-1
Image@ISADMIN:
Width:16
Height:16
X:150
Y:4
ImageName:isadmin
ImageCollection:misc
DropDownButton@NAME_HOST: DropDownButton@NAME_HOST:
Text:Name Text:Name
Width:150 Width:150
@@ -197,6 +218,13 @@ Background@SERVER_LOBBY:
Width:150 Width:150
Height:25 Height:25
MaxLength:16 MaxLength:16
Image@ISADMIN:
Width:16
Height:16
X:150
Y:4
ImageName:isadmin
ImageCollection:misc
DropDownButton@COLOR: DropDownButton@COLOR:
Width:80 Width:80
Height:25 Height:25
@@ -243,6 +271,13 @@ Background@SERVER_LOBBY:
Height:25 Height:25
X:5 X:5
Y:0-1 Y:0-1
Image@ISADMIN:
Width:16
Height:16
X:150
Y:4
ImageName:isadmin
ImageCollection:misc
Button@KICK: Button@KICK:
Text:X Text:X
Width:25 Width:25

View File

@@ -46,6 +46,13 @@ Background@SERVER_LOBBY:
X:0 X:0
Y:0 Y:0
MaxLength:16 MaxLength:16
Image@ISADMIN:
Width:16
Height:16
X:150
Y:4
ImageName:isadmin
ImageCollection:misc
DropDownButton@BOT_DROPDOWN: DropDownButton@BOT_DROPDOWN:
Text:Name Text:Name
Width:150 Width:150
@@ -192,6 +199,13 @@ Background@SERVER_LOBBY:
Height:25 Height:25
X:160 X:160
Y:0 Y:0
Image@ISADMIN:
Width:16
Height:16
X:150
Y:4
ImageName:isadmin
ImageCollection:misc
Container@TEMPLATE_EDITABLE_SPECTATOR: Container@TEMPLATE_EDITABLE_SPECTATOR:
X:5 X:5
Y:0 Y:0
@@ -236,6 +250,13 @@ Background@SERVER_LOBBY:
Height:20 Height:20
ImageCollection:checkbox-bits ImageCollection:checkbox-bits
ImageName:checked ImageName:checked
Image@ISADMIN:
Width:16
Height:16
X:150
Y:4
ImageName:isadmin
ImageCollection:misc
Container@TEMPLATE_NONEDITABLE_SPECTATOR: Container@TEMPLATE_NONEDITABLE_SPECTATOR:
X:5 X:5