QTfrontend/gamecfgwidget.cpp
changeset 5468 8a7264a094fb
parent 5352 7f57d0c7816a
child 5717 6d513913b7a9
equal deleted inserted replaced
5466:a65aed0f38f1 5468:8a7264a094fb
    47     GBoxOptions->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    47     GBoxOptions->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    48     mainLayout.addWidget(GBoxOptions, 1, 0);
    48     mainLayout.addWidget(GBoxOptions, 1, 0);
    49 
    49 
    50     QGridLayout *GBoxOptionsLayout = new QGridLayout(GBoxOptions);
    50     QGridLayout *GBoxOptionsLayout = new QGridLayout(GBoxOptions);
    51 
    51 
    52     GBoxOptionsLayout->addWidget(new QLabel(QLabel::tr("Gameplay"), GBoxOptions), 0, 0);
    52     QLabel *titleLabel = new QLabel(QLabel::tr("Game Options"), GBoxOptions);
       
    53     titleLabel->setMargin(7);    // TODO: make the text larger/richer!!!!
       
    54     GBoxOptionsLayout->addWidget(titleLabel, 0, 0, 1, 0, Qt::AlignHCenter);
       
    55     GBoxOptionsLayout->addWidget(new QLabel(QLabel::tr("Style"), GBoxOptions), 1, 0);
    53 
    56 
    54     Scripts = new QComboBox(GBoxOptions);
    57     Scripts = new QComboBox(GBoxOptions);
    55     GBoxOptionsLayout->addWidget(Scripts, 0, 1);
    58     GBoxOptionsLayout->addWidget(Scripts, 1, 1);
    56 
    59 
    57     Scripts->addItem("Normal");
    60     Scripts->addItem("Normal");
    58     Scripts->insertSeparator(1);
    61     Scripts->insertSeparator(1);
    59 
    62 
    60     for (int i = 0; i < scriptList->size(); ++i) {
    63     for (int i = 0; i < scriptList->size(); ++i) {
    89     }
    92     }
    90 
    93 
    91     connect(Scripts, SIGNAL(currentIndexChanged(int)), this, SLOT(scriptChanged(int)));
    94     connect(Scripts, SIGNAL(currentIndexChanged(int)), this, SLOT(scriptChanged(int)));
    92 
    95 
    93     QWidget *SchemeWidget = new QWidget(GBoxOptions);
    96     QWidget *SchemeWidget = new QWidget(GBoxOptions);
    94     GBoxOptionsLayout->addWidget(SchemeWidget, 1, 0, 1, 2);
    97     GBoxOptionsLayout->addWidget(SchemeWidget, 2, 0, 1, 2);
    95 
    98 
    96     QGridLayout *SchemeWidgetLayout = new QGridLayout(SchemeWidget);
    99     QGridLayout *SchemeWidgetLayout = new QGridLayout(SchemeWidget);
    97     SchemeWidgetLayout->setMargin(0);
   100     SchemeWidgetLayout->setMargin(0);
    98 
   101 
    99     GameSchemes = new QComboBox(SchemeWidget);
   102     GameSchemes = new QComboBox(SchemeWidget);
   100     SchemeWidgetLayout->addWidget(GameSchemes, 0, 2);
   103     SchemeWidgetLayout->addWidget(GameSchemes, 0, 2);
   101     connect(GameSchemes, SIGNAL(currentIndexChanged(int)), this, SLOT(schemeChanged(int)));
   104     connect(GameSchemes, SIGNAL(currentIndexChanged(int)), this, SLOT(schemeChanged(int)));
   102 
   105 
   103     SchemeWidgetLayout->addWidget(new QLabel(QLabel::tr("Game scheme"), SchemeWidget), 0, 0);
   106     SchemeWidgetLayout->addWidget(new QLabel(QLabel::tr("Scheme"), SchemeWidget), 0, 0);
   104 
   107 
   105     QPixmap pmEdit(":/res/edit.png");
   108     QPixmap pmEdit(":/res/edit.png");
   106     
   109     
   107     QPushButton * goToSchemePage = new QPushButton(SchemeWidget);
   110     QPushButton * goToSchemePage = new QPushButton(SchemeWidget);
   108     goToSchemePage->setToolTip(tr("Edit schemes"));
   111     goToSchemePage->setToolTip(tr("Edit schemes"));
   125     goToWeaponPage->setIcon(pmEdit);
   128     goToWeaponPage->setIcon(pmEdit);
   126     goToWeaponPage->setMaximumWidth(pmEdit.width() + 6);
   129     goToWeaponPage->setMaximumWidth(pmEdit.width() + 6);
   127     SchemeWidgetLayout->addWidget(goToWeaponPage, 1, 3);
   130     SchemeWidgetLayout->addWidget(goToWeaponPage, 1, 3);
   128     connect(goToWeaponPage, SIGNAL(clicked()), this, SLOT(jumpToWeapons()));
   131     connect(goToWeaponPage, SIGNAL(clicked()), this, SLOT(jumpToWeapons()));
   129 
   132 
   130     //GBoxOptionsLayout->addWidget(new QLabel(QLabel::tr("Bind schemes with weapons"), GBoxOptions), 2, 0);
       
   131 
       
   132     bindEntries = new QCheckBox(SchemeWidget);
   133     bindEntries = new QCheckBox(SchemeWidget);
   133     bindEntries->setToolTip(tr("When this option is enabled selecting a game scheme will auto-select a weapon"));
   134     bindEntries->setToolTip(tr("When this option is enabled selecting a game scheme will auto-select a weapon"));
   134     bindEntries->setChecked(true);
   135     bindEntries->setChecked(true);
   135     bindEntries->setMaximumWidth(42);
   136     bindEntries->setMaximumWidth(42);
   136     bindEntries->setStyleSheet( "QCheckBox::indicator:checked   { image: url(\":/res/lock.png\"); }"
   137     bindEntries->setStyleSheet( "QCheckBox::indicator:checked   { image: url(\":/res/lock.png\"); }"
   137                                 "QCheckBox::indicator:unchecked { image: url(\":/res/unlock.png\");   }" );
   138                                 "QCheckBox::indicator:unchecked { image: url(\":/res/unlock.png\");   }" );
   138     SchemeWidgetLayout->addWidget(bindEntries, 0, 1, 0, 1, Qt::AlignVCenter);
   139     SchemeWidgetLayout->addWidget(bindEntries, 0, 1, 0, 1, Qt::AlignVCenter);
   139     //GBoxOptionsLayout->addWidget(bindEntries, 2, 2);
       
   140 
   140 
   141     connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(seedChanged(const QString &)));
   141     connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(seedChanged(const QString &)));
   142     connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(mapChanged(const QString &)));
   142     connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(mapChanged(const QString &)));
   143     connect(pMapContainer, SIGNAL(mapgenChanged(MapGenerator)), this, SLOT(mapgenChanged(MapGenerator)));
   143     connect(pMapContainer, SIGNAL(mapgenChanged(MapGenerator)), this, SLOT(mapgenChanged(MapGenerator)));
   144     connect(pMapContainer, SIGNAL(mazeSizeChanged(int)), this, SLOT(maze_sizeChanged(int)));
   144     connect(pMapContainer, SIGNAL(mazeSizeChanged(int)), this, SLOT(maze_sizeChanged(int)));