mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-22 08:36:06 -05:00
Fix duplicate event script label completions
This commit is contained in:
@@ -180,7 +180,7 @@ public:
|
||||
QString getScriptDefaultString(bool usePoryScript, QString mapName) const;
|
||||
QString getMapScriptsFilePath(const QString &mapName) const;
|
||||
QStringList getEventScriptsFilePaths() const;
|
||||
QCompleter *getEventScriptLabelCompleter(const QStringList &additionalCompletions) const;
|
||||
QCompleter *getEventScriptLabelCompleter(QStringList additionalCompletions) const;
|
||||
|
||||
bool loadMapBorder(Map *map);
|
||||
|
||||
|
||||
@@ -427,8 +427,8 @@ QStringList Map::eventScriptLabels(const QString &event_group_type) const {
|
||||
scriptLabels << event->get("script_label");
|
||||
}
|
||||
|
||||
scriptLabels.removeAll("");
|
||||
scriptLabels.removeDuplicates();
|
||||
scriptLabels.removeAll(QString());
|
||||
if (scriptLabels.contains("0x0"))
|
||||
scriptLabels.move(scriptLabels.indexOf("0x0"), scriptLabels.count() - 1);
|
||||
if (scriptLabels.contains("NULL"))
|
||||
|
||||
@@ -2386,8 +2386,10 @@ QStringList Project::getEventScriptsFilePaths() const {
|
||||
return filePaths;
|
||||
}
|
||||
|
||||
QCompleter *Project::getEventScriptLabelCompleter(const QStringList &additionalCompletions) const {
|
||||
eventScriptLabelModel->setStringList(eventScriptLabels + additionalCompletions);
|
||||
QCompleter *Project::getEventScriptLabelCompleter(QStringList additionalCompletions) const {
|
||||
additionalCompletions += eventScriptLabels;
|
||||
additionalCompletions.removeDuplicates();
|
||||
eventScriptLabelModel->setStringList(additionalCompletions);
|
||||
return eventScriptLabelCompleter;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user