Fix DBC loading and bank drag-and-drop reliability

- Force binary loading for SkillLine.dbc (CSV exports are garbled)
- Handle quoted numeric values in DBC CSV parser
- Fix bank slot drag-and-drop to use mouse-release detection instead
  of click detection, preventing item drops on wrong slots
- Fix action bar item drop to use hoveredOnRelease for consistency
This commit is contained in:
Kelsi 2026-02-26 02:33:10 -08:00
parent 5cb469e318
commit 25412ff5cc
3 changed files with 47 additions and 25 deletions

View file

@ -291,6 +291,31 @@ bool DBCFile::loadCSV(const std::vector<uint8_t>& csvData) {
stringBlock.push_back(0); // null terminator
row.fields[col] = offset;
}
} else if (pos < line.size() && line[pos] == '"') {
// Quoted value in numeric field — skip quotes, try to parse content
pos++; // skip opening quote
std::string str;
while (pos < line.size()) {
if (line[pos] == '"') {
if (pos + 1 < line.size() && line[pos + 1] == '"') {
str += '"';
pos += 2;
} else {
pos++; // closing quote
break;
}
} else {
str += line[pos++];
}
}
if (pos < line.size() && line[pos] == ',') pos++;
if (!str.empty()) {
try {
row.fields[col] = static_cast<uint32_t>(std::stoul(str));
} catch (...) {
row.fields[col] = 0;
}
}
} else {
// Numeric field — read until comma or end of line
size_t end = line.find(',', pos);