mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-31 13:29:07 +01:00
feat(editor): Help > Tutorial instead of First steps: seven lessons (looking around, laying track, curves, joining, switches, selecting and fixing, saving and driving), each with a looping clip from lang/editor_tutorial/<lesson>.gif played from the start on a click, the mouse buttons and keys drawn as pictures beside what they do, ticks that fill in when the user does it, a button that turns the right tool on, Back / Next and a dot per lesson that turns green when it is done
This commit is contained in:
56
editor/editorClips.hpp
Normal file
56
editor/editorClips.hpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace editor_clips
|
||||
{
|
||||
|
||||
class clip
|
||||
{
|
||||
public:
|
||||
clip() = default;
|
||||
~clip();
|
||||
clip(clip const &) = delete;
|
||||
clip &operator=(clip const &) = delete;
|
||||
|
||||
void open(std::string const &Path);
|
||||
void close();
|
||||
std::uint64_t texture(double const Seconds);
|
||||
bool loading() const;
|
||||
bool missing() const;
|
||||
int width() const;
|
||||
int height() const;
|
||||
std::string const &path() const
|
||||
{
|
||||
return m_path;
|
||||
}
|
||||
|
||||
private:
|
||||
struct frames
|
||||
{
|
||||
int width{0};
|
||||
int height{0};
|
||||
std::vector<std::uint8_t> rgba;
|
||||
std::vector<int> delays;
|
||||
std::atomic<bool> done{false};
|
||||
};
|
||||
std::string m_path;
|
||||
std::shared_ptr<frames> m_frames;
|
||||
std::uint64_t m_texture{0};
|
||||
int m_shown{-1};
|
||||
};
|
||||
|
||||
} // namespace editor_clips
|
||||
Reference in New Issue
Block a user