File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ void MapsWidget::loadBanks()
222222 auto id = o[" id" ].toInt ();
223223 auto name = o[" name" ].toString ();
224224 auto row = QStringLiteral (" %1 %2" ).arg (id).arg (name);
225- bankCombo->addItem (row);
225+ bankCombo->addItem (row, id );
226226 }
227227 bankCombo->blockSignals (false );
228228 if (bankCombo->count () > 0 ) {
@@ -233,8 +233,12 @@ void MapsWidget::loadBanks()
233233
234234void MapsWidget::onBankChanged (int idx)
235235{
236- QString bank = bankCombo->itemText (idx);
237- Core ()->cmd (QString (" omb %1" ).arg (bank));
236+ bool ok = false ;
237+ int bankId = bankCombo->itemData (idx).toInt (&ok);
238+ if (!ok) {
239+ return ;
240+ }
241+ Core ()->cmd (QString (" omb %1" ).arg (bankId));
238242 refreshMaps ();
239243}
240244
@@ -246,7 +250,8 @@ void MapsWidget::onAddBank()
246250 if (!ok || name.isEmpty ()) {
247251 return ;
248252 }
249- Core ()->cmd (QString (" omb+ %1" ).arg (name));
253+ name = Core ()->sanitizeStringForCommand (name).replace (' \n ' , ' _' ).replace (' \r ' , ' _' );
254+ Core ()->cmdRaw (QString (" omb+ %1" ).arg (name));
250255 loadBanks ();
251256}
252257
You can’t perform that action at this time.
0 commit comments