Hi there,
I finally managed to hook EndScene and was hoping for come conceptional help. I mean how are you guys getting your object list from there or how are you executing lua functions? Is the following rough concept ok?
Code:
private static void EndScene()
{
ObjectManager.Pulse();
MyMainForm.UpdatePlayerStatus(SomeSortOfStatus);
MyFiniteStateMachine.Pulse();
}
Are you starting your own Finite State Machine as separated thread and have just the Pulse() function do all the stuff?
How are you handling your main form? Started in your own thread? Then how are you communicating with it in process?
I am for example updating the status text field as follows. Is that ok or will I get problems in future?
Code:
delegate void delegateUpdateStatus(string message);
public void UpdateStatus(string message)
{
if (textBox1.InvokeRequired)
{
delegateUpdateStatus d = new delegateUpdateStatus(UpdateStatus);
this.Invoke(d, new object[] { message });
}
else
{
textBox1.AppendText(DateTime.Now + ": " + message + "\r\n");
}
}
Would be nice to hear something conceptual