add non-functional replay browser

This commit is contained in:
Chris Forbes
2010-11-10 09:36:11 +13:00
parent 25ebdea758
commit 4f3b16cab2
6 changed files with 418 additions and 291 deletions

View File

@@ -201,6 +201,7 @@
<Compile Include="TraitDictionary.cs" /> <Compile Include="TraitDictionary.cs" />
<Compile Include="Traits\Activities\CancelableActivity.cs" /> <Compile Include="Traits\Activities\CancelableActivity.cs" />
<Compile Include="Traits\SharesCell.cs" /> <Compile Include="Traits\SharesCell.cs" />
<Compile Include="Widgets\Delegates\ReplayBrowserDelegate.cs" />
<Compile Include="Widgets\PasswordFieldWidget.cs" /> <Compile Include="Widgets\PasswordFieldWidget.cs" />
<Compile Include="Widgets\ScrollingTextWidget.cs" /> <Compile Include="Widgets\ScrollingTextWidget.cs" />
</ItemGroup> </ItemGroup>

View File

@@ -0,0 +1,21 @@
#region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see LICENSE.
*/
#endregion
namespace OpenRA.Widgets.Delegates
{
public class ReplayBrowserDelegate : IWidgetDelegate
{
[ObjectCreator.UseCtor]
public ReplayBrowserDelegate( [ObjectCreator.Param] Widget widget )
{
/* todo */
}
}
}

View File

@@ -21,14 +21,15 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
static bool FirstInit = true; static bool FirstInit = true;
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public MainMenuButtonsDelegate( [ObjectCreator.Param] Widget widget ) public MainMenuButtonsDelegate([ObjectCreator.Param] Widget widget)
{ {
// Main menu is the default window // Main menu is the default window
widget.GetWidget( "MAINMENU_BUTTON_JOIN" ).OnMouseUp = mi => { Widget.OpenWindow( "JOINSERVER_BG" ); return true; }; widget.GetWidget("MAINMENU_BUTTON_JOIN").OnMouseUp = mi => { Widget.OpenWindow("JOINSERVER_BG"); return true; };
widget.GetWidget( "MAINMENU_BUTTON_CREATE" ).OnMouseUp = mi => { Widget.OpenWindow( "CREATESERVER_BG" ); return true; }; widget.GetWidget("MAINMENU_BUTTON_CREATE").OnMouseUp = mi => { Widget.OpenWindow("CREATESERVER_BG"); return true; };
widget.GetWidget( "MAINMENU_BUTTON_SETTINGS" ).OnMouseUp = mi => { Widget.OpenWindow( "SETTINGS_MENU" ); return true; }; widget.GetWidget("MAINMENU_BUTTON_SETTINGS").OnMouseUp = mi => { Widget.OpenWindow("SETTINGS_MENU"); return true; };
widget.GetWidget( "MAINMENU_BUTTON_MUSIC" ).OnMouseUp = mi => { Widget.OpenWindow( "MUSIC_MENU" ); return true; }; widget.GetWidget("MAINMENU_BUTTON_MUSIC").OnMouseUp = mi => { Widget.OpenWindow("MUSIC_MENU"); return true; };
widget.GetWidget( "MAINMENU_BUTTON_QUIT" ).OnMouseUp = mi => { Game.Exit(); return true; }; widget.GetWidget("MAINMENU_BUTTON_REPLAY_VIEWER").OnMouseUp = mi => { Widget.OpenWindow("REPLAYBROWSER_BG"); return true; };
widget.GetWidget("MAINMENU_BUTTON_QUIT").OnMouseUp = mi => { Game.Exit(); return true; };
var version = widget.GetWidget<LabelWidget>("VERSION_STRING"); var version = widget.GetWidget<LabelWidget>("VERSION_STRING");

View File

@@ -1,285 +1,294 @@
Background@MAINMENU_BG: Background@MAINMENU_BG:
Id:MAINMENU_BG Id:MAINMENU_BG
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:250 Width:250
Height:290 Height:330
Delegate:MainMenuButtonsDelegate Delegate:MainMenuButtonsDelegate
Children: Children:
Background@MOTD_BG: Background@MOTD_BG:
Id:MOTD_BG Id:MOTD_BG
X:0 - PARENT_LEFT + WINDOW_RIGHT/3 X:0 - PARENT_LEFT + WINDOW_RIGHT/3
Y:0 - PARENT_TOP + 44 Y:0 - PARENT_TOP + 44
Width:WINDOW_RIGHT/3 Width:WINDOW_RIGHT/3
Height:30 Height:30
Background:dialog4 Background:dialog4
Children: Children:
ScrollingText@MOTD_SCROLLER: ScrollingText@MOTD_SCROLLER:
Id:MOTD_SCROLLER Id:MOTD_SCROLLER
X:15 X:15
Y:2 Y:2
Width:PARENT_RIGHT - 30 Width:PARENT_RIGHT - 30
Height:25 Height:25
ScrollRate:8 ScrollRate:8
Text:Welcome to OpenRA. Enjoy your stay. Text:Welcome to OpenRA. Enjoy your stay.
Background@MOTD_LABEL_BG Background@MOTD_LABEL_BG
Id:MOTD_LABEL_BG Id:MOTD_LABEL_BG
X:0 - PARENT_LEFT + (WINDOW_RIGHT/16)*7 X:0 - PARENT_LEFT + (WINDOW_RIGHT/16)*7
Y:0 - PARENT_TOP + 15 Y:0 - PARENT_TOP + 15
Width:(WINDOW_RIGHT/16)*2 Width:(WINDOW_RIGHT/16)*2
Height:30 Height:30
Background:dialog4 Background:dialog4
Children: Children:
Label@MOTD_LABEL Label@MOTD_LABEL
Id:MOTD_LABEL Id:MOTD_LABEL
X:0 X:0
Y:2 Y:2
Width:(WINDOW_RIGHT/16)*2 Width:(WINDOW_RIGHT/16)*2
Height:25 Height:25
Text:Message of the Day Text:Message of the Day
Align:Center Align:Center
Bold:True Bold:True
Label@MAINMENU_LABEL_TITLE: Label@MAINMENU_LABEL_TITLE:
Id:MAINMENU_LABEL_TITLE Id:MAINMENU_LABEL_TITLE
X:0 X:0
Y:20 Y:20
Width:250 Width:250
Height:25 Height:25
Text:OpenRA Main Menu Text:OpenRA Main Menu
Align:Center Align:Center
Bold:True Bold:True
Button@MAINMENU_BUTTON_JOIN: Button@MAINMENU_BUTTON_JOIN:
Id:MAINMENU_BUTTON_JOIN Id:MAINMENU_BUTTON_JOIN
X:45 X:45
Y:70 Y:70
Width:160 Width:160
Height:25 Height:25
Text:Join Game Text:Join Game
Bold:True Bold:True
Button@MAINMENU_BUTTON_CREATE: Button@MAINMENU_BUTTON_CREATE:
Id:MAINMENU_BUTTON_CREATE Id:MAINMENU_BUTTON_CREATE
X:45 X:45
Y:110 Y:110
Width:160 Width:160
Height:25 Height:25
Text:Create Game Text:Create Game
Bold:True Bold:True
Button@MAINMENU_BUTTON_SETTINGS: Button@MAINMENU_BUTTON_SETTINGS:
Id:MAINMENU_BUTTON_SETTINGS Id:MAINMENU_BUTTON_SETTINGS
X:45 X:45
Y:150 Y:150
Width:160 Width:160
Height:25 Height:25
Text:Settings Text:Settings
Bold:True Bold:True
Button@MAINMENU_BUTTON_MUSIC: Button@MAINMENU_BUTTON_MUSIC:
Id:MAINMENU_BUTTON_MUSIC Id:MAINMENU_BUTTON_MUSIC
X:45 X:45
Y:190 Y:190
Width:160 Width:160
Height:25 Height:25
Text:Music Text:Music
Bold:True Bold:True
Button@MAINMENU_BUTTON_QUIT: Button@MAINMENU_BUTTON_REPLAY_VIEWER:
Id:MAINMENU_BUTTON_QUIT Id:MAINMENU_BUTTON_REPLAY_VIEWER
X:45 X:45
Y:230 Y:230
Width:160 Width:160
Height:25 Height:25
Text:Quit Text: Replay Viewer
Bold:True Bold: True
Button@MAINMENU_BUTTON_VIDEOPLAYER: Button@MAINMENU_BUTTON_QUIT:
Id:MAINMENU_BUTTON_VIDEOPLAYER Id:MAINMENU_BUTTON_QUIT
Visible:false X:45
X:45 Y:270
Y:260 Width:160
Width:160 Height:25
Height:25 Text:Quit
Text:Video Player Bold:True
Bold:True Button@MAINMENU_BUTTON_VIDEOPLAYER:
Label@VERSION_STRING: Id:MAINMENU_BUTTON_VIDEOPLAYER
Id:VERSION_STRING Visible:false
X:WINDOW_RIGHT - PARENT_LEFT - WIDTH - 15 X:45
Y:WINDOW_BOTTOM - PARENT_TOP - 65 Y:260
Width:400 Width:160
Height:70 Height:25
Text: Text:Video Player
Align:Right Bold:True
Bold:True Label@VERSION_STRING:
Background@PERF_BG: Id:VERSION_STRING
ClickThrough:true X:WINDOW_RIGHT - PARENT_LEFT - WIDTH - 15
Id:PERF_BG Y:WINDOW_BOTTOM - PARENT_TOP - 65
Background:dialog4 Width:400
Delegate:PerfDebugDelegate Height:70
X:10 Text:
Y:WINDOW_BOTTOM - 250 Align:Right
Width: 210 Bold:True
Height: 250 Background@PERF_BG:
Children: ClickThrough:true
PerfGraph@GRAPH: Id:PERF_BG
Id:GRAPH Background:dialog4
X:5 Delegate:PerfDebugDelegate
Y:5 X:10
Width:200 Y:WINDOW_BOTTOM - 250
Height:200 Width: 210
Label@TEXT: Height: 250
Id:TEXT Children:
Bold: false PerfGraph@GRAPH:
X:20 Id:GRAPH
Y:205 X:5
Width:170 Y:5
Height:40 Width:200
Background@MUSIC_MENU: Height:200
Id:MUSIC_MENU Label@TEXT:
Delegate:MusicPlayerDelegate Id:TEXT
X:(WINDOW_RIGHT - WIDTH)/2 Bold: false
Y:(WINDOW_BOTTOM - HEIGHT)/2 X:20
Width: 450 Y:205
Height: 250 Width:170
Children: Height:40
Label@SETTINGS_LABEL_TITLE: Background@MUSIC_MENU:
Id:SETTINGS_LABEL_TITLE Id:MUSIC_MENU
X:0 Delegate:MusicPlayerDelegate
Y:20 X:(WINDOW_RIGHT - WIDTH)/2
Width:450 Y:(WINDOW_BOTTOM - HEIGHT)/2
Height:25 Width: 450
Text:Music Height: 250
Align:Center Visible: true
Bold:True Children:
Button@BUTTON_CLOSE: Label@SETTINGS_LABEL_TITLE:
Id:BUTTON_CLOSE Id:SETTINGS_LABEL_TITLE
X:PARENT_RIGHT - 180 X:0
Y:PARENT_BOTTOM - 45 Y:20
Width:160 Width:450
Height:25 Height:25
Text:Close Text:Music
Bold:True Align:Center
Container@BUTTONS: Bold:True
X:PARENT_RIGHT - 150 Button@BUTTON_CLOSE:
Y:50 Id:BUTTON_CLOSE
Children: X:PARENT_RIGHT - 180
Button@BUTTON_PLAY: Y:PARENT_BOTTOM - 45
Id:BUTTON_PLAY Width:160
X:35 Height:25
Y:0 Text:Close
Width:25 Bold:True
Height:25 Container@BUTTONS:
Children: X:PARENT_RIGHT - 150
Image@IMAGE_PLAY: Y:50
Id:IMAGE_PLAY Children:
X:0 Button@BUTTON_PLAY:
Y:0 Id:BUTTON_PLAY
Width:25 X:35
Height:25 Y:0
ImageCollection:music Width:25
ImageName:play Height:25
Button@BUTTON_PAUSE: Children:
Id:BUTTON_PAUSE Image@IMAGE_PLAY:
Visible:false Id:IMAGE_PLAY
X:35 X:0
Y:0 Y:0
Width:25 Width:25
Height:25 Height:25
Children: ImageCollection:music
Image@IMAGE_PAUSE: ImageName:play
Id:IMAGE_PAUSE Button@BUTTON_PAUSE:
X:0 Id:BUTTON_PAUSE
Y:0 Visible:false
Width:25 X:35
Height:25 Y:0
ImageCollection:music Width:25
ImageName:pause Height:25
Button@BUTTON_STOP: Children:
Id:BUTTON_STOP Image@IMAGE_PAUSE:
X:70 Id:IMAGE_PAUSE
Y:0 X:0
Width:25 Y:0
Height:25 Width:25
Children: Height:25
Image@IMAGE_STOP: ImageCollection:music
Id:IMAGE_STOP ImageName:pause
X:0 Button@BUTTON_STOP:
Y:0 Id:BUTTON_STOP
Width:25 X:70
Height:25 Y:0
ImageCollection:music Width:25
ImageName:stop Height:25
Button@BUTTON_NEXT: Children:
Id:BUTTON_NEXT Image@IMAGE_STOP:
X:105 Id:IMAGE_STOP
Y:0 X:0
Width:25 Y:0
Height:25 Width:25
Children: Height:25
Image@IMAGE_NEXT: ImageCollection:music
Id:IMAGE_NEXT ImageName:stop
X:0 Button@BUTTON_NEXT:
Y:0 Id:BUTTON_NEXT
Width:25 X:105
Height:25 Y:0
ImageCollection:music Width:25
ImageName:next Height:25
Button@BUTTON_PREV: Children:
Id:BUTTON_PREV Image@IMAGE_NEXT:
X:0 Id:IMAGE_NEXT
Y:0 X:0
Width:25 Y:0
Height:25 Width:25
Children: Height:25
Image@IMAGE_PREV: ImageCollection:music
Id:IMAGE_PREV ImageName:next
X:0 Button@BUTTON_PREV:
Y:0 Id:BUTTON_PREV
Width:25 X:0
Height:25 Y:0
ImageCollection:music Width:25
ImageName:prev Height:25
Label@TIME: Children:
Id:TIME Image@IMAGE_PREV:
X:PARENT_RIGHT - 150 Id:IMAGE_PREV
Y:75 X:0
Width:140 Y:0
Height:25 Width:25
Align: Center Height:25
ScrollPanel@MUSIC_LIST: ImageCollection:music
Id:MUSIC_LIST ImageName:prev
X:10 Label@TIME:
Y:50 Id:TIME
Width:280 X:PARENT_RIGHT - 150
Height:140 Y:75
Children: Width:140
Label@MUSIC_TEMPLATE: Height:25
Id:MUSIC_TEMPLATE Align: Center
Width:PARENT_RIGHT-28 ListBox@MUSIC_LIST:
Height:25 Id:MUSIC_LIST
ClickThrough:false X:10
X:2 Y:50
Y:0 Width:280
Visible:false Height:140
Children: Children:
Label@TITLE: Label@MUSIC_TEMPLATE:
Id:TITLE Id:MUSIC_TEMPLATE
X:5 Width:PARENT_RIGHT-28
Width:PARENT_RIGHT - 10 Height:25
Height:PARENT_BOTTOM ClickThrough:false
Align: Left X:2
Label@LENGTH: Y:0
Id:LENGTH Visible:false
X:5 Children:
Width:PARENT_RIGHT - 10 Label@TITLE:
Height:PARENT_BOTTOM Id:TITLE
Align: Right X:5
Checkbox@SHUFFLE: Width:PARENT_RIGHT - 10
Id:SHUFFLE Height:PARENT_BOTTOM
X:PARENT_RIGHT - 150 Align: Left
Y:110 Label@LENGTH:
Width:100 Id:LENGTH
Height:20 X:5
Text:Shuffle Width:PARENT_RIGHT - 10
Checkbox@REPEAT: Height:PARENT_BOTTOM
Id:REPEAT Align: Right
X:PARENT_RIGHT - 150 Checkbox@SHUFFLE:
Y:140 Id:SHUFFLE
Width:100 X:PARENT_RIGHT - 150
Height:20 Y:110
Text:Loop Width:100
Height:20
Text:Shuffle
Checkbox@REPEAT:
Id:REPEAT
X:PARENT_RIGHT - 150
Y:140
Width:100
Height:20
Text:Loop

View File

@@ -0,0 +1,94 @@
Background@REPLAYBROWSER_BG:
Id:REPLAYBROWSER_BG
Delegate:ReplayBrowserDelegate
X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:700
Height:410
Children:
Label@REPLAYBROWSER_LABEL_TITLE:
Id:REPLAYBROWSER_LABEL_TITLE
X:0
Y:20
Width:PARENT_RIGHT
Height:25
Text:Choose Replay
Align:Center
Bold:True
ListBox@REPLAY_LIST:
Id:REPLAY_LIST
X:20
Y:50
Width:390
Height:300
Children:
Label@REPLAY_TEMPLATE:
Id:REPLAY_TEMPLATE
Width:PARENT_RIGHT-28
Height:25
ClickThrough:false
X:2
Y:0
Visible:false
Container@REPLAY_INFO:
Id:REPLAY_INFO
X:0
Y:0
Width:PARENT_RIGHT
Height:PARENT_BOTTOM
Visible:false
Children:
MapPreview@MAP_PREVIEW:
Id:MAP_PREVIEW
X:PARENT_RIGHT-241
Y:30
Width:192
Height:192
Label@MAP_TITLE_LABEL:
Id:MAP_TITLE_LABEL
X:PARENT_RIGHT - 200 - WIDTH
Y:250
Align:Right
Width:70
Height:20
Text:Map:
Bold:True
Label@MAP_TITLE:
Id:MAP_TITLE
X:PARENT_RIGHT - 195
Y:250
Align:Left
Width:70
Height:20
Label@MAP_PLAYERS_LABEL:
Id:MAP_PLAYERS_LABEL
X:PARENT_RIGHT - 200 - WIDTH
Y:270
Align:Right
Width:70
Height:20
Text:Players:
Bold:True
Label@MAP_PLAYERS:
Id:MAP_PLAYERS
X:PARENT_RIGHT - 195
Y:270
Align:Left
Width:70
Height:20
Button@WATCH_BUTTON:
Id:WATCH_BUTTON
X:PARENT_RIGHT - 140 - 130
Y:PARENT_BOTTOM - 45
Width:120
Height:25
Text:Watch
Bold:True
Button@CANCEL_BUTTON:
Id:CANCEL_BUTTON
X:PARENT_RIGHT - 140
Y:PARENT_BOTTOM - 45
Width:120
Height:25
Text:Cancel
Bold:True

View File

@@ -57,6 +57,7 @@ ChromeLayout:
mods/ra/chrome/settings.yaml mods/ra/chrome/settings.yaml
mods/ra/chrome/gamelobby.yaml mods/ra/chrome/gamelobby.yaml
mods/ra/chrome/serverbrowser.yaml mods/ra/chrome/serverbrowser.yaml
mods/ra/chrome/replaybrowser.yaml
Weapons: Weapons:
mods/ra/weapons.yaml mods/ra/weapons.yaml