Application: allow swapping BS<->ES.
This is the only safe swap that won't be a pain in the ass to deal with. The best I can do for other weapons is allowing to change their type, which will come later.
This commit is contained in:
parent
f322cf4ab2
commit
6aba2bf8c5
1 changed files with 23 additions and 0 deletions
|
@ -346,6 +346,29 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) {
|
||||||
weapon.name = name_buf.data();
|
weapon.name = name_buf.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(conf().advancedMode()) {
|
||||||
|
if(weapon.type == GameObjects::Weapon::Type::BulletShooter) {
|
||||||
|
ImGui::Button("Import energy shooter by dragging it here");
|
||||||
|
if(ImGui::BeginDragDropTarget()) {
|
||||||
|
if(const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("EShooter")) {
|
||||||
|
std::uint32_t index = *static_cast<std::uint32_t*>(payload->Data);
|
||||||
|
weapon = _currentMass->energyShooters()[index];
|
||||||
|
}
|
||||||
|
ImGui::EndDragDropTarget();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(weapon.type == GameObjects::Weapon::Type::EnergyShooter) {
|
||||||
|
ImGui::Button("Import bullet shooter by dragging it here");
|
||||||
|
if(ImGui::BeginDragDropTarget()) {
|
||||||
|
if(const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("BShooter")) {
|
||||||
|
std::uint32_t index = *static_cast<std::uint32_t*>(payload->Data);
|
||||||
|
weapon = _currentMass->bulletShooters()[index];
|
||||||
|
}
|
||||||
|
ImGui::EndDragDropTarget();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
drawAlignedText("Equipped:");
|
drawAlignedText("Equipped:");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue