Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "toonz/txshlevel.h"
Toshihiro Shimizu 890ddd
#include "toonz/txshleveltypes.h"
Toshihiro Shimizu 890ddd
#include "toonz/hook.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
TXshLevel::TXshLevel(ClassCode code, std::wstring name)
Shinya Kitaoka 120a6e
    : TSmartObject(code)
Shinya Kitaoka 120a6e
    , m_name(name)
Shinya Kitaoka 120a6e
    , m_type(UNKNOWN_XSHLEVEL)
Shinya Kitaoka 120a6e
    , m_hookSet(new HookSet())
Shinya Kitaoka 120a6e
    , m_scene(0) {
Shinya Kitaoka 120a6e
  updateShortName();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
TXshLevel::~TXshLevel() { delete m_hookSet; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void TXshLevel::setScene(ToonzScene *scene) { m_scene = scene; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void TXshLevel::setName(std::wstring name) {
Shinya Kitaoka 120a6e
  m_name = name;
Shinya Kitaoka 120a6e
  updateShortName();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void TXshLevel::updateShortName() {
Shinya Kitaoka 120a6e
  if (m_name.size() < 5)
Shinya Kitaoka 120a6e
    m_shortName = m_name;
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    m_shortName = m_name.substr(0, 4) + L"~";
Toshihiro Shimizu 890ddd
}