Rename ListBoxWidget -> ScrollPanelWidget.
This commit is contained in:
@@ -165,7 +165,6 @@
|
|||||||
<Compile Include="Widgets\ImageWidget.cs" />
|
<Compile Include="Widgets\ImageWidget.cs" />
|
||||||
<Compile Include="Widgets\TextFieldWidget.cs" />
|
<Compile Include="Widgets\TextFieldWidget.cs" />
|
||||||
<Compile Include="Widgets\ChatDisplayWidget.cs" />
|
<Compile Include="Widgets\ChatDisplayWidget.cs" />
|
||||||
<Compile Include="Widgets\ListBoxWidget.cs" />
|
|
||||||
<Compile Include="Widgets\SliderWidget.cs" />
|
<Compile Include="Widgets\SliderWidget.cs" />
|
||||||
<Compile Include="Widgets\TimerWidget.cs" />
|
<Compile Include="Widgets\TimerWidget.cs" />
|
||||||
<Compile Include="Widgets\ShpImageWidget.cs" />
|
<Compile Include="Widgets\ShpImageWidget.cs" />
|
||||||
@@ -182,6 +181,7 @@
|
|||||||
<Compile Include="Traits\Armor.cs" />
|
<Compile Include="Traits\Armor.cs" />
|
||||||
<Compile Include="Graphics\CursorProvider.cs" />
|
<Compile Include="Graphics\CursorProvider.cs" />
|
||||||
<Compile Include="Server\TraitInterfaces.cs" />
|
<Compile Include="Server\TraitInterfaces.cs" />
|
||||||
|
<Compile Include="Widgets\ScrollPanelWidget.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ namespace OpenRA.Widgets
|
|||||||
Widget.RootWidget.AddChild(fullscreenMask);
|
Widget.RootWidget.AddChild(fullscreenMask);
|
||||||
|
|
||||||
var origin = w.RenderOrigin;
|
var origin = w.RenderOrigin;
|
||||||
var dropDown = new ListBoxWidget
|
var dropDown = new ScrollPanelWidget
|
||||||
{
|
{
|
||||||
Bounds = new Rectangle(w.RenderOrigin.X, w.RenderOrigin.Y + w.Bounds.Height, w.Bounds.Width, 100),
|
Bounds = new Rectangle(w.RenderOrigin.X, w.RenderOrigin.Y + w.Bounds.Height, w.Bounds.Width, 100),
|
||||||
Visible = true,
|
Visible = true,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using OpenRA.Graphics;
|
|||||||
|
|
||||||
namespace OpenRA.Widgets
|
namespace OpenRA.Widgets
|
||||||
{
|
{
|
||||||
public class ListBoxWidget : Widget
|
public class ScrollPanelWidget : Widget
|
||||||
{
|
{
|
||||||
public readonly string Background = "dialog3";
|
public readonly string Background = "dialog3";
|
||||||
public readonly int ScrollbarWidth = 24;
|
public readonly int ScrollbarWidth = 24;
|
||||||
@@ -30,8 +30,8 @@ namespace OpenRA.Widgets
|
|||||||
Rectangle backgroundRect;
|
Rectangle backgroundRect;
|
||||||
Rectangle scrollbarRect;
|
Rectangle scrollbarRect;
|
||||||
|
|
||||||
public ListBoxWidget() : base() {}
|
public ScrollPanelWidget() : base() {}
|
||||||
protected ListBoxWidget(ListBoxWidget other)
|
protected ScrollPanelWidget(ScrollPanelWidget other)
|
||||||
: base(other)
|
: base(other)
|
||||||
{
|
{
|
||||||
Background = other.Background;
|
Background = other.Background;
|
||||||
@@ -115,6 +115,6 @@ namespace OpenRA.Widgets
|
|||||||
return (UpPressed || DownPressed);
|
return (UpPressed || DownPressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Widget Clone() { return new ListBoxWidget(this); }
|
public override Widget Clone() { return new ScrollPanelWidget(this); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
|||||||
else
|
else
|
||||||
Map = Game.modData.AvailableMaps.FirstOrDefault(m => m.Value.Selectable).Value;
|
Map = Game.modData.AvailableMaps.FirstOrDefault(m => m.Value.Selectable).Value;
|
||||||
|
|
||||||
var ml = bg.GetWidget<ListBoxWidget>("MAP_LIST");
|
var ml = bg.GetWidget<ScrollPanelWidget>("MAP_LIST");
|
||||||
bg.GetWidget<MapPreviewWidget>("MAPCHOOSER_MAP_PREVIEW").Map = () => Map;
|
bg.GetWidget<MapPreviewWidget>("MAPCHOOSER_MAP_PREVIEW").Map = () => Map;
|
||||||
bg.GetWidget<LabelWidget>("CURMAP_TITLE").GetText = () => Map.Title;
|
bg.GetWidget<LabelWidget>("CURMAP_TITLE").GetText = () => Map.Title;
|
||||||
bg.GetWidget<LabelWidget>("CURMAP_SIZE").GetText = () => "{0}x{1}".F(Map.Bounds.Width, Map.Bounds.Height);
|
bg.GetWidget<LabelWidget>("CURMAP_SIZE").GetText = () => "{0}x{1}".F(Map.Bounds.Width, Map.Bounds.Height);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
|||||||
Rules.Music[CurrentSong].Length / 60, Rules.Music[CurrentSong].Length % 60);
|
Rules.Music[CurrentSong].Length / 60, Rules.Music[CurrentSong].Length % 60);
|
||||||
};
|
};
|
||||||
|
|
||||||
var ml = bg.GetWidget<ListBoxWidget>("MUSIC_LIST");
|
var ml = bg.GetWidget<ScrollPanelWidget>("MUSIC_LIST");
|
||||||
var itemTemplate = ml.GetWidget<LabelWidget>("MUSIC_TEMPLATE");
|
var itemTemplate = ml.GetWidget<LabelWidget>("MUSIC_TEMPLATE");
|
||||||
int offset = itemTemplate.Bounds.Y;
|
int offset = itemTemplate.Bounds.Y;
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var sl = bg.GetWidget<ListBoxWidget>("SERVER_LIST");
|
var sl = bg.GetWidget<ScrollPanelWidget>("SERVER_LIST");
|
||||||
ServerTemplate = sl.GetWidget<LabelWidget>("SERVER_TEMPLATE");
|
ServerTemplate = sl.GetWidget<LabelWidget>("SERVER_TEMPLATE");
|
||||||
|
|
||||||
bg.GetWidget("REFRESH_BUTTON").OnMouseUp = mi =>
|
bg.GetWidget("REFRESH_BUTTON").OnMouseUp = mi =>
|
||||||
@@ -137,7 +137,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
|||||||
if (bg == null) // We got a MasterServer reply AFTER the browser is gone, just return to prevent crash - Gecko
|
if (bg == null) // We got a MasterServer reply AFTER the browser is gone, just return to prevent crash - Gecko
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var sl = bg.GetWidget<ListBoxWidget>("SERVER_LIST");
|
var sl = bg.GetWidget<ScrollPanelWidget>("SERVER_LIST");
|
||||||
|
|
||||||
sl.Children.Clear();
|
sl.Children.Clear();
|
||||||
currentServer = null;
|
currentServer = null;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
var vl = bg.GetWidget<ListBoxWidget>("VIDEO_LIST");
|
var vl = bg.GetWidget<ScrollPanelWidget>("VIDEO_LIST");
|
||||||
var itemTemplate = vl.GetWidget<LabelWidget>("VIDEO_TEMPLATE");
|
var itemTemplate = vl.GetWidget<LabelWidget>("VIDEO_TEMPLATE");
|
||||||
int offset = itemTemplate.Bounds.Y;
|
int offset = itemTemplate.Bounds.Y;
|
||||||
|
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ Background@MAP_CHOOSER:
|
|||||||
Height:20
|
Height:20
|
||||||
Text:Choose Map
|
Text:Choose Map
|
||||||
Bold:True
|
Bold:True
|
||||||
ListBox@MAP_LIST:
|
ScrollPanel@MAP_LIST:
|
||||||
Id:MAP_LIST
|
Id:MAP_LIST
|
||||||
X:20
|
X:20
|
||||||
Y:50
|
Y:50
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ Background@MUSIC_MENU:
|
|||||||
Width:140
|
Width:140
|
||||||
Height:25
|
Height:25
|
||||||
Align: Center
|
Align: Center
|
||||||
ListBox@MUSIC_LIST:
|
ScrollPanel@MUSIC_LIST:
|
||||||
Id:MUSIC_LIST
|
Id:MUSIC_LIST
|
||||||
X:10
|
X:10
|
||||||
Y:50
|
Y:50
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ Background@JOINSERVER_BG:
|
|||||||
Text:Join Server
|
Text:Join Server
|
||||||
Align:Center
|
Align:Center
|
||||||
Bold:True
|
Bold:True
|
||||||
ListBox@SERVER_LIST:
|
ScrollPanel@SERVER_LIST:
|
||||||
Id:SERVER_LIST
|
Id:SERVER_LIST
|
||||||
X:20
|
X:20
|
||||||
Y:50
|
Y:50
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Background@VIDEOPLAYER_MENU:
|
|||||||
Y:50
|
Y:50
|
||||||
Width:640
|
Width:640
|
||||||
Height:400
|
Height:400
|
||||||
ListBox@VIDEO_LIST:
|
ScrollPanel@VIDEO_LIST:
|
||||||
Id:VIDEO_LIST
|
Id:VIDEO_LIST
|
||||||
X:20
|
X:20
|
||||||
Y:460
|
Y:460
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ Background@MAP_CHOOSER:
|
|||||||
Height:20
|
Height:20
|
||||||
Text:Choose Map
|
Text:Choose Map
|
||||||
Bold:True
|
Bold:True
|
||||||
ListBox@MAP_LIST:
|
ScrollPanel@MAP_LIST:
|
||||||
Id:MAP_LIST
|
Id:MAP_LIST
|
||||||
X:20
|
X:20
|
||||||
Y:50
|
Y:50
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ Background@MUSIC_MENU:
|
|||||||
Width:140
|
Width:140
|
||||||
Height:25
|
Height:25
|
||||||
Align: Center
|
Align: Center
|
||||||
ListBox@MUSIC_LIST:
|
ScrollPanel@MUSIC_LIST:
|
||||||
Id:MUSIC_LIST
|
Id:MUSIC_LIST
|
||||||
X:10
|
X:10
|
||||||
Y:50
|
Y:50
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ Background@JOINSERVER_BG:
|
|||||||
Text:Join Server
|
Text:Join Server
|
||||||
Align:Center
|
Align:Center
|
||||||
Bold:True
|
Bold:True
|
||||||
ListBox@SERVER_LIST:
|
ScrollPanel@SERVER_LIST:
|
||||||
Id:SERVER_LIST
|
Id:SERVER_LIST
|
||||||
X:20
|
X:20
|
||||||
Y:50
|
Y:50
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Background@VIDEOPLAYER_MENU:
|
|||||||
Y:50
|
Y:50
|
||||||
Width:640
|
Width:640
|
||||||
Height:400
|
Height:400
|
||||||
ListBox@VIDEO_LIST:
|
ScrollPanel@VIDEO_LIST:
|
||||||
Id:VIDEO_LIST
|
Id:VIDEO_LIST
|
||||||
X:20
|
X:20
|
||||||
Y:460
|
Y:460
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Background@SERVER_LOBBY:
|
|||||||
Y:4
|
Y:4
|
||||||
Width:244
|
Width:244
|
||||||
Height:244
|
Height:244
|
||||||
ListBox@PLAYERSX:
|
ScrollPanel@PLAYERSX:
|
||||||
Id:PLAYERSX
|
Id:PLAYERSX
|
||||||
X:20
|
X:20
|
||||||
Y:75
|
Y:75
|
||||||
@@ -439,7 +439,7 @@ Background@MAP_CHOOSER:
|
|||||||
Height:20
|
Height:20
|
||||||
Text:Choose Map
|
Text:Choose Map
|
||||||
Bold:True
|
Bold:True
|
||||||
ListBox@MAP_LIST:
|
ScrollPanel@MAP_LIST:
|
||||||
Id:MAP_LIST
|
Id:MAP_LIST
|
||||||
X:20
|
X:20
|
||||||
Y:50
|
Y:50
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ Background@MUSIC_MENU:
|
|||||||
Width:140
|
Width:140
|
||||||
Height:25
|
Height:25
|
||||||
Align: Center
|
Align: Center
|
||||||
ListBox@MUSIC_LIST:
|
ScrollPanel@MUSIC_LIST:
|
||||||
Id:MUSIC_LIST
|
Id:MUSIC_LIST
|
||||||
X:10
|
X:10
|
||||||
Y:50
|
Y:50
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ Background@JOINSERVER_BG:
|
|||||||
Text:Join Server
|
Text:Join Server
|
||||||
Align:Center
|
Align:Center
|
||||||
Bold:True
|
Bold:True
|
||||||
ListBox@SERVER_LIST:
|
ScrollPanel@SERVER_LIST:
|
||||||
Id:SERVER_LIST
|
Id:SERVER_LIST
|
||||||
X:20
|
X:20
|
||||||
Y:50
|
Y:50
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Background@VIDEOPLAYER_MENU:
|
|||||||
Y:50
|
Y:50
|
||||||
Width:640
|
Width:640
|
||||||
Height:400
|
Height:400
|
||||||
ListBox@VIDEO_LIST:
|
ScrollPanel@VIDEO_LIST:
|
||||||
Id:VIDEO_LIST
|
Id:VIDEO_LIST
|
||||||
X:20
|
X:20
|
||||||
Y:460
|
Y:460
|
||||||
|
|||||||
Reference in New Issue
Block a user