More small changes

This commit is contained in:
EntenKoeniq
2022-03-28 15:08:30 +02:00
parent a6167528dd
commit d99613445f
3 changed files with 25 additions and 31 deletions

View File

@ -8,17 +8,14 @@ using GTA.Native;
namespace CoopClient
{
/// <summary>
/// Don't use it!
/// </summary>
public class Chat
internal class Chat
{
private readonly Scaleform MainScaleForm;
internal string CurrentInput { get; set; }
public string CurrentInput { get; set; }
private bool CurrentFocused { get; set; }
internal bool Focused
public bool Focused
{
get { return CurrentFocused; }
set
@ -66,18 +63,18 @@ namespace CoopClient
MainScaleForm = new Scaleform("multiplayer_chat");
}
internal void Init()
public void Init()
{
MainScaleForm.CallFunction("SET_FOCUS", 2, 2, "ALL");
MainScaleForm.CallFunction("SET_FOCUS", 1, 2, "ALL");
}
internal void Clear()
public void Clear()
{
MainScaleForm.CallFunction("RESET");
}
internal void Tick()
public void Tick()
{
if ((Util.GetTickCount64() - LastMessageTime) > 15000 && !Focused && !Hidden)
{
@ -97,14 +94,14 @@ namespace CoopClient
Function.Call(Hash.DISABLE_ALL_CONTROL_ACTIONS, 0);
}
internal void AddMessage(string sender, string msg)
public void AddMessage(string sender, string msg)
{
MainScaleForm.CallFunction("ADD_MESSAGE", sender + ":", msg);
LastMessageTime = Util.GetTickCount64();
Hidden = false;
}
internal void OnKeyDown(Keys key)
public void OnKeyDown(Keys key)
{
if (key == Keys.Escape)
{
@ -157,12 +154,12 @@ namespace CoopClient
}
[DllImport("user32.dll")]
internal static extern int ToUnicodeEx(uint virtualKeyCode, uint scanCode, byte[] keyboardState,
public static extern int ToUnicodeEx(uint virtualKeyCode, uint scanCode, byte[] keyboardState,
[Out, MarshalAs(UnmanagedType.LPWStr, SizeConst = 64)]
StringBuilder receivingBuffer,
int bufferSize, uint flags, IntPtr kblayout);
internal static string GetCharFromKey(Keys key, bool shift, bool altGr)
public static string GetCharFromKey(Keys key, bool shift, bool altGr)
{
StringBuilder buf = new StringBuilder(256);
byte[] keyboardState = new byte[256];

View File

@ -11,20 +11,17 @@ using GTA.Native;
namespace CoopClient
{
/// <summary>
/// Don't use it!
/// </summary>
public class Networking
internal class Networking
{
internal NetClient Client;
internal float Latency = 0;
public NetClient Client;
public float Latency = 0;
internal bool ShowNetworkInfo = false;
public bool ShowNetworkInfo = false;
internal int BytesReceived = 0;
internal int BytesSend = 0;
public int BytesReceived = 0;
public int BytesSend = 0;
internal void DisConnectFromServer(string address)
public void DisConnectFromServer(string address)
{
if (IsOnServer())
{
@ -72,12 +69,12 @@ namespace CoopClient
}
}
internal bool IsOnServer()
public bool IsOnServer()
{
return Client?.ConnectionStatus == NetConnectionStatus.Connected;
}
internal void ReceiveMessages()
public void ReceiveMessages()
{
if (Client == null)
{
@ -902,7 +899,7 @@ namespace CoopClient
#region -- SEND --
private ulong LastPlayerFullSync = 0;
internal void SendPlayerData()
public void SendPlayerData()
{
Ped player = Game.Player.Character;
@ -1024,7 +1021,7 @@ namespace CoopClient
#endif
}
internal void SendNpcData(Ped npc)
public void SendNpcData(Ped npc)
{
NetOutgoingMessage outgoingMessage = Client.CreateMessage();
@ -1091,7 +1088,7 @@ namespace CoopClient
#endif
}
internal void SendChatMessage(string message)
public void SendChatMessage(string message)
{
NetOutgoingMessage outgoingMessage = Client.CreateMessage();
@ -1108,7 +1105,7 @@ namespace CoopClient
#endif
}
internal void SendModData(long target, string modName, byte customID, byte[] bytes)
public void SendModData(long target, string modName, byte customID, byte[] bytes)
{
NetOutgoingMessage outgoingMessage = Client.CreateMessage();
new Packets.Mod()

View File

@ -28,7 +28,7 @@ namespace CoopClient
};
}
internal static void OnTick(object sender, EventArgs e)
private void OnTick(object sender, EventArgs e)
{
if (Game.IsLoading)
{
@ -62,7 +62,7 @@ namespace CoopClient
LastDisableTraffic = Main.DisableTraffic;
}
private static void Traffic(bool enable)
private void Traffic(bool enable)
{
if (enable)
{