Changeset - r9510:6d2f1c62ff65
[Not reviewed]
master
0 3 0
smatz - 16 years ago 2008-06-12 22:29:42
smatz@openttd.org
(svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
3 files changed with 14 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/signs_func.h
Show inline comments
 
@@ -15,6 +15,7 @@ void PlaceProc_Sign(TileIndex tile);
 

	
 
/* signs_gui.cpp */
 
void ShowRenameSignWindow(const Sign *si);
 
void HandleClickOnSign(const Sign *si);
 

	
 
void ShowSignList();
 

	
src/signs_gui.cpp
Show inline comments
 
@@ -8,6 +8,7 @@
 
#include "textbuf_gui.h"
 
#include "window_gui.h"
 
#include "player_gui.h"
 
#include "player_func.h"
 
#include "signs_base.h"
 
#include "signs_func.h"
 
#include "debug.h"
 
@@ -301,6 +302,15 @@ static const WindowDesc _query_sign_edit
 
	_query_sign_edit_widgets,
 
};
 

	
 
void HandleClickOnSign(const Sign *si)
 
{
 
	if (_ctrl_pressed && si->owner == _local_player) {
 
		RenameSign(si->index, "");
 
		return;
 
	}
 
	ShowRenameSignWindow(si);
 
}
 

	
 
void ShowRenameSignWindow(const Sign *si)
 
{
 
	/* Delete all other edit windows and the save window */
src/viewport.cpp
Show inline comments
 
@@ -1870,7 +1870,7 @@ static bool CheckClickOnSign(const ViewP
 
						y <  si->sign.top + 12 &&
 
						x >= si->sign.left &&
 
						x <  si->sign.left + si->sign.width_1) {
 
					ShowRenameSignWindow(si);
 
					HandleClickOnSign(si);
 
					return true;
 
				}
 
			}
 
@@ -1884,7 +1884,7 @@ static bool CheckClickOnSign(const ViewP
 
						y <  si->sign.top + 24 &&
 
						x >= si->sign.left &&
 
						x <  si->sign.left + si->sign.width_1 * 2) {
 
					ShowRenameSignWindow(si);
 
					HandleClickOnSign(si);
 
					return true;
 
				}
 
			}
 
@@ -1900,7 +1900,7 @@ static bool CheckClickOnSign(const ViewP
 
						y <  si->sign.top + ScaleByZoom(12, vp->zoom) &&
 
						x >= si->sign.left &&
 
						x <  si->sign.left + ScaleByZoom(si->sign.width_2, vp->zoom)) {
 
					ShowRenameSignWindow(si);
 
					HandleClickOnSign(si);
 
					return true;
 
				}
 
			}
0 comments (0 inline, 0 general)