Пример #1
0
PaletteViewerPanel::PaletteViewerPanel(QWidget *parent) : TPanel(parent) {
  m_paletteHandle = new TPaletteHandle();
  connect(m_paletteHandle, SIGNAL(colorStyleSwitched()),
          SLOT(onColorStyleSwitched()));
  connect(m_paletteHandle, SIGNAL(paletteSwitched()),
          SLOT(onPaletteSwitched()));

  TApp *app       = TApp::instance();
  m_paletteViewer = new PaletteViewer(this, PaletteViewerGUI::LEVEL_PALETTE);
  m_paletteViewer->setPaletteHandle(
      app->getPaletteController()->getCurrentLevelPalette());
  m_paletteViewer->setFrameHandle(app->getCurrentFrame());
  m_paletteViewer->setXsheetHandle(app->getCurrentXsheet());
  // for clearing cache when paste style command called from the StyleSelection
  m_paletteViewer->setLevelHandle(app->getCurrentLevel());

  TSceneHandle *sceneHandle = app->getCurrentScene();
  connect(sceneHandle, SIGNAL(sceneSwitched()), SLOT(onSceneSwitched()));

  CurrentStyleChangeCommand *currentStyleChangeCommand =
      new CurrentStyleChangeCommand();
  m_paletteViewer->setChangeStyleCommand(currentStyleChangeCommand);

  setWidget(m_paletteViewer);
  initializeTitleBar();
}
PaletteController::PaletteController()
	: QObject(), m_currentLevelPalette(0), m_currentCleanupPalette(0), m_originalCurrentPalette(0), m_currentPalette(0), m_colorAutoApplyEnabled(true), m_colorSample()
{
	m_currentLevelPalette = new TPaletteHandle;
	m_currentCleanupPalette = new TPaletteHandle;
	m_currentPalette = new TPaletteHandle;

	QObject::connect(m_currentCleanupPalette, SIGNAL(paletteSwitched()), this, SLOT(editCleanupPalette()));
	QObject::connect(m_currentCleanupPalette, SIGNAL(colorStyleSwitched()), this, SLOT(editCleanupPalette()));

	QObject::connect(m_currentLevelPalette, SIGNAL(paletteSwitched()), this, SLOT(editLevelPalette()));
	QObject::connect(m_currentLevelPalette, SIGNAL(colorStyleSwitched()), this, SLOT(editLevelPalette()));
	//QObject::connect(m_currentLevelPalette, SIGNAL(colorStyleSwitched()), this, SLOT(setColorCheckIndex()));

	QObject::connect(m_currentLevelPalette, SIGNAL(paletteLockChanged()), this, SLOT(editLevelPalette()));
}
Пример #3
0
StudioPaletteViewerPanel::StudioPaletteViewerPanel(QWidget *parent)
    : TPanel(parent) {
  m_studioPaletteHandle = new TPaletteHandle();
  connect(m_studioPaletteHandle, SIGNAL(colorStyleSwitched()),
          SLOT(onColorStyleSwitched()));
  connect(m_studioPaletteHandle, SIGNAL(paletteSwitched()),
          SLOT(onPaletteSwitched()));

  connect(m_studioPaletteHandle, SIGNAL(paletteLockChanged()),
          SLOT(onPaletteSwitched()));

  TApp *app             = TApp::instance();
  m_studioPaletteViewer = new StudioPaletteViewer(
      this, m_studioPaletteHandle,
      app->getPaletteController()->getCurrentLevelPalette(),
      app->getCurrentFrame(), app->getCurrentXsheet(), app->getCurrentLevel());
  setWidget(m_studioPaletteViewer);
}