コード例 #1
0
ファイル: MainForm.cs プロジェクト: tecmopsycho/tsbtools
		/// <summary>
		/// Get an image.
		/// If you want to Get an image from the 'Tiles' directory,
		/// the input string needs to be in the format:
		/// "PlayProto.Tiles.Filename.ext"
		/// </summary>
		/// <param name="file"></param>
		/// <returns></returns>
		public static Image GetImage( string file )
		{
			Image ret = null;
			try
			{
				if( form == null )
					form = new ButtonForm();
				System.IO.Stream s =  
					form.GetType().Assembly.GetManifestResourceStream(file);
				if( s != null )
					ret = Image.FromStream(s);
			}
			catch(Exception e )
			{
				MessageBox.Show(e.Message);
			}
			return ret;
		}
コード例 #2
0
ファイル: OffensePanel.cs プロジェクト: tecmopsycho/tsbtools
		private void mCurrentPlayButton_Click(object sender, System.EventArgs e)
		{
			byte[] vals = MainForm.TheMainForm.ThePlayTool.GetOffensivePlayToCall(MainForm.TheMainForm.PlayIndex);
			string[] str_vals = new string[vals.Length];
			for(int i = 0; i < vals.Length; i++)
			{
				string s = string.Format("{0:x2}", vals[i]).ToUpper();
				str_vals[i] = s;
			}
			ButtonForm bf = new ButtonForm();
			bf.Title = "Choose Offensive Play number";
			bf.Info  = "Press a button below to choose a play to modify.";
			bf.ButtonValues = str_vals;
			if( bf.ShowDialog(this) == DialogResult.OK )
			{
				try
				{
					int g = Int32.Parse( bf.Result, System.Globalization.NumberStyles.AllowHexSpecifier);
					CurrentPlay = g;
				}
				catch(Exception ex)
				{
					Console.WriteLine(ex.Message);
				}
			}
			bf.Dispose();
		}