Skip to content

Commit b9be0f2

Browse files
committed
remove some song and gui test
1 parent ecc3892 commit b9be0f2

9 files changed

+30
-4
lines changed
-2.97 MB
Binary file not shown.
-2.82 MB
Binary file not shown.

Source/GUI/Button.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace GUI
99
std::function<void(void)> function)
1010
: m_function (function)
1111
{
12-
m_quad.setSize({500, 100});
12+
m_quad.setSize({BASE_WIDTH, BASE_HEIGHT});
1313
m_quad.setTexture(&Component::guiTexture);
1414
m_quad.setOutlineColor(sf::Color::Black);
1515
m_quad.setOutlineThickness(4);

Source/GUI/Component.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ namespace GUI
1010
class Component
1111
{
1212
public:
13+
static constexpr int BASE_WIDTH = 500;
14+
static constexpr int BASE_HEIGHT = 100;
15+
1316
Component();
1417
virtual ~Component(){}
1518

Source/GUI/Imaged_Button.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace GUI
1010
std::function<void(void)>function)
1111
: m_function (function)
1212
{
13-
m_quad.setSize({800, 150});
13+
m_quad.setSize({BASE_WIDTH, BASE_HEIGHT});
1414
m_quad.setTexture(&Component::guiTexture);
1515
m_quad.setOutlineColor(sf::Color::Black);
1616
m_quad.setOutlineThickness(2);

Source/GUI/Panel.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,26 @@ namespace GUI
6767

6868
void Panel::addComponentGrid2x(std::unique_ptr<Component>& component)
6969
{
70+
if(m_2xCount == 2)
71+
{
72+
m_currentY += Component::BASE_HEIGHT;
73+
m_2xRow++;
74+
m_2xCount = 0;
75+
}
76+
m_2xCount++;
7077

78+
static auto w = Component::BASE_WIDTH;
79+
if (m_isGrid2xleft)
80+
{
81+
component->setPosition({Display::get().getSize().x / 2 - component->getSize().x / 2 - w / 2,
82+
float(m_currentY) });
83+
}
84+
else
85+
{
86+
component->setPosition({Display::get().getSize().x / 2 + component->getSize().x / 2 + w / 2,
87+
float(m_currentY) });
88+
}
89+
m_isGrid2xleft = !m_isGrid2xleft;
7190
}
7291

7392

Source/GUI/Panel.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ namespace GUI
4646
int m_currentX = 0;
4747
int m_currentY = 15;
4848

49+
bool m_isGrid2xleft = true;
50+
int m_2xRow = 0;
51+
int m_2xCount = 0;
52+
4953
};
5054
}
5155

Source/GUI/Toggle_Option_Button.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace GUI
2121
, m_pOption (&option)
2222
, m_label (std::move(title))
2323
{
24-
m_quad.setSize({500, 100});
24+
m_quad.setSize({BASE_WIDTH, BASE_HEIGHT});
2525
m_quad.setTexture(&Component::guiTexture);
2626
m_quad.setOutlineColor(sf::Color::Black);
2727
m_quad.setOutlineThickness(4);

Source/States/SPlaying.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ namespace State
181181
return
182182
{
183183
centre,
184-
m_world.getHeightAt({centre, 0, centre}) + 3,
184+
200, //m_world.getHeightAt({centre, 0, centre}) + 3,
185185
centre
186186
};
187187
}

0 commit comments

Comments
 (0)