Skip to content

Commit

Permalink
Add option to switch Warcraft III to Ribbon menu
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanW3 committed Sep 18, 2018
1 parent 0a0248f commit 1c23e44
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Binary file added HiveWE/Data/Icons/Ribbon/WarIII32x32.ico
Binary file not shown.
1 change: 1 addition & 0 deletions HiveWE/HiveWE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ HiveWE::HiveWE(QWidget* parent) : QMainWindow(parent) {
connect(ui.ribbon->save_map, &QPushButton::clicked, [&]() { map.save(map.filesystem_path); });
connect(ui.ribbon->save_map_as, &QPushButton::clicked, this, &HiveWE::save_as);
connect(ui.ribbon->test_map, &QPushButton::clicked, [&]() { map.play_test(); });
connect(ui.ribbon->switch_warcraft, &QPushButton::clicked, this, &HiveWE::switch_warcraft);
connect(ui.ribbon->exit, &QPushButton::clicked, [&]() { });

connect(ui.ribbon->change_tileset, &QRibbonButton::clicked, [this]() { new TileSetter(this); });
Expand Down
6 changes: 6 additions & 0 deletions HiveWE/MainRibbon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ MainRibbon::MainRibbon(QWidget* parent) : QRibbon(parent) {
test_map->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
addMenuItem(test_map);

switch_warcraft->setText("Switch Warcraft III folder");
switch_warcraft->setIcon(QIcon("Data/Icons/Ribbon/WarIII32x32.ico"));
switch_warcraft->setIconSize({ 32, 32 });
switch_warcraft->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
addMenuItem(switch_warcraft);

addMenuSeperator();

exit->setText("Exit");
Expand Down
1 change: 1 addition & 0 deletions HiveWE/MainRibbon.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class MainRibbon : public QRibbon {
QToolButton* save_map = new QToolButton;
QToolButton* save_map_as = new QToolButton;
QToolButton* test_map = new QToolButton;
QToolButton* switch_warcraft = new QToolButton;
QToolButton* exit = new QToolButton;

MainRibbon(QWidget* parent);
Expand Down

0 comments on commit 1c23e44

Please sign in to comment.