moved shoot out of core libe and put in libsecondlife.Utilities Realism class.
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1703 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -1648,51 +1648,6 @@ namespace libsecondlife
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aims at the specified position, enters mouselook, presses and
|
||||
/// releases the left mouse button, and leaves mouselook
|
||||
/// </summary>
|
||||
/// <param name="target">Target to shoot at</param>
|
||||
/// <returns></returns>
|
||||
public bool Shoot(LLVector3 target)
|
||||
{
|
||||
if (Movement.TurnToward(target))
|
||||
return Shoot();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enters mouselook, presses and releases the left mouse button, and leaves mouselook
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool Shoot()
|
||||
{
|
||||
if (Client.Settings.SEND_AGENT_UPDATES)
|
||||
{
|
||||
Movement.Mouselook = true;
|
||||
Movement.MLButtonDown = true;
|
||||
Movement.SendUpdate();
|
||||
|
||||
Movement.MLButtonUp = true;
|
||||
Movement.MLButtonDown = false;
|
||||
Movement.FinishAnim = true;
|
||||
Movement.SendUpdate();
|
||||
|
||||
Movement.Mouselook = false;
|
||||
Movement.MLButtonUp = false;
|
||||
Movement.FinishAnim = false;
|
||||
Movement.SendUpdate();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Client.Log("Attempted Shoot but agent updates are disabled", Helpers.LogLevel.Warning);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Movement actions
|
||||
|
||||
#region Touch and grab
|
||||
|
||||
@@ -520,7 +520,7 @@ namespace libsecondlife
|
||||
/// </summary>
|
||||
/// <param name="target">Target to shoot at</param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("Use Self.Shoot()")]
|
||||
[Obsolete("Moved to libsecondlife.Utilities")]
|
||||
public bool Shoot(LLVector3 target)
|
||||
{
|
||||
if (TurnToward(target))
|
||||
@@ -533,7 +533,7 @@ namespace libsecondlife
|
||||
/// Enters mouselook, presses and releases the left mouse button, and leaves mouselook
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Obsolete("Use Self.Shoot()")]
|
||||
[Obsolete("Moved to libsecondlife.Utilities")]
|
||||
public bool Shoot()
|
||||
{
|
||||
if (Client.Settings.SEND_AGENT_UPDATES)
|
||||
|
||||
@@ -24,6 +24,51 @@ namespace libsecondlife.Utilities
|
||||
|
||||
public static class Realism
|
||||
{
|
||||
/// <summary>
|
||||
/// Aims at the specified position, enters mouselook, presses and
|
||||
/// releases the left mouse button, and leaves mouselook
|
||||
/// </summary>
|
||||
/// <param name="target">Target to shoot at</param>
|
||||
/// <returns></returns>
|
||||
public static bool Shoot(SecondLife client, LLVector3 target)
|
||||
{
|
||||
if (client.Self.Movement.TurnToward(target))
|
||||
return Shoot(client);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enters mouselook, presses and releases the left mouse button, and leaves mouselook
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool Shoot(SecondLife client)
|
||||
{
|
||||
if (client.Settings.SEND_AGENT_UPDATES)
|
||||
{
|
||||
client.Self.Movement.Mouselook = true;
|
||||
client.Self.Movement.MLButtonDown = true;
|
||||
client.Self.Movement.SendUpdate();
|
||||
|
||||
client.Self.Movement.MLButtonUp = true;
|
||||
client.Self.Movement.MLButtonDown = false;
|
||||
client.Self.Movement.FinishAnim = true;
|
||||
client.Self.Movement.SendUpdate();
|
||||
|
||||
client.Self.Movement.Mouselook = false;
|
||||
client.Self.Movement.MLButtonUp = false;
|
||||
client.Self.Movement.FinishAnim = false;
|
||||
client.Self.Movement.SendUpdate();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
client.Log("Attempted Shoot but agent updates are disabled", Helpers.LogLevel.Warning);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A psuedo-realistic chat function that uses the typing sound and
|
||||
/// animation, types at three characters per second, and randomly
|
||||
|
||||
Reference in New Issue
Block a user