These are chat archives for ikkentim/SampSharp

17th
Jan 2017
Oleg
@5LICK
Jan 17 2017 01:36
i will try to change locale
Oleg
@5LICK
Jan 17 2017 12:10
i have question about commands, if i need to create command for using itself, i need put the command outside BasePlayer (or subtype of BasePlayer) class, and this command should be a static?
Oleg
@5LICK
Jan 17 2017 13:51
How to handle dialog response?
Tim Potze
@ikkentim
Jan 17 2017 17:23
Yes, a command must be static if it's not in a player class. It must also have a BasePlayer (or your subclass of BasePlayer) as the first argument, this is the sender.
there are two ways of handling responses:
var dialog = new InputDialog("Potatoes", "How do you like your potatoes?", false, "Order", "Cancel");

// in sync
dialog.Response += (sender, e) => { 
    // handle response in sync
};
dialog.Show(player);

// async
var response = await dialog.ShowAsync(player);
// handle response here
The async way is the fanciest tho :)
Oleg
@5LICK
Jan 17 2017 18:07
Thank you :)