about summary refs log tree commit diff
path: root/src/game/editor
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-08-16 01:29:11 +0200
committeroy <Tom_Adams@web.de>2010-08-16 01:29:11 +0200
commit4c2dcc4f2b5f061a1d75aa2aa0b316c4b86bc1d8 (patch)
treec0b24f13f675fe782fe161033cb69cd42f1f776d /src/game/editor
parent5922cbb56d17e9bff2a160c141c069a6004b7940 (diff)
downloadzcatch-4c2dcc4f2b5f061a1d75aa2aa0b316c4b86bc1d8.tar.gz
zcatch-4c2dcc4f2b5f061a1d75aa2aa0b316c4b86bc1d8.zip
added localisation fixes and map editor tool tips by sworddragon
Diffstat (limited to 'src/game/editor')
-rw-r--r--src/game/editor/ed_editor.cpp29
-rw-r--r--src/game/editor/ed_editor.h2
-rw-r--r--src/game/editor/ed_layer_quads.cpp3
-rw-r--r--src/game/editor/ed_popups.cpp2
4 files changed, 21 insertions, 15 deletions
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp
index 3220e420..a2ecfb7e 100644
--- a/src/game/editor/ed_editor.cpp
+++ b/src/game/editor/ed_editor.cpp
@@ -462,7 +462,7 @@ void CEditor::RenderBackground(CUIRect View, int Texture, float Size, float Brig
 	Graphics()->QuadsEnd();
 }
 
-int CEditor::UiDoValueSelector(void *pId, CUIRect *r, const char *pLabel, int Current, int Min, int Max, float Scale)
+int CEditor::UiDoValueSelector(void *pId, CUIRect *r, const char *pLabel, int Current, int Min, int Max, float Scale, const char *pToolTip)
 {
     // logic
     static float s_Value;
@@ -496,7 +496,8 @@ int CEditor::UiDoValueSelector(void *pId, CUIRect *r, const char *pLabel, int Cu
 					Current = Max;
 			}
 		}
-		m_pTooltip = Localize("Use left mouse button to drag and the change the value. Hold shift to be more precise.");
+		if(pToolTip)
+			m_pTooltip = pToolTip;
 	}
 	else if(UI()->HotItem() == pId)
 	{
@@ -506,7 +507,8 @@ int CEditor::UiDoValueSelector(void *pId, CUIRect *r, const char *pLabel, int Cu
 			s_Value = 0;
 			UI()->SetActiveItem(pId);
 		}
-		m_pTooltip = Localize("Use left mouse button to drag and the change the value. Hold shift to be more precise.");
+		if(pToolTip)
+			m_pTooltip = pToolTip;
 	}
 
 	if(Inside)
@@ -728,7 +730,7 @@ void CEditor::DoToolbar(CUIRect ToolBar)
 
 		TB_Top.VSplitLeft(30.0f, &Button, &TB_Top);
 		static int s_RotationAmount = 90;
-		s_RotationAmount = UiDoValueSelector(&s_RotationAmount, &Button, "", s_RotationAmount, 1, 360, 2.0f);
+		s_RotationAmount = UiDoValueSelector(&s_RotationAmount, &Button, "", s_RotationAmount, 1, 360, 2.0f, Localize("Rotation of the brush in degrees. Use left mouse button to drag and change the value. Hold shift to be more precise."));
 
 		TB_Top.VSplitLeft(5.0f, &Button, &TB_Top);
 		TB_Top.VSplitLeft(30.0f, &Button, &TB_Top);
@@ -1603,7 +1605,7 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIds, int *
 		}
 		else if(pProps[i].m_Type == PROPTYPE_INT_SCROLL)
 		{
-			int NewValue = UiDoValueSelector(&pIds[i], &Shifter, "", pProps[i].m_Value, pProps[i].m_Min, pProps[i].m_Max, 1.0f);
+			int NewValue = UiDoValueSelector(&pIds[i], &Shifter, "", pProps[i].m_Value, pProps[i].m_Min, pProps[i].m_Max, 1.0f, Localize("Use left mouse button to drag and change the value. Hold shift to be more precise."));
 			if(NewValue != pProps[i].m_Value)
 			{
 				*pNewVal = NewValue;
@@ -1619,7 +1621,7 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIds, int *
 			for(int c = 0; c < 4; c++)
 			{
 				int v = (pProps[i].m_Value >> s_aShift[c])&0xff;
-				NewColor |= UiDoValueSelector(((char *)&pIds[i])+c, &Shifter, s_paTexts[c], v, 0, 255, 1.0f)<<s_aShift[c];
+				NewColor |= UiDoValueSelector(((char *)&pIds[i])+c, &Shifter, s_paTexts[c], v, 0, 255, 1.0f, Localize("Use left mouse button to drag and change the color value. Hold shift to be more precise."))<<s_aShift[c];
 
 				if(c != 3)
 				{
@@ -2067,7 +2069,7 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
 	static int s_NewImageButton = 0;
 	ToolBox.HSplitTop(10.0f, &Slot, &ToolBox);
 	ToolBox.HSplitTop(12.0f, &Slot, &ToolBox);
-	if(DoButton_Editor(&s_NewImageButton, "Add", 0, &Slot, 0, Localize("Load a new image to use in the map")))
+	if(DoButton_Editor(&s_NewImageButton, Localize("Add"), 0, &Slot, 0, Localize("Load a new image to use in the map")))
 		InvokeFileDialog(IStorage::TYPE_ALL, Localize("Add Image"), Localize("Add"), "mapres/", "", AddImage, this);
 }
 
@@ -2398,13 +2400,16 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
 
 			ToolBar.VSplitLeft(15.0f, &Button, &ToolBar);
 
-			static const char *s_paNames[4][4] = {
-				{"X", "", "", ""},
-				{"X", "Y", "", ""},
+			static const char *s_paNames[2][4] = {
 				{"X", "Y", "R", ""},
 				{"R", "G", "B", "A"},
 			};
 
+			const char *paDescriptions[2][4] = {
+				{Localize("X-axis of the envelope"), Localize("Y-axis of the envelope"), Localize("Rotation of the envelope"), ""},
+				{Localize("Red value of the envelope"), Localize("Green value of the envelope"), Localize("Blue value of the envelope"), Localize("Alpha value of the envelope")},
+			};
+
 			static int s_aChannelButtons[4] = {0};
 			int Bit = 1;
 			//ui_draw_button_func draw_func;
@@ -2417,7 +2422,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
 				else if(i == envelope->channels-1) draw_func = draw_editor_button_r;
 				else draw_func = draw_editor_button_m;*/
 
-				if(DoButton_Editor(&s_aChannelButtons[i], s_paNames[pEnvelope->m_Channels-1][i], s_ActiveChannels&Bit, &Button, 0, 0))
+				if(DoButton_Editor(&s_aChannelButtons[i], s_paNames[pEnvelope->m_Channels-3][i], s_ActiveChannels&Bit, &Button, 0, paDescriptions[pEnvelope->m_Channels-3][i]))
 					s_ActiveChannels ^= Bit;
 			}
 		}
@@ -2721,7 +2726,7 @@ int CEditor::PopupMenuFile(CEditor *pEditor, CUIRect View)
 
 	View.HSplitTop(10.0f, &Slot, &View);
 	View.HSplitTop(12.0f, &Slot, &View);
-	if(pEditor->DoButton_MenuItem(&s_ExitButton, "Exit", 0, &Slot, 0, Localize("Exits from the editor")))
+	if(pEditor->DoButton_MenuItem(&s_ExitButton, Localize("Exit"), 0, &Slot, 0, Localize("Exits from the editor")))
 	{
 		g_Config.m_ClEditor = 0;
 		return 1;
diff --git a/src/game/editor/ed_editor.h b/src/game/editor/ed_editor.h
index e459e70f..9ccb3203 100644
--- a/src/game/editor/ed_editor.h
+++ b/src/game/editor/ed_editor.h
@@ -574,7 +574,7 @@ public:
 	void UiInvokePopupMenu(void *pId, int Flags, float x, float y, float w, float h, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect), void *pExtra=0);
 	void UiDoPopupMenu();
 	
-	int UiDoValueSelector(void *pId, CUIRect *r, const char *pLabel, int Current, int Min, int Max, float Scale);
+	int UiDoValueSelector(void *pId, CUIRect *r, const char *pLabel, int Current, int Min, int Max, float Scale, const char *pToolTip);
 
 	static int PopupGroup(CEditor *pEditor, CUIRect View);
 	static int PopupLayer(CEditor *pEditor, CUIRect View);
diff --git a/src/game/editor/ed_layer_quads.cpp b/src/game/editor/ed_layer_quads.cpp
index 3aeffc73..023fd29f 100644
--- a/src/game/editor/ed_layer_quads.cpp
+++ b/src/game/editor/ed_layer_quads.cpp
@@ -5,6 +5,7 @@
 #include "ed_editor.h"
 #include <game/generated/client_data.h>
 #include <game/client/render.h>
+#include <game/localization.h>
 
 CLayerQuads::CLayerQuads()
 {
@@ -220,7 +221,7 @@ int CLayerQuads::RenderProperties(CUIRect *pToolBox)
 	};
 	
 	CProperty aProps[] = {
-		{"Image", m_Image, PROPTYPE_IMAGE, -1, 0},
+		{Localize("Image"), m_Image, PROPTYPE_IMAGE, -1, 0},
 		{0},
 	};
 	
diff --git a/src/game/editor/ed_popups.cpp b/src/game/editor/ed_popups.cpp
index 18351d7a..8152c67c 100644
--- a/src/game/editor/ed_popups.cpp
+++ b/src/game/editor/ed_popups.cpp
@@ -346,7 +346,7 @@ int CEditor::PopupPoint(CEditor *pEditor, CUIRect View)
 	
 	
 	CProperty aProps[] = {
-		{"Color", Color, PROPTYPE_COLOR, -1, pEditor->m_Map.m_lEnvelopes.size()},
+		{Localize("Color"), Color, PROPTYPE_COLOR, -1, pEditor->m_Map.m_lEnvelopes.size()},
 		{0},
 	};