Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
946604e
commit d840408
Showing
7 changed files
with
719 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[SelectSpeechWindow] | ||
$Width=600 | ||
$Height=RESOLUTION_HEIGHT - 100 | ||
$CC0=lblDescription:XNALabel | ||
$CC1=tbSearch:EditorSuggestionTextBox | ||
$CC2=btnSelect:EditorButton | ||
$CC3=lbObjectList:EditorListBox | ||
|
||
|
||
[lblDescription] | ||
$X=EMPTY_SPACE_SIDES | ||
$Y=EMPTY_SPACE_TOP | ||
FontIndex=1 | ||
Text=Select Speech: | ||
|
||
[tbSearch] | ||
$X=EMPTY_SPACE_SIDES | ||
$Y=getBottom(lblDescription) + EMPTY_SPACE_TOP | ||
$Width=getWidth(SelectSpeechWindow) - (EMPTY_SPACE_SIDES * 2) | ||
Suggestion=Search Speech... | ||
|
||
[btnSelect] | ||
$Width=100 | ||
$X=(getWidth(SelectSpeechWindow) - getWidth(btnSelect)) / 2 | ||
$Y=getHeight(SelectSpeechWindow) - EMPTY_SPACE_BOTTOM - getHeight(btnSelect) | ||
Text=Select | ||
|
||
[lbObjectList] | ||
$X=EMPTY_SPACE_SIDES | ||
$Y=getBottom(tbSearch) + VERTICAL_SPACING | ||
$Width=getWidth(tbSearch) | ||
$Height=getY(btnSelect) - getY(lbObjectList) - EMPTY_SPACE_TOP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Rampastring.XNAUI.XNAControls; | ||
using Rampastring.XNAUI; | ||
using System; | ||
using TSMapEditor.Models; | ||
|
||
namespace TSMapEditor.UI.Windows | ||
{ | ||
public class SelectSpeechWindow : SelectObjectWindow<int> | ||
{ | ||
public SelectSpeechWindow(WindowManager windowManager, Map map) : base(windowManager) | ||
{ | ||
this.map = map; | ||
} | ||
|
||
private readonly Map map; | ||
|
||
public override void Initialize() | ||
{ | ||
Name = nameof(SelectSpeechWindow); | ||
base.Initialize(); | ||
} | ||
|
||
protected override void LbObjectList_SelectedIndexChanged(object sender, EventArgs e) | ||
{ | ||
if (lbObjectList.SelectedItem == null || lbObjectList.SelectedItem.Tag == null) | ||
{ | ||
SelectedObject = -1; | ||
return; | ||
} | ||
|
||
SelectedObject = (int)lbObjectList.SelectedItem.Tag; | ||
} | ||
|
||
protected override void ListObjects() | ||
{ | ||
lbObjectList.Clear(); | ||
|
||
foreach (var kvp in map.EditorConfig.Speeches) | ||
{ | ||
lbObjectList.AddItem(new XNAListBoxItem() { Text = $"{kvp.Key} {kvp.Value}", Tag = kvp.Key }); | ||
if (kvp.Key == SelectedObject) | ||
lbObjectList.SelectedIndex = lbObjectList.Items.Count - 1; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters