[gnome-robots/wip/libgames-support: 5/22] Modified game to use new libgames-scores written in Vala.
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-robots/wip/libgames-support: 5/22] Modified game to use new libgames-scores written in Vala.
- Date: Sun, 28 Jun 2015 19:59:50 +0000 (UTC)
commit 495f4d2618d537ed80a59b49ed6d451685d5d429
Author: Nikhar Agrawal <nikharagrawal2006 gmail com>
Date: Thu Jul 17 23:29:30 2014 +0530
Modified game to use new libgames-scores written in Vala.
src/game.c | 15 +++++++++------
src/gnome-robots.c | 9 +++------
src/gnome-robots.h | 2 +-
src/graphics.c | 1 -
src/properties.c | 1 -
5 files changed, 13 insertions(+), 15 deletions(-)
---
diff --git a/src/game.c b/src/game.c
index 5442686..d1b2439 100644
--- a/src/game.c
+++ b/src/game.c
@@ -37,7 +37,6 @@
#include "graphics.h"
#include "cursors.h"
#include "games-scores.h"
-#include "games-scores-dialog.h"
/**********************************************************************/
/* Exported Variables */
@@ -93,6 +92,7 @@ static gboolean random_teleport (void);
static gboolean safe_teleport (void);
/**********************************************************************/
+struct _GamesScoresCategory current_cat;
/**********************************************************************/
/* Function Definitions */
@@ -128,7 +128,8 @@ message_box (gchar * msg)
gint
show_scores (gint pos, gboolean endofgame)
{
- gchar *message;
+ games_scores_context_print_scores (highscores);
+/* gchar *message;
static GtkWidget *scoresdialog = NULL;
static GtkWidget *sorrydialog = NULL;
GtkWidget *dialog;
@@ -195,9 +196,9 @@ show_scores (gint pos, gboolean endofgame)
}
result = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_hide (dialog);
+ gtk_widget_hide (dialog);*/
- return result;
+ return 0;
}
/**
@@ -230,8 +231,10 @@ log_score (gint sc)
}
if (sc != 0) {
- games_scores_set_category (highscores, sbuf);
- pos = games_scores_add_plain_score (highscores, (guint32) sc);
+ // games_scores_set_category (highscores, sbuf);
+ current_cat.key = sbuf;
+ current_cat.name = sbuf;
+ pos = games_scores_context_add_score (highscores, (guint32) sc, ¤t_cat);
}
g_free (sbuf);
diff --git a/src/gnome-robots.c b/src/gnome-robots.c
index 371a168..30e1c2e 100644
--- a/src/gnome-robots.c
+++ b/src/gnome-robots.c
@@ -1,3 +1,4 @@
+
/*
* Gnome Robots II
* written by Mark Rae <m rae inpharmatica co uk>
@@ -38,7 +39,6 @@
#include "cursors.h"
#include "games-gridframe.h"
#include "games-scores.h"
-#include "games-scores-dialog.h"
/* Minimum sizes. */
#define MINIMUM_TILE_WIDTH 8
@@ -53,7 +53,7 @@ GtkWidget *window = NULL;
static gint window_width = 0, window_height = 0;
static gboolean window_is_maximized = FALSE;
GtkWidget *game_area = NULL;
-GamesScores *highscores;
+GamesScoresContext *highscores;
GSettings *settings;
/**********************************************************************/
@@ -292,10 +292,7 @@ startup (GtkApplication *app, gpointer user_data)
g_set_application_name (_("Robots"));
- highscores = games_scores_new ("gnome-robots",
- scorecats, G_N_ELEMENTS (scorecats),
- NULL, NULL,
- 0 /* default category */,
+ highscores = games_scores_context_new ("gnome-robots",
GAMES_SCORES_STYLE_PLAIN_DESCENDING);
settings = g_settings_new ("org.gnome.robots");
diff --git a/src/gnome-robots.h b/src/gnome-robots.h
index 98cfa91..3dfaf0c 100644
--- a/src/gnome-robots.h
+++ b/src/gnome-robots.h
@@ -10,7 +10,7 @@
/**********************************************************************/
extern GtkWidget *window;
extern GtkWidget *game_area;
-extern GamesScores *highscores;
+extern GamesScoresContext *highscores;
extern GSettings *settings;
/**********************************************************************/
diff --git a/src/graphics.c b/src/graphics.c
index abb3997..53d508b 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -39,7 +39,6 @@
#include "properties.h"
#include "games-preimage.h"
#include "games-scores.h"
-#include "games-scores-dialog.h"
/**********************************************************************/
diff --git a/src/properties.c b/src/properties.c
index 17be9ea..c90fbba 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -37,7 +37,6 @@
#include "games-file-list.h"
#include "games-controls.h"
#include "games-scores.h"
-#include "games-scores-dialog.h"
/**********************************************************************/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]