buncha slop
This commit is contained in:
1 parent
f00396bdfe
commit
80ef3f8597
16 files changed
+405
-43
No files matched your search
@@ -997,7 +997,7 @@ namespace anm2ed::imgui
|
||||
sync_checker_pan();
|
||||
render_checker_background(ImGui::GetWindowDrawList(), min, max, -size - checkerPan, CHECKER_SIZE);
|
||||
}
|
||||
ImGui::Image(texture, to_imvec2(size));
|
||||
image_premultiplied_draw(texture, to_imvec2(size));
|
||||
|
||||
isPreviewHovered = ImGui::IsItemHovered();
|
||||
|
||||
|
||||
@@ -60,7 +60,9 @@ namespace anm2ed::imgui
|
||||
if (auto layer = anm2.element_get(ElementType::LAYER_ELEMENT, reference.itemID)) return layer->spritesheetId;
|
||||
return -1;
|
||||
};
|
||||
if (auto selectedLayerSpritesheet = selected_layer_spritesheet_get(); selectedLayerSpritesheet != -1)
|
||||
if (auto selectedLayerSpritesheet = selected_layer_spritesheet_get();
|
||||
selectedLayerSpritesheet != -1 && document.editTarget != Document::EditTarget::REGION &&
|
||||
document.editTarget != Document::EditTarget::SPRITESHEET)
|
||||
referenceSpritesheet = selectedLayerSpritesheet;
|
||||
auto spritesheet = anm2.element_get(ElementType::SPRITESHEET, referenceSpritesheet);
|
||||
auto texture = document.texture_get(referenceSpritesheet);
|
||||
@@ -257,7 +259,11 @@ namespace anm2ed::imgui
|
||||
frame && reference.itemID > -1 && layer && layer->spritesheetId == referenceSpritesheet;
|
||||
|
||||
int highlightedRegionId = -1;
|
||||
if (isReferenceLayerOnSpritesheet && frame->regionId != -1 && region_get(frame->regionId))
|
||||
if (document.editTarget == Document::EditTarget::REGION && regionReference != -1 && region_get(regionReference))
|
||||
{
|
||||
highlightedRegionId = regionReference;
|
||||
}
|
||||
else if (isReferenceLayerOnSpritesheet && frame->regionId != -1 && region_get(frame->regionId))
|
||||
{
|
||||
highlightedRegionId = frame->regionId;
|
||||
}
|
||||
@@ -318,7 +324,7 @@ namespace anm2ed::imgui
|
||||
render_checker_background(drawList, min, max, -size * 0.5f - checkerPan, CHECKER_SIZE);
|
||||
else
|
||||
drawList->AddRectFilled(min, max, ImGui::GetColorU32(to_imvec4(vec4(backgroundColor, 1.0f))));
|
||||
ImGui::Image(this->texture, to_imvec2(size));
|
||||
image_premultiplied_draw(this->texture, to_imvec2(size));
|
||||
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
@@ -612,8 +618,12 @@ namespace anm2ed::imgui
|
||||
|
||||
auto region_selection_set = [&](int id)
|
||||
{
|
||||
document.editTarget = Document::EditTarget::REGION;
|
||||
regionReference = id;
|
||||
regionSelection = {id};
|
||||
manager.command_push({manager.selected, [=](Manager&, Document& document)
|
||||
{
|
||||
document.editTarget = Document::EditTarget::REGION;
|
||||
document.region.reference = id;
|
||||
document.region.selection = {id};
|
||||
}});
|
||||
@@ -665,12 +675,13 @@ namespace anm2ed::imgui
|
||||
|
||||
auto& toolInfo = tool::INFO[useTool];
|
||||
auto& areaType = toolInfo.areaType;
|
||||
auto selectedFrameToolReferences = selectedFrameReferences;
|
||||
auto isRegionEditTarget = document.editTarget == Document::EditTarget::REGION;
|
||||
auto selectedFrameToolReferences = isRegionEditTarget ? std::set<Reference>{} : selectedFrameReferences;
|
||||
bool isAreaAllowed = areaType == tool::ALL || areaType == tool::SPRITESHEET_EDITOR;
|
||||
bool isFrameRequired =
|
||||
!(useTool == tool::PAN || useTool == tool::DRAW || useTool == tool::ERASE || useTool == tool::COLOR_PICKER);
|
||||
bool isMultiFrameToolSelection = selectedFrameToolReferences.size() > 1;
|
||||
bool isRegionInUse = !isMultiFrameToolSelection && frame && frame->regionId != -1 &&
|
||||
bool isRegionInUse = !isRegionEditTarget && !isMultiFrameToolSelection && frame && frame->regionId != -1 &&
|
||||
(useTool == tool::CROP || useTool == tool::MOVE);
|
||||
bool isFrameAvailable = !isFrameRequired || (frame && !isRegionInUse && !selectedFrameToolReferences.empty()) ||
|
||||
(useTool == tool::CROP && !regionSelection.empty()) ||
|
||||
@@ -709,7 +720,7 @@ namespace anm2ed::imgui
|
||||
if (isMouseDown || isMouseMiddleDown) pan += mouseDelta;
|
||||
break;
|
||||
case tool::MOVE:
|
||||
if ((isRegionInUse || selectedFrameReferences.empty()) && regionReference != -1)
|
||||
if ((isRegionEditTarget || isRegionInUse || selectedFrameToolReferences.empty()) && regionReference != -1)
|
||||
{
|
||||
if (!spritesheet) break;
|
||||
auto region = region_get(regionReference);
|
||||
@@ -770,7 +781,7 @@ namespace anm2ed::imgui
|
||||
if (isEnd) document_change_push(Document::FRAMES);
|
||||
break;
|
||||
case tool::CROP:
|
||||
if ((isRegionInUse || selectedFrameReferences.empty()) && !regionSelection.empty())
|
||||
if ((isRegionEditTarget || isRegionInUse || selectedFrameToolReferences.empty()) && !regionSelection.empty())
|
||||
{
|
||||
if (!spritesheet || regionSelection.empty()) break;
|
||||
if (isBegin) snapshot_push(EDIT_REGION_CROP);
|
||||
|
||||
+243
-16
@@ -5,6 +5,7 @@
|
||||
#include <cstdint>
|
||||
#include <format>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
|
||||
#include <imgui_internal.h>
|
||||
@@ -265,12 +266,14 @@ namespace anm2ed::imgui
|
||||
auto frame_selection_set_for = [&](Document& targetDocument, Reference frameReference)
|
||||
{
|
||||
group_selection_reset_for(targetDocument);
|
||||
targetDocument.editTarget = Document::EditTarget::FRAME;
|
||||
targetDocument.frame_references_set({frameReference});
|
||||
frames_selection_sync_for(targetDocument);
|
||||
};
|
||||
auto frame_selection_toggle_for = [&](Document& targetDocument, Reference frameReference)
|
||||
{
|
||||
group_selection_reset_for(targetDocument);
|
||||
targetDocument.editTarget = Document::EditTarget::FRAME;
|
||||
auto selection = targetDocument.frame_references_get(Document::FrameReferenceFallback::NONE);
|
||||
auto itemReference = item_reference_from_frame_get(frameReference);
|
||||
if (selection.contains(frameReference))
|
||||
@@ -295,6 +298,7 @@ namespace anm2ed::imgui
|
||||
Reference lastReference, bool isAdditive) -> bool
|
||||
{
|
||||
group_selection_reset_for(targetDocument);
|
||||
targetDocument.editTarget = Document::EditTarget::FRAME;
|
||||
if (!is_same_item(firstReference, lastReference) || firstReference.frameIndex < 0 || lastReference.frameIndex < 0)
|
||||
return false;
|
||||
|
||||
@@ -335,7 +339,10 @@ namespace anm2ed::imgui
|
||||
{
|
||||
auto& targetReference = targetDocument.reference;
|
||||
if (targetReference.frameIndex >= 0)
|
||||
{
|
||||
targetDocument.editTarget = Document::EditTarget::FRAME;
|
||||
targetDocument.frame_references_set({targetReference});
|
||||
}
|
||||
else
|
||||
targetDocument.frame_references_clear();
|
||||
frameSelectionSnapshot.assign(targetDocument.frames.selection.begin(), targetDocument.frames.selection.end());
|
||||
@@ -570,6 +577,168 @@ namespace anm2ed::imgui
|
||||
{ frames_delete_for(document, selectedFrames); });
|
||||
};
|
||||
|
||||
auto frames_duplicate = [&]()
|
||||
{
|
||||
auto selectedFrames = frame_references_for_current_get();
|
||||
std::erase_if(selectedFrames,
|
||||
[](const Reference& frameReference) { return frameReference.itemType == TRIGGER; });
|
||||
if (selectedFrames.empty()) return;
|
||||
|
||||
edit_command_push(EDIT_DUPLICATE_FRAMES, Document::FRAMES,
|
||||
[=, this](Manager&, Document& document) mutable
|
||||
{
|
||||
std::map<Reference, std::set<int>> groupedFrames{};
|
||||
for (auto frameReference : selectedFrames)
|
||||
{
|
||||
auto itemReference = item_reference_from_frame_get(frameReference);
|
||||
groupedFrames[itemReference].insert(frameReference.frameIndex);
|
||||
}
|
||||
|
||||
std::set<Reference> duplicatedSelection{};
|
||||
auto newReference = document.reference;
|
||||
bool isReferenceSet{};
|
||||
|
||||
for (auto& [itemReference, indices] : groupedFrames)
|
||||
{
|
||||
auto item = command_item_get(document, itemReference.animationIndex,
|
||||
itemReference.itemType, itemReference.itemID);
|
||||
if (!item) continue;
|
||||
|
||||
std::vector<int> validIndices{};
|
||||
std::vector<Element> duplicatedFrames{};
|
||||
for (auto i : indices)
|
||||
{
|
||||
if (!vector::in_bounds(item->children, i)) continue;
|
||||
validIndices.push_back(i);
|
||||
duplicatedFrames.push_back(item->children[i]);
|
||||
}
|
||||
if (validIndices.empty()) continue;
|
||||
|
||||
auto insertIndex = validIndices.back() + 1;
|
||||
item->children.insert(item->children.begin() + insertIndex,
|
||||
std::make_move_iterator(duplicatedFrames.begin()),
|
||||
std::make_move_iterator(duplicatedFrames.end()));
|
||||
|
||||
for (int offset = 0; offset < (int)validIndices.size(); ++offset)
|
||||
{
|
||||
auto targetReference = Reference{itemReference.animationIndex, itemReference.itemType,
|
||||
itemReference.itemID, insertIndex + offset};
|
||||
duplicatedSelection.insert(targetReference);
|
||||
auto sourceReference = Reference{itemReference.animationIndex, itemReference.itemType,
|
||||
itemReference.itemID, validIndices[offset]};
|
||||
if (sourceReference == document.reference)
|
||||
{
|
||||
newReference = targetReference;
|
||||
isReferenceSet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (duplicatedSelection.empty()) return;
|
||||
document.reference = isReferenceSet ? newReference : *duplicatedSelection.begin();
|
||||
document.frame_references_set(std::move(duplicatedSelection));
|
||||
if (auto item = command_item_get(document, document.reference.animationIndex,
|
||||
document.reference.itemType, document.reference.itemID))
|
||||
document.frameTime = frame_time_from_index_get(*item, document.reference.frameIndex);
|
||||
frames_selection_sync_for(document);
|
||||
frameSelectionSnapshotReference = document.reference;
|
||||
frameSelectionLocked.clear();
|
||||
isFrameSelectionLocked = false;
|
||||
frameFocusIndex = document.reference.frameIndex;
|
||||
frameFocusRequested = true;
|
||||
});
|
||||
};
|
||||
|
||||
auto is_frames_reverse_available = [&](std::set<Reference> selectedFrames)
|
||||
{
|
||||
std::map<Reference, int> counts{};
|
||||
std::erase_if(selectedFrames,
|
||||
[](const Reference& frameReference) { return frameReference.itemType == TRIGGER; });
|
||||
for (auto frameReference : selectedFrames)
|
||||
{
|
||||
auto itemReference = item_reference_from_frame_get(frameReference);
|
||||
++counts[itemReference];
|
||||
}
|
||||
return std::ranges::any_of(counts, [](const auto& item) { return item.second >= 2; });
|
||||
};
|
||||
|
||||
auto frames_reverse = [&]()
|
||||
{
|
||||
auto selectedFrames = frame_references_for_current_get();
|
||||
std::erase_if(selectedFrames,
|
||||
[](const Reference& frameReference) { return frameReference.itemType == TRIGGER; });
|
||||
if (!is_frames_reverse_available(selectedFrames)) return;
|
||||
|
||||
edit_command_push(EDIT_REVERSE_FRAMES, Document::FRAMES,
|
||||
[=, this](Manager&, Document& document) mutable
|
||||
{
|
||||
std::map<Reference, std::set<int>> groupedFrames{};
|
||||
for (auto frameReference : selectedFrames)
|
||||
{
|
||||
auto itemReference = item_reference_from_frame_get(frameReference);
|
||||
groupedFrames[itemReference].insert(frameReference.frameIndex);
|
||||
}
|
||||
|
||||
std::set<Reference> reversedSelection{};
|
||||
auto newReference = document.reference;
|
||||
bool isReferenceSet{};
|
||||
|
||||
for (auto& [itemReference, indices] : groupedFrames)
|
||||
{
|
||||
auto item = command_item_get(document, itemReference.animationIndex,
|
||||
itemReference.itemType, itemReference.itemID);
|
||||
if (!item || indices.size() < 2) continue;
|
||||
|
||||
std::vector<int> validIndices{};
|
||||
std::vector<Element> reversedFrames{};
|
||||
for (auto i : indices)
|
||||
{
|
||||
if (!vector::in_bounds(item->children, i)) continue;
|
||||
validIndices.push_back(i);
|
||||
reversedFrames.push_back(std::move(item->children[i]));
|
||||
}
|
||||
if (validIndices.size() < 2) continue;
|
||||
|
||||
auto insertIndex = validIndices.front();
|
||||
for (auto it = validIndices.rbegin(); it != validIndices.rend(); ++it)
|
||||
item->children.erase(item->children.begin() + *it);
|
||||
|
||||
std::ranges::reverse(reversedFrames);
|
||||
item->children.insert(item->children.begin() + insertIndex,
|
||||
std::make_move_iterator(reversedFrames.begin()),
|
||||
std::make_move_iterator(reversedFrames.end()));
|
||||
|
||||
for (int offset = 0; offset < (int)validIndices.size(); ++offset)
|
||||
{
|
||||
auto targetReference = Reference{itemReference.animationIndex, itemReference.itemType,
|
||||
itemReference.itemID, insertIndex + offset};
|
||||
reversedSelection.insert(targetReference);
|
||||
auto sourceIndex = validIndices[(int)validIndices.size() - 1 - offset];
|
||||
auto sourceReference = Reference{itemReference.animationIndex, itemReference.itemType,
|
||||
itemReference.itemID, sourceIndex};
|
||||
if (sourceReference == document.reference)
|
||||
{
|
||||
newReference = targetReference;
|
||||
isReferenceSet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (reversedSelection.empty()) return;
|
||||
document.reference = isReferenceSet ? newReference : *reversedSelection.begin();
|
||||
document.frame_references_set(std::move(reversedSelection));
|
||||
if (auto item = command_item_get(document, document.reference.animationIndex,
|
||||
document.reference.itemType, document.reference.itemID))
|
||||
document.frameTime = frame_time_from_index_get(*item, document.reference.frameIndex);
|
||||
frames_selection_sync_for(document);
|
||||
frameSelectionSnapshotReference = document.reference;
|
||||
frameSelectionLocked.clear();
|
||||
isFrameSelectionLocked = false;
|
||||
frameFocusIndex = document.reference.frameIndex;
|
||||
frameFocusRequested = true;
|
||||
});
|
||||
};
|
||||
|
||||
auto frames_bake = [&]()
|
||||
{
|
||||
auto selectedFrames = frame_references_for_current_get();
|
||||
@@ -728,7 +897,7 @@ namespace anm2ed::imgui
|
||||
auto isMatchRootInterpolation = settings.bakeIsMatchRootInterpolation;
|
||||
auto isUseRootPivot = settings.bakeIsUseRootPivot;
|
||||
edit_command_push(EDIT_BAKE_INTO_OTHER_FRAMES, Document::FRAMES,
|
||||
[=](Manager&, Document& document) mutable
|
||||
[=, this](Manager&, Document& document) mutable
|
||||
{
|
||||
auto animation = command_animation_get(document, document.reference.animationIndex);
|
||||
if (!animation) return;
|
||||
@@ -789,25 +958,72 @@ namespace anm2ed::imgui
|
||||
}
|
||||
}
|
||||
|
||||
std::set<int> selectedRootFrameIndices{};
|
||||
for (auto rootReference : selectedRootFrames)
|
||||
{
|
||||
auto rootFrame = command_frame_get(document, rootReference);
|
||||
if (!rootFrame) continue;
|
||||
rootFrame->position = {};
|
||||
rootFrame->scale = {100.0f, 100.0f};
|
||||
rootFrame->rotation = {};
|
||||
rootFrame->tint = types::color::WHITE;
|
||||
rootFrame->colorOffset = {};
|
||||
selectedRootFrameIndices.insert(rootReference.frameIndex);
|
||||
}
|
||||
if (selectedRootFrameIndices.empty()) return;
|
||||
|
||||
std::vector<Element> rootFrames{};
|
||||
std::set<Reference> defaultRootSelection{};
|
||||
int frameIndex{};
|
||||
int rewrittenFrameIndex{};
|
||||
int defaultDuration{};
|
||||
auto default_root_frame_push = [&]()
|
||||
{
|
||||
if (defaultDuration <= 0) return;
|
||||
auto frame = element_make(ElementType::FRAME);
|
||||
frame.duration = glm::max(defaultDuration, FRAME_DURATION_MIN);
|
||||
defaultRootSelection.insert({document.reference.animationIndex, ROOT, -1,
|
||||
rewrittenFrameIndex});
|
||||
rootFrames.push_back(frame);
|
||||
++rewrittenFrameIndex;
|
||||
defaultDuration = 0;
|
||||
};
|
||||
|
||||
for (const auto& frame : root->children)
|
||||
{
|
||||
if (frame.type != ElementType::FRAME)
|
||||
{
|
||||
default_root_frame_push();
|
||||
rootFrames.push_back(frame);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (selectedRootFrameIndices.contains(frameIndex))
|
||||
defaultDuration += frame.duration;
|
||||
else
|
||||
{
|
||||
default_root_frame_push();
|
||||
rootFrames.push_back(frame);
|
||||
++rewrittenFrameIndex;
|
||||
}
|
||||
++frameIndex;
|
||||
}
|
||||
default_root_frame_push();
|
||||
|
||||
root->children = std::move(rootFrames);
|
||||
document.frame_references_set(std::move(defaultRootSelection));
|
||||
frames_selection_sync_for(document);
|
||||
frameSelectionSnapshotReference = document.reference;
|
||||
frameSelectionLocked.clear();
|
||||
isFrameSelectionLocked = false;
|
||||
frameFocusIndex = document.reference.frameIndex;
|
||||
frameFocusRequested = true;
|
||||
});
|
||||
};
|
||||
|
||||
std::optional<int> frameSplitTimeAtCursor;
|
||||
|
||||
auto frame_split = [&]()
|
||||
{
|
||||
auto selectedFrames = frame_references_for_current_get();
|
||||
if (selectedFrames.size() != 1) return;
|
||||
auto targetReference = *selectedFrames.begin();
|
||||
auto playheadTime = (int)std::floor(playback.time);
|
||||
auto splitTime = frameSplitTimeAtCursor.value_or((int)std::floor(playback.time));
|
||||
if (targetReference.itemType == TRIGGER) return;
|
||||
|
||||
edit_command_push(EDIT_SPLIT_FRAME, Document::FRAMES,
|
||||
@@ -826,7 +1042,7 @@ namespace anm2ed::imgui
|
||||
|
||||
auto frameStartTime = frame_time_from_index_get(*item, targetReference.frameIndex);
|
||||
int frameStart = (int)std::round(frameStartTime);
|
||||
int firstDuration = playheadTime - frameStart + 1;
|
||||
int firstDuration = splitTime - frameStart + 1;
|
||||
|
||||
if (firstDuration <= 0 || firstDuration >= originalDuration) return;
|
||||
|
||||
@@ -1597,6 +1813,7 @@ namespace anm2ed::imgui
|
||||
auto selectedBakeFrames = selectedFrames;
|
||||
std::erase_if(selectedBakeFrames,
|
||||
[](const Reference& frameReference) { return frameReference.itemType == TRIGGER; });
|
||||
auto isReverseFrames = is_frames_reverse_available(selectedFrames);
|
||||
auto selectedRootFrames = selected_root_frame_references_get();
|
||||
bool isMakeRegion = frame && reference.itemType == LAYER && reference.itemID != -1 && frame->regionId == -1 &&
|
||||
layer_get(reference.itemID) && spritesheet_get(layer_get(reference.itemID)->spritesheetId);
|
||||
@@ -1611,10 +1828,13 @@ namespace anm2ed::imgui
|
||||
.shortcut = SHORTCUT_INSERT_FRAME,
|
||||
.isEnabled = [&]() { return item; },
|
||||
.run = [&]() { frame_insert(); }});
|
||||
actions.add({.label = LABEL_DELETE,
|
||||
.shortcut = SHORTCUT_REMOVE,
|
||||
.isEnabled = [=]() { return !selectedFrames.empty(); },
|
||||
.run = [&]() { frames_delete_action(); }});
|
||||
actions.add(ACTION_DUPLICATE, [=]() { return !selectedBakeFrames.empty(); }, [&]() { frames_duplicate(); });
|
||||
actions.add({.label = LABEL_SPLIT,
|
||||
.shortcut = SHORTCUT_SPLIT,
|
||||
.isEnabled = [=]() { return selectedBakeFrames.size() == 1; },
|
||||
.run = [&]() { frame_split(); }});
|
||||
actions.add(ACTION_REVERSE, [=]() { return isReverseFrames; }, [&]() { frames_reverse(); });
|
||||
actions.separator();
|
||||
actions.add({.label = LABEL_BAKE,
|
||||
.shortcut = SHORTCUT_BAKE,
|
||||
.isEnabled = [=]() { return !selectedBakeFrames.empty(); },
|
||||
@@ -1627,15 +1847,17 @@ namespace anm2ed::imgui
|
||||
.shortcut = SHORTCUT_FIT,
|
||||
.isEnabled = [&]() { return animation && animation->frameNum != animation_length_get(*animation); },
|
||||
.run = [&]() { fit_animation_length(); }});
|
||||
actions.add({.label = LABEL_SPLIT,
|
||||
.shortcut = SHORTCUT_SPLIT,
|
||||
.isEnabled = [=]() { return selectedBakeFrames.size() == 1; },
|
||||
.run = [&]() { frame_split(); }});
|
||||
actions.separator();
|
||||
actions.add({.label = LABEL_MAKE_REGION,
|
||||
.shortcut = -1,
|
||||
.isEnabled = [&]() { return isMakeRegion; },
|
||||
.run = [&]() { make_region(); }});
|
||||
actions.separator();
|
||||
actions.add({.label = LABEL_DELETE,
|
||||
.shortcut = SHORTCUT_REMOVE,
|
||||
.isEnabled = [=]() { return !selectedFrames.empty(); },
|
||||
.run = [&]() { frames_delete_action(); }});
|
||||
actions.separator();
|
||||
actions.add(ACTION_CUT, [=]() { return !selectedFrames.empty(); }, cut);
|
||||
actions.add(ACTION_COPY, [=]() { return !selectedFrames.empty(); }, copy);
|
||||
actions.add(ACTION_PASTE, [&]() { return !clipboard.is_empty(); }, paste);
|
||||
@@ -2594,6 +2816,11 @@ namespace anm2ed::imgui
|
||||
auto framesSize = ImVec2(frameSize.x * length, frameSize.y);
|
||||
auto cursorPos = ImGui::GetCursorPos();
|
||||
auto cursorScreenPos = ImGui::GetCursorScreenPos();
|
||||
if (frameSize.x > 0.0f && ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem))
|
||||
{
|
||||
auto mouseX = ImGui::GetIO().MousePos.x - cursorScreenPos.x;
|
||||
frameSplitTimeAtCursor = glm::max(0, (int)std::floor(mouseX / frameSize.x));
|
||||
}
|
||||
auto border = glm::max(0.5f, ImGui::GetStyle().FrameBorderSize * 0.5f);
|
||||
auto borderLineLength = frameSize.y / 5;
|
||||
auto frameMin = std::max(0, (int)std::floor(scroll.x / frameSize.x) - 1);
|
||||
|
||||
@@ -1454,6 +1454,7 @@ namespace anm2ed::imgui
|
||||
ImGui::SetNextItemStorageID(id);
|
||||
if (ImGui::Selectable("##Region Selectable", isSelected, 0, regionChildSize))
|
||||
{
|
||||
document.editTarget = Document::EditTarget::REGION;
|
||||
reference = id;
|
||||
document.reference = {document.reference.animationIndex};
|
||||
frame.reference = -1;
|
||||
@@ -1511,7 +1512,6 @@ namespace anm2ed::imgui
|
||||
ImGui::TextUnformatted(nameCStr);
|
||||
ImGui::PopFont();
|
||||
|
||||
ImGui::TextUnformatted(std::vformat(localize.get(FORMAT_ID), std::make_format_args(id)).c_str());
|
||||
ImGui::TextUnformatted(
|
||||
std::vformat(localize.get(FORMAT_CROP), std::make_format_args(region->crop.x, region->crop.y))
|
||||
.c_str());
|
||||
@@ -2106,6 +2106,7 @@ namespace anm2ed::imgui
|
||||
ImGui::SetNextItemStorageID(id);
|
||||
if (ImGui::Selectable("##Spritesheet Selectable", isSelected, 0, spritesheetChildSize))
|
||||
{
|
||||
document.editTarget = Document::EditTarget::SPRITESHEET;
|
||||
reference = id;
|
||||
region.reference = -1;
|
||||
region.selection.clear();
|
||||
|
||||
Reference in new issue
Block a user