Fix some initial nits

This commit is contained in:
Paul Chote
2010-07-14 23:29:05 +12:00
parent fbf94f9f43
commit d01b3a25c4
7 changed files with 26 additions and 265 deletions

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -88,7 +88,6 @@
<Compile Include="Traits\Modifiers\HiddenUnderFog.cs" />
<Compile Include="Traits\World\Shroud.cs" />
<Compile Include="Widgets\ChatEntryWidget.cs" />
<Compile Include="Widgets\Delegates\ChatDelegate.cs" />
<Compile Include="Widgets\Delegates\ConnectionDialogsDelegate.cs" />
<Compile Include="Widgets\Delegates\CreateServerMenuDelegate.cs" />
<Compile Include="Widgets\Delegates\DiplomacyDelegate.cs" />

View File

@@ -50,6 +50,7 @@ namespace OpenRA.Widgets
var renderer = Game.chrome.renderer;
var font = renderer.RegularFont;
renderer.RgbaSpriteRenderer.Flush();
renderer.Device.EnableScissor(chatLogArea.Left, chatLogArea.Top, chatLogArea.Width, chatLogArea.Height);
foreach (var line in recentLines.AsEnumerable().Reverse())
{

View File

@@ -1,33 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
namespace OpenRA.Widgets.Delegates
{
public class ChatDelegate : IWidgetDelegate
{
public ChatDelegate()
{
var r = Chrome.rootWidget;
var chatDisplay = r.GetWidget<ChatDisplayWidget>("INGAME_CHAT_DISPLAY");
var chatEntry = r.GetWidget<ChatEntryWidget>("INGAME_CHAT_ENTRY");
Game.AddChatLine += chatDisplay.AddLine;
}
}
}

View File

@@ -62,6 +62,8 @@ namespace OpenRA.Widgets.Delegates
Game.Exit();
return true;
};
Game.AddChatLine += gameRoot.GetWidget<ChatDisplayWidget>("CHAT_DISPLAY").AddLine;
}
}
}

View File

@@ -103,7 +103,7 @@ namespace OpenRA.Widgets.Delegates
};
Game.LobbyInfoChanged += UpdatePlayerList;
Game.AddChatLine += (c, n, s) => lobby.GetWidget<ChatDisplayWidget>("CHAT_DISPLAY").AddLine(c, n, s);
Game.AddChatLine += lobby.GetWidget<ChatDisplayWidget>("CHAT_DISPLAY").AddLine;
bool teamChat = false;
var chatLabel = lobby.GetWidget<LabelWidget>("LABEL_CHATTYPE");

View File

@@ -125,113 +125,18 @@ Container@ROOT:
Text:Diplomacy
Align:Center
Bold:True
Background@PERF_BG:
ClickThrough:true
Id:PERF_BG
Background:dialog4
Delegate:PerfDebugDelegate
X:10
Y:WINDOW_BOTTOM - 250
Width: 210
Height: 250
Children:
PerfGraph@GRAPH:
Id:GRAPH
X:5
Y:5
Width:200
Height:200
Label@TEXT:
Id:TEXT
Bold: false
X:20
Y:205
Width:170
Height:40
Background@MUSIC_BG:
Id:MUSIC_BG
Delegate:MusicPlayerDelegate
X:WINDOW_RIGHT - 175
Y:WINDOW_BOTTOM - 95
Width: 160
Height: 55
Visible: true
Children:
Button@BUTTON_PLAY:
Id:BUTTON_PLAY
Visible:false
X:50
Y:15
Width:25
Height:25
Children:
Image@IMAGE_PLAY:
Id:IMAGE_PLAY
X:0
Y:0
Width:25
Height:25
ImageCollection:music
ImageName:play
Button@BUTTON_PAUSE:
Id:BUTTON_PAUSE
X:50
Y:15
Width:25
Height:25
Children:
Image@IMAGE_PAUSE:
Id:IMAGE_PAUSE
X:0
Y:0
Width:25
Height:25
ImageCollection:music
ImageName:pause
Button@BUTTON_STOP:
Id:BUTTON_STOP
X:85
Y:15
Width:25
Height:25
Children:
Image@IMAGE_STOP:
Id:IMAGE_STOP
X:0
Y:0
Width:25
Height:25
ImageCollection:music
ImageName:stop
Button@BUTTON_NEXT:
Id:BUTTON_NEXT
X:120
Y:15
Width:25
Height:25
Children:
Image@IMAGE_NEXT:
Id:IMAGE_NEXT
X:0
Y:0
Width:25
Height:25
ImageCollection:music
ImageName:next
Button@BUTTON_PREV:
Id:BUTTON_PREV
X:15
Y:15
Width:25
Height:25
Children:
Image@IMAGE_PREV:
Id:IMAGE_PREV
X:0
Y:0
Width:25
Height:25
ImageCollection:music
ImageName:prev
ChatDisplay@CHAT_DISPLAY:
Id:CHAT_DISPLAY
X:250
Y:WINDOW_BOTTOM - HEIGHT - 30
Width: 760
Height: 200
ClickThrough: True
DrawBackground: False
ChatEntry@CHAT_ENTRY:
Id:CHAT_ENTRY
X:250
Y:WINDOW_BOTTOM - HEIGHT
Width: 760
Height: 30
ClickThrough: True

View File

@@ -125,131 +125,18 @@ Container@ROOT:
Text:Diplomacy
Align:Center
Bold:True
ChatDisplay@INGAME_CHAT_DISPLAY:
Id:INGAME_CHAT_DISPLAY
ChatDisplay@CHAT_DISPLAY:
Id:CHAT_DISPLAY
X:250
Y:WINDOW_BOTTOM - HEIGHT - 30
Width: 760
Height: 200
Visible: True
Delegate: ChatDelegate
ClickThrough: True
DrawBackground: False
ChatEntry@INGAME_CHAT_ENTRY:
Id:INGAME_CHAT_ENTRY
ChatEntry@CHAT_ENTRY:
Id:CHAT_ENTRY
X:250
Y:WINDOW_BOTTOM - HEIGHT
Width: 760
Height: 30
Visible: True
ClickThrough: True
Background@PERF_BG:
ClickThrough:true
Id:PERF_BG
Background:dialog4
Delegate:PerfDebugDelegate
X:10
Y:WINDOW_BOTTOM - 250
Width: 210
Height: 250
Children:
PerfGraph@GRAPH:
Id:GRAPH
X:5
Y:5
Width:200
Height:200
Label@TEXT:
Id:TEXT
Bold: false
X:20
Y:205
Width:170
Height:40
Background@MUSIC_BG:
Id:MUSIC_BG
Delegate:MusicPlayerDelegate
X:WINDOW_RIGHT - 175
Y:WINDOW_BOTTOM - 95
Width: 160
Height: 55
Visible: true
Children:
Button@BUTTON_PLAY:
Id:BUTTON_PLAY
Visible:false
X:50
Y:15
Width:25
Height:25
Children:
Image@IMAGE_PLAY:
Id:IMAGE_PLAY
X:0
Y:0
Width:25
Height:25
ImageCollection:music
ImageName:play
Button@BUTTON_PAUSE:
Id:BUTTON_PAUSE
X:50
Y:15
Width:25
Height:25
Children:
Image@IMAGE_PAUSE:
Id:IMAGE_PAUSE
X:0
Y:0
Width:25
Height:25
ImageCollection:music
ImageName:pause
Button@BUTTON_STOP:
Id:BUTTON_STOP
X:85
Y:15
Width:25
Height:25
Children:
Image@IMAGE_STOP:
Id:IMAGE_STOP
X:0
Y:0
Width:25
Height:25
ImageCollection:music
ImageName:stop
Button@BUTTON_NEXT:
Id:BUTTON_NEXT
X:120
Y:15
Width:25
Height:25
Children:
Image@IMAGE_NEXT:
Id:IMAGE_NEXT
X:0
Y:0
Width:25
Height:25
ImageCollection:music
ImageName:next
Button@BUTTON_PREV:
Id:BUTTON_PREV
X:15
Y:15
Width:25
Height:25
Children:
Image@IMAGE_PREV:
Id:IMAGE_PREV
X:0
Y:0
Width:25
Height:25
ImageCollection:music
ImageName:prev