Build viewer/editor #13
1 changed files with 53 additions and 43 deletions
|
@ -651,13 +651,19 @@ void SaveTool::drawWeapons() {
|
||||||
} \
|
} \
|
||||||
if(ImGui::BeginDragDropSource()) { \
|
if(ImGui::BeginDragDropSource()) { \
|
||||||
ImGui::SetDragDropPayload(payload_type, &i, sizeof(UnsignedInt)); \
|
ImGui::SetDragDropPayload(payload_type, &i, sizeof(UnsignedInt)); \
|
||||||
|
if(ImGui::GetIO().KeyCtrl) { \
|
||||||
|
ImGui::Text(payload_tooltip " %i - %s (copy)", i + 1, weapon.name.c_str()); \
|
||||||
|
} \
|
||||||
|
else { \
|
||||||
ImGui::Text(payload_tooltip " %i - %s", i + 1, weapon.name.c_str()); \
|
ImGui::Text(payload_tooltip " %i - %s", i + 1, weapon.name.c_str()); \
|
||||||
|
} \
|
||||||
ImGui::EndDragDropSource(); \
|
ImGui::EndDragDropSource(); \
|
||||||
} \
|
} \
|
||||||
if(ImGui::BeginDragDropTarget()) { \
|
if(ImGui::BeginDragDropTarget()) { \
|
||||||
if(const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(payload_type)) { \
|
if(const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(payload_type)) { \
|
||||||
int index = *static_cast<int*>(payload->Data); \
|
int index = *static_cast<int*>(payload->Data); \
|
||||||
\
|
\
|
||||||
|
if(!ImGui::GetIO().KeyCtrl) { \
|
||||||
if(current_weapon == &_currentMass->array()[index]) { \
|
if(current_weapon == &_currentMass->array()[index]) { \
|
||||||
current_weapon = &_currentMass->array()[i]; \
|
current_weapon = &_currentMass->array()[i]; \
|
||||||
} \
|
} \
|
||||||
|
@ -666,6 +672,10 @@ void SaveTool::drawWeapons() {
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
std::swap(_currentMass->array()[index], _currentMass->array()[i]); \
|
std::swap(_currentMass->array()[index], _currentMass->array()[i]); \
|
||||||
|
} \
|
||||||
|
else { \
|
||||||
|
_currentMass->array()[i] = _currentMass->array()[index]; \
|
||||||
|
} \
|
||||||
(dirty) = true; \
|
(dirty) = true; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
|
|
Loading…
Reference in a new issue