Compare commits
No commits in common. "c054169124c63b701453a9a5affa1427e1b733d7" and "d0a3375d7ab5067cb9bfdf64ce9448290151f13b" have entirely different histories.
c054169124
...
d0a3375d7a
3 changed files with 556 additions and 620 deletions
File diff suppressed because it is too large
Load diff
|
@ -15,7 +15,6 @@
|
|||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include <Corrade/Containers/ScopeGuard.h>
|
||||
#include <Corrade/Utility/Format.h>
|
||||
|
||||
#include <Magnum/ImGuiIntegration/Integration.h>
|
||||
|
||||
|
@ -496,7 +495,7 @@ void SaveTool::drawAccessoryEditor(Accessory& accessory, Containers::ArrayView<C
|
|||
ImGui::TextUnformatted("Accessory: <none>");
|
||||
}
|
||||
else if(accessories.find(accessory.id) != accessories.cend()) {
|
||||
ImGui::Text("Accessory #%.4i - %s", accessory.id, accessories.at(accessory.id).name.data());
|
||||
ImGui::Text("Accessory #%i - %s", accessory.id, accessories.at(accessory.id).data());
|
||||
}
|
||||
else {
|
||||
ImGui::Text("Accessory #%i", accessory.id);
|
||||
|
@ -506,10 +505,12 @@ void SaveTool::drawAccessoryEditor(Accessory& accessory, Containers::ArrayView<C
|
|||
ImGui::SameLine();
|
||||
|
||||
static Int tab = 0;
|
||||
static Containers::Optional<AccessorySize> size = Containers::NullOpt;
|
||||
if(ImGui::SmallButton("Change")) {
|
||||
ImGui::OpenPopup("##AccessoryPopup");
|
||||
if(accessory.id >= 3000) {
|
||||
if(accessory.id < 1000) {
|
||||
tab = 0;
|
||||
}
|
||||
else if(accessory.id >= 3000) {
|
||||
tab = 3;
|
||||
}
|
||||
else if(accessory.id >= 2000) {
|
||||
|
@ -518,18 +519,9 @@ void SaveTool::drawAccessoryEditor(Accessory& accessory, Containers::ArrayView<C
|
|||
else if(accessory.id >= 1000) {
|
||||
tab = 1;
|
||||
}
|
||||
else {
|
||||
tab = 0;
|
||||
}
|
||||
}
|
||||
if(ImGui::BeginPopup("##AccessoryPopup")) {
|
||||
static const char* size_labels[] = {
|
||||
"S",
|
||||
"M",
|
||||
"L",
|
||||
"XL"
|
||||
};
|
||||
static const Float selectable_width = 90.0f;
|
||||
Float selectable_width = 90.0f;
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, {0.5f, 0.0f});
|
||||
if(ImGui::Selectable("Primitives", tab == 0, ImGuiSelectableFlags_DontClosePopups, {selectable_width, 0.0f})) {
|
||||
|
@ -557,56 +549,10 @@ void SaveTool::drawAccessoryEditor(Accessory& accessory, Containers::ArrayView<C
|
|||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, {0.5f, 0.0f});
|
||||
if(ImGui::Selectable("All", !size, ImGuiSelectableFlags_DontClosePopups, {70.0f, 0.0f})) {
|
||||
size = Containers::NullOpt;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical);
|
||||
ImGui::SameLine();
|
||||
if(ImGui::Selectable("S", size && *size == AccessorySize::S, ImGuiSelectableFlags_DontClosePopups, {70.0f, 0.0f})) {
|
||||
if(!size) {
|
||||
size.emplace();
|
||||
}
|
||||
*size = AccessorySize::S;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical);
|
||||
ImGui::SameLine();
|
||||
if(ImGui::Selectable("M", size && *size == AccessorySize::M, ImGuiSelectableFlags_DontClosePopups, {70.0f, 0.0f})) {
|
||||
if(!size) {
|
||||
size.emplace();
|
||||
}
|
||||
*size = AccessorySize::M;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical);
|
||||
ImGui::SameLine();
|
||||
if(ImGui::Selectable("L", size && *size == AccessorySize::L, ImGuiSelectableFlags_DontClosePopups, {70.0f, 0.0f})) {
|
||||
if(!size) {
|
||||
size.emplace();
|
||||
}
|
||||
*size = AccessorySize::L;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical);
|
||||
ImGui::SameLine();
|
||||
if(ImGui::Selectable("XL", size && *size == AccessorySize::XL, ImGuiSelectableFlags_DontClosePopups, {70.0f, 0.0f})) {
|
||||
if(!size) {
|
||||
size.emplace();
|
||||
}
|
||||
*size = AccessorySize::XL;
|
||||
}
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
if(ImGui::BeginListBox("##AccessoryListbox", {-1.0f, 0.0f})) {
|
||||
for(const auto& acc : accessories) {
|
||||
if(acc.first >= tab * 1000 && acc.first < ((tab + 1) * 1000) && (!size || *size == acc.second.size)) {
|
||||
if(ImGui::Selectable(Utility::format("#{:.4d} - {} ({})", acc.first, acc.second.name, size_labels[acc.second.size]).data(),
|
||||
acc.first == accessory.id))
|
||||
{
|
||||
if(acc.first >= tab * 1000 && acc.first < ((tab + 1) * 1000)) {
|
||||
if(ImGui::Selectable(acc.second.data(), acc.first == accessory.id)) {
|
||||
accessory.id = acc.first;
|
||||
accessory.attachIndex = 0;
|
||||
}
|
||||
|
|
|
@ -160,6 +160,7 @@ auto PropertySerialiser::deserialise(Containers::String name, Containers::String
|
|||
auto serialiser = getSerialiser(type);
|
||||
|
||||
if(serialiser == nullptr) {
|
||||
LOG_ERROR_FORMAT("No valid serialiser found for property type {}.", type);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -181,6 +182,7 @@ auto PropertySerialiser::serialise(UnrealPropertyBase::ptr& prop, Containers::St
|
|||
{
|
||||
auto serialiser = getSerialiser(item_type);
|
||||
if(!serialiser) {
|
||||
LOG_ERROR_FORMAT("No valid serialiser found for property type {}.", item_type);
|
||||
return false;
|
||||
}
|
||||
return serialiser->serialise(prop, bytes_written, writer, *this);
|
||||
|
|
Loading…
Reference in a new issue