diff --git a/src/imgui/window/timeline.cpp b/src/imgui/window/timeline.cpp index a67c272..642b975 100644 --- a/src/imgui/window/timeline.cpp +++ b/src/imgui/window/timeline.cpp @@ -1141,101 +1141,6 @@ namespace anm2ed::imgui ImGui::PopStyleColor(4); - ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, style.WindowPadding); - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, style.ItemSpacing); - auto& imguiStyle = ImGui::GetStyle(); - auto previousTooltipFlags = imguiStyle.HoverFlagsForTooltipMouse; - auto previousTooltipDelay = imguiStyle.HoverDelayNormal; - imguiStyle.HoverFlagsForTooltipMouse = ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayNormal | - ImGuiHoveredFlags_AllowWhenDisabled | - ImGuiHoveredFlags_NoSharedDelay; - imguiStyle.HoverDelayNormal = FRAME_TOOLTIP_HOVER_DELAY; - bool showFrameTooltip = ImGui::BeginItemTooltip(); - imguiStyle.HoverFlagsForTooltipMouse = previousTooltipFlags; - imguiStyle.HoverDelayNormal = previousTooltipDelay; - - if (showFrameTooltip) - { - if (type != anm2::TRIGGER) - { - auto cropX = frame.crop.x; - auto cropY = frame.crop.y; - auto sizeX = frame.size.x; - auto sizeY = frame.size.y; - auto pivotX = frame.pivot.x; - auto pivotY = frame.pivot.y; - auto scaleX = frame.scale.x; - auto scaleY = frame.scale.y; - auto rotationValue = frame.rotation; - auto durationValue = frame.duration; - auto tintR = math::float_to_uint8(frame.tint.r); - auto tintG = math::float_to_uint8(frame.tint.g); - auto tintB = math::float_to_uint8(frame.tint.b); - auto tintA = math::float_to_uint8(frame.tint.a); - auto visibleLabel = frame.isVisible ? localize.get(BASIC_YES) : localize.get(BASIC_NO); - auto interpolatedLabel = frame.isInterpolated ? localize.get(BASIC_YES) : localize.get(BASIC_NO); - - ImGui::PushFont(resources.fonts[font::BOLD].get(), font::SIZE); - ImGui::Text("%s %s", localize.get(anm2::TYPE_STRINGS[type]), localize.get(BASIC_FRAME)); - ImGui::PopFont(); - - auto indexValue = (int)i; - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_INDEX), std::make_format_args(indexValue)).c_str()); - - if (type == anm2::LAYER) - { - - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_CROP), std::make_format_args(cropX, cropY)).c_str()); - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_SIZE), std::make_format_args(sizeX, sizeY)).c_str()); - } - - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_POSITION), std::make_format_args(sizeX, sizeY)).c_str()); - - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_PIVOT), std::make_format_args(pivotX, pivotY)).c_str()); - - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_SCALE), std::make_format_args(scaleX, scaleY)).c_str()); - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_ROTATION), std::make_format_args(rotationValue)).c_str()); - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_DURATION), std::make_format_args(durationValue)).c_str()); - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_TINT), std::make_format_args(tintR, tintG, tintB, tintA)).c_str()); - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_COLOR_OFFSET), std::make_format_args(tintR, tintG, tintB)) - .c_str()); - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_VISIBLE), std::make_format_args(visibleLabel)).c_str()); - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_INTERPOLATED), std::make_format_args(interpolatedLabel)).c_str()); - } - else - { - auto atFrameValue = frame.atFrame; - auto eventLabel = document.event.labels[frame.eventID + 1]; - auto soundLabel = document.sound.labels[frame.soundID + 1]; - - ImGui::PushFont(resources.fonts[font::BOLD].get(), font::SIZE); - ImGui::Text("%s %s", localize.get(anm2::TYPE_STRINGS[type]), localize.get(BASIC_FRAME)); - ImGui::PopFont(); - - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_AT_FRAME), std::make_format_args(atFrameValue)).c_str()); - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_EVENT_LABEL), std::make_format_args(eventLabel)).c_str()); - ImGui::TextUnformatted( - std::vformat(localize.get(FORMAT_SOUND_LABEL), std::make_format_args(soundLabel)).c_str()); - } - - ImGui::EndTooltip(); - } - ImGui::PopStyleVar(2); - if (ImGui::IsItemHovered() && ImGui::IsMouseDown(ImGuiMouseButton_Left)) { if (ImGui::IsMouseDown(ImGuiMouseButton_Left))