Skip to content

Commit

Permalink
- rework parse cursor
Browse files Browse the repository at this point in the history
- fix newGame.json loading panel twice
  • Loading branch information
dgengin committed Jun 29, 2016
1 parent 14bbc90 commit fe8d7bd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
1 change: 0 additions & 1 deletion gamefiles/level/newGame.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
{ "name": "loadingScreen.setProgress", "progress": 45 },
{ "name": "load", "file": ["level/player/save.json", "%charName%", "%charClass%"] },
{ "name": "load", "file": ["level/player/loadCel.json", "%charName%"] },
{ "name": "load", "file": "level/loadBaseLevel.json" },
{ "name": "loadingScreen.setProgress", "progress": 55 },
{ "name": "resource.add", "id": "currentLevel" },
{ "name": "load", "file": "level/town/level.json" },
Expand Down
2 changes: 1 addition & 1 deletion gamefiles/ui/credits.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"id": "credits",
"ignorePrevious": true
},
"cursor": {},
"cursor": null,
"keyboard": {
"key": ["enter", "esc", " "],
"action": { "name": "button.click", "id": "back" }
Expand Down
2 changes: 1 addition & 1 deletion gamefiles/ui/playVideo.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "audio.pauseAll"
}
],
"cursor": {},
"cursor": null,
"keyboard": {
"key": ["enter", "esc", " "],
"action": { "name": "button.click", "id": "background" }
Expand Down
3 changes: 0 additions & 3 deletions gamefiles/ui/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@
"mask": "0x00FF00"
}
],
"cursor": {
"texture": "cursor"
},
"image": {
"id": "mainmenu",
"texture": "mainmenu",
Expand Down
16 changes: 11 additions & 5 deletions src/Parser/ParseCursor.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@ namespace Parser

void parseCursor(Game& game, const Value& elem)
{
if (elem.IsNull() == true)
{
game.Resources().addCursor(nullptr);
return;
}
else if (elem.IsObject() == false)
{
return;
}

game.Window().setMouseCursorVisible(getBool(elem, "show"));

if (getBool(elem, "pop") == true)
if (getBool(elem, "pop", false) == true)
{
game.Resources().popCursor();
game.updateMouse();
Expand All @@ -41,9 +51,5 @@ namespace Parser
game.Resources().addCursor(cursor);
game.updateMouse();
}
else
{
game.Resources().addCursor(nullptr);
}
}
}
Empty file modified src/Parser/ParseCursor.h
100755 → 100644
Empty file.

0 comments on commit fe8d7bd

Please sign in to comment.