From 4c2dcc4f2b5f061a1d75aa2aa0b316c4b86bc1d8 Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 16 Aug 2010 01:29:11 +0200 Subject: [PATCH] added localisation fixes and map editor tool tips by sworddragon --- src/game/editor/ed_editor.cpp | 29 +++++++++++++++++------------ src/game/editor/ed_editor.h | 2 +- src/game/editor/ed_layer_quads.cpp | 3 ++- src/game/editor/ed_popups.cpp | 2 +- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp index 3220e4203..a2ecfb7ee 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)<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 e459e70f8..9ccb32030 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 3aeffc73b..023fd29f8 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 #include +#include 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 18351d7a6..8152c67c8 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}, };