[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src playturn.cpp preferences.cpp prefer...
From: |
David White |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src playturn.cpp preferences.cpp prefer... |
Date: |
Wed, 25 Aug 2004 22:54:50 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: David White <address@hidden> 04/08/26 02:50:15
Modified files:
src : playturn.cpp preferences.cpp preferences.hpp
src/server : server.cpp
Log message:
added new turn_cmd preferences option which can be pointed to a command
executed at the start of the player's turn
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.257&tr2=1.258&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/preferences.cpp.diff?tr1=1.110&tr2=1.111&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/preferences.hpp.diff?tr1=1.39&tr2=1.40&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/server/server.cpp.diff?tr1=1.55&tr2=1.56&r1=text&r2=text
Patches:
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.257 wesnoth/src/playturn.cpp:1.258
--- wesnoth/src/playturn.cpp:1.257 Thu Aug 26 00:33:11 2004
+++ wesnoth/src/playturn.cpp Thu Aug 26 02:50:15 2004
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.257 2004/08/26 00:33:11 isaaccp Exp $ */
+/* $Id: playturn.cpp,v 1.258 2004/08/26 02:50:15 Sirp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -33,6 +33,7 @@
#include "util.hpp"
#include <cmath>
+#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
@@ -77,6 +78,11 @@
gui::show_dialog(gui,NULL,"",_("It is now your
turn"),gui::MESSAGE);
}
+ const std::string& turn_cmd = preferences::turn_cmd();
+ if(turn_cmd.empty() == false) {
+ system(turn_cmd.c_str());
+ }
+
turn_info turn_data(gameinfo,state_of_game,status,terrain_config,level,
key,gui,map,teams,team_num,units,turn_info::PLAY_TURN,textbox,network_sender);
Index: wesnoth/src/preferences.cpp
diff -u wesnoth/src/preferences.cpp:1.110 wesnoth/src/preferences.cpp:1.111
--- wesnoth/src/preferences.cpp:1.110 Wed Aug 25 02:59:51 2004
+++ wesnoth/src/preferences.cpp Thu Aug 26 02:50:15 2004
@@ -1,4 +1,4 @@
-/* $Id: preferences.cpp,v 1.110 2004/08/25 02:59:51 Sirp Exp $ */
+/* $Id: preferences.cpp,v 1.111 2004/08/26 02:50:15 Sirp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -409,6 +409,16 @@
prefs["turn_bell"] = (ison ? "yes" : "no");
}
+const std::string& turn_cmd()
+{
+ return prefs["turn_cmd"];
+}
+
+void set_turn_cmd(const std::string& cmd)
+{
+ prefs["turn_cmd"] = cmd;
+}
+
bool message_bell()
{
return prefs["message_bell"] != "no";
Index: wesnoth/src/preferences.hpp
diff -u wesnoth/src/preferences.hpp:1.39 wesnoth/src/preferences.hpp:1.40
--- wesnoth/src/preferences.hpp:1.39 Fri Aug 13 21:24:33 2004
+++ wesnoth/src/preferences.hpp Thu Aug 26 02:50:15 2004
@@ -1,4 +1,4 @@
-/* $Id: preferences.hpp,v 1.39 2004/08/13 21:24:33 erl Exp $ */
+/* $Id: preferences.hpp,v 1.40 2004/08/26 02:50:15 Sirp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -81,6 +81,9 @@
bool message_bell();
void set_message_bell(bool ison);
+ const std::string& turn_cmd();
+ void set_turn_cmd(const std::string& cmd);
+
bool turn_dialog();
void set_turn_dialog(bool ison);
Index: wesnoth/src/server/server.cpp
diff -u wesnoth/src/server/server.cpp:1.55 wesnoth/src/server/server.cpp:1.56
--- wesnoth/src/server/server.cpp:1.55 Sat Aug 21 22:21:05 2004
+++ wesnoth/src/server/server.cpp Thu Aug 26 02:50:15 2004
@@ -182,7 +182,7 @@
std::cout << "---" << std::endl;
} else if(command == "metrics") {
- std::cout << metrics_;
+ std::cout << metrics_ << std::endl;
} else if(command == "ban") {
if(i == cmd.end()) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src playturn.cpp preferences.cpp prefer...,
David White <=