- 8,778
- 11,221
Почему диалог не отображается еще раз после нажатия на кнопку в этом же диалоге? При этом в консоль выводит "Dialog shown!"
C++:
void ShowDialog() {
string Text = "";
for (int GangIndex = 0; GangIndex < Settings.size(); GangIndex++) {
Text.append(Settings[GangIndex].name + "\t" + (Settings[GangIndex].enabled ? "ON" : "OFF") + "\n");
}
SF->getSAMP()->getDialog()->ShowDialog(DialogId, 2, "dialogtitle", (char*)Text.c_str(), "TOGGLE", "X");
cout << "Dialog shown!" << endl;
}
void CALLBACK dialogCallback(int dialogId, int buttonId, int listItem, const char* input) {
if (dialogId == DialogId && buttonId == 1) {
if (listItem >= 0 && listItem <= Settings.size()) {
Settings[listItem].enabled = !Settings[listItem].enabled;
cout << "State: " + (Settings[listItem].enabled ? "ON" : "OFF") << endl;
}
ShowDialog();
}