Replies: 7 comments
-
either make cm.SendYesNo thread blocking or use a callback On 17 June 2015 at 08:27, Fraysa [email protected] wrote:
|
Beta Was this translation helpful? Give feedback.
-
I got around it using this code, however I can't call the await keyword using JavaScript. Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
I think you over engineered this.
Just do this:
public bool SendYesNo(string message)
{
return MessageBox.Show(message, "", MessageBoxButtons.YesNo) ==
DialogResult.Yes;
}
|
Beta Was this translation helpful? Give feedback.
-
The MessageBox was just an example, I'm not actually using MessageBoxes. This is for a MMORPG, so the MessageBoxes are imaginary NPC chats. |
Beta Was this translation helpful? Give feedback.
-
ok, in that case, use the taskcompletionsource, but I didn't see anywhere public bool SendYesNo(string message)
} On 17 June 2015 at 15:43, Fraysa [email protected] wrote:
|
Beta Was this translation helpful? Give feedback.
-
Am I doing something wrong? By the way, I have to have "SetResult" in a separate method, as I'm calling it from another class. |
Beta Was this translation helpful? Give feedback.
-
if that is the case I would do this:
On 18 June 2015 at 01:36, Fraysa [email protected] wrote:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using this to make a scripting interface for a MMORPG game server.
Once the user initates a chat with a NPC, the script is executed. For example, I can open up a Yes/No window for the NPC using this:
var yes = cm.SendYesNo("yes or no?");
if (yes)
{
// do smthn
} else {
// do smthn else
}
However, I want to halt the exceution of the script after I send SendYesNo and continue it once I return the boolean that is returned. How can I do that code-wise?
Beta Was this translation helpful? Give feedback.
All reactions