520 |
527 |
521 gbTBLayout->addWidget(teamsBox, 0, 0); |
528 gbTBLayout->addWidget(teamsBox, 0, 0); |
522 } |
529 } |
523 |
530 |
524 { |
531 { |
525 // TODO: This box should contain controls for all schemes: game modes and weapons |
|
526 |
|
527 IconedGroupBox* groupWeapons = new IconedGroupBox(this); |
532 IconedGroupBox* groupWeapons = new IconedGroupBox(this); |
|
533 |
528 //groupWeapons->setContentTopPadding(0); |
534 //groupWeapons->setContentTopPadding(0); |
529 //groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
535 //groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
530 groupWeapons->setIcon(QIcon(":/res/weaponsicon.png")); |
536 groupWeapons->setIcon(QIcon(":/res/weaponsicon.png")); |
531 groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
537 groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
532 groupWeapons->setTitle(QGroupBox::tr("Weapons")); |
538 groupWeapons->setTitle(QGroupBox::tr("Schemes and Weapons")); |
533 QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons); |
539 QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons); |
534 |
540 |
|
541 QLabel* SchemeLabel = new QLabel(groupWeapons); |
|
542 SchemeLabel->setText(QLabel::tr("Game scheme")); |
|
543 WeaponsLayout->addWidget(SchemeLabel, 1, 0); |
|
544 |
|
545 SchemesName = new QComboBox(groupWeapons); |
|
546 WeaponsLayout->addWidget(SchemesName, 1, 1); |
|
547 |
|
548 SchemeNew = new QPushButton(groupWeapons); |
|
549 SchemeNew->setToolTip(tr("New scheme")); |
|
550 SchemeNew->setIconSize(pmNew.size()); |
|
551 SchemeNew->setIcon(pmNew); |
|
552 SchemeNew->setMaximumWidth(pmNew.width() + 6); |
|
553 WeaponsLayout->addWidget(SchemeNew, 1, 2); |
|
554 |
|
555 SchemeEdit = new QPushButton(groupWeapons); |
|
556 SchemeEdit->setToolTip(tr("Edit scheme")); |
|
557 SchemeEdit->setIconSize(pmEdit.size()); |
|
558 SchemeEdit->setIcon(pmEdit); |
|
559 SchemeEdit->setMaximumWidth(pmEdit.width() + 6); |
|
560 WeaponsLayout->addWidget(SchemeEdit, 1, 3); |
|
561 |
|
562 SchemeDelete = new QPushButton(groupWeapons); |
|
563 SchemeDelete->setToolTip(tr("Delete scheme")); |
|
564 SchemeDelete->setIconSize(pmDelete.size()); |
|
565 SchemeDelete->setIcon(pmDelete); |
|
566 SchemeDelete->setMaximumWidth(pmDelete.width() + 6); |
|
567 WeaponsLayout->addWidget(SchemeDelete, 1, 4); |
|
568 |
|
569 QLabel* WeaponLabel = new QLabel(groupWeapons); |
|
570 WeaponLabel->setText(QLabel::tr("Weapons")); |
|
571 WeaponsLayout->addWidget(WeaponLabel, 2, 0); |
|
572 |
535 WeaponsName = new QComboBox(groupWeapons); |
573 WeaponsName = new QComboBox(groupWeapons); |
536 WeaponsLayout->addWidget(WeaponsName, 0, 0); |
574 WeaponsLayout->addWidget(WeaponsName, 2, 1); |
537 |
575 |
538 WeaponsButt = new QPushButton(groupWeapons); |
576 WeaponNew = new QPushButton(groupWeapons); |
539 WeaponsButt->setToolTip(tr("New weapon scheme")); |
577 WeaponNew->setToolTip(tr("New weapon set")); |
540 WeaponsButt->setIconSize(pmNew.size()); |
578 WeaponNew->setIconSize(pmNew.size()); |
541 WeaponsButt->setIcon(pmNew); |
579 WeaponNew->setIcon(pmNew); |
542 WeaponsButt->setMaximumWidth(pmNew.width() + 6); |
580 WeaponNew->setMaximumWidth(pmNew.width() + 6); |
543 WeaponsLayout->addWidget(WeaponsButt, 0, 1); |
581 WeaponsLayout->addWidget(WeaponNew, 2, 2); |
544 |
582 |
545 WeaponEdit = new QPushButton(groupWeapons); |
583 WeaponEdit = new QPushButton(groupWeapons); |
546 WeaponEdit->setToolTip(tr("Edit weapon scheme")); |
584 WeaponEdit->setToolTip(tr("Edit weapon set")); |
547 WeaponEdit->setIconSize(pmEdit.size()); |
585 WeaponEdit->setIconSize(pmEdit.size()); |
548 WeaponEdit->setIcon(pmEdit); |
586 WeaponEdit->setIcon(pmEdit); |
549 WeaponEdit->setMaximumWidth(pmEdit.width() + 6); |
587 WeaponEdit->setMaximumWidth(pmEdit.width() + 6); |
550 WeaponsLayout->addWidget(WeaponEdit, 0, 2); |
588 WeaponsLayout->addWidget(WeaponEdit, 2, 3); |
551 |
589 |
552 WeaponDelete = new QPushButton(groupWeapons); |
590 WeaponDelete = new QPushButton(groupWeapons); |
553 WeaponDelete->setToolTip(tr("Delete weapon scheme")); |
591 WeaponDelete->setToolTip(tr("Delete weapon set")); |
554 WeaponDelete->setIconSize(pmDelete.size()); |
592 WeaponDelete->setIconSize(pmDelete.size()); |
555 WeaponDelete->setIcon(pmDelete); |
593 WeaponDelete->setIcon(pmDelete); |
556 WeaponDelete->setMaximumWidth(pmDelete.width() + 6); |
594 WeaponDelete->setMaximumWidth(pmDelete.width() + 6); |
557 WeaponDelete->setEnabled(false); |
595 WeaponsLayout->addWidget(WeaponDelete, 2, 4); |
558 WeaponDelete->setVisible(false); // hide for now |
|
559 WeaponsLayout->addWidget(WeaponDelete, 0, 3); |
|
560 |
596 |
561 WeaponTooltip = new QCheckBox(this); |
597 WeaponTooltip = new QCheckBox(this); |
562 WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips")); |
598 WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips")); |
563 WeaponsLayout->addWidget(WeaponTooltip, 1, 0, 1, 3); |
599 WeaponsLayout->addWidget(WeaponTooltip, 3, 0, 1, 4); |
564 |
600 |
565 gbTBLayout->addWidget(groupWeapons, 1, 0); |
601 gbTBLayout->addWidget(groupWeapons, 1, 0); |
566 } |
602 } |
567 |
603 |
568 { |
604 { |
1108 AbstractPage(parent) |
1152 AbstractPage(parent) |
1109 { |
1153 { |
1110 QGridLayout * pageLayout = new QGridLayout(this); |
1154 QGridLayout * pageLayout = new QGridLayout(this); |
1111 |
1155 |
1112 pWeapons = new SelWeaponWidget(cAmmoNumber, this); |
1156 pWeapons = new SelWeaponWidget(cAmmoNumber, this); |
1113 pageLayout->addWidget(pWeapons, 0, 0, 1, 4); |
1157 pageLayout->addWidget(pWeapons, 0, 0, 1, 5); |
1114 |
1158 |
1115 BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, true); |
1159 BtnBack = addButton(":/res/Exit.png", pageLayout, 1, 0, 2, 1, true); |
1116 BtnDefault = addButton(tr("Default"), pageLayout, 1, 1); |
1160 BtnDefault = addButton(tr("Default"), pageLayout, 1, 3); |
1117 BtnDelete = addButton(tr("Delete"), pageLayout, 1, 2); |
1161 BtnNew = addButton(tr("New"), pageLayout, 1, 2); |
1118 BtnSave = addButton(":/res/Save.png", pageLayout, 1, 3, true); |
1162 BtnCopy = addButton(tr("Copy"), pageLayout, 2, 2); |
|
1163 BtnDelete = addButton(tr("Delete"), pageLayout, 2, 3); |
|
1164 BtnSave = addButton(":/res/Save.png", pageLayout, 1, 4, 2, 1, true); |
1119 BtnSave->setStyleSheet("QPushButton{margin: 24px 0px 0px 0px;}"); |
1165 BtnSave->setStyleSheet("QPushButton{margin: 24px 0px 0px 0px;}"); |
1120 BtnBack->setFixedHeight(BtnSave->height()); |
1166 BtnBack->setFixedHeight(BtnSave->height()); |
1121 BtnBack->setStyleSheet("QPushButton{margin-top: 31px;}"); |
1167 BtnBack->setStyleSheet("QPushButton{margin-top: 31px;}"); |
1122 |
1168 |
|
1169 selectWeaponSet = new QComboBox(this); |
|
1170 pageLayout->addWidget(selectWeaponSet, 1, 1, 2, 1); |
|
1171 |
1123 connect(BtnDefault, SIGNAL(clicked()), pWeapons, SLOT(setDefault())); |
1172 connect(BtnDefault, SIGNAL(clicked()), pWeapons, SLOT(setDefault())); |
1124 connect(BtnSave, SIGNAL(clicked()), pWeapons, SLOT(save())); |
1173 connect(BtnSave, SIGNAL(clicked()), pWeapons, SLOT(save())); |
|
1174 connect(BtnNew, SIGNAL(clicked()), pWeapons, SLOT(newWeaponsName())); |
|
1175 connect(BtnCopy, SIGNAL(clicked()), pWeapons, SLOT(copy())); |
|
1176 connect(selectWeaponSet, SIGNAL(currentIndexChanged(const QString&)), pWeapons, SLOT(setWeaponsName(const QString&))); |
1125 } |
1177 } |
1126 |
1178 |
1127 PageInGame::PageInGame(QWidget* parent) : |
1179 PageInGame::PageInGame(QWidget* parent) : |
1128 AbstractPage(parent) |
1180 AbstractPage(parent) |
1129 { |
1181 { |
1703 SB_HealthDecrease->setValue(5); |
1755 SB_HealthDecrease->setValue(5); |
1704 SB_HealthDecrease->setSingleStep(1); |
1756 SB_HealthDecrease->setSingleStep(1); |
1705 glBSLayout->addWidget(SB_HealthDecrease,5,2,1,1); |
1757 glBSLayout->addWidget(SB_HealthDecrease,5,2,1,1); |
1706 |
1758 |
1707 l = new QLabel(gbBasicSettings); |
1759 l = new QLabel(gbBasicSettings); |
|
1760 l->setText(QLabel::tr("% Rope Length")); |
|
1761 l->setWordWrap(true); |
|
1762 glBSLayout->addWidget(l,6,0,1,1); |
|
1763 l = new QLabel(gbBasicSettings); |
|
1764 l->setFixedSize(32,32); |
|
1765 l->setPixmap(QPixmap(":/res/iconRope.png")); |
|
1766 glBSLayout->addWidget(l,6,1,1,1); |
|
1767 SB_RopeModifier = new QSpinBox(gbBasicSettings); |
|
1768 SB_RopeModifier->setRange(25, 999); |
|
1769 SB_RopeModifier->setValue(100); |
|
1770 SB_RopeModifier->setSingleStep(25); |
|
1771 glBSLayout->addWidget(SB_RopeModifier,6,2,1,1); |
|
1772 |
|
1773 l = new QLabel(gbBasicSettings); |
1708 l->setText(QLabel::tr("Crate Drops")); |
1774 l->setText(QLabel::tr("Crate Drops")); |
1709 l->setWordWrap(true); |
1775 l->setWordWrap(true); |
1710 glBSLayout->addWidget(l,6,0,1,1); |
1776 glBSLayout->addWidget(l,7,0,1,1); |
1711 l = new QLabel(gbBasicSettings); |
1777 l = new QLabel(gbBasicSettings); |
1712 l->setFixedSize(32,32); |
1778 l->setFixedSize(32,32); |
1713 l->setPixmap(QPixmap(":/res/iconBox.png")); |
1779 l->setPixmap(QPixmap(":/res/iconBox.png")); |
1714 glBSLayout->addWidget(l,6,1,1,1); |
1780 glBSLayout->addWidget(l,7,1,1,1); |
1715 SB_CaseProb = new FreqSpinBox(gbBasicSettings); |
1781 SB_CaseProb = new FreqSpinBox(gbBasicSettings); |
1716 SB_CaseProb->setRange(0, 9); |
1782 SB_CaseProb->setRange(0, 9); |
1717 SB_CaseProb->setValue(5); |
1783 SB_CaseProb->setValue(5); |
1718 glBSLayout->addWidget(SB_CaseProb,6,2,1,1); |
1784 glBSLayout->addWidget(SB_CaseProb,7,2,1,1); |
1719 |
1785 |
1720 l = new QLabel(gbBasicSettings); |
1786 l = new QLabel(gbBasicSettings); |
1721 l->setText(QLabel::tr("% Health Crates")); |
1787 l->setText(QLabel::tr("% Health Crates")); |
1722 l->setWordWrap(true); |
1788 l->setWordWrap(true); |
1723 glBSLayout->addWidget(l,7,0,1,1); |
1789 glBSLayout->addWidget(l,8,0,1,1); |
1724 l = new QLabel(gbBasicSettings); |
1790 l = new QLabel(gbBasicSettings); |
1725 l->setFixedSize(32,32); |
1791 l->setFixedSize(32,32); |
1726 l->setPixmap(QPixmap(":/res/iconHealth.png")); // TODO: icon |
1792 l->setPixmap(QPixmap(":/res/iconHealth.png")); // TODO: icon |
1727 glBSLayout->addWidget(l,7,1,1,1); |
1793 glBSLayout->addWidget(l,8,1,1,1); |
1728 SB_HealthCrates = new QSpinBox(gbBasicSettings); |
1794 SB_HealthCrates = new QSpinBox(gbBasicSettings); |
1729 SB_HealthCrates->setRange(0, 100); |
1795 SB_HealthCrates->setRange(0, 100); |
1730 SB_HealthCrates->setValue(35); |
1796 SB_HealthCrates->setValue(35); |
1731 SB_HealthCrates->setSingleStep(5); |
1797 SB_HealthCrates->setSingleStep(5); |
1732 glBSLayout->addWidget(SB_HealthCrates,7,2,1,1); |
1798 glBSLayout->addWidget(SB_HealthCrates,8,2,1,1); |
1733 |
1799 |
1734 l = new QLabel(gbBasicSettings); |
1800 l = new QLabel(gbBasicSettings); |
1735 l->setText(QLabel::tr("Health in Crates")); |
1801 l->setText(QLabel::tr("Health in Crates")); |
1736 l->setWordWrap(true); |
1802 l->setWordWrap(true); |
1737 glBSLayout->addWidget(l,8,0,1,1); |
1803 glBSLayout->addWidget(l,9,0,1,1); |
1738 l = new QLabel(gbBasicSettings); |
1804 l = new QLabel(gbBasicSettings); |
1739 l->setFixedSize(32,32); |
1805 l->setFixedSize(32,32); |
1740 l->setPixmap(QPixmap(":/res/iconHealth.png")); // TODO: icon |
1806 l->setPixmap(QPixmap(":/res/iconHealth.png")); // TODO: icon |
1741 glBSLayout->addWidget(l,8,1,1,1); |
1807 glBSLayout->addWidget(l,9,1,1,1); |
1742 SB_CrateHealth = new QSpinBox(gbBasicSettings); |
1808 SB_CrateHealth = new QSpinBox(gbBasicSettings); |
1743 SB_CrateHealth->setRange(0, 200); |
1809 SB_CrateHealth->setRange(0, 200); |
1744 SB_CrateHealth->setValue(25); |
1810 SB_CrateHealth->setValue(25); |
1745 SB_CrateHealth->setSingleStep(5); |
1811 SB_CrateHealth->setSingleStep(5); |
1746 glBSLayout->addWidget(SB_CrateHealth,8,2,1,1); |
1812 glBSLayout->addWidget(SB_CrateHealth,9,2,1,1); |
1747 |
1813 |
1748 l = new QLabel(gbBasicSettings); |
1814 l = new QLabel(gbBasicSettings); |
1749 l->setText(QLabel::tr("Mines Time")); |
1815 l->setText(QLabel::tr("Mines Time")); |
1750 l->setWordWrap(true); |
1816 l->setWordWrap(true); |
1751 glBSLayout->addWidget(l,9,0,1,1); |
1817 glBSLayout->addWidget(l,10,0,1,1); |
1752 l = new QLabel(gbBasicSettings); |
1818 l = new QLabel(gbBasicSettings); |
1753 l->setFixedSize(32,32); |
1819 l->setFixedSize(32,32); |
1754 l->setPixmap(QPixmap(":/res/iconTime.png")); // TODO: icon |
1820 l->setPixmap(QPixmap(":/res/iconTime.png")); // TODO: icon |
1755 glBSLayout->addWidget(l,9,1,1,1); |
1821 glBSLayout->addWidget(l,10,1,1,1); |
1756 SB_MinesTime = new QSpinBox(gbBasicSettings); |
1822 SB_MinesTime = new QSpinBox(gbBasicSettings); |
1757 SB_MinesTime->setRange(-1, 5); |
1823 SB_MinesTime->setRange(-1, 5); |
1758 SB_MinesTime->setValue(3); |
1824 SB_MinesTime->setValue(3); |
1759 SB_MinesTime->setSingleStep(1); |
1825 SB_MinesTime->setSingleStep(1); |
1760 SB_MinesTime->setSpecialValueText(tr("Random")); |
1826 SB_MinesTime->setSpecialValueText(tr("Random")); |
1761 SB_MinesTime->setSuffix(" "+ tr("Seconds")); |
1827 SB_MinesTime->setSuffix(" "+ tr("Seconds")); |
1762 glBSLayout->addWidget(SB_MinesTime,9,2,1,1); |
1828 glBSLayout->addWidget(SB_MinesTime,10,2,1,1); |
1763 |
1829 |
1764 l = new QLabel(gbBasicSettings); |
1830 l = new QLabel(gbBasicSettings); |
1765 l->setText(QLabel::tr("Mines")); |
1831 l->setText(QLabel::tr("Mines")); |
1766 l->setWordWrap(true); |
1832 l->setWordWrap(true); |
1767 glBSLayout->addWidget(l,10,0,1,1); |
1833 glBSLayout->addWidget(l,11,0,1,1); |
1768 l = new QLabel(gbBasicSettings); |
1834 l = new QLabel(gbBasicSettings); |
1769 l->setFixedSize(32,32); |
1835 l->setFixedSize(32,32); |
1770 l->setPixmap(QPixmap(":/res/iconMine.png")); // TODO: icon |
1836 l->setPixmap(QPixmap(":/res/iconMine.png")); // TODO: icon |
1771 glBSLayout->addWidget(l,10,1,1,1); |
1837 glBSLayout->addWidget(l,11,1,1,1); |
1772 SB_Mines = new QSpinBox(gbBasicSettings); |
1838 SB_Mines = new QSpinBox(gbBasicSettings); |
1773 SB_Mines->setRange(0, 80); |
1839 SB_Mines->setRange(0, 80); |
1774 SB_Mines->setValue(0); |
1840 SB_Mines->setValue(0); |
1775 SB_Mines->setSingleStep(5); |
1841 SB_Mines->setSingleStep(5); |
1776 glBSLayout->addWidget(SB_Mines,10,2,1,1); |
1842 glBSLayout->addWidget(SB_Mines,11,2,1,1); |
1777 |
1843 |
1778 l = new QLabel(gbBasicSettings); |
1844 l = new QLabel(gbBasicSettings); |
1779 l->setText(QLabel::tr("% Dud Mines")); |
1845 l->setText(QLabel::tr("% Dud Mines")); |
1780 l->setWordWrap(true); |
1846 l->setWordWrap(true); |
1781 glBSLayout->addWidget(l,11,0,1,1); |
1847 glBSLayout->addWidget(l,12,0,1,1); |
1782 l = new QLabel(gbBasicSettings); |
1848 l = new QLabel(gbBasicSettings); |
1783 l->setFixedSize(32,32); |
1849 l->setFixedSize(32,32); |
1784 l->setPixmap(QPixmap(":/res/iconDud.png")); |
1850 l->setPixmap(QPixmap(":/res/iconDud.png")); |
1785 glBSLayout->addWidget(l,11,1,1,1); |
1851 glBSLayout->addWidget(l,12,1,1,1); |
1786 SB_MineDuds = new QSpinBox(gbBasicSettings); |
1852 SB_MineDuds = new QSpinBox(gbBasicSettings); |
1787 SB_MineDuds->setRange(0, 100); |
1853 SB_MineDuds->setRange(0, 100); |
1788 SB_MineDuds->setValue(0); |
1854 SB_MineDuds->setValue(0); |
1789 SB_MineDuds->setSingleStep(5); |
1855 SB_MineDuds->setSingleStep(5); |
1790 glBSLayout->addWidget(SB_MineDuds,11,2,1,1); |
1856 glBSLayout->addWidget(SB_MineDuds,12,2,1,1); |
1791 |
1857 |
1792 |
1858 |
1793 l = new QLabel(gbBasicSettings); |
1859 l = new QLabel(gbBasicSettings); |
1794 l->setText(QLabel::tr("Explosives")); |
1860 l->setText(QLabel::tr("Explosives")); |
1795 l->setWordWrap(true); |
1861 l->setWordWrap(true); |
1796 glBSLayout->addWidget(l,12,0,1,1); |
1862 glBSLayout->addWidget(l,13,0,1,1); |
1797 l = new QLabel(gbBasicSettings); |
1863 l = new QLabel(gbBasicSettings); |
1798 l->setFixedSize(32,32); |
1864 l->setFixedSize(32,32); |
1799 l->setPixmap(QPixmap(":/res/iconDamage.png")); |
1865 l->setPixmap(QPixmap(":/res/iconDamage.png")); |
1800 glBSLayout->addWidget(l,12,1,1,1); |
1866 glBSLayout->addWidget(l,13,1,1,1); |
1801 SB_Explosives = new QSpinBox(gbBasicSettings); |
1867 SB_Explosives = new QSpinBox(gbBasicSettings); |
1802 SB_Explosives->setRange(0, 40); |
1868 SB_Explosives->setRange(0, 40); |
1803 SB_Explosives->setValue(0); |
1869 SB_Explosives->setValue(0); |
1804 SB_Explosives->setSingleStep(1); |
1870 SB_Explosives->setSingleStep(1); |
1805 glBSLayout->addWidget(SB_Explosives,12,2,1,1); |
1871 glBSLayout->addWidget(SB_Explosives,13,2,1,1); |
1806 |
|
1807 |
1872 |
1808 l = new QLabel(gbBasicSettings); |
1873 l = new QLabel(gbBasicSettings); |
1809 l->setText(QLabel::tr("Scheme Name:")); |
1874 l->setText(QLabel::tr("Scheme Name:")); |
1810 |
1875 |
1811 LE_name = new QLineEdit(this); |
1876 LE_name = new QLineEdit(this); |