Compare commits
No commits in common. "940fe3feeeeaa03918c86a7904c7b82de66af08a" and "51faed72105c2dafdab70dc932696c1319c17641" have entirely different histories.
940fe3feee
...
51faed7210
2 changed files with 43 additions and 89 deletions
|
@ -101,42 +101,6 @@ struct WeaponPart {
|
|||
};
|
||||
|
||||
struct Weapon {
|
||||
Weapon() = default;
|
||||
|
||||
Weapon(const Weapon& other) {
|
||||
name = other.name;
|
||||
type = other.type;
|
||||
parts = Containers::Array<WeaponPart>{other.parts.size()};
|
||||
for(UnsignedInt i = 0; i < parts.size(); i++) {
|
||||
parts[i] = other.parts[i];
|
||||
}
|
||||
customStyles = other.customStyles;
|
||||
attached = other.attached;
|
||||
damageType = other.damageType;
|
||||
dualWield = other.dualWield;
|
||||
effectColourMode = other.effectColourMode;
|
||||
effectColour = other.effectColour;
|
||||
}
|
||||
Weapon& operator=(const Weapon& other) {
|
||||
name = other.name;
|
||||
type = other.type;
|
||||
parts = Containers::Array<WeaponPart>{other.parts.size()};
|
||||
for(UnsignedInt i = 0; i < parts.size(); i++) {
|
||||
parts[i] = other.parts[i];
|
||||
}
|
||||
customStyles = other.customStyles;
|
||||
attached = other.attached;
|
||||
damageType = other.damageType;
|
||||
dualWield = other.dualWield;
|
||||
effectColourMode = other.effectColourMode;
|
||||
effectColour = other.effectColour;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Weapon(Weapon&& other) = default;
|
||||
Weapon& operator=(Weapon&& other) = default;
|
||||
|
||||
std::string name;
|
||||
std::string type;
|
||||
Containers::Array<WeaponPart> parts;
|
||||
|
|
|
@ -651,19 +651,13 @@ 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]; \
|
||||
} \
|
||||
|
@ -672,10 +666,6 @@ void SaveTool::drawWeapons() {
|
|||
} \
|
||||
\
|
||||
std::swap(_currentMass->array()[index], _currentMass->array()[i]); \
|
||||
} \
|
||||
else { \
|
||||
_currentMass->array()[i] = _currentMass->array()[index]; \
|
||||
} \
|
||||
(dirty) = true; \
|
||||
} \
|
||||
\
|
||||
|
|
Loading…
Reference in a new issue