]> git.sesse.net Git - ultimatescore/commitdiff
Make quick codes for goals.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 25 Oct 2017 07:30:38 +0000 (09:30 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 25 Oct 2017 07:30:38 +0000 (09:30 +0200)
client/mainwindow.cpp

index 7936ee3228c7588b709cde74a4895a468c2e43cb..e515cf3d3aac90fc3d6fdc7577dada8ab1d53d42 100644 (file)
@@ -260,10 +260,17 @@ void MainWindow::hide_lower_third_clicked()
 
 void MainWindow::quick_lower_third_activate()
 {
-       map<string, string> param;
-       param["code"] = ui->quick_lower_third_edit->text().toStdString();
-       acmp->send_command("cg 1 update 1 \"" + escape_quotes(serialize_as_json(param)) + "\"");
-       acmp->send_command("cg 1 invoke 1 quicklowerthird");
+       string code = ui->quick_lower_third_edit->text().toUpper().toStdString();
+       if (code == "A") {
+               add_goal(ui->score_1_box, 1);
+       } else if (code == "B") {
+               add_goal(ui->score_2_box, 1);
+       } else {
+               map<string, string> param;
+               param["code"] = code;
+               acmp->send_command("cg 1 update 1 \"" + escape_quotes(serialize_as_json(param)) + "\"");
+               acmp->send_command("cg 1 invoke 1 quicklowerthird");
+       }
        ui->quick_lower_third_edit->clear();
 }