Build viewer/editor #13

Manually merged
williamjcm merged 128 commits from mass-viewer into master 2022-03-02 14:50:10 +01:00
Showing only changes of commit 940fe3feee - Show all commits

View file

@ -651,13 +651,19 @@ void SaveTool::drawWeapons() {
} \
if(ImGui::BeginDragDropSource()) { \
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::EndDragDropSource(); \
} \
if(ImGui::BeginDragDropTarget()) { \
if(const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(payload_type)) { \
int index = *static_cast<int*>(payload->Data); \
\
if(!ImGui::GetIO().KeyCtrl) { \
if(current_weapon == &_currentMass->array()[index]) { \
current_weapon = &_currentMass->array()[i]; \
} \
@ -666,6 +672,10 @@ void SaveTool::drawWeapons() {
} \
\
std::swap(_currentMass->array()[index], _currentMass->array()[i]); \
} \
else { \
_currentMass->array()[i] = _currentMass->array()[index]; \
} \
(dirty) = true; \
} \
\