mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-09 18:44:46 +00:00
Use the generated goto_frame.xml.h file in cmd_goto_frame.cpp
This commit is contained in:
parent
63aac49f81
commit
52d091810b
@ -19,6 +19,8 @@
|
|||||||
#include "doc/sprite.h"
|
#include "doc/sprite.h"
|
||||||
#include "ui/window.h"
|
#include "ui/window.h"
|
||||||
|
|
||||||
|
#include "goto_frame.xml.h"
|
||||||
|
|
||||||
namespace app {
|
namespace app {
|
||||||
|
|
||||||
using namespace ui;
|
using namespace ui;
|
||||||
@ -117,17 +119,15 @@ protected:
|
|||||||
|
|
||||||
frame_t onGetFrame(Editor* editor) override {
|
frame_t onGetFrame(Editor* editor) override {
|
||||||
if (m_frame == 0) {
|
if (m_frame == 0) {
|
||||||
base::UniquePtr<Window> window(app::load_widget<Window>("goto_frame.xml", "goto_frame"));
|
app::gen::GotoFrame window;
|
||||||
Widget* frame = app::find_widget<Widget>(window, "frame");
|
|
||||||
Widget* ok = app::find_widget<Widget>(window, "ok");
|
|
||||||
|
|
||||||
frame->setTextf("%d", editor->frame()+1);
|
window.frame()->setTextf("%d", editor->frame()+1);
|
||||||
|
|
||||||
window->openWindowInForeground();
|
window.openWindowInForeground();
|
||||||
if (window->getKiller() != ok)
|
if (window.getKiller() != window.ok())
|
||||||
return editor->frame();
|
return editor->frame();
|
||||||
|
|
||||||
m_frame = frame->getTextInt();
|
m_frame = window.frame()->getTextInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
return MID(0, m_frame-1, editor->sprite()->lastFrame());
|
return MID(0, m_frame-1, editor->sprite()->lastFrame());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user