Skip to content
This repository was archived by the owner on Mar 1, 2018. It is now read-only.

Commit

Permalink
Refactoring, based on Visual Studio 2015
Browse files Browse the repository at this point in the history
  • Loading branch information
jxpxxzj committed Oct 3, 2015
1 parent 26b280e commit 15cb2be
Show file tree
Hide file tree
Showing 48 changed files with 2,629 additions and 2,367 deletions.
12 changes: 6 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
2015/7/21: Wiki启用,不定期更新开发信息和游戏数据

此游戏为国产手游<战舰少女>的开源复刻版本,旨在为PC用户提供一个近似于移动端的用户体验和自由扩展游戏的空间.

程序使用 **GPL v3** 作为开源协议,详见LICENSE文件.

2015/7/21: Wiki启用,不定期更新开发信息和游戏数据

此游戏为国产手游<战舰少女>的开源复刻版本,旨在为PC用户提供一个近似于移动端的用户体验和自由扩展游戏的空间.

程序使用 **GPL v3** 作为开源协议,详见LICENSE文件.

贴吧地址:http://tieba.baidu.com/p/3872470837
Binary file modified WarshipGirl/Content/daywar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WarshipGirl/Content/dw2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions WarshipGirl/Controls/MapPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ public string PreviewPath
set
{
_pp = value;
MapSprite.Texture = Sprite.CreateTextureFromFile(GraphicsDevice, value);
MapSprite.Texture = Sprite.CreateTextureFromFile(value);
}
}

public override void LoadContent()
{
this.Texture=Sprite.CreateTextureFromFile(GraphicsDevice,@"Content\menu-button-background.png");
this.Texture=Sprite.CreateTextureFromFile(@"Content\menu-button-background.png");
this.Width = Texture.Width;
this.Height=Texture.Height;

TextFont = new Font(GraphicsDevice,"msyh.ttc",20);
TextFontsm = new Font(GraphicsDevice, "msyh.ttc", 15);
TextFont = new Font("msyh.ttc",20);
TextFontsm = new Font("msyh.ttc", 15);

SeaTitle = new Label()
{
Expand All @@ -128,7 +128,7 @@ public override void LoadContent()
Left = 138,
Top = 50,
};
var temptext = Sprite.CreateTextureFromFile(GraphicsDevice, @"Content\Map_1-1.png");
var temptext = Sprite.CreateTextureFromFile(@"Content\Map_1-1.png");
MapSprite=new Sprite()
{
Texture=temptext,
Expand Down
10 changes: 3 additions & 7 deletions WarshipGirl/Controls/ResourceLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ public override void LoadContent()
}

FileStream restream = new FileStream(string.Format(@"Content\{0}.png", Type.ToString()), FileMode.Open, FileAccess.Read);
Texture2D restexture = Texture2D.FromStream(this.GraphicsDevice, restream);
this.Texture = Texture2D.FromStream(this.GraphicsDevice, bgstream);
Texture2D restexture = Texture2D.FromStream(jxGameFramework.Graphics.Instance.GraphicsDevice, restream);
this.Texture = Texture2D.FromStream(jxGameFramework.Graphics.Instance.GraphicsDevice, bgstream);
this.Width = 134;
this.Height = 34;
this.Color = Color.White;
TypeSprite = new Sprite()
{
GraphicsDevice=this.GraphicsDevice,
SpriteBatch=this.SpriteBatch,
Texture=restexture,
Color=Color.White,
Width=(int)(restexture.Width / 2),
Expand All @@ -54,10 +52,8 @@ public override void LoadContent()

LabelText = new Label()
{
Font = new Font(this.GraphicsDevice, "msyh.ttc", 20),
Font = new Font("msyh.ttc", 20),
Color = Color.White,
GraphicsDevice = this.GraphicsDevice,
SpriteBatch = this.SpriteBatch,
Left = this.Width / 3,
Margin = Origins.CenterLeft,
};
Expand Down
51 changes: 37 additions & 14 deletions WarshipGirl/Controls/Ship64Img.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,23 @@ namespace WarshipGirl.Controls
class Ship64Img : Control
{
public BaseShip Ship { get; set; }
public bool isReverse { get; set; }

Sprite bg;
Sprite padding;
Sprite border;
Sprite icon;
Sprite img;
public Ship64Img(BaseShip target)
SpriteEffects se;

public Ship64Img(BaseShip target,bool reverse)
{
Ship = target;
isReverse = reverse;
if (isReverse)
se = SpriteEffects.FlipHorizontally;
else
se = SpriteEffects.None;
}
public override void LoadContent()
{
Expand All @@ -37,53 +46,67 @@ public override void LoadContent()
Left=16,
Top=4,
Margin=Origins.TopLeft,
Texture=Sprite.CreateTextureFromFile(this.GraphicsDevice,string.Format(@"Content\bg_64_{0}.png",Ship.Stars)),
Color=Color.White
Texture=Sprite.CreateTextureFromFile(string.Format(@"Content\bg_64_{0}.png",Ship.Stars)),
};
border = new Sprite()
{
Width=202,
Height=72,
Left=14,
Margin=Origins.TopLeft,
Texture=Sprite.CreateTextureFromFile(this.GraphicsDevice,@"Content\border_64_gold.png"),
Color=Color.White
Texture=Sprite.CreateTextureFromFile(@"Content\border_64_gold.png"),
};

padding = new Sprite()
{
Width=30,
Height=70,
Top = 1,
Margin=Origins.TopLeft,
Texture=Sprite.CreateTextureFromFile(this.GraphicsDevice,@"Content\padding_64_gold.png"),
Color=Color.White
Texture=Sprite.CreateTextureFromFile(@"Content\padding_64_gold.png"),
SpriteEffect=se,
};

icon = new Sprite()
{
Width=50,
Height=50,
Left=22,
Margin = Origins.CenterLeft,
Texture=Sprite.CreateTextureFromFile(this.GraphicsDevice,string.Format(@"Content\icon_{0}.png",Ship.Type.ToString())),
Color=Color.White
Texture=Sprite.CreateTextureFromFile(string.Format(@"Content\icon_{0}.png",Ship.Type.ToString())),
};
img = new Sprite()
{
Width = 248,
Height = 64,
Margin = Origins.Center,
Texture = TextureManager.LoadShipImage(GraphicsDevice,Ship.ID,TextureManager.ShipSize.Small),//Sprite.CreateTextureFromFile(this.GraphicsDevice, string.Format(@"F:\shipwar\assets\bin\Pic\ship64_normal_{0}.png", Ship.ID)),
Color = Color.White
Texture = TextureManager.LoadShipImage(Ship.ID,TextureManager.ShipSize.Small),
};
img.Width = (int)(img.Width * 0.9);
img.Height = (int)(img.Height * 0.9);
AddComponent(bg);
AddComponent(img);
AddComponent(border);
AddComponent(padding);
AddComponent(icon);
if(isReverse)
{
border.SpriteEffect = se;
border.Margin = Origins.TopRight;
border.Right = 14;

padding.SpriteEffect = se;
padding.Margin = Origins.TopRight;

icon.Margin = Origins.CenterRight;
icon.Right = 22;

bg.Margin = Origins.TopRight;
bg.Right = 16;

}
base.LoadContent();
}
public override void Draw(GameTime gameTime)
{
base.Draw(gameTime);
}
}
}
138 changes: 69 additions & 69 deletions WarshipGirl/Data/BaseEquipment.cs
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WarshipGirl.Data
{
class BaseEquipment
{
/// <summary>
/// 装备类型
/// </summary>
public enum EquipmentType
{
Cannon,Aircraft,Submarine,Others
}

/// <summary>
/// 编号
/// </summary>
public int ID { get; set; }
/// <summary>
/// 稀有度
/// </summary>
public int Star { get; set; }
/// <summary>
/// 类型
/// </summary>
public EquipmentType Type { get; set; }
/// <summary>
/// 火力
/// </summary>
public int Fire { get; set; }
/// <summary>
/// 射程
/// </summary>
public int Range { get; set; }
/// <summary>
/// 对空
/// </summary>
public int Air { get; set; }
/// <summary>
/// 对潜
/// </summary>
public int Submarine { get; set; }
/// <summary>
/// 命中
/// </summary>
public int Accuracy { get; set; }
/// <summary>
/// 装甲
/// </summary>
public int Protect { get; set; }
/// <summary>
/// 闪避
/// </summary>
public int Evade { get; set; }
/// <summary>
/// 幸运
/// </summary>
public int Fortune { get; set; }
/// <summary>
/// 索敌
/// </summary>
public int Searching { get; set; }

}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WarshipGirl.Data
{
class BaseEquipment
{
/// <summary>
/// 装备类型
/// </summary>
public enum EquipmentType
{
Cannon,Aircraft,Submarine,Others
}

/// <summary>
/// 编号
/// </summary>
public int ID { get; set; }
/// <summary>
/// 稀有度
/// </summary>
public int Star { get; set; }
/// <summary>
/// 类型
/// </summary>
public EquipmentType Type { get; set; }
/// <summary>
/// 火力
/// </summary>
public int Fire { get; set; }
/// <summary>
/// 射程
/// </summary>
public int Range { get; set; }
/// <summary>
/// 对空
/// </summary>
public int Air { get; set; }
/// <summary>
/// 对潜
/// </summary>
public int Submarine { get; set; }
/// <summary>
/// 命中
/// </summary>
public int Accuracy { get; set; }
/// <summary>
/// 装甲
/// </summary>
public int Protect { get; set; }
/// <summary>
/// 闪避
/// </summary>
public int Evade { get; set; }
/// <summary>
/// 幸运
/// </summary>
public int Fortune { get; set; }
/// <summary>
/// 索敌
/// </summary>
public int Searching { get; set; }

}
}
Loading

0 comments on commit 15cb2be

Please sign in to comment.