QTfrontend/gameuiconfig.cpp
changeset 603 d7877468653b
parent 578 6b0af3860192
child 646 ed610c2cd0a4
equal deleted inserted replaced
602:f7628ebfccde 603:d7877468653b
    17  */
    17  */
    18 
    18 
    19 #include <QMessageBox>
    19 #include <QMessageBox>
    20 #include <QCheckBox>
    20 #include <QCheckBox>
    21 #include <QLineEdit>
    21 #include <QLineEdit>
       
    22 #include <QDesktopWidget>
    22 
    23 
    23 #include "gameuiconfig.h"
    24 #include "gameuiconfig.h"
    24 #include "hwform.h"
    25 #include "hwform.h"
    25 #include "pages.h"
    26 #include "pages.h"
    26 #include "hwconsts.h"
    27 #include "hwconsts.h"
    42 
    43 
    43 	Form->ui.pageOptions->CBShowFPS->setChecked(value("fps/show", false).toBool());
    44 	Form->ui.pageOptions->CBShowFPS->setChecked(value("fps/show", false).toBool());
    44 	Form->ui.pageOptions->fpsedit->setValue(value("fps/interval", 27).toUInt());
    45 	Form->ui.pageOptions->fpsedit->setValue(value("fps/interval", 27).toUInt());
    45 
    46 
    46 	Form->ui.pageOptions->CBAltDamage->setChecked(value("misc/altdamage", false).toBool());
    47 	Form->ui.pageOptions->CBAltDamage->setChecked(value("misc/altdamage", false).toBool());
       
    48 
       
    49 	QDesktopWidget desktop;
       
    50 	depth = desktop.depth();
       
    51 	if (depth < 16) depth = 16;
       
    52 	else if (depth > 16) depth = 32;
    47 }
    53 }
    48 
    54 
    49 QStringList GameUIConfig::GetTeamsList()
    55 QStringList GameUIConfig::GetTeamsList()
    50 {
    56 {
    51 	QStringList teamslist = cfgdir->entryList(QStringList("*.cfg"));
    57 	QStringList teamslist = cfgdir->entryList(QStringList("*.cfg"));
    52 	QStringList cleanedList;
    58 	QStringList cleanedList;
    53 	for (QStringList::Iterator it = teamslist.begin(); it != teamslist.end(); ++it ) {
    59 	for (QStringList::Iterator it = teamslist.begin(); it != teamslist.end(); ++it ) {
    54 	  QString tmpTeamStr=(*it).replace(QRegExp("^(.*).cfg$"), "\\1");
    60 	  QString tmpTeamStr=(*it).replace(QRegExp("^(.*)\\.cfg$"), "\\1");
    55 	  cleanedList.push_back(tmpTeamStr);
    61 	  cleanedList.push_back(tmpTeamStr);
    56 	}
    62 	}
    57 	return cleanedList;
    63 	return cleanedList;
    58 }
    64 }
    59 
    65 
   107 
   113 
   108 quint8 GameUIConfig::timerInterval()
   114 quint8 GameUIConfig::timerInterval()
   109 {
   115 {
   110 	return 35 - Form->ui.pageOptions->fpsedit->value();
   116 	return 35 - Form->ui.pageOptions->fpsedit->value();
   111 }
   117 }
       
   118 
       
   119 quint8 GameUIConfig::bitDepth()
       
   120 {
       
   121 	return depth;
       
   122 }