Author: cazfi Date: Wed Sep 14 21:05:45 2016 New Revision: 33801 URL: http://svn.gna.org/viewcvs/freeciv?rev=33801&view=rev Log: Show description of preventing requirements in requirement editor.
See bug #25056 Modified: trunk/tools/ruledit/req_edit.cpp Modified: trunk/tools/ruledit/req_edit.cpp URL: http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruledit/req_edit.cpp?rev=33801&r1=33800&r2=33801&view=diff ============================================================================== --- trunk/tools/ruledit/req_edit.cpp (original) +++ trunk/tools/ruledit/req_edit.cpp Wed Sep 14 21:05:45 2016 @@ -140,19 +140,24 @@ req_list->clear(); requirement_vector_iterate(req_vector, preq) { - if (preq->present) { - char buf[512]; - QListWidgetItem *item; - - buf[0] = '\0'; - if (!req_text_insert(buf, sizeof(buf), NULL, preq, VERB_ACTUAL)) { + char buf[512]; + QListWidgetItem *item; + + buf[0] = '\0'; + if (!req_text_insert(buf, sizeof(buf), NULL, preq, VERB_ACTUAL)) { + if (preq->present) { universal_name_translation(&preq->source, buf, sizeof(buf)); + } else { + char buf2[256]; + + universal_name_translation(&preq->source, buf2, sizeof(buf2)); + fc_snprintf(buf, sizeof(buf), "%s prevents", buf2); } - item = new QListWidgetItem(QString::fromUtf8(buf)); - req_list->insertItem(i++, item); - if (selected == preq) { - item->setSelected(true); - } + } + item = new QListWidgetItem(QString::fromUtf8(buf)); + req_list->insertItem(i++, item); + if (selected == preq) { + item->setSelected(true); } } requirement_vector_iterate_end; _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits