Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cpp-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Maul
cpp-project
Merge requests
!30
implemented loading level from provided commandline arg
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
implemented loading level from provided commandline arg
level-from-commandline
into
main
Overview
0
Commits
1
Pipelines
0
Changes
5
Merged
Jonathan Dueck
requested to merge
level-from-commandline
into
main
5 months ago
Overview
0
Commits
1
Pipelines
0
Changes
5
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
c3cc85d1
1 commit,
5 months ago
5 files
+
17
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
src/game/ui/Menu.cpp
+
5
−
4
View file @ c3cc85d1
Edit in single-file editor
Open in Web IDE
Show full file
#include
"Menu.hpp"
#include
"../Level.hpp"
#include
"../Building.hpp"
#include
"../Config.hpp"
#include
"../Level.hpp"
#include
"../Spritesheet.hpp"
#include
"../Tile.hpp"
#include
"../Unit.hpp"
@@ -14,8 +14,9 @@
namespace
advanced_wars
{
Menu
::
Menu
(
int
selectedOption
)
:
m_selectedOption
(
selectedOption
),
m_options
({
"Start Game"
,
"Options"
,
"Exit"
}),
Menu
::
Menu
(
int
selectedOption
,
const
std
::
string
&
level_filepath
)
:
m_selectedOption
(
selectedOption
),
m_level_filepath
(
level_filepath
),
m_options
({
"Start Game"
,
"Options"
,
"Exit"
}),
m_backgroundTexture
(
nullptr
)
{
}
@@ -202,7 +203,7 @@ void Menu::handleEvent(Engine& engine, SDL_Event& event)
// std::make_shared<Level>("Osnabrück", 20, 20, tiles, buildings, units,
// effects, std::queue<Player>{});
engine
.
pushScene
(
Level
::
loadLevel
(
"../res/level.h5"
,
engine
));
engine
.
pushScene
(
Level
::
loadLevel
(
m_level_filepath
,
engine
));
}
else
if
(
m_options
[
m_selectedOption
]
==
"Options"
)
{
Loading