GUI: update newSong.cpp
This commit is contained in:
parent
d6a24cd32a
commit
7cb1504215
|
|
@ -115,24 +115,22 @@ void FurnaceGUI::drawNewSong() {
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
if (ImGui::BeginTooltip()) {
|
if (ImGui::BeginTooltip()) {
|
||||||
std::map<DivSystem, int> chipCounts;
|
std::map<DivSystem,int> chipCounts;
|
||||||
std::vector<DivSystem> chips;
|
std::vector<DivSystem> chips;
|
||||||
for (FurnaceGUISysDefChip chip: i.orig) {
|
for (FurnaceGUISysDefChip chip: i.orig) {
|
||||||
if (chipCounts.find(chip.sys) == chipCounts.end()) {
|
if (chipCounts.find(chip.sys)==chipCounts.end()) {
|
||||||
chipCounts[chip.sys] = 1;
|
chipCounts[chip.sys]=1;
|
||||||
chips.push_back(chip.sys);
|
chips.push_back(chip.sys);
|
||||||
}
|
} else {
|
||||||
else {
|
chipCounts[chip.sys]+=1;
|
||||||
chipCounts[chip.sys] += 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int num_chips = chips.size();
|
for (size_t chipIndex=0; chipIndex<chips.size(); chipIndex++) {
|
||||||
for (int chipIndex = 0; chipIndex < num_chips; chipIndex++) {
|
DivSystem chip=chips[chipIndex];
|
||||||
DivSystem chip = chips[chipIndex];
|
const DivSysDef* sysDef=e->getSystemDef(chip);
|
||||||
const DivSysDef* sysDef = e->getSystemDef(chip);
|
ImGui::Text("%s (x%d): ",sysDef->name,chipCounts[chip]);
|
||||||
ImGui::Text("%s (x%d): ", sysDef->name, chipCounts[chip]);
|
ImGui::TextWrapped("%s",sysDef->description);
|
||||||
ImGui::TextWrapped("%s", sysDef->description);
|
if (chipIndex+1<chips.size()) {
|
||||||
if (chipIndex + 1 < num_chips) {
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue