Skip to content

Commit

Permalink
Add translation for tutorial stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Kahdeg-15520487 committed Jan 28, 2018
1 parent 1e5e7ab commit 22850ce
Show file tree
Hide file tree
Showing 17 changed files with 418 additions and 1,341 deletions.
652 changes: 312 additions & 340 deletions Wartorn/CONTENT_MANAGER.cs

Large diffs are not rendered by default.

900 changes: 60 additions & 840 deletions Wartorn/Content/Content.mgcb

Large diffs are not rendered by default.

151 changes: 9 additions & 142 deletions Wartorn/Content/obj/DesktopGL/.mgcontent

Large diffs are not rendered by default.

Binary file modified Wartorn/Content/sprite/GUI/commandspritesheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Wartorn/Dialog/DropdownDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public IEnumerable<string> Options
{
this.comboBox1.Items.Add(item);
}
comboBox1.SelectedIndex = 0;
}
}

Expand Down
4 changes: 4 additions & 0 deletions Wartorn/Handler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ private void OnFormLoad(object sender, EventArgs e)
{
frm.ShowInTaskbar = false;
frm.Opacity = 0;

MessageEventArgs messageEventArgs = new MessageEventArgs("Choose your language:|en|vi");
ShowDropdownBoxMainThread(messageEventArgs);
CONTENT_MANAGER.Language = messageEventArgs.message;
}

private static void MessageShow(object sender, MessageEventArgs e)
Expand Down
4 changes: 3 additions & 1 deletion Wartorn/Screens/EditorScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ public override void Shutdown() {
#region InitUI

private void InitEscapeMenu() {
PictureBox picturebox_tutorial = new PictureBox(CONTENT_MANAGER.mapeditortutorial, Point.Zero, null, null);
PictureBox picturebox_tutorial = new PictureBox(CONTENT_MANAGER.mapeditortutorial, Point.Zero, null, null) {
IsVisible = CONTENT_MANAGER.IsTutorial
};

//escape menu
Canvas canvas_Menu = new Canvas();
Expand Down
28 changes: 22 additions & 6 deletions Wartorn/Screens/MainGameScreen/GameScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ public override bool Init() {

#region init ui
private void InitUI() {
PictureBox picturebox_tutorial = new PictureBox(CONTENT_MANAGER.gametutorial, Point.Zero, null, null);
PictureBox picturebox_tutorial = new PictureBox(CONTENT_MANAGER.gametutorial, Point.Zero, null, null) {
IsVisible = CONTENT_MANAGER.IsTutorial
};

//declare ui elements
canvas_SelectedMapCell = new Canvas();
Expand Down Expand Up @@ -627,7 +629,20 @@ public override void Update(GameTime gameTime) {
//bắt đầu lượt chơi
//next state: None
case GameState.TurnStart:
canvas.GetElementAs<Label>("label_whoseturn").Text = playerInfos[currentPlayer].owner.ToString();
var label_whoseturn = canvas.GetElementAs<Label>("label_whoseturn");
label_whoseturn.Text = playerInfos[currentPlayer].owner.ToString();
switch (playerInfos[currentPlayer].owner) {
case Owner.Red:
label_whoseturn.foregroundColor = Color.IndianRed;
break;
case Owner.Blue:
label_whoseturn.foregroundColor = Color.CadetBlue;
break;
case Owner.Green:
break;
case Owner.Yellow:
break;
}

#region trừ fuel cho các unit air và naval
foreach (var guid in playerInfos[currentPlayer].ownedUnit) {
Expand Down Expand Up @@ -1345,29 +1360,30 @@ private void ShowCommandMenu() {
Rectangle cmdslot = CommandSpriteSourceRectangle.GetSprite(cmds.Count, playerInfos[currentPlayer].owner);

canvas_action_Unit.GetElementAs<PictureBox>("commandslot").SourceRectangle = cmdslot;
Point cmdslotPosition = new Point(selectedUnit.X * Constants.MapCellWidth + 50, selectedUnit.Y * Constants.MapCellHeight);
//Point cmdslotPosition = new Point(selectedUnit.X * Constants.MapCellWidth + 50, selectedUnit.Y * Constants.MapCellHeight);
Point cmdslotPosition = new Point(selectedUnit.X * Constants.MapCellWidth - 2, selectedUnit.Y * Constants.MapCellHeight);
canvas_action_Unit.GetElementAs<PictureBox>("commandslot").Position = camera.TranslateFromWorldToScreen(cmdslotPosition.ToVector2()).ToPoint();

Button firstslot = canvas_action_Unit.GetElementAs<Button>("firstslot");
Button secondslot = canvas_action_Unit.GetElementAs<Button>("secondslot");
Button thirdslot = canvas_action_Unit.GetElementAs<Button>("thirdslot");

Point slotPosition = new Point(selectedUnit.X * Constants.MapCellWidth + 50 + 6, selectedUnit.Y * Constants.MapCellHeight + 8);
Point slotPosition = new Point(selectedUnit.X * Constants.MapCellWidth + 6, selectedUnit.Y * Constants.MapCellHeight + 8);
slotPosition = camera.TranslateFromWorldToScreen(slotPosition.ToVector2()).ToPoint();

firstslot.Position = slotPosition;
firstslot.spriteSourceRectangle = CommandSpriteSourceRectangle.GetSprite(cmds[0]);
firstslot.rect = new Rectangle(firstslot.Position, firstslot.spriteSourceRectangle.Size);

if (cmds.Count > 1) {
slotPosition = new Point(selectedUnit.X * Constants.MapCellWidth + 50 + 6, selectedUnit.Y * Constants.MapCellHeight + 16 + 8);
slotPosition = new Point(selectedUnit.X * Constants.MapCellWidth + 6, selectedUnit.Y * Constants.MapCellHeight + 16 + 8);
slotPosition = camera.TranslateFromWorldToScreen(slotPosition.ToVector2()).ToPoint();
secondslot.Position = slotPosition;
secondslot.spriteSourceRectangle = CommandSpriteSourceRectangle.GetSprite(cmds[1]);
secondslot.rect = new Rectangle(secondslot.Position, secondslot.spriteSourceRectangle.Size);
}
if (cmds.Count > 2) {
slotPosition = new Point(selectedUnit.X * Constants.MapCellWidth + 50 + 6, selectedUnit.Y * Constants.MapCellHeight + 32 + 8);
slotPosition = new Point(selectedUnit.X * Constants.MapCellWidth + 6, selectedUnit.Y * Constants.MapCellHeight + 32 + 8);
slotPosition = camera.TranslateFromWorldToScreen(slotPosition.ToVector2()).ToPoint();
thirdslot.Position = slotPosition;
thirdslot.spriteSourceRectangle = CommandSpriteSourceRectangle.GetSprite(cmds[2]);
Expand Down
4 changes: 3 additions & 1 deletion Wartorn/Screens/MainGameScreen/SetupScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ private void InitUI()
//declare ui elements
Label label_playerinfo = new Label("kahdeg", new Point(10, 20), new Vector2(80, 30), CONTENT_MANAGER.arcadefont);

PictureBox picturebox_tutorial = new PictureBox(CONTENT_MANAGER.setuptutorial, Point.Zero, null, null);
PictureBox picturebox_tutorial = new PictureBox(CONTENT_MANAGER.setuptutorial, Point.Zero, null, null) {
IsVisible = CONTENT_MANAGER.IsTutorial
};

Button button_selectmap = new Button(UISpriteSheetSourceRectangle.GetSpriteRectangle(SpriteSheetUI.Open), new Point(650, 20), 0.5f);
Button button_exit = new Button(UISpriteSheetSourceRectangle.GetSpriteRectangle(SpriteSheetUI.Exit), new Point(5, 5), 0.5f);
Expand Down
3 changes: 3 additions & 0 deletions Wartorn/Wartorn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Content Include="license.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SDL2.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
12 changes: 1 addition & 11 deletions WartornInstaller/WartornInstaller.iss
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,9 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "..\Build\IronPython.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\IronPython.Modules.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\IronPython.SQLite.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\IronPython.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\Microsoft.Dynamic.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\Microsoft.Scripting.AspNet.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\Microsoft.Scripting.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\Microsoft.Scripting.Metadata.dll"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\Build\MonoGame.Framework.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\Utility_Project.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\NVorbis.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\OpenTK.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\SDL2.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Build\soft_oal.dll"; DestDir: "{app}"; Flags: ignoreversion

Expand Down

0 comments on commit 22850ce

Please sign in to comment.