Application: make BS/ES swapping non-advanced.

This commit is contained in:
Guillaume Jacquemin 2024-12-12 15:39:19 +01:00
parent 826f53c26b
commit 57f1a3ccef
Signed by: williamjcm
SSH key fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A

View file

@ -246,26 +246,24 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) {
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();
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();
}
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();
}
}