Exemple #1
0
EQStatList::EQStatList(EQPlayer* player,
                       QWidget* parent, 
                       const char* name)
  : SEQListView("StatList", parent, name),
    m_pPlayer(player)
{
   int i;

   m_guessMaxMana = 0;

   for (i = 0; i < LIST_MAXLIST; i++)
     m_statList[i] = NULL;

   // add columns
   addColumn("Stat");
   addColumn("Val", "Value");
   addColumn("Max");
   addColumn("%", "Percent");

   restoreColumns();

   QString statPrefName;
   for (int nloop = 0; nloop < LIST_MAXLIST; nloop++)
   {
     statPrefName.sprintf("show%s", statNames[nloop]);
     m_showStat[nloop] = pSEQPrefs->getPrefBool(statPrefName, 
						preferenceName(), false);
     updateStat(nloop);
   }

   connect (m_pPlayer, SIGNAL(statChanged(int,int,int)), 
	    this, SLOT(statChanged (int,int,int)));
   connect (m_pPlayer, SIGNAL(expChangedInt(int,int,int)),
	    this, SLOT(expChanged(int,int,int)));
   connect (m_pPlayer, SIGNAL(expAltChangedInt(int,int,int)),
	    this, SLOT(expAltChanged(int,int,int)));
   connect (m_pPlayer, SIGNAL(stamChanged(int,int,int,int,int,int)),
	    this, SLOT(stamChanged(int,int,int,int,int,int)));
   connect (m_pPlayer, SIGNAL(manaChanged(uint32_t,uint32_t)),
	    this, SLOT(manaChanged(uint32_t,uint32_t)));
   connect (m_pPlayer, SIGNAL(hpChanged(uint16_t, uint16_t)), 
	    this, SLOT(hpChanged(uint16_t, uint16_t)));

   // restore the columns
   restoreColumns();
}
Exemple #2
0
SkillList::SkillList(Player* player,
			 QWidget* parent, 
			 const char* name)
  : SEQListView("SkillList", parent, name), 
  m_pPlayer(player)
{
  int i;

  // initialize the lists
  for (i = 0; i < MAX_KNOWN_SKILLS; i++)
    m_skillList[i] = NULL;

  for (i = 0; i < MAX_KNOWN_LANGS; i++)
    m_languageList[i] = NULL;

  // add the columns
  addColumn("Skill");
  addColumn("Value");

  restoreColumns();

  // connect to player signals
   connect (m_pPlayer, SIGNAL(addSkill(int,int)), 
	    this, SLOT(addSkill(int,int)));
   connect (m_pPlayer, SIGNAL(changeSkill(int,int)), 
	    this, SLOT(changeSkill(int,int)));
   connect (m_pPlayer, SIGNAL(deleteSkills()), 
	    this, SLOT(deleteSkills()));
   connect (m_pPlayer, SIGNAL(addLanguage(int,int)), 
	    this, SLOT(addLanguage(int,int)));
   connect (m_pPlayer, SIGNAL(changeLanguage(int,int)), 
	    this, SLOT(changeLanguage(int,int)));
   connect (m_pPlayer, SIGNAL(deleteLanguages()), 
	    this, SLOT(deleteLanguages()));

   for (i = 0; i < MAX_KNOWN_SKILLS; i++)
     addSkill(i, m_pPlayer->getSkill(i));

   // show the languages or not according to the user preference
   m_showLanguages = pSEQPrefs->getPrefBool("ShowLanguages", preferenceName(),
					    true);
   if (m_showLanguages)
     addLanguages();
}
  std::vector<TRenderer::RenderData> *makeRenderData(
      ToonzScene *scene, const std::vector<int> &rows) {
    TRenderSettings settings =
        scene->getProperties()->getOutputProperties()->getRenderSettings();

    QList<bool> oldColumnStates;
    enableColumns(scene, oldColumnStates);

    std::vector<TRenderer::RenderData> *rds =
        new std::vector<TRenderer::RenderData>;
    for (int i = 0; i < (int)rows.size(); i++) {
      double frame = rows[i];
      TFxP sceneFx = buildSceneFx(scene, frame, 1, false);
      TFxPair fxPair;
      fxPair.m_frameA = sceneFx;
      rds->push_back(TRenderer::RenderData(frame, settings, fxPair));
    }

    restoreColumns(scene, oldColumnStates);
    return rds;
  }
SpawnPointList::SpawnPointList(SpawnMonitor* spawnMonitor, 
			       QWidget* parent, const char* name):
  SEQListView("SpawnPointList", parent, name),
  m_spawnMonitor(spawnMonitor),
  m_menu(NULL),
  m_aboutToPop(false)
{
  // get whether to keep the list sorted or not
  m_keepSorted = pSEQPrefs->getPrefBool("KeepSorted", preferenceName(), false);

  // add all the columns
  if (showeq_params->retarded_coords)
  {
    addColumn ("N/S", "Coord1");
    addColumn ("E/W", "Coord2");
  }
  else
  {
    addColumn ("X", "Coord1");
    addColumn ("Y", "Coord2");
  }
  addColumn("Z", "Coord3");
  addColumn("Remaining");
  addColumn("Name");
  addColumn("Last");
  addColumn("Spawned");
  addColumn("Count");

  // default sort is on remaining
  setSorting(tSpawnPointRemaining, true);

  // restore the columns settings from preferences
  restoreColumns();

  // put in all the spawn points that might already be present in
  // the spawn monitor
  QAsciiDictIterator<SpawnPoint> it( m_spawnMonitor->spawnPoints() );
  SpawnPoint*             sp;
  while ((sp = it.current()))
  {
    new SpawnPointListItem(this, sp);
    ++it;
  }

  // create the timer
  m_timer = new QTimer( this, "spawn-point-timer" );
  connect( m_timer, SIGNAL( timeout() ), this, SLOT( refresh() ) );


  connect(m_spawnMonitor, SIGNAL(newSpawnPoint(const SpawnPoint*)),
	  this, SLOT(newSpawnPoint(const SpawnPoint*)));
  connect(m_spawnMonitor, SIGNAL(clearSpawnPoints()),
	  this, SLOT(clear()));
  connect(m_spawnMonitor, SIGNAL(selectionChanged(const SpawnPoint*)),
	  this, SLOT(handleSelChanged(const SpawnPoint*)));
  connect(this, SIGNAL(rightButtonClicked(QListViewItem*, const QPoint&, int)),
	  this, SLOT(rightButtonClicked(QListViewItem*, const QPoint&, int)));
  connect(this, SIGNAL( selectionChanged(QListViewItem*)),
	  this, SLOT(handleSelectItem(QListViewItem*)));
  m_timer->start(10000L);
}