|
From: slartibartfast <sla...@us...> - 2004-09-30 21:00:03
|
Update of /cvsroot/seq/myseq/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21575 Modified Files: AssemblyInfo.cs ClientReleaseNotes.htm MapCon.cs Structures.cs frmMain.cs frmMain.resx myseq.csproj Log Message: Changes for Version 1.16.3 Index: frmMain.resx =================================================================== RCS file: /cvsroot/seq/myseq/client/frmMain.resx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- frmMain.resx 30 Sep 2004 19:12:12 -0000 1.3 +++ frmMain.resx 30 Sep 2004 20:59:53 -0000 1.4 @@ -97,15 +97,6 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="mapPane.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="mapPane.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="mapPane.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Public</value> - </data> <data name="openFileDialog.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> @@ -403,10 +394,34 @@ <data name="mnuSep6.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> - <data name="mnuCenterOnPlayer.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <data name="mnuFollowNone.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> - <data name="mnuCenterOnPlayer.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <data name="mnuFollowNone.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuFollowPlayer.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuFollowPlayer.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuFollowTarget.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuFollowTarget.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="menuItem6.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="menuItem6.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuKeepCentered.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mnuKeepCentered.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> <data name="mnuListSettings.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> @@ -721,12 +736,12 @@ <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </data> - <data name="$this.Name"> - <value>frmMain</value> - </data> <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>56</value> </data> + <data name="$this.Name"> + <value>frmMain</value> + </data> <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </data> Index: Structures.cs =================================================================== RCS file: /cvsroot/seq/myseq/client/Structures.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Structures.cs 30 Sep 2004 19:12:11 -0000 1.3 +++ Structures.cs 30 Sep 2004 20:59:53 -0000 1.4 @@ -11,20 +11,38 @@ { #region SPAWNINFO class [StructLayout(LayoutKind.Sequential, Pack=1)] - public class SPAWNINFO { + public class SPAWNINFO + { public SPAWNINFO() {} - private string BytesToString(byte []b, int start, int maxlen) { + private string BytesToString(byte []b, int start, int maxlen) + { int i=0; // look for a null for(;i<maxlen&&b[start+i]!='\0';i++); return Encoding.ASCII.GetString(b, start, i); } - public void frombytes(byte []b, int offset, RegexHelper reh) { + public void frombytes(byte []b, int offset, RegexHelper reh) + { + flags = (SPAWNINFO.PacketType) BitConverter.ToInt32(b, 84+offset); Name = BytesToString(b, 0+offset, 30); - Y = BitConverter.ToSingle(b, 30+offset); - X = BitConverter.ToSingle(b, 34+offset); + + if (this.flags == PacketType.Player || this.flags == PacketType.Spawn || this.flags == PacketType.Target) + { + // Bug in original CavemanBob server meant that X + Y co-ordinates were reversed + // The client now correctly stores the X coordinate in X + // When the server is updated tyo fix this bug then this + // code can be removed. + X = BitConverter.ToSingle(b, 30+offset); + Y = BitConverter.ToSingle(b, 34+offset); + } + else + { + Y = BitConverter.ToSingle(b, 30+offset); + X = BitConverter.ToSingle(b, 34+offset); + } + Z = BitConverter.ToSingle(b, 38+offset); Heading = BitConverter.ToSingle(b, 42+offset); SpeedRun = BitConverter.ToSingle(b, 46+offset); @@ -35,7 +53,6 @@ Level = b[60+offset]; Hide = b[61+offset]; Lastname = BytesToString(b,62+offset, 22); - flags = (SPAWNINFO.PacketType) BitConverter.ToInt32(b, 84+offset); highlight = false; // highlight flag m_isPlayer = false; @@ -55,7 +72,8 @@ hiddenOnList = false; //non-corpse, non-player spawn (aka NPC) - if (!Settings.Instance.ShowMapNPCs || !Settings.Instance.ShowListNPCs) { + if (!Settings.Instance.ShowMapNPCs || !Settings.Instance.ShowListNPCs) + { if (flags==PacketType.Spawn && Type!=2 && Type!=0) { if (!Settings.Instance.ShowMapNPCs) hiddenOnMap = true; @@ -87,7 +105,8 @@ if (!Settings.Instance.ShowListInvis) hiddenOnList = true; } // Check Mounts - if (!Settings.Instance.ShowMapMounts || !Settings.Instance.ShowListMounts) { + if (!Settings.Instance.ShowMapMounts || !Settings.Instance.ShowListMounts) + { if (reh.IsMount(Name)) { if (!Settings.Instance.ShowMapMounts) hiddenOnMap = true; @@ -140,7 +159,8 @@ } } - public enum PacketType { + public enum PacketType + { Spawn = 0, Target = 1, Zone = 4, @@ -166,7 +186,6 @@ public string Lastname = ""; public int gone = 0; public PacketType flags = 0; - //public ListViewItem lvi = null; public bool isHunt = false; public bool isCaution = false; public bool isRare = false; @@ -180,11 +199,13 @@ public string SpawnLoc = ""; public bool IsPlayer() {return m_isPlayer;} + } #endregion #region GroundItem class - public class GroundItem { + public class GroundItem + { public float X = 0.0f; public float Y = 0.0f; public float Z = 0.0f; @@ -196,11 +217,12 @@ #region SPAWNTIMER class //[StructLayout(LayoutKind.Sequential, Pack=1)] - public class SPAWNTIMER { + public class SPAWNTIMER + { public SPAWNTIMER() {} - public float Y = 0; public float X = 0; + public float Y = 0; public float Z = 0; public int SpawnCount = 0; public int SpawnTimer = 0; @@ -225,15 +247,18 @@ private static extern int GetPrivateProfileString(string section, string key,string def, StringBuilder retVal, int size,string filePath); - public IniFile(string INIPath){ + public IniFile(string INIPath) + { path = INIPath; } - public void WriteValue(string Section, string Key, string Value) { + public void WriteValue(string Section, string Key, string Value) + { WritePrivateProfileString(Section, Key, Value, this.path); } - public string ReadValue(string Section, string Key, string Default) { + public string ReadValue(string Section, string Key, string Default) + { StringBuilder buffer = new StringBuilder(255); GetPrivateProfileString(Section, Key, Default, buffer, 255, this.path); @@ -273,7 +298,6 @@ private bool depthFilter = false; private bool showMobTrails = false; private bool collectMobTrails = false; - private bool centerOnPlayer =false; private bool saveOnExit = true; private int maxLogLevel = 0; @@ -370,6 +394,10 @@ private bool showSpawnPoints = false; private bool autoSelectSpawnList = true; + private myseq.FollowOption followOption = myseq.FollowOption.Player; + private bool keepCentered = true; + + public bool KeepCentered{get{return keepCentered;} set{keepCentered = value;}} public bool AutoSelectSpawnList {get{return autoSelectSpawnList;} set{autoSelectSpawnList = value;}} public bool ShowSpawnPoints {get{return showSpawnPoints;} set{showSpawnPoints = value;}} public bool ShowMapPlayers { get { return showMapPlayers; } set { showMapPlayers = value; } } @@ -386,48 +414,61 @@ public bool ShowListMounts { get { return showListMounts; } set { showListMounts = value; } } public bool ShowListFamiliars { get { return showListFamiliars; } set { showListFamiliars = value; } } public bool ShowListPets { get { return showListPets; } set { showListPets = value; } } - public bool ShowAllPlayers { + public bool ShowAllPlayers + { get {return (showListPlayers && showMapPlayers);} set {showListPlayers = value; showMapPlayers = value;} } - public bool ShowAllNPCs { + public bool ShowAllNPCs + { get { return (showListNPCs && showMapNPCs); } - set { + set + { showListNPCs = value; showMapNPCs = value; } } - public bool ShowAllCorpses { + public bool ShowAllCorpses + { get { return (showListCorpses && showMapCorpses); } - set { + set + { showListCorpses = value; showMapCorpses = value; } } - public bool ShowAllInvis { + public bool ShowAllInvis + { get { return (showListInvis && showMapInvis); } - set { + set + { showListInvis = value; showMapInvis = value; } } - public bool ShowAllMounts { + public bool ShowAllMounts + { get { return (showListMounts && showMapMounts); } - set { + set + { showListMounts = value; showMapMounts = value; } } - public bool ShowAllFamiliars { + public bool ShowAllFamiliars + { get { return (showListFamiliars && showMapFamiliars); } - set { + set + { showListFamiliars = value; showMapFamiliars = value; } } - public bool ShowAllPets { + public bool ShowAllPets + { get { return (showListPets && showMapPets); } - set { + set + { showListPets = value; showMapPets = value; } @@ -444,7 +485,7 @@ public Color RangeCircleColor {get{return rangeCircleColor;} set{rangeCircleColor = value;}} public Color ListBackColor {get{return listBackColor;} set{listBackColor = value;}} public Color MQConsoleColor {get{return mqConsoleColor;} set{mqConsoleColor = value;}} - public bool CenterOnPlayer {get{return centerOnPlayer;} set{centerOnPlayer = value;}} + public myseq.FollowOption FollowOption {get {return followOption;} set{followOption = value;}} public bool ShowMobList {get{return showMobList;} set{showMobList = value;}} public bool NoneOnHunt {get{return noneOnHunt;} set{noneOnHunt = value;}} public bool NoneOnCaution {get{return noneOnCaution;} set{noneOnCaution = value;}} Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/seq/myseq/client/AssemblyInfo.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- AssemblyInfo.cs 30 Sep 2004 19:12:12 -0000 1.5 +++ AssemblyInfo.cs 30 Sep 2004 20:59:53 -0000 1.6 @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.16.2.*")] +[assembly: AssemblyVersion("1.16.3.*")] // // In order to sign your assembly you must specify a key to use. Refer to the Index: ClientReleaseNotes.htm =================================================================== RCS file: /cvsroot/seq/myseq/client/ClientReleaseNotes.htm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ClientReleaseNotes.htm 30 Sep 2004 19:12:12 -0000 1.2 +++ ClientReleaseNotes.htm 30 Sep 2004 20:59:53 -0000 1.3 @@ -1,39 +1,63 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- saved from url=(0069)http://www.geocities.com/slartibartfast1232000/ClientRleaseNotes.html --> -<HTML><HEAD><TITLE>MySeq Client Release Notes</TITLE> -<META http-equiv=Content-Type content="text/html; charset=windows-1252"> -<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD> -<BODY text=#000000 vLink=#ff0000 aLink=#800080 link=#0000ff bgColor=#ffffff> -<H1 align=center><U>MYSEQ Client Release Notes</U></H1> -<P> -<H2>Changes for next version</H2> -<H2>Release Version 1.16.2</H2> -<p>Dated 28 September 2004</p> -<ol> - <li>Added all missing Con Level Information - please post feedback if any of - the con level data is incorrect. </li> - <li>Fixed the MobInfo panel background color. (Thanks CybMax for spotting it). - </li> - <li>Added the ability to select which character to monitor when multiboxing.</li> -</ol> -<p>Note: The list does not refresh automatically - you must click on the refresh -menu item. (this is an attempt to keep the overhead of this feature to a -minimum).</p> -<p>Also Note that a new server version is required for this to work...</p> -<ol> - <li value="4">Added 42!'s ability to select a point on the map for navigation - purposes. Shift Left-click on the map to toggle the selected point.</li> -</ol> -<p>(I changed 42's code a little to preserve the default behavior for selecting -spawns, also made the line dashed so that it is easy to distinguish from tyhe -selected spawn)</p> -<p> </p> -<H2>Release Version 1.16.1</H2> -<P>Dated 18 September 2004</P> -<OL> - <LI><FONT class=nf face="verdana, arial, helvetica" size=2>Updated program to - read con level data from an ini file.</FONT><LI> - <font face="verdana, arial, helvetica" size="2">Updated Con Level Information - to include level 66-70 (using extrapolated data)</font><LI> - <font face="verdana, arial, helvetica" size="2">Added new race names for OOW</font></OL> -</BODY></HTML> \ No newline at end of file +<HTML> + <HEAD> + <TITLE>MySeq Client Release Notes</TITLE> + <META http-equiv="Content-Type" content="text/html; charset=windows-1252"> + <META content="Microsoft FrontPage 5.0" name="GENERATOR"> + </HEAD> + <BODY text="#000000" vLink="#ff0000" aLink="#800080" link="#0000ff" bgColor="#ffffff"> + <H1 align="center"><U>MYSEQ Client Release Notes</U></H1> + <P> + <H2>Changes for next version</H2> + <OL> + <li> + Fixed up spawnInfo so that X contains the X co-ordinate for Player + Spawn + packets. (They are still reversed in the packet stream - I will probably + release a new server to correct this soon) + <LI> + Changed the way "Center on Player" works to restore the original behavior but + add in the ability to keep the player or target centered<BR> + "Follow None" = Do not scroll the map<BR> + "Follow Player" = move map to keep player in view<BR> + "Follow target" = move map to keep target in viewtered on screen<BR> + <BR> + Keep Centered" = The follow target (either player or target) will remain in the + same position on the screen, even if this causes most of the map to be off the + screen.</LI></OL> + <p> </p> + <H2>Release Version 1.16.2</H2> + <p>Dated 28 September 2004</p> + <ol> + <li> + Added all missing Con Level Information - please post feedback if any of the + con level data is incorrect. + <li> + Fixed the MobInfo panel background color. (Thanks CybMax for spotting it). + <li> + Added the ability to select which character to monitor when multiboxing.</li> + </ol> + <p>Note: The list does not refresh automatically - you must click on the refresh + menu item. (this is an attempt to keep the overhead of this feature to a + minimum).</p> + <p>Also Note that a new server version is required for this to work...</p> + <ol> + <li value="4"> + Added 42!'s ability to select a point on the map for navigation purposes. Shift + Left-click on the map to toggle the selected point.</li> + </ol> + <p>(I changed 42's code a little to preserve the default behavior for selecting + spawns, also made the line dashed so that it is easy to distinguish from tyhe + selected spawn)</p> + <p> </p> + <H2>Release Version 1.16.1</H2> + <P>Dated 18 September 2004</P> + <OL> + <LI> + <FONT class="nf" face="verdana, arial, helvetica" size="2">Updated program to read + con level data from an ini file.</FONT><LI> + <font face="verdana, arial, helvetica" size="2">Updated Con Level Information to + include level 66-70 (using extrapolated data)</font><LI> + <font face="verdana, arial, helvetica" size="2">Added new race names for OOW</font></LI></OL> + </BODY> +</HTML> Index: myseq.csproj =================================================================== RCS file: /cvsroot/seq/myseq/client/myseq.csproj,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- myseq.csproj 30 Sep 2004 19:12:11 -0000 1.6 +++ myseq.csproj 30 Sep 2004 20:59:53 -0000 1.7 @@ -138,6 +138,10 @@ BuildAction = "Compile" /> <File + RelPath = "ClientReleaseNotes.htm" + BuildAction = "Content" + /> + <File RelPath = "frmMain.cs" SubType = "Form" BuildAction = "Compile" @@ -203,10 +207,6 @@ BuildAction = "EmbeddedResource" /> <File - RelPath = "MySeq Client Release Notes.htm" - BuildAction = "Content" - /> - <File RelPath = "Structures.cs" SubType = "Code" BuildAction = "Compile" Index: MapCon.cs =================================================================== RCS file: /cvsroot/seq/myseq/client/MapCon.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- MapCon.cs 30 Sep 2004 19:12:11 -0000 1.10 +++ MapCon.cs 30 Sep 2004 20:59:53 -0000 1.11 @@ -16,6 +16,8 @@ namespace myseq { + public enum FollowOption{None, Player, Target}; + public class MapCon : System.Windows.Forms.UserControl { private System.ComponentModel.Container components = null; public System.Windows.Forms.Label lblMobInfo; @@ -49,23 +51,21 @@ // m_zoom - factor by which map has been zoomed. private float m_zoom = 0; - - // size of map once zoom has been taken into account. - private float m_zoomWidth = 0; - private float m_zoomHeight = 0; // m_panOffset define how far map has been dragged. public float m_panOffsetX = 0; public float m_panOffsetY = 0; - float m_screenOffsetX = 0; - float m_screenOffsetY = 0; // m_ratio - adjustment factor required to convert map->screen size. float m_ratio = 0; - // m_screenCenter - centre point of screen expressed in map units. - public float m_screenCenterX = 0; - public float m_screenCenterY = 0; + // m_mapCenter - centre point of screen in Map Units. + private float m_mapCenterX = 0; + private float m_mapCenterY = 0; + + // m_screenCenter - centre point of screen in Screen Units. + private float m_screenCenterX = 0; + private float m_screenCenterY = 0; public bool m_readjustRequired = false; @@ -765,7 +765,7 @@ { if (!sp.hiddenOnMap) { - if (sp.Y < x+delta && sp.Y > x-delta && sp.X < y+delta && sp.X > y-delta) + if (sp.X < x+delta && sp.X > x-delta && sp.Y < y+delta && sp.Y > y-delta) { if (Settings.Instance.AutoSelectSpawnList) { @@ -805,7 +805,7 @@ float mousey = ScreenToMapCoordY((float)e.Y); // Range - float sd = (float)Math.Sqrt(Math.Pow((mousey - playerinfo.X),2) + Math.Pow((mousex - playerinfo.Y),2)); + float sd = (float)Math.Sqrt(Math.Pow((mousey - playerinfo.Y),2) + Math.Pow((mousex - playerinfo.X),2)); f1.statusBar.Panels[0].Text = String.Format("Mouse Loc: {0:f3}, {1:f3}", mousex, mousey); f1.statusBar.Panels[1].Text = String.Format("Distance: {0:f1}", sd); @@ -849,7 +849,7 @@ delta = 5 / m_ratio; foreach (SPAWNINFO sp in mobs.Values) { if (!sp.hiddenOnMap) { - if (sp.Y < x+delta && sp.Y > x-delta && sp.X < y+delta && sp.X > y-delta) + if (sp.X < x+delta && sp.X > x-delta && sp.Y < y+delta && sp.Y > y-delta) { tt.SetToolTip(this, MobInfo(sp, false)); tt.AutomaticDelay = 0; @@ -883,7 +883,7 @@ if (!found) { foreach (SPAWNTIMER st in mobsTimer.Values) { if (st.SpawnCount > 1) { - if (st.Y < x+delta && st.Y > x-delta && st.X < y+delta && st.X > y-delta) { + if (st.X < x+delta && st.X > x-delta && st.Y < y+delta && st.Y > y-delta) { int countTime = 0; string countTimer = ""; if (st.NextSpawn.Length > 0) { @@ -903,7 +903,7 @@ spawnTimer.AppendFormat("Spawn Timer: {0} secs\n", st.SpawnTimer); spawnTimer.AppendFormat("Spawning In: {0}\n", countTimer); spawnTimer.AppendFormat("Spawn Count: {0}\n", st.SpawnCount); - spawnTimer.AppendFormat("X: {0:f3} Y: {1:f3} Z: {2:f3}", st.Y, st.X, st.Z); + spawnTimer.AppendFormat("Y: {0:f3} X: {1:f3} Z: {2:f3}", st.Y, st.X, st.Z); tt.SetToolTip(this, spawnTimer.ToString()); tt.AutomaticDelay = 0; @@ -992,140 +992,109 @@ m_panOffsetY = 0; ReAdjust(); } - + public void ReAdjust() { - // get the map length - //const QSize& mapSize = m_mapData->size(); float mapWidth = maxx - minx; float mapHeight = maxy - miny; - float border = 10; - float ScreenWidth; - float ScreenHeight; - - ScreenWidth = Width - (3*border); - ScreenHeight = Height - (3*border); - - float zoom = (float)scale; - if (m_zoom > 32) - m_zoom = 32; - - // calculate zoomed map size - m_zoomWidth = mapWidth / zoom; - m_zoomHeight = mapHeight / zoom; - - // if it's a bit small, zoom out - if ((m_zoomWidth <= 2) || (m_zoomHeight <= 2)) { - if (zoom > 1) { - zoom /= 2; - // recalculate zoomed map size - m_zoomWidth =(int)((float)mapWidth / zoom); - m_zoomHeight = (int)((float)mapHeight / zoom); - } - } - - // if (zoom == 1) - // { - // m_panOffsetX = 0; - // m_panOffsetY = 0; - // } - float xrat = (float)ScreenWidth / m_zoomWidth; - float yrat = (float)ScreenHeight / m_zoomHeight; + float border = 15; - // mapOffset used to centre the map when it is smaller than the screen. - float xoff = 0; - float yoff = 0; + float ScreenWidth = Width - (2*border); + float ScreenHeight = Height - (2*border); + m_screenCenterX = Width/2; + m_screenCenterY = Height/2; + + float zoom = (float)scale; + if (m_zoom > 32) + m_zoom = 32; - // Use the smaller scale ratio so that the map fits in the screen. - if (xrat < yrat) { - float newZoomHeight; - newZoomHeight = (ScreenHeight / xrat); - // if the map is smaller than the screen calc offset needed to centre map - //if (m_zoom <= 1) - // yoff = (newZoomHeight - m_zoomHeight) / 2; + float xratio = (float)ScreenWidth / mapWidth; + float yratio = (float)ScreenHeight / mapHeight; - m_zoomHeight = newZoomHeight; - m_ratio = xrat; + // Use the smaller scale ratio so that the map fits in the screen at a zoom of 1. + if (xratio < yratio) { + m_ratio = xratio * zoom; } else { - float newZoomWidth; - newZoomWidth = (ScreenWidth / yrat); - - // if the map is smaller than the screen calc offset needed to centre map - //if (m_zoom <= 1) - // xoff = (newZoomWidth - m_zoomWidth) /2; - m_zoomWidth = newZoomWidth; - m_ratio = yrat; + m_ratio = yratio * zoom; } - if (ScreenWidth>mapWidth * m_ratio * zoom) - xoff = border + (ScreenWidth - (mapWidth * m_ratio))/2; - else - xoff = border; - - if (ScreenHeight>mapHeight * m_ratio * zoom) - yoff = border + (ScreenHeight - (mapHeight * m_ratio))/2; - else - yoff = border; - - float ZMaxX, ZMinX, ZMaxY, ZMinY; - - // Center on the target based on target - if (Settings.Instance.CenterOnPlayer) { - ZMaxX = (playerinfo.Y) + (m_zoomWidth / 2); - ZMinX = (playerinfo.Y) - (m_zoomWidth / 2); - - ZMaxY = (playerinfo.X) + (m_zoomHeight / 2); - ZMinY = (playerinfo.X) - (m_zoomHeight / 2); - } else { - ZMaxX = -m_panOffsetX + (m_zoomWidth / 2); - ZMinX = -m_panOffsetX - (m_zoomWidth / 2); - - ZMaxY = m_panOffsetY + (m_zoomHeight / 2); - ZMinY = m_panOffsetY - (m_zoomHeight / 2); - } + // Calculate the Map Center + switch (Settings.Instance.FollowOption) + { + case FollowOption.None: + m_mapCenterX = minx + (mapWidth/2); + m_mapCenterY = miny + (mapHeight/2); + break; + case FollowOption.Player: + m_mapCenterX = playerinfo.X; + m_mapCenterY = playerinfo.Y; + break; + case FollowOption.Target: + SPAWNINFO siTarget; + if (mobs.ContainsKey((uint)selectedID)) + { + siTarget = (SPAWNINFO)mobs[(uint)selectedID]; + m_mapCenterX = playerinfo.X; + m_mapCenterY = playerinfo.Y; + break; + } + else + goto case FollowOption.Player; - // try not to have blank space on the sides - - // [42!] ... unless we're centered on the player (CoP, F5...). In this case, - // we're making sure that the Player is always in the same spot, exactly (i.e., unless - // the user moves the MySEQ window around, it will always be in exactly the same spot on the - // screen, in absolute screen coordinates). This is important if the user uses the map - // window "behind" the EQ window on a single monitor setup. - - if (Settings.Instance.CenterOnPlayer) - { - xoff = 0; - yoff = 0; - } - else - { - if (ZMinX < minx) { - ZMaxX -= (ZMinX - minx); - ZMinX -= (ZMinX - minx); - } + default: + goto case FollowOption.None; + } + - if (ZMaxX > maxx) { - ZMinX -= (ZMaxX - maxx); - ZMaxX -= (ZMaxX - maxx); - } + // When Following a player or spawn and KeepCentered is not selected + // adjust the map center so as to minimise the amount of blank space in the map window. - if (ZMinY < miny) { - ZMaxY -= (ZMinY - miny); - ZMinY -= (ZMinY -miny); - } + if (Settings.Instance.KeepCentered==false && Settings.Instance.FollowOption!=FollowOption.None) + { + // Calculate the MapCordinates of the Screen Edges + float ScreenMaxY, ScreenMinY, ScreenMinX, ScreenMaxX; + float ScreenMapWidth, ScreenMapHeight; - if (ZMaxY > maxy) { - ZMinY -= (ZMaxY - maxy); - ZMaxY -= (ZMaxY - maxy); - } - } + ScreenMaxY = ScreenToMapCoordY(border); + ScreenMinY = ScreenToMapCoordY(Height - (2*border)); + ScreenMapHeight = Math.Abs(ScreenMaxY - ScreenMinY); + + // X sense is wrong way round... + ScreenMinX = ScreenToMapCoordX(Width - (2*border)); + ScreenMaxX = ScreenToMapCoordX(border); + ScreenMapWidth = Math.Abs(ScreenMaxX - ScreenMinX); + - float midx = (ZMinX + ZMaxX)/2; - float midy = (ZMinY + ZMaxY)/2; + if (mapWidth <= ScreenMapWidth) + { + // If map fits in window set center to center of map + m_mapCenterX = minx + (mapWidth/2); + } + else + { + // if we have blank space to the left or right repostion the center point appropriately + if (ScreenMinX<minx) + m_mapCenterX += (minx-ScreenMinY); + else if (ScreenMaxX>maxx) + m_mapCenterX -= (ScreenMaxY-maxx); + } - m_screenOffsetX = xoff + ((float)ScreenWidth/2) + (midx * m_ratio); - m_screenOffsetY = yoff + ((float)ScreenHeight/2) + (midy * m_ratio); + if (mapHeight <= ScreenMapHeight) + { + // If map fits in window set center to center of map + m_mapCenterY = miny + (mapHeight/2); + } + else + { + // if we have blank space at the top or botton repostion the center point appropriately + if (ScreenMinY<miny) + m_mapCenterY += (miny-ScreenMinY); + else if (ScreenMaxY>maxy) + m_mapCenterY -= (ScreenMaxY-maxy); + } + } } + public void fillConColors() { try @@ -1182,19 +1151,30 @@ } private float CalcScreenCoordX(float mapCoordinateX) { - return m_panOffsetX + (m_screenOffsetX)-(mapCoordinateX * m_ratio); + + // Formula Should be + // Screen X =CenterScreenX + ((mapCoordinateX - MapCenterX) * m_ratio) + // However Eq's Map coordinates are in the oposite sense to the screen + // so we have to multiply the second portion by -1, which is the same + // as changing the plus to a minus... + + //m_ratio = (ScreenWidth/MapWidth) * zoom (Calculated ahead of time in ReAdjust) + return m_panOffsetX + m_screenCenterX - ((mapCoordinateX - m_mapCenterX) * m_ratio); } private float CalcScreenCoordY(float mapCoordinateY) { - return m_panOffsetY + (m_screenOffsetY)-(mapCoordinateY * m_ratio); + //return m_panOffsetY + (m_screenOffsetY)-(mapCoordinateY * m_ratio); + return m_panOffsetY + m_screenCenterY - ((mapCoordinateY - m_mapCenterY) * m_ratio); } private float ScreenToMapCoordX(float screenCoordX) { - return ((m_screenOffsetX + m_panOffsetX)- screenCoordX) / m_ratio; + //return ((m_screenOffsetX + m_panOffsetX)- screenCoordX) / m_ratio; + return m_mapCenterX + ((m_panOffsetX + m_screenCenterX - screenCoordX) / m_ratio); } private float ScreenToMapCoordY(float screenCoordY) { - return ((m_screenOffsetY + m_panOffsetY) - screenCoordY) / m_ratio; + //return ((m_screenOffsetY + m_panOffsetY) - screenCoordY) / m_ratio; + return m_mapCenterY + ((m_panOffsetY + m_screenCenterY - screenCoordY) / m_ratio); } private void DrawLine(Pen pen, float x1, float y1, float x2, float y2) { @@ -1247,14 +1227,14 @@ (si.Z - playerinfo.Z) * (si.Z - playerinfo.Z)); StringBuilder mobInfo = new StringBuilder(); - mobInfo.AppendFormat("Name: {0}\n", si.Name); - mobInfo.AppendFormat("Level: {0}\n", si.Level.ToString()); + mobInfo.AppendFormat("Name: {0} ({1})\n", si.Name,si.SpawnID); + mobInfo.AppendFormat("Level: {0}\n" , si.Level.ToString()); mobInfo.AppendFormat("Class: {0}\n", f1.classNumToString(si.Class)); mobInfo.AppendFormat("Race: {0}\n", f1.raceNumtoString(si.Race)); mobInfo.AppendFormat("Speed: {0:f3}\n", si.SpeedRun); mobInfo.AppendFormat("Visible: {0}\n", f1.hideNumToString(si.Hide)); mobInfo.AppendFormat("Distance: {0:f3}\n", sd); - mobInfo.AppendFormat("X: {0:f3} Y: {1:f3} Z: {2:f3}", si.Y, si.X, si.Z); + mobInfo.AppendFormat("Y: {0:f3} X: {1:f3} Z: {2:f3}", si.Y, si.X, si.Z); if (SetColor) { if (si.Level <= greenRange) lblMobInfo.BackColor = Color.PaleGreen; @@ -1308,8 +1288,8 @@ float pX = playerinfo.X; float pY = playerinfo.Y; float pZ = playerinfo.Z; - float playerx = CalcScreenCoordX(pY); - float playery = CalcScreenCoordY(pX); + float playerx = CalcScreenCoordX(pX); + float playery = CalcScreenCoordY(pY); float realhead = CalcRealHeading(playerinfo); uint playerSpawnID = playerinfo.SpawnID; @@ -1333,8 +1313,8 @@ // Draw Spawns foreach(SPAWNINFO sp in mobs.Values) { // Draw Caution Line to Mob - x = CalcScreenCoordX(sp.Y); - y = CalcScreenCoordY(sp.X); + x = CalcScreenCoordX(sp.X); + y = CalcScreenCoordY(sp.Y); if (sp.isCaution && flash) { float sd = (float)Math.Sqrt(Math.Pow((sp.X - pX),2) + Math.Pow((sp.Y - pY),2) + Math.Pow((sp.Z - pZ),2)); if (sd > RangeCircle && sd < RangeCircle + 100) @@ -1596,13 +1576,16 @@ // Draw Spawn Timers if (Settings.Instance.ShowSpawnPoints) { + int SpawnSize = Settings.Instance.SpawnDrawSize; + int SpawnSizeOffset = SpawnSize /2; + foreach (SPAWNTIMER st in mobsTimer.Values) { if (st.SpawnCount > 1) { Pen pen = ltgrayPen; - float stX = CalcScreenCoordX(st.Y); - float stY = CalcScreenCoordY(st.X); + float stX = CalcScreenCoordX(st.X); + float stY = CalcScreenCoordY(st.Y); int checkTimer = 0; bool canDraw = false; @@ -1631,8 +1614,8 @@ if (canDraw) { - DrawLine(pen, stX - 2, stY, stX + 2, stY); - DrawLine(pen, stX, stY - 2, stX, stY + 2); + DrawLine(pen, stX - SpawnSizeOffset, stY, stX + SpawnSize , stY); + DrawLine(pen, stX, stY - SpawnSizeOffset, stX, stY + SpawnSize); } } } @@ -1669,7 +1652,7 @@ // Draw Mob Trails if (Settings.Instance.ShowMobTrails) foreach (MobTrailPoint mtp in mobtrails) - FillEllipse(whiteBrush, CalcScreenCoordX(mtp.y)-2, CalcScreenCoordY(mtp.x)-2, 2,2); + FillEllipse(whiteBrush, CalcScreenCoordX(mtp.x)-2, CalcScreenCoordY(mtp.y)-2, 2,2); } catch (Exception ex) {LogLib.WriteLine("Error in DrawSpawnTrails(): " + ex.Message);} } Index: frmMain.cs =================================================================== RCS file: /cvsroot/seq/myseq/client/frmMain.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- frmMain.cs 30 Sep 2004 19:12:12 -0000 1.3 +++ frmMain.cs 30 Sep 2004 20:59:53 -0000 1.4 @@ -118,7 +118,6 @@ private System.Windows.Forms.MenuItem mnuGridColor; private System.Windows.Forms.MenuItem mnuBackgroungColor; private System.Windows.Forms.MenuItem mnuSep6; - private System.Windows.Forms.MenuItem mnuCenterOnPlayer; private System.Windows.Forms.MenuItem mnuAlert; private System.Windows.Forms.MenuItem mnuSep7; private System.Windows.Forms.MenuItem mnuAddEditAlerts; @@ -181,6 +180,11 @@ private System.Windows.Forms.MenuItem mnuChar4; private System.Windows.Forms.MenuItem mnuChar5; private System.Windows.Forms.MenuItem mnuChar6; + private System.Windows.Forms.MenuItem menuItem6; + private System.Windows.Forms.MenuItem mnuFollowNone; + private System.Windows.Forms.MenuItem mnuFollowTarget; + private System.Windows.Forms.MenuItem mnuFollowPlayer; + private System.Windows.Forms.MenuItem mnuKeepCentered; private System.Windows.Forms.MenuItem mnuIPAddress5; #endregion @@ -423,6 +427,23 @@ public frmMain() { InitializeComponent(); + // Add the StatusBar Panels + statusBar.Panels.Add(new StatusBarPanel()); // 0 - Mouse Location + statusBar.Panels.Add(new StatusBarPanel()); // 1 - Distance + statusBar.Panels.Add(new StatusBarPanel()); // 2 - Blank Space + statusBar.Panels.Add(new StatusBarPanel()); // 3 - Version Number + statusBar.Panels.Add(new StatusBarPanel()); // 4 - Server IP Address + statusBar.Panels.Add(new StatusBarPanel()); // 5 - Center on Player (CoP) + statusBar.Panels.Add(new StatusBarPanel()); // 6 - Zone Short Name + statusBar.Panels[0].Width = 175; + statusBar.Panels[1].Width = 100; + statusBar.Panels[2].AutoSize = StatusBarPanelAutoSize.Spring; + statusBar.Panels[3].Width = 60; + statusBar.Panels[4].Width = 90; + statusBar.Panels[5].Width = 30; + statusBar.Panels[3].Alignment = HorizontalAlignment.Center; + statusBar.Panels[4].Alignment = HorizontalAlignment.Center; + statusBar.Panels[5].Alignment = HorizontalAlignment.Center; LogLib.maxLogLevel = 1; @@ -528,24 +549,6 @@ try {mapCon.lblMobInfo.Font = new Font(Settings.Instance.TargetInfoFontName, Settings.Instance.TargetInfoFontSize, Settings.Instance.TargetInfoFontStyle); } catch (Exception ex) {LogLib.WriteLine("Error setting Target Info font: " + ex.Message);} - // Add the StatusBar Panels - statusBar.Panels.Add(new StatusBarPanel()); // 0 - Mouse Location - statusBar.Panels.Add(new StatusBarPanel()); // 1 - Distance - statusBar.Panels.Add(new StatusBarPanel()); // 2 - Blank Space - statusBar.Panels.Add(new StatusBarPanel()); // 3 - Version Number - statusBar.Panels.Add(new StatusBarPanel()); // 4 - Server IP Address - statusBar.Panels.Add(new StatusBarPanel()); // 5 - Center on Player (CoP) - statusBar.Panels.Add(new StatusBarPanel()); // 6 - Zone Short Name - statusBar.Panels[0].Width = 175; - statusBar.Panels[1].Width = 100; - statusBar.Panels[2].AutoSize = StatusBarPanelAutoSize.Spring; - statusBar.Panels[3].Width = 60; - statusBar.Panels[4].Width = 90; - statusBar.Panels[5].Width = 30; - statusBar.Panels[3].Alignment = HorizontalAlignment.Center; - statusBar.Panels[4].Alignment = HorizontalAlignment.Center; - statusBar.Panels[5].Alignment = HorizontalAlignment.Center; - statusBar.Panels[3].Text = Version; ClearMap(); @@ -600,7 +603,6 @@ { this.components = new System.ComponentModel.Container(); System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain)); - this.mapPane = new myseq.MapPane(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.fontDialog1 = new System.Windows.Forms.FontDialog(); this.mnuContext = new System.Windows.Forms.ContextMenu(); @@ -647,7 +649,11 @@ this.mnuShowMobTrails = new System.Windows.Forms.MenuItem(); this.mnuShowSpawnPoints = new System.Windows.Forms.MenuItem(); this.mnuSep6 = new System.Windows.Forms.MenuItem(); - this.mnuCenterOnPlayer = new System.Windows.Forms.MenuItem(); + this.mnuFollowNone = new System.Windows.Forms.MenuItem(); + this.mnuFollowPlayer = new System.Windows.Forms.MenuItem(); + this.mnuFollowTarget = new System.Windows.Forms.MenuItem(); + this.menuItem6 = new System.Windows.Forms.MenuItem(); + this.mnuKeepCentered = new System.Windows.Forms.MenuItem(); this.mnuListSettings = new System.Windows.Forms.MenuItem(); this.mnuShowSpawnList = new System.Windows.Forms.MenuItem(); this.mnuSep10 = new System.Windows.Forms.MenuItem(); @@ -698,13 +704,6 @@ this.mnuHelpMain = new System.Windows.Forms.MenuItem(); this.mnuAbout = new System.Windows.Forms.MenuItem(); // - // mapPane - // - this.mapPane.Location = new System.Drawing.Point(0, 0); - this.mapPane.Name = "mapPane"; - this.mapPane.Size = new System.Drawing.Size(728, 480); - this.mapPane.TabIndex = 0; - // // mnuContext // this.mnuContext.Popup += new System.EventHandler(this.mnuContext_Popup); @@ -892,7 +891,9 @@ // // mnuChar1 // + this.mnuChar1.Checked = true; this.mnuChar1.Index = 0; + this.mnuChar1.RadioCheck = true; this.mnuChar1.Shortcut = System.Windows.Forms.Shortcut.CtrlShift1; this.mnuChar1.Text = "Char 1"; this.mnuChar1.Visible = false; @@ -901,6 +902,7 @@ // mnuChar2 // this.mnuChar2.Index = 1; + this.mnuChar2.RadioCheck = true; this.mnuChar2.Shortcut = System.Windows.Forms.Shortcut.CtrlShift2; this.mnuChar2.Text = "Char 2"; this.mnuChar2.Visible = false; @@ -909,6 +911,7 @@ // mnuChar3 // this.mnuChar3.Index = 2; + this.mnuChar3.RadioCheck = true; this.mnuChar3.Shortcut = System.Windows.Forms.Shortcut.CtrlShift3; this.mnuChar3.Text = "Char 3"; this.mnuChar3.Visible = false; @@ -917,6 +920,7 @@ // mnuChar4 // this.mnuChar4.Index = 3; + this.mnuChar4.RadioCheck = true; this.mnuChar4.Shortcut = System.Windows.Forms.Shortcut.CtrlShift4; this.mnuChar4.Text = "Char 4"; this.mnuChar4.Visible = false; @@ -925,6 +929,7 @@ // mnuChar5 // this.mnuChar5.Index = 4; + this.mnuChar5.RadioCheck = true; this.mnuChar5.Shortcut = System.Windows.Forms.Shortcut.CtrlShift5; this.mnuChar5.Text = "Char 5"; this.mnuChar5.Visible = false; @@ -933,6 +938,7 @@ // mnuChar6 // this.mnuChar6.Index = 5; + this.mnuChar6.RadioCheck = true; this.mnuChar6.Shortcut = System.Windows.Forms.Shortcut.CtrlShift6; this.mnuChar6.Text = "Char 6"; this.mnuChar6.Visible = false; @@ -960,7 +966,11 @@ this.mnuShowMobTrails, this.mnuShowSpawnPoints, this.mnuSep6, - this.mnuCenterOnPlayer}); + this.mnuFollowNone, + this.mnuFollowPlayer, + this.mnuFollowTarget, + this.menuItem6, + this.mnuKeepCentered}); this.mnuMapSettings.Text = "Map Settings"; // // mnuDepthFilter @@ -1039,12 +1049,38 @@ this.mnuSep6.Index = 6; this.mnuSep6.Text = "-"; // - // mnuCenterOnPlayer + // mnuFollowNone // - this.mnuCenterOnPlayer.Index = 7; - this.mnuCenterOnPlayer.Shortcut = System.Windows.Forms.Shortcut.F5; - this.mnuCenterOnPlayer.Text = "Center on Player"; - this.mnuCenterOnPlayer.Click += new System.EventHandler(this.mnuCenterOnPlayer_Click); + this.mnuFollowNone.Index = 7; + this.mnuFollowNone.RadioCheck = true; + this.mnuFollowNone.Text = "No Follow"; + this.mnuFollowNone.Click += new System.EventHandler(this.mnuFollowNone_Click); + // + // mnuFollowPlayer + // + this.mnuFollowPlayer.Checked = true; + this.mnuFollowPlayer.Index = 8; + this.mnuFollowPlayer.RadioCheck = true; + this.mnuFollowPlayer.Text = "Follow Player"; + this.mnuFollowPlayer.Click += new System.EventHandler(this.mnuFollowPlayer_Click); + // + // mnuFollowTarget + // + this.mnuFollowTarget.Index = 9; + this.mnuFollowTarget.RadioCheck = true; + this.mnuFollowTarget.Text = "Follow Target"; + this.mnuFollowTarget.Click += new System.EventHandler(this.mnuFollowTarget_Click); + // + // menuItem6 + // + this.menuItem6.Index = 10; + this.menuItem6.Text = "-"; + // + // mnuKeepCentered + // + this.mnuKeepCentered.Index = 11; + this.mnuKeepCentered.Text = "Keep Centered"; + this.mnuKeepCentered.Click += new System.EventHandler(this.mnuKeepCentered_Click); // // mnuListSettings // @@ -1477,7 +1513,8 @@ this.mnuShowSpawnList.Checked = Settings.Instance.ShowMobList; this.mnuShowGridLines.Checked = Settings.Instance.ShowGridLines; this.mnuShowListGridLines.Checked = Settings.Instance.ShowListGridLines; - this.mnuCenterOnPlayer.Checked = Settings.Instance.CenterOnPlayer; + SetFollowOption(Settings.Instance.FollowOption); + this.mnuKeepCentered.Checked = Settings.Instance.KeepCentered; this.mnuShowTargetInfo.Checked = Settings.Instance.ShowTargetInfo; this.mnuAutoSelectEQTarget.Checked = Settings.Instance.AutoSelectEQTarget; @@ -1767,10 +1804,10 @@ private void CheckMapMinMax(SPAWNINFO si) { - if (mapCon.minx>si.Y) mapCon.minx=si.Y; - if (mapCon.maxx<si.Y) mapCon.maxx=si.Y; - if (mapCon.miny>si.X) mapCon.miny=si.X; - if (mapCon.maxy<si.X) mapCon.maxy=si.X; + if (mapCon.minx>si.X) mapCon.minx=si.X; + if (mapCon.maxx<si.X) mapCon.maxx=si.X; + if (mapCon.miny>si.Y) mapCon.miny=si.Y; + if (mapCon.maxy<si.Y) mapCon.maxy=si.Y; } #region ProcessPacket @@ -2268,13 +2305,14 @@ } if ((mob.X != si.X) || (mob.Y != si.Y) || (mob.Z != si.Z)) - { + { + mob.X = si.X; - li.SubItems[10].Text = si.X.ToString(); - + li.SubItems[11].Text = si.X.ToString(); + mob.Y = si.Y; - li.SubItems[11].Text = si.Y.ToString(); - + li.SubItems[10].Text = si.Y.ToString(); + mob.Z = si.Z; li.SubItems[12].Text = si.Z.ToString(); @@ -2439,8 +2477,8 @@ item1.SubItems.Add(si.SpeedRun.ToString()); item1.SubItems.Add(si.SpawnID.ToString()); item1.SubItems.Add(dt.ToLongTimeString()); - item1.SubItems.Add(si.X.ToString("#.000")); item1.SubItems.Add(si.Y.ToString("#.000")); + item1.SubItems.Add(si.X.ToString("#.000")); item1.SubItems.Add(si.Z.ToString("#.000")); float sd = (float)Math.Sqrt((si.X - mapCon.playerinfo.X)* (si.X - mapCon.playerinfo.X) + @@ -2536,8 +2574,8 @@ string spawnTimer = ""; itmSpawnTimerList.SubItems.Add(spawnTimer); - itmSpawnTimerList.SubItems.Add(st.X.ToString()); itmSpawnTimerList.SubItems.Add(st.Y.ToString()); + itmSpawnTimerList.SubItems.Add(st.X.ToString()); itmSpawnTimerList.SubItems.Add(st.Z.ToString()); itmSpawnTimerList.SubItems.Add(st.SpawnCount.ToString()); itmSpawnTimerList.SubItems.Add(st.SpawnTime); @@ -2585,8 +2623,8 @@ string SpawnLoc = String.Format("{0:f3},{1:f3}", si.Y, si.X); SPAWNTIMER st = new SPAWNTIMER(); - st.Y = si.Y; st.X = si.X; + st.Y = si.Y; st.Z = si.Z; st.SpawnTime = dt.ToLongTimeString() + " " + dt.ToShortDateString(); st.KillTime = ""; @@ -3011,21 +3049,44 @@ } } - - private void mnuCenterOnPlayer_Click(object sender, System.EventArgs e) + private void SetFollowOption(FollowOption NewFollowOption) { - mnuCenterOnPlayer.Checked = !mnuCenterOnPlayer.Checked; + Settings.Instance.FollowOption = NewFollowOption; - Settings.Instance.CenterOnPlayer = mnuCenterOnPlayer.Checked; + mnuFollowNone.Checked = (NewFollowOption == FollowOption.None); + mnuFollowPlayer.Checked = (NewFollowOption == FollowOption.Player); + mnuFollowTarget.Checked = (NewFollowOption == FollowOption.Target); - if (mnuCenterOnPlayer.Checked) + switch (NewFollowOption) { - this.statusBar.Panels[5].Text = "CoP"; - mapPane.offsetx.Value = 0; - mapPane.offsety.Value = 0; + case FollowOption.None: + this.statusBar.Panels[5].Text = ""; + break; + case FollowOption.Player: + this.statusBar.Panels[5].Text = "CoP"; + mapPane.offsetx.Value = 0; + mapPane.offsety.Value = 0; + break; + case FollowOption.Target: + this.statusBar.Panels[5].Text = "CoT"; + mapPane.offsetx.Value = 0; + mapPane.offsety.Value = 0; + break; } - else - this.statusBar.Panels[5].Text = ""; + } + private void mnuFollowNone_Click(object sender, System.EventArgs e) + { + SetFollowOption(FollowOption.None); + } + + private void mnuFollowPlayer_Click(object sender, System.EventArgs e) + { + SetFollowOption(FollowOption.Player); + } + + private void mnuFollowTarget_Click(object sender, System.EventArgs e) + { + SetFollowOption(FollowOption.Target); } @@ -3362,6 +3423,7 @@ SendData(requestdata); } } + private void mnuChar1_Click(object sender, System.EventArgs e) { SwitchCharacter(1); @@ -3391,6 +3453,12 @@ { SwitchCharacter(6); } + + private void mnuKeepCentered_Click(object sender, System.EventArgs e) + { + Settings.Instance.KeepCentered = !Settings.Instance.KeepCentered; + mnuKeepCentered.Checked = Settings.Instance.KeepCentered; + } } |