[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src playturn.cpp
From: |
Isaac Clerencia |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src playturn.cpp |
Date: |
Sun, 02 Jan 2005 20:37:08 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Isaac Clerencia <address@hidden> 05/01/03 01:22:46
Modified files:
src : playturn.cpp
Log message:
ASR (As Sanna Required)
Add ": " after nick completion if the name is at the beginning of the
line,
and " " otherwise
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.314&tr2=1.315&r1=text&r2=text
Patches:
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.314 wesnoth/src/playturn.cpp:1.315
--- wesnoth/src/playturn.cpp:1.314 Fri Dec 31 21:01:37 2004
+++ wesnoth/src/playturn.cpp Mon Jan 3 01:22:45 2005
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.314 2004/12/31 21:01:37 isaaccp Exp $ */
+/* $Id: playturn.cpp,v 1.315 2005/01/03 01:22:45 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -2743,11 +2743,10 @@
switch(textbox_.mode) {
case floating_textbox::TEXTBOX_MESSAGE:
{
- std::cerr << "Tab pressed in active textbox" << std::endl;
std::string text = textbox_.box->text();
- std::cerr << "Current text: " << text << std::endl;
std::string semiword;
-
+ bool beginning;
+
const size_t last_space = text.rfind(" ");
//if last character is a space return
@@ -2756,12 +2755,13 @@
}
if(last_space == -1) {
+ beginning = true;
semiword = text;
}else{
+ beginning = false;
semiword.assign(text,last_space+1,text.size());
}
- std::cerr << "Semiword: " << semiword << std::endl;
std::string guess;
for(size_t n = 0; n != teams_.size(); ++n) {
@@ -2787,10 +2787,9 @@
}
}
- std::cerr << "Guess: " << guess << std::endl;
if(guess.size() != 0) {
- text.replace(last_space+1, semiword.size(), guess);
- std::cerr << "Replaced text: " << text << std::endl;
+ std::string add = beginning ? ": " : " ";
+ text.replace(last_space+1, semiword.size(), guess +
add);
textbox_.box->set_text(text);
}
break;
- [Wesnoth-cvs-commits] wesnoth/src playturn.cpp,
Isaac Clerencia <=
- [Wesnoth-cvs-commits] wesnoth/src playturn.cpp, Jon Daniel, 2005/01/19
- [Wesnoth-cvs-commits] wesnoth/src playturn.cpp, Jon Daniel, 2005/01/21
- [Wesnoth-cvs-commits] wesnoth/src playturn.cpp, Jon Daniel, 2005/01/23
- [Wesnoth-cvs-commits] wesnoth/src playturn.cpp, Jon Daniel, 2005/01/27
- [Wesnoth-cvs-commits] wesnoth/src playturn.cpp, Jon Daniel, 2005/01/27
- [Wesnoth-cvs-commits] wesnoth/src playturn.cpp, David White, 2005/01/28