Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Progark gruppe 3
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Ingebrigt Ørstad
Progark gruppe 3
Commits
bbfc8e8e
Commit
bbfc8e8e
authored
5 years ago
by
Haakon Gunleiksrud
Browse files
Options
Downloads
Patches
Plain Diff
#32
Added a not very good dark mode.
parent
c87cf334
No related branches found
No related tags found
1 merge request
!26
Resolve "Options-functionality"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/core/src/com/gameware/game/GameWare.java
+15
-4
15 additions, 4 deletions
frontend/core/src/com/gameware/game/GameWare.java
with
15 additions
and
4 deletions
frontend/core/src/com/gameware/game/GameWare.java
+
15
−
4
View file @
bbfc8e8e
...
@@ -7,6 +7,7 @@ import com.badlogic.gdx.graphics.GL20;
...
@@ -7,6 +7,7 @@ import com.badlogic.gdx.graphics.GL20;
import
com.badlogic.gdx.graphics.g2d.SpriteBatch
;
import
com.badlogic.gdx.graphics.g2d.SpriteBatch
;
import
com.gameware.game.states.GameStateManager
;
import
com.gameware.game.states.GameStateManager
;
import
com.gameware.game.states.LoginState
;
import
com.gameware.game.states.LoginState
;
import
com.gameware.game.states.MenuState
;
public
class
GameWare
extends
ApplicationAdapter
{
public
class
GameWare
extends
ApplicationAdapter
{
private
SpriteBatch
batch
;
private
SpriteBatch
batch
;
...
@@ -19,6 +20,7 @@ public class GameWare extends ApplicationAdapter {
...
@@ -19,6 +20,7 @@ public class GameWare extends ApplicationAdapter {
private
static
Music
music
;
private
static
Music
music
;
private
static
Boolean
musicOn
=
false
;
private
static
Boolean
musicOn
=
false
;
private
static
Boolean
soundEffects
=
true
;
private
static
Boolean
soundEffects
=
true
;
private
static
Boolean
darkMode
=
false
;
private
static
GameWare
instance
=
null
;
private
static
GameWare
instance
=
null
;
//Singleton (lazy initialization)
//Singleton (lazy initialization)
...
@@ -44,11 +46,19 @@ public class GameWare extends ApplicationAdapter {
...
@@ -44,11 +46,19 @@ public class GameWare extends ApplicationAdapter {
@Override
@Override
public
void
render
()
{
public
void
render
()
{
if
(
darkMode
){
Gdx
.
gl
.
glClearColor
(
50
/
255
f
,
50
/
255
f
,
50
/
255
f
,
1
);
Gdx
.
gl
.
glClear
(
GL20
.
GL_COLOR_BUFFER_BIT
);
gsm
.
update
(
Gdx
.
graphics
.
getDeltaTime
());
gsm
.
render
(
batch
);
}
else
{
Gdx
.
gl
.
glClearColor
(
1
,
1
,
1
,
1
);
Gdx
.
gl
.
glClearColor
(
1
,
1
,
1
,
1
);
Gdx
.
gl
.
glClear
(
GL20
.
GL_COLOR_BUFFER_BIT
);
Gdx
.
gl
.
glClear
(
GL20
.
GL_COLOR_BUFFER_BIT
);
gsm
.
update
(
Gdx
.
graphics
.
getDeltaTime
());
gsm
.
update
(
Gdx
.
graphics
.
getDeltaTime
());
gsm
.
render
(
batch
);
gsm
.
render
(
batch
);
}
}
}
public
static
void
toggleMusic
(){
public
static
void
toggleMusic
(){
if
(
musicOn
){
music
.
pause
();}
if
(
musicOn
){
music
.
pause
();}
...
@@ -67,6 +77,7 @@ public class GameWare extends ApplicationAdapter {
...
@@ -67,6 +77,7 @@ public class GameWare extends ApplicationAdapter {
public
static
void
toggleDarkMode
(){
public
static
void
toggleDarkMode
(){
//Should change the skin. Either what skin is chosen when initiating a state, or done within the glassy ui json file.
//Should change the skin. Either what skin is chosen when initiating a state, or done within the glassy ui json file.
//Probably have to move the skin initalization to the state abstract class.
//Probably have to move the skin initalization to the state abstract class.
darkMode
=
!
darkMode
;
}
}
@Override
@Override
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment