From f0d808a91257ceda848453c02b342d8a15dd31cc Mon Sep 17 00:00:00 2001 From: Zero Fanker Date: Tue, 29 Oct 2024 00:22:39 -0400 Subject: [PATCH] L10n/chinese translation (#5) * hotkey tips using \t . * simplified edit menu translation (ZH_CN) * refactored GetLanguageStringACP and implemented 'TranslateDlgItem' and 'TranslateWindowCaption' helper function . --------- Co-authored-by: shuiping233 <49360196+shuiping233@users.noreply.github.com> --- MissionEditor/AITriggerAddDlg.cpp | 11 + MissionEditor/AITriggerAddDlg.h | 4 +- MissionEditor/AITriggerTypes.cpp | 47 +- MissionEditor/AITriggerTypes.h | 7 +- MissionEditor/AiTriggerTypesEnable.cpp | 33 +- MissionEditor/AiTriggerTypesEnable.h | 4 +- MissionEditor/All.cpp | 47 +- MissionEditor/All.h | 5 +- MissionEditor/DynamicGraphDlg.cpp | 14 + MissionEditor/DynamicGraphDlg.h | 11 +- MissionEditor/FinalSunDlg.cpp | 4 +- MissionEditor/GlobalsDlg.cpp | 13 + MissionEditor/GlobalsDlg.h | 11 +- MissionEditor/Houses.cpp | 7 +- MissionEditor/Lighting.cpp | 34 +- MissionEditor/Lighting.h | 1 + MissionEditor/MissionEditor.rc | 248 +++++---- MissionEditor/NewRA2HouseDlg.cpp | 11 + MissionEditor/NewRA2HouseDlg.h | 6 +- MissionEditor/SearchWaypointDlg.cpp | 17 +- MissionEditor/SearchWaypointDlg.h | 8 +- MissionEditor/SpecialFlags.cpp | 39 +- MissionEditor/SpecialFlags.h | 8 +- MissionEditor/Structs.h | 37 +- MissionEditor/TSOptions.cpp | 61 +- MissionEditor/TSOptions.h | 19 +- MissionEditor/Tags.cpp | 24 + MissionEditor/Tags.h | 4 +- MissionEditor/TaskForce.cpp | 4 +- MissionEditor/TriggerActionsDlg.cpp | 52 +- MissionEditor/TriggerActionsDlg.h | 4 +- MissionEditor/TriggerEditorDlg.cpp | 14 +- MissionEditor/TriggerEventsDlg.cpp | 24 +- MissionEditor/TriggerEventsDlg.h | 2 + MissionEditor/TriggerOptionsDlg.cpp | 22 +- MissionEditor/Triggers.cpp | 17 +- MissionEditor/UserScriptsDlg.cpp | 34 +- MissionEditor/UserScriptsDlg.h | 5 +- MissionEditor/WaypointID.cpp | 17 +- MissionEditor/WaypointID.h | 7 +- MissionEditor/data/FinalAlert2/FAData.ini | 519 +++++++++--------- MissionEditor/data/FinalAlert2/FALanguage.ini | 194 +++++++ MissionEditor/functions.cpp | 6 +- MissionEditor/functions.h | 1 + MissionEditor/resource.h | 38 +- 45 files changed, 1162 insertions(+), 533 deletions(-) diff --git a/MissionEditor/AITriggerAddDlg.cpp b/MissionEditor/AITriggerAddDlg.cpp index d03d901..e17018a 100644 --- a/MissionEditor/AITriggerAddDlg.cpp +++ b/MissionEditor/AITriggerAddDlg.cpp @@ -68,6 +68,8 @@ BOOL CAITriggerAddDlg::OnInitDialog() { CDialog::OnInitDialog(); + translateUI(); + CListBox* lb = (CListBox*)GetDlgItem(IDC_AITRIGGERS); int i; @@ -80,3 +82,12 @@ BOOL CAITriggerAddDlg::OnInitDialog() return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben } + +void CAITriggerAddDlg::translateUI() +{ + TranslateWindowCaption(*this, "AITriggerEnableAddCaption"); + + TranslateDlgItem(*this, IDC_STATIC, "AITriggerEnableAddDesc"); + TranslateDlgItem(*this, IDOK, "AITriggerEnableAddOK"); + TranslateDlgItem(*this, IDCANCEL, "AITriggerEnableAddCancel"); +} diff --git a/MissionEditor/AITriggerAddDlg.h b/MissionEditor/AITriggerAddDlg.h index e4f0deb..1a66629 100644 --- a/MissionEditor/AITriggerAddDlg.h +++ b/MissionEditor/AITriggerAddDlg.h @@ -48,14 +48,14 @@ public: //{{AFX_VIRTUAL(CAITriggerAddDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual BOOL OnInitDialog(); //}}AFX_VIRTUAL // Implementierung protected: - + void translateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CAITriggerAddDlg) - virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; diff --git a/MissionEditor/AITriggerTypes.cpp b/MissionEditor/AITriggerTypes.cpp index 47ef439..3b66cae 100644 --- a/MissionEditor/AITriggerTypes.cpp +++ b/MissionEditor/AITriggerTypes.cpp @@ -89,8 +89,8 @@ void CAITriggerTypes::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_TEAMTYPE1, m_TeamType1); DDX_Control(pDX, IDC_UNITTYPE, m_UnitType); DDX_Control(pDX, IDC_TEAMTYPE2, m_TeamType2); - DDX_Control(pDX, IDC_FLAG2, m_Flag2); - DDX_Control(pDX, IDC_FLAG1, m_Flag1); + DDX_Control(pDX, IDC_FLAG2, m_conditionType); + DDX_Control(pDX, IDC_FLAG1, m_technoLevel); DDX_Control(pDX, IDC_DATA, m_Data); DDX_Control(pDX, IDC_OWNER, m_Owner); DDX_Control(pDX, IDC_FLOAT3, m_Float3); @@ -100,7 +100,7 @@ void CAITriggerTypes::DoDataExchange(CDataExchange* pDX) DDX_Text(pDX, IDC_FLAG4, m_Flag4); DDX_Text(pDX, IDC_NAME, m_Name); DDX_Check(pDX, IDC_ENABLED, m_Enabled); - DDX_Control(pDX, IDC_CONDITION, m_Condition); + DDX_Control(pDX, IDC_CONDITION, m_operator); DDX_Text(pDX, IDC_NUMBER, m_Number); DDV_MinMaxInt(pDX, m_Number, 0, 256); DDX_Check(pDX, IDC_EASY, m_Easy); @@ -116,12 +116,27 @@ BOOL CAITriggerTypes::OnInitDialog() { auto const ret = CDialog::OnInitDialog(); translateUI(); + initCondtionTypeComboBox(); initMultisideComboBox(); initConditionOpComboBox(); return ret; } +void CAITriggerTypes::initCondtionTypeComboBox() +{ + // TODO: define values from ini + m_conditionType.InsertString(COND_TYPE_NONE, TranslateStringACP("-1 None")); + m_conditionType.InsertString(COND_TYPE_ENEMY_OWNS, TranslateStringACP("0 Enemy owns (CONDITION) N of type X")); + m_conditionType.InsertString(COND_TYPE_SELF_OWNS, TranslateStringACP("1 House owns (CONDITION) N of type X")); + m_conditionType.InsertString(COND_TYPE_ENEMY_YELLOW_POWR, TranslateStringACP("2 Enemy: Yellow power")); + m_conditionType.InsertString(COND_TYPE_ENEMY_RED_POWR, TranslateStringACP("3 Enemy: Red power")); + m_conditionType.InsertString(COND_TYPE_ENEMY_OWNS_SOME_MONEY, TranslateStringACP("4 Enemy owns (CONDITION) N money")); + m_conditionType.InsertString(COND_TYPE_IRON_CURTAIN_READY, TranslateStringACP("5 Iron curtain near ready")); + m_conditionType.InsertString(COND_TYPE_CHRONO_SPHERE_READY, TranslateStringACP("6 Chronosphere near ready")); + m_conditionType.InsertString(COND_TYPE_NEUTRAL_OWNS, TranslateStringACP("7 Neutral owns (CONDITION) N of type X")); +} + void CAITriggerTypes::initMultisideComboBox() { m_MultiSide.InsertString(0, TranslateStringACP("0 None")); @@ -143,12 +158,12 @@ void CAITriggerTypes::initMultisideComboBox() void CAITriggerTypes::initConditionOpComboBox() { - m_Condition.InsertString(COND_LT, TranslateStringACP("less than")); - m_Condition.InsertString(COND_LE, TranslateStringACP("less than or equal to")); - m_Condition.InsertString(COND_EQ, TranslateStringACP("equal to")); - m_Condition.InsertString(COND_GE, TranslateStringACP("greater than or equal to")); - m_Condition.InsertString(COND_GT, TranslateStringACP("greater than")); - m_Condition.InsertString(COND_NE, TranslateStringACP("not equal to")); + m_operator.InsertString(COND_OP_LT, TranslateStringACP("less than")); + m_operator.InsertString(COND_OP_LE, TranslateStringACP("less than or equal to")); + m_operator.InsertString(COND_OP_EQ, TranslateStringACP("equal to")); + m_operator.InsertString(COND_OP_GE, TranslateStringACP("greater than or equal to")); + m_operator.InsertString(COND_OP_GT, TranslateStringACP("greater than")); + m_operator.InsertString(COND_OP_NE, TranslateStringACP("not equal to")); } void CAITriggerTypes::translateUI() @@ -307,10 +322,10 @@ void CAITriggerTypes::OnSelchangeAitriggertype() m_Name = aitt.name; m_TeamType1.SetWindowText(aitt.teamtype1); m_Owner.SetWindowText(TranslateHouse(aitt.owner, TRUE)); - m_Flag1.SetWindowText(aitt.techlevel); + m_technoLevel.SetWindowText(aitt.techlevel); //m_Flag2.SetWindowText(aitt.type); int type = atoi(aitt.type) + 1; - m_Flag2.SetCurSel(type); + m_conditionType.SetCurSel(type); m_UnitType.SetWindowText(aitt.unittype); m_Data.SetWindowText(aitt.data); m_Float1.SetWindowText(aitt.float1); @@ -333,7 +348,7 @@ void CAITriggerTypes::OnSelchangeAitriggertype() AITrigInfo info; info = ConvertToAITrigInfoFromHex((char*)(LPCSTR)aitt.data); - m_Condition.SetCurSel(info.Condition); + m_operator.SetCurSel(info.Condition); m_Number = info.Number; ListObjects(m_UnitType); @@ -386,7 +401,7 @@ void CAITriggerTypes::OnEditchangeTeamtype2() void CAITriggerTypes::OnEditchangeFlag1() { CString value; - m_Flag1.GetWindowText(value); + m_technoLevel.GetWindowText(value); SetAITriggerParam(value, 3); } @@ -394,7 +409,7 @@ void CAITriggerTypes::OnEditchangeFlag1() void CAITriggerTypes::OnEditchangeFlag2() { CString value; - m_Flag2.GetWindowText(value); + m_conditionType.GetWindowText(value); TruncSpace(value); @@ -714,7 +729,7 @@ void CAITriggerTypes::OnSelchangeCondition() UpdateData(TRUE); AITrigInfo info; - info.Condition = ConditionEnum(m_Condition.GetCurSel()); + info.Condition = ConditionOpEnum(m_operator.GetCurSel()); info.Number = m_Number; char buffer[65]; @@ -735,7 +750,7 @@ void CAITriggerTypes::OnChangeNumber() AITrigInfo info; memset(&info, 0, sizeof(AITrigInfo)); - info.Condition = ConditionEnum(m_Condition.GetCurSel()); + info.Condition = ConditionOpEnum(m_operator.GetCurSel()); info.Number = m_Number; char buffer[65]; diff --git a/MissionEditor/AITriggerTypes.h b/MissionEditor/AITriggerTypes.h index 50596aa..5d77055 100644 --- a/MissionEditor/AITriggerTypes.h +++ b/MissionEditor/AITriggerTypes.h @@ -50,8 +50,8 @@ public: CMyComboBox m_TeamType1; CMyComboBox m_UnitType; CMyComboBox m_TeamType2; - CMyComboBox m_Flag2; - CMyComboBox m_Flag1; + CMyComboBox m_conditionType; + CMyComboBox m_technoLevel; CMyComboBox m_Data; CMyComboBox m_Owner; CFloatEdit m_Float3; @@ -66,7 +66,7 @@ public: CString m_Flag8; CString m_Flag9; BOOL m_Enabled; - CComboBox m_Condition; + CComboBox m_operator; int m_Number; BOOL m_Easy; BOOL m_Medium; @@ -88,6 +88,7 @@ protected: // implementation void translateUI(); + void initCondtionTypeComboBox(); void initMultisideComboBox(); void initConditionOpComboBox(); void addTrigger(CString&& content); diff --git a/MissionEditor/AiTriggerTypesEnable.cpp b/MissionEditor/AiTriggerTypesEnable.cpp index 8d8fb42..373e92f 100644 --- a/MissionEditor/AiTriggerTypesEnable.cpp +++ b/MissionEditor/AiTriggerTypesEnable.cpp @@ -72,11 +72,30 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // Behandlungsroutinen für Nachrichten CAiTriggerTypesEnable +BOOL CAiTriggerTypesEnable::OnInitDialog() +{ + auto const ret = CDialog::OnInitDialog(); + translateUI(); + return ret; +} + +void CAiTriggerTypesEnable::translateUI() +{ + TranslateWindowCaption(*this, "AITriggerEnableCaption"); + + TranslateDlgItem(*this, IDC_AI_TRG_ENB_DESC, "AITriggerEnableDesc"); + TranslateDlgItem(*this, IDC_ENABLEALL, "AITriggerEnableAll"); + TranslateDlgItem(*this, IDC_AI_TRG_ENB_TYPE, "AITriggerEnableType"); + TranslateDlgItem(*this, IDC_ADD, "AITriggerEnableAdd"); + TranslateDlgItem(*this, IDC_DELETE, "AITriggerEnableDelete"); +} void CAiTriggerTypesEnable::UpdateDialog() { int sel = m_AITriggerType.GetCurSel(); - if (sel < 0) sel = 0; + if (sel < 0) { + sel = 0; + } while (m_AITriggerType.DeleteString(0) != CB_ERR); @@ -108,8 +127,9 @@ void CAiTriggerTypesEnable::UpdateDialog() m_AITriggerType.AddString(str); } - if (m_AITriggerType.SetCurSel(sel) == CB_ERR) + if (m_AITriggerType.SetCurSel(sel) == CB_ERR) { m_AITriggerType.SetCurSel(0); + } OnSelchangeAitriggertype(); @@ -119,7 +139,6 @@ void CAiTriggerTypesEnable::OnEnableall() { // enable all standard ai triggers CIniFile& ini = Map->GetIniFile(); - int i; for (auto const& [id, def] : ai["AITriggerTypes"]) { ini.SetBool("AITriggerTypesEnable", id, true); } @@ -130,7 +149,9 @@ void CAiTriggerTypesEnable::OnEnableall() void CAiTriggerTypesEnable::OnSelchangeAitriggertype() { int sel = m_AITriggerType.GetCurSel(); - if (sel < 0) return; + if (sel < 0) { + return; + } } @@ -154,7 +175,9 @@ void CAiTriggerTypesEnable::OnAdd() { //CString newTriggerId=InputBox("Please enter the ID of the AITriggerType (for a list of all AITriggerType-IDs use the All-Section)","Enable AITriggerType"); CAITriggerAddDlg dlg; - if (dlg.DoModal() == IDCANCEL) return; + if (dlg.DoModal() == IDCANCEL) { + return; + } CString newTriggerId = dlg.m_AITrigger; TruncSpace(newTriggerId); diff --git a/MissionEditor/AiTriggerTypesEnable.h b/MissionEditor/AiTriggerTypesEnable.h index dfd9f11..1a7fbe9 100644 --- a/MissionEditor/AiTriggerTypesEnable.h +++ b/MissionEditor/AiTriggerTypesEnable.h @@ -52,10 +52,12 @@ public: //{{AFX_VIRTUAL(CAiTriggerTypesEnable) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual BOOL OnInitDialog() override; //}}AFX_VIRTUAL // Implementierung -protected: + + void translateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CAiTriggerTypesEnable) afx_msg void OnEnableall(); diff --git a/MissionEditor/All.cpp b/MissionEditor/All.cpp index f8dad98..0928e8d 100644 --- a/MissionEditor/All.cpp +++ b/MissionEditor/All.cpp @@ -26,6 +26,7 @@ #include "All.h" #include "mapdata.h" #include "variables.h" +#include "functions.h" #ifdef _DEBUG @@ -65,6 +66,33 @@ void CAll::DoDataExchange(CDataExchange* pDX) //}}AFX_DATA_MAP } +BOOL CAll::OnInitDialog() +{ + auto const ret = CDialog::OnInitDialog(); + + translateUI(); + + return ret; +} + +void CAll::translateUI() +{ + TranslateWindowCaption(*this, "IniEditorCaption"); + + TranslateDlgItem(*this, IDC_INI_EDITOR_DESC, "IniEditorDesc"); + TranslateDlgItem(*this, IDC_INI_EDITOR_SECTIONS, "IniEditorSections"); + TranslateDlgItem(*this, IDC_INI_EDITOR_CONTENT, "IniEditorSectionContent"); + TranslateDlgItem(*this, IDC_INI_EDITOR_KEYS, "IniEditorSectionKeys"); + TranslateDlgItem(*this, IDC_INI_EDITOR_VAL, "IniEditorSectionValue"); + + TranslateDlgItem(*this, IDC_ADDSECTION, "IniEditorAdd"); + TranslateDlgItem(*this, IDC_DELETESECTION, "IniEditorDelete"); + TranslateDlgItem(*this, IDC_INISECTION, "IniEditorInsert"); + + TranslateDlgItem(*this, IDC_ADDKEY, "IniEditorAddKey"); + TranslateDlgItem(*this, IDC_DELETEKEY, "IniEditorDeleteKey"); + +} BEGIN_MESSAGE_MAP(CAll, CDialog) //{{AFX_MSG_MAP(CAll) @@ -181,17 +209,23 @@ void CAll::OnDeletesection() { CIniFile& ini = Map->GetIniFile(); - int cusection; - cusection = m_Sections.GetCurSel(); + const int cusection = m_Sections.GetCurSel(); + if (cusection == -1) { - MessageBox("You cannot delete a section without choosing one."); + auto const msg = TranslateStringACP("IniEditorItemUnselected"); + auto const cap = TranslateStringACP("Error"); + MessageBox(msg, cap); return; } CString str; m_Sections.GetLBText(cusection, str); - if (MessageBox(CString((CString)"Are you sure you want to delete " + str + "? You should be really careful, you may not be able to use the map afterwards."), "Delete section", MB_YESNO) == IDNO) { + auto const msgBefore = TranslateStringACP("IniEditorSelectionDeletePrefix"); + auto const msgAfter = TranslateStringACP("IniEditorSelectionDeleteSUffix"); + auto const cap = TranslateStringACP("IniEditorDeleteSelectionCap"); + + if (MessageBox(msgBefore + str + msgAfter, cap, MB_YESNO) == IDNO) { return; } @@ -243,7 +277,10 @@ void CAll::OnAddkey() CString sec; m_Sections.GetLBText(cusection, sec); - CString key = InputBox("Please set the name and value for the current key here: (for example, setting a new key ""Strength"" with the value 200 can be written as ""Strength=200"". You don´t need to specify a value.)", "Create key"); + auto const msg = TranslateStringACP("IniEditorAddKeyDesc"); + auto const cap = TranslateStringACP("IniEditorAddKeyCap"); + auto key = InputBox(msg, cap); + if (key.IsEmpty()) { return; } diff --git a/MissionEditor/All.h b/MissionEditor/All.h index 9456a5e..da6ceb5 100644 --- a/MissionEditor/All.h +++ b/MissionEditor/All.h @@ -55,12 +55,13 @@ public: // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CAll) protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV-Unterstützung + virtual BOOL OnInitDialog() override; //}}AFX_VIRTUAL // Implementierung protected: - + void translateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CAll) afx_msg void OnSelchangeSections(); diff --git a/MissionEditor/DynamicGraphDlg.cpp b/MissionEditor/DynamicGraphDlg.cpp index 530fd6c..dcdaf57 100644 --- a/MissionEditor/DynamicGraphDlg.cpp +++ b/MissionEditor/DynamicGraphDlg.cpp @@ -21,6 +21,7 @@ #include "stdafx.h" #include "finalsun.h" #include "DynamicGraphDlg.h" +#include "functions.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -43,6 +44,19 @@ CDynamicGraphDlg::CDynamicGraphDlg(CWnd* pParent /*=NULL*/) } +BOOL CDynamicGraphDlg::OnInitDialog() +{ + auto const ret = CDialog::OnInitDialog(); + TranslateUI(); + return ret; +} + +void CDynamicGraphDlg::TranslateUI() +{ + TranslateWindowCaption(*this, "LoadingDialogCaption"); + TranslateDlgItem(*this, IDC_LOADING_GRAPH_TXT, "LoadingDialogDesc"); +} + void CDynamicGraphDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); diff --git a/MissionEditor/DynamicGraphDlg.h b/MissionEditor/DynamicGraphDlg.h index 516d39a..2d173fd 100644 --- a/MissionEditor/DynamicGraphDlg.h +++ b/MissionEditor/DynamicGraphDlg.h @@ -38,24 +38,23 @@ class CDynamicGraphDlg : public CDialog public: CDynamicGraphDlg(CWnd* pParent = NULL); // Standardkonstruktor -// Dialogfelddaten - //{{AFX_DATA(CDynamicGraphDlg) + // Dialogfelddaten enum { IDD = IDD_DYNAMICLOAD }; CProgressCtrl m_Progress; - //}}AFX_DATA // Überschreibungen // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CDynamicGraphDlg) protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung - virtual void PostNcDestroy(); + virtual BOOL OnInitDialog() override; + virtual void DoDataExchange(CDataExchange* pDX)override; // DDX/DDV-Unterstützung + virtual void PostNcDestroy()override; //}}AFX_VIRTUAL // Implementierung protected: - + void TranslateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CDynamicGraphDlg) // HINWEIS: Der Klassen-Assistent fügt hier Member-Funktionen ein diff --git a/MissionEditor/FinalSunDlg.cpp b/MissionEditor/FinalSunDlg.cpp index 2eeaa71..aa156e0 100644 --- a/MissionEditor/FinalSunDlg.cpp +++ b/MissionEditor/FinalSunDlg.cpp @@ -3126,7 +3126,9 @@ void CFinalSunDlg::OnMaptoolsAutolevel() } Sound(SOUND_POSITIVE); - MessageBox("This tool will try to automatically raise the terrain using the cliffs.\nIt may take some seconds to execute, as there are masses of data to handle.\nAfter this, you should check your map if everything looks fine. If not, you should use the different height tools, especially flatten ground, to fix any errors. You can use Edit->Undo to undo anything that has been done by using this function.", "Auto Leveler"); + + auto const txt = TranslateStringACP("AutoLevelerDlgDesc"); + MessageBox(EscapeString(txt), TranslateStringACP("Auto Leveler")); m_view.m_isoview->AutoLevel(); } diff --git a/MissionEditor/GlobalsDlg.cpp b/MissionEditor/GlobalsDlg.cpp index 45cf121..0a590d1 100644 --- a/MissionEditor/GlobalsDlg.cpp +++ b/MissionEditor/GlobalsDlg.cpp @@ -178,12 +178,25 @@ BOOL CGlobalsDlg::OnInitDialog() { CDialog::OnInitDialog(); + translateUI(); + UpdateDialog(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben } +void CGlobalsDlg::translateUI() +{ + TranslateWindowCaption(*this, "LocalVariableCaption"); + TranslateDlgItem(*this, IDC_LOCAL_VAR_CUR_TXT, "LocalVariableCurrent"); + TranslateDlgItem(*this, IDC_DESC, "LocalVariableDesc"); + TranslateDlgItem(*this, IDC_LOCAL_VAR_INIT_TXT, "LocalVariableInitValue"); + + m_Value.InsertString(0, TranslateStringACP("0 - Clear")); + m_Value.InsertString(1, TranslateStringACP("1 - Set")); +} + void CGlobalsDlg::OnSelchangeValue() { diff --git a/MissionEditor/GlobalsDlg.h b/MissionEditor/GlobalsDlg.h index 72519f8..36be788 100644 --- a/MissionEditor/GlobalsDlg.h +++ b/MissionEditor/GlobalsDlg.h @@ -50,19 +50,20 @@ public: // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CGlobalsDlg) protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual BOOL OnInitDialog() override; + virtual void OnOK() override; + virtual void OnCancel() override; + virtual void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV-Unterstützung //}}AFX_VIRTUAL // Implementierung protected: - + void translateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CGlobalsDlg) - virtual void OnOK(); - virtual void OnCancel(); + afx_msg void OnChangeDescription(); afx_msg void OnSelchangeGlobal(); - virtual BOOL OnInitDialog(); afx_msg void OnSelchangeValue(); afx_msg void OnEditchangeValue(); //}}AFX_MSG diff --git a/MissionEditor/Houses.cpp b/MissionEditor/Houses.cpp index d3a7467..5de0da0 100644 --- a/MissionEditor/Houses.cpp +++ b/MissionEditor/Houses.cpp @@ -273,7 +273,9 @@ void CHouses::OnPreparehouses() // import the rules.ini houses if (ini[MAPHOUSES].Size() > 0) { - MessageBox("There are already houses in your map. You need to delete these first."); + auto const title = TranslateStringACP("HouseDuplicatedCreatingCaption"); + auto const content = TranslateStringACP("HouseDuplicatedCreatingTip"); + MessageBox(content, title); return; } @@ -414,10 +416,11 @@ void CHouses::OnShowWindow(BOOL bShow, UINT nStatus) if (bShow) { if (!ini.TryGetSection(MAPHOUSES) && ini.Size() > 0) { + auto const caption = TranslateStringACP("HouseNoneExistenseCap"); #ifndef RA2_MODE MessageBox("No houses do exist, if you want to use houses, you should use ""Prepare houses"" before doing anything else. Note that in a multiplayer map independent computer players cannot be created by using the names GDI and Nod for the house. Just use something like GDI_AI."); #else - MessageBox("No houses do exist, if you want to use houses, you should use ""Prepare houses"" before doing anything else."); + MessageBox(TranslateStringACP("HouseNoneExistense"), caption); #endif } diff --git a/MissionEditor/Lighting.cpp b/MissionEditor/Lighting.cpp index 92c81e9..4209ae0 100644 --- a/MissionEditor/Lighting.cpp +++ b/MissionEditor/Lighting.cpp @@ -26,6 +26,7 @@ #include "Lighting.h" #include "mapdata.h" #include "variables.h" +#include "functions.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -102,21 +103,36 @@ void CLighting::UpdateDialog() //MessageBox(ini.GetString("Lightning", "Ambient")); } -BOOL CLighting::OnInitDialog() +void CLighting::translateUI() { - CDialog::OnInitDialog(); + TranslateDlgItem(*this, IDC_TASKFORCE_T_TYPE, "TaskforcesType"); + TranslateWindowCaption(*this, "Lighting"); + TranslateDlgItem(*this, IDD_LIGHTING, "Lighting"); + TranslateDlgItem(*this, IDC_DESC, "LightingDesc"); + TranslateDlgItem(*this, IDC_LNORMAL, "LightingNormal"); + TranslateDlgItem(*this, IDC_LAMBIENT1, "LightingNormalAmbient"); + TranslateDlgItem(*this, IDC_LLEVEL1, "LightingNormalLevel"); + TranslateDlgItem(*this, IDC_LRED1, "LightingNormalRed"); + TranslateDlgItem(*this, IDC_LGREEN1, "LightingNormalGreen"); + TranslateDlgItem(*this, IDC_LBLUE1, "LightingNormalBlue"); + TranslateDlgItem(*this, IDC_LIONSTORM, "LightingIonStorm"); + TranslateDlgItem(*this, IDC_LAMBIENT2, "LightingWeatherStormAmbient"); + TranslateDlgItem(*this, IDC_LLEVEL2, "LightingWeatherStormLevel"); + TranslateDlgItem(*this, IDC_LRED2, "LightingWeatherStormRed"); + TranslateDlgItem(*this, IDC_LGREEN2, "LightingWeatherStormGreen"); + TranslateDlgItem(*this, IDC_LBLUE2, "LightingWeatherStormBlue"); #ifdef RA2_MODE - SetDlgItemText(IDC_LIONSTORM, "Weather Storm Settings"); + TranslateDlgItem(*this, IDC_LIONSTORM, "LightingWeatherStorm"); #endif - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben } - - - +BOOL CLighting::OnInitDialog() +{ + auto const ret = CDialog::OnInitDialog(); + translateUI(); + return ret; +} void CLighting::OnChangeAmbient() { diff --git a/MissionEditor/Lighting.h b/MissionEditor/Lighting.h index b17cde7..7d1ef2a 100644 --- a/MissionEditor/Lighting.h +++ b/MissionEditor/Lighting.h @@ -70,6 +70,7 @@ protected: // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CLighting) virtual BOOL OnInitDialog(); + void translateUI(); afx_msg void OnChangeAmbient(); afx_msg void OnChangeLevel(); afx_msg void OnKillfocusAmbient(); diff --git a/MissionEditor/MissionEditor.rc b/MissionEditor/MissionEditor.rc index 7430c5c..ae86e91 100644 --- a/MissionEditor/MissionEditor.rc +++ b/MissionEditor/MissionEditor.rc @@ -166,14 +166,14 @@ IDB_SCROLLCURSOR BITMAP "res\\scrollcursor_ra2.bmp" // Dialog // -IDD_NEWRA2HOUSE DIALOG 0, 0, 186, 52 +IDD_NEWRA2HOUSE DIALOGEX 0, 0, 186, 52 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Create new house" -FONT 8, "MS Sans Serif" +FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN DEFPUSHBUTTON "OK",IDOK,129,7,50,14 PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14 - LTEXT "Choose parent country:",IDC_STATIC,7,7,98,12 + LTEXT "Choose parent country:",IDC_NEWHOUSE_PARERNT,7,7,98,12 COMBOBOX IDC_COUNTRY,7,20,112,118,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END @@ -300,15 +300,15 @@ BEGIN LTEXT "UNDO IS NOT AVAILABLE!",IDC_STATIC,7,152,198,16 END -IDD_AITRIGGERADD DIALOG 0, 0, 222, 97 +IDD_AITRIGGERADD DIALOGEX 0, 0, 223, 292 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Enable AI Trigger" -FONT 8, "MS Sans Serif" +FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - DEFPUSHBUTTON "OK",IDOK,165,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,165,24,50,14 + DEFPUSHBUTTON "OK",IDOK,166,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,166,24,50,14 LTEXT "Select AI Trigger that should be enabled:",IDC_STATIC,7,7,136,21 - LISTBOX IDC_AITRIGGERS,7,48,208,42,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_AITRIGGERS,7,39,209,246,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END IDD_MYOPENDIALOG DIALOGEX 0, 0, 222, 30 @@ -356,12 +356,12 @@ FONT 8, "Tahoma", 0, 0, 0x0 BEGIN DEFPUSHBUTTON "OK",IDOK,140,159,50,14 PUSHBUTTON "Cancel",IDCANCEL,85,159,50,14 - LTEXT "Red Alert 2 EXE (make sure its in the correct path)",IDC_STATIC,5,5,130,20 + LTEXT "Red Alert 2 EXE (make sure its in the correct path)",IDC_DESC,5,5,184,20 EDITTEXT IDC_EDIT1,5,25,130,15,ES_AUTOHSCROLL PUSHBUTTON "Browse",IDC_CHOOSE,140,25,50,15 - LTEXT "Language / Sprache:",IDC_STATIC,7,51,128,11 + LTEXT "Language / Sprache:",IDC_OPTIONS_LAN_TXT,7,51,128,11 COMBOBOX IDC_LANGUAGE,7,63,183,94,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Support settings",IDC_STATIC,7,81,183,71 + GROUPBOX "Support settings",IDC_OPTIONS_SUPPORT_TXT,7,81,183,71 CONTROL "Support mission disks and mods (recommended)",IDC_RULESLIKETS, "Button",BS_AUTORADIOBUTTON | BS_MULTILINE | WS_GROUP,14,92,170,16 CONTROL "Only support original Red Alert 2",IDC_ONLYORIGINAL, @@ -371,20 +371,20 @@ BEGIN END #endif -IDD_ALL DIALOG 0, 0, 303, 204 +IDD_ALL DIALOGEX 0, 0, 303, 204 STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU CAPTION "INI Editor" -FONT 8, "Tahoma" +FONT 8, "Tahoma", 0, 0, 0x0 BEGIN - LTEXT "We highly recommend not to use this editor except you really know what you are doing.",IDC_STATIC,6,5,290,15 - LTEXT "Sections:",IDC_STATIC,5,25,55,10 + LTEXT "We highly recommend not to use this editor except you really know what you are doing.",IDC_INI_EDITOR_DESC,6,5,290,15 + LTEXT "Sections:",IDC_INI_EDITOR_SECTIONS,5,25,55,10 COMBOBOX IDC_SECTIONS,61,25,235,85,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Keys:",IDC_STATIC,15,80,40,10 + LTEXT "Keys:",IDC_INI_EDITOR_KEYS,15,80,40,10 PUSHBUTTON "Add",IDC_ADDSECTION,60,40,55,15 PUSHBUTTON "Delete",IDC_DELETESECTION,120,40,55,15 - GROUPBOX "Section content",IDC_STATIC,6,67,290,130 + GROUPBOX "Section content",IDC_INI_EDITOR_CONTENT,6,67,290,130 LISTBOX IDC_KEYS,60,80,225,90,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Value:",IDC_STATIC,15,175,40,15 + LTEXT "Value:",IDC_INI_EDITOR_VAL,15,175,40,15 EDITTEXT IDC_VALUE,60,175,225,12,ES_AUTOHSCROLL PUSHBUTTON "Add",IDC_ADDKEY,15,95,40,15 PUSHBUTTON "Delete",IDC_DELETEKEY,15,115,40,15 @@ -412,15 +412,15 @@ BEGIN LTEXT "Height:",IDC_MAP_D_HEIGHT,107,56,93,9 END -IDD_INPUTBOX DIALOG 0, 0, 214, 70 +IDD_INPUTBOX DIALOGEX 0, 0, 289, 62 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Dialog" -FONT 8, "Tahoma" +FONT 8, "Tahoma", 0, 0, 0x0 BEGIN - DEFPUSHBUTTON "OK",IDOK,160,5,50,14 - PUSHBUTTON "Cancel",IDCANCEL,160,25,50,14 - LTEXT "Static",IDC_SENTENCE,5,5,150,35 - EDITTEXT IDC_VAL,5,50,205,12,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,235,4,50,14 + PUSHBUTTON "Cancel",IDCANCEL,235,20,50,14 + LTEXT "Static",IDC_SENTENCE,5,5,228,33 + EDITTEXT IDC_VAL,2,46,280,12,ES_AUTOHSCROLL END IDD_IMPORTINI DIALOG 0, 0, 229, 150 @@ -811,23 +811,23 @@ BEGIN PUSHBUTTON "Clone",IDC_COPYUNIT,17,118,61,15 END -IDD_TAGS DIALOG 0, 0, 303, 204 +IDD_TAGS DIALOGEX 0, 0, 303, 204 STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU CAPTION "Tags" -FONT 8, "Tahoma" +FONT 8, "Tahoma", 0, 0, 0x0 BEGIN - LTEXT "Tags make Triggers work. Without a tag, a trigger is usually useless, because it won't be executed (except if another triggers fires it directly).",IDC_STATIC,7,7,290,20 - LTEXT "Tag:",IDC_STATIC,7,36,54,12 + LTEXT "Tags make Triggers work. Without a tag, a trigger is usually useless, because it won't be executed (except if another triggers fires it directly).",IDC_DESC,7,7,290,20 + LTEXT "Tag:",IDC_TAGS_CUR_TXT,7,36,54,12 COMBOBOX IDC_TAG,61,37,236,196,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Add",IDC_ADD,169,53,59,14 PUSHBUTTON "Delete",IDC_DELETE,238,53,59,14 - LTEXT "Name:",IDC_STATIC,7,90,54,12 + LTEXT "Name:",IDC_TAGS_NAME,7,90,54,12 EDITTEXT IDC_NAME,61,89,236,13,ES_AUTOHSCROLL - LTEXT "Repeat:",IDC_STATIC,7,110,54,13 + LTEXT "Repeat:",IDC_TAGS_REPEAT,7,110,54,13 COMBOBOX IDC_REPEAT,61,110,236,59,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Trigger:",IDC_STATIC,7,131,54,13 + LTEXT "Trigger:",IDC_TAGS_TRIGGER,7,131,54,13 COMBOBOX IDC_TRIGGER,61,131,236,135,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "For every trigger you create, you should create a tag to make the trigger work. A trigger consists of some general properties, an event and an action, which can all be defined in the ""trigger"" section.",IDC_STATIC,7,167,290,30 + LTEXT "For every trigger you create, you should create a tag to make the trigger work. A trigger consists of some general properties, an event and an action, which can all be defined in the ""trigger"" section.",IDC_TAGS_DESC_2,7,167,290,30 END IDD_TRIGGERS DIALOG 0, 0, 303, 204 @@ -1096,13 +1096,13 @@ BEGIN PUSHBUTTON "Copy",IDC_COPYACTION,165,201,60,14 END -IDD_AITRIGGERTYPESENABLE DIALOG 0, 0, 303, 204 +IDD_AITRIGGERTYPESENABLE DIALOGEX 0, 0, 303, 204 STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU CAPTION "AI Trigger Types Enable" -FONT 8, "Tahoma" +FONT 8, "Tahoma", 0, 0, 0x0 BEGIN - LTEXT "This allows the AI for example to create teams automatically. You simply specify which AITriggerTypes are enabled.",IDC_STATIC,7,7,287,23 - LTEXT "AITriggerType:",IDC_STATIC,7,62,60,13 + LTEXT "This allows the AI for example to create teams automatically. You simply specify which AITriggerTypes are enabled.",IDC_AI_TRG_ENB_DESC,7,7,287,23 + LTEXT "AITriggerType:",IDC_AI_TRG_ENB_TYPE,7,62,60,13 COMBOBOX IDC_AITRIGGERTYPE,71,62,223,281,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Enable all standard AI triggers (recommended)",IDC_ENABLEALL,7,30,160,14 PUSHBUTTON "Delete = Disable AITrigger",IDC_DELETE,192,81,102,15 @@ -1136,12 +1136,12 @@ BEGIN LTEXT "Shutting down, please wait a few seconds",IDC_STATIC,7,14,172,13 END -IDD_DYNAMICLOAD DIALOG 0, 0, 220, 44 +IDD_DYNAMICLOAD DIALOGEX 0, 0, 220, 44 STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION CAPTION "Loading" -FONT 8, "MS Sans Serif" +FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - LTEXT "Loading graphics, please wait a few seconds.",IDC_STATIC,7,7,206,15 + LTEXT "Loading graphics, please wait a few seconds.",IDC_LOADING_GRAPH_TXT,7,7,206,15 CONTROL "Progress4",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,7,22,206,15 END @@ -1197,50 +1197,50 @@ IDD_TRIGGEREVENTS DIALOGEX 0, 0, 365, 204 STYLE DS_SETFONT | WS_CHILD FONT 8, "Tahoma", 0, 0, 0x0 BEGIN - LTEXT "Current event:",IDC_STATIC,6,6,64,11 + LTEXT "Current event:",IDC_EVENT_CUR_TXT,6,6,64,11 COMBOBOX IDC_EVENT,72,6,150,79,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "New event",IDC_NEWEVENT,233,6,61,14 PUSHBUTTON "Delete event",IDC_DELETEEVENT,300,6,61,14 - GROUPBOX "Event options",IDC_STATIC,6,19,355,178 - LTEXT "Event type:",IDC_STATIC,14,32,57,12 + GROUPBOX "Event options",IDC_EVENT_OPT_TXT,6,19,355,178 + LTEXT "Event type:",IDC_EVENT_TYPE_TXT,14,32,57,12 COMBOBOX IDC_EVENTTYPE,72,30,282,184,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP EDITTEXT IDC_EVENTDESCRIPTION,14,48,340,26,ES_MULTILINE | ES_READONLY | WS_VSCROLL - LTEXT "Event parameters:",IDC_STATIC,14,79,74,10 + LTEXT "Event parameters:",IDC_EVENT_PARAM_TXT,14,79,74,10 LISTBOX IDC_PARAMETER,14,93,159,96,LBS_SORT | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP - LTEXT "Parameter value:",IDC_STATIC,185,79,118,10 + LTEXT "Parameter value:",IDC_EVENT_VAL_TXT,185,79,118,10 COMBOBOX IDC_PARAMVALUE,185,93,169,125,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_NOINTEGRALHEIGHT | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP - LTEXT "Select the event type first, then set all parameters.",IDC_STATIC,185,110,169,25 + LTEXT "Select the event type first, then set all parameters.",IDC_EVENT_DESC,185,110,169,25 END IDD_TRIGGERACTIONS DIALOGEX 0, 0, 365, 202 STYLE DS_SETFONT | WS_CHILD FONT 8, "Tahoma", 0, 0, 0x0 BEGIN - LTEXT "Current action:",IDC_STATIC,6,6,58,11 + LTEXT "Current action:",IDC_ACTION_CUR_TXT,6,6,58,11 COMBOBOX IDC_ACTION,72,6,149,79,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "New action",IDC_NEWACTION,233,6,60,14 PUSHBUTTON "Delete action",IDC_DELETEACTION,301,6,59,14 - GROUPBOX "Action options",IDC_STATIC,6,20,354,174 - LTEXT "Action type:",IDC_STATIC,14,32,57,12 + GROUPBOX "Action options",IDC_ACTION_OPT_TXT,6,20,354,174 + LTEXT "Action type:",IDC_ACTION_TYPE_TXT,14,32,57,12 COMBOBOX IDC_ACTIONTYPE,72,30,282,184,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP EDITTEXT IDC_ACTIONDESCRIPTION,14,48,340,26,ES_MULTILINE | ES_READONLY | WS_VSCROLL - LTEXT "Action parameters:",IDC_STATIC,14,79,74,10 + LTEXT "Action parameters:",IDC_ACTION_PARAM_TXT,14,79,74,10 LISTBOX IDC_PARAMETER,14,93,160,94,LBS_SORT | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP - LTEXT "Parameter value:",IDC_STATIC,186,79,118,10 + LTEXT "Parameter value:",IDC_ACTION_VAL_TXT,186,79,118,10 COMBOBOX IDC_PARAMVALUE,186,92,168,125,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_NOINTEGRALHEIGHT | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP - LTEXT "Select the event type first, then set all parameters.",IDC_STATIC,186,110,168,25 + LTEXT "Select the event type first, then set all parameters.",IDC_ACTION_DESC,186,110,168,25 END -IDD_GLOBALS DIALOG 0, 0, 186, 79 +IDD_GLOBALS DIALOGEX 0, 0, 186, 79 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Local Variables" -FONT 8, "MS Sans Serif" +FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - LTEXT "Select variable:",IDC_STATIC,7,7,60,12 + LTEXT "Select variable:",IDC_LOCAL_VAR_CUR_TXT,7,7,60,12 COMBOBOX IDC_GLOBAL,7,19,172,92,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Description:",IDC_STATIC,7,41,44,12 + LTEXT "Description:",IDC_DESC,7,41,44,12 EDITTEXT IDC_DESCRIPTION,56,41,123,13,ES_AUTOHSCROLL - LTEXT "Preset value:",IDC_STATIC,7,60,45,11 + LTEXT "Preset value:",IDC_LOCAL_VAR_INIT_TXT,7,60,45,11 COMBOBOX IDC_VALUE,57,59,122,55,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -1599,14 +1599,14 @@ BEGIN GROUPBOX "Preview",IDC_PREVIEW,7,140,179,86 END -IDD_SEARCHWAYPOINT DIALOG 0, 0, 186, 95 +IDD_SEARCHWAYPOINT DIALOGEX 0, 0, 186, 95 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Search Waypoint" -FONT 8, "MS Sans Serif" +FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN DEFPUSHBUTTON "Search",IDOK,129,7,50,14 PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14 - LTEXT "Waypoints:",IDC_STATIC,7,7,96,12 + LTEXT "Waypoints:",IDC_SEARCH_WP_WP,7,7,96,12 LISTBOX IDC_WAYPOINTS,7,21,97,67,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END @@ -1664,18 +1664,18 @@ BEGIN END #endif -IDD_USERSCRIPTS DIALOG 0, 0, 301, 193 +IDD_USERSCRIPTS DIALOGEX 0, 0, 301, 193 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Map Scripts" -FONT 8, "MS Sans Serif" +FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN DEFPUSHBUTTON "Run",IDOK,244,40,50,14 PUSHBUTTON "Quit",IDCANCEL,244,57,50,14 - LTEXT "Scripts available:",IDC_STATIC,7,24,109,12 + LTEXT "Scripts available:",IDC_USR_SCRIPTS_AVA,7,24,109,12 LISTBOX IDC_SCRIPTS,7,39,230,74,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Report:",IDC_STATIC,7,124,117,15 + LTEXT "Report:",IDC_USR_SCRIPTS_REPORT,7,124,117,15 EDITTEXT IDC_REPORT,7,145,287,41,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL - LTEXT "For safety reasons, you should save your map before running scripts. Undo is not available.",IDC_STATIC,7,7,287,17 + LTEXT "For safety reasons, you should save your map before running scripts. Undo is not available.",IDC_USR_SCRIPTS_DESC,7,7,287,17 END IDD_COMBO_UINPUT DIALOG 0, 0, 238, 63 @@ -1749,9 +1749,9 @@ BEGIN IDD_AITRIGGERADD, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 215 + RIGHTMARGIN, 216 TOPMARGIN, 7 - BOTTOMMARGIN, 90 + BOTTOMMARGIN, 285 END IDD_MYOPENDIALOG, DIALOG @@ -1782,6 +1782,8 @@ BEGIN IDD_INPUTBOX, DIALOG BEGIN + RIGHTMARGIN, 285 + BOTTOMMARGIN, 60 END IDD_IMPORTINI, DIALOG @@ -1905,6 +1907,10 @@ BEGIN HORZGUIDE, 280 END + IDD_AITRIGGERTYPESENABLE, DIALOG + BEGIN + END + IDD_TERRAINBAR, DIALOG BEGIN RIGHTMARGIN, 412 @@ -1977,6 +1983,10 @@ BEGIN HORZGUIDE, 79 END + IDD_GLOBALS, DIALOG + BEGIN + END + "IDD_TSOPTIONS$(TS_MODE)", DIALOG BEGIN BOTTOMMARGIN, 165 @@ -2550,20 +2560,6 @@ BEGIN END #endif -IDD_TAGS DLGINIT -BEGIN - IDC_REPEAT, 0x403, 36, 0 -0x2030, 0x202d, 0x614d, 0x656b, 0x7420, 0x6568, 0x7420, 0x6972, 0x6767, -0x7265, 0x7720, 0x726f, 0x206b, 0x6e6f, 0x796c, 0x6f20, 0x636e, 0x0065, - - IDC_REPEAT, 0x403, 12, 0 -0x2031, 0x202d, 0x6e55, 0x6e6b, 0x776f, 0x006e, - IDC_REPEAT, 0x403, 32, 0 -0x2032, 0x202d, 0x614d, 0x656b, 0x7420, 0x6568, 0x7420, 0x6972, 0x6767, -0x7265, 0x7220, 0x7065, 0x6165, 0x6974, 0x676e, 0x0020, - 0 -END - IDD_TRIGGERS DLGINIT BEGIN IDC_TRIGGER2, 0x403, 7, 0 @@ -2578,35 +2574,6 @@ IDD_AITRIGGERTYPES$(RA2_MODE) DLGINIT IDD_AITRIGGERTYPES DLGINIT #endif BEGIN - IDC_FLAG2, 0x403, 8, 0 -0x312d, 0x4e20, 0x6e6f, 0x0065, - IDC_FLAG2, 0x403, 37, 0 -0x2030, 0x6e45, 0x6d65, 0x2079, 0x776f, 0x736e, 0x2820, 0x4f43, 0x444e, -0x5449, 0x4f49, 0x294e, 0x4e20, 0x6f20, 0x2066, 0x7974, 0x6570, 0x5820, -"\000" - IDC_FLAG2, 0x403, 37, 0 -0x2031, 0x6f48, 0x7375, 0x2065, 0x776f, 0x736e, 0x2820, 0x4f43, 0x444e, -0x5449, 0x4f49, 0x294e, 0x4e20, 0x6f20, 0x2066, 0x7974, 0x6570, 0x5820, -"\000" - IDC_FLAG2, 0x403, 22, 0 -0x2032, 0x6e45, 0x6d65, 0x3a79, 0x5920, 0x6c65, 0x6f6c, 0x2077, 0x6f70, -0x6577, 0x0072, - IDC_FLAG2, 0x403, 19, 0 -0x2033, 0x6e45, 0x6d65, 0x3a79, 0x5220, 0x6465, 0x7020, 0x776f, 0x7265, -"\000" - IDC_FLAG2, 0x403, 33, 0 -0x2034, 0x6e45, 0x6d65, 0x2079, 0x776f, 0x736e, 0x2820, 0x4f43, 0x444e, -0x5449, 0x4f49, 0x294e, 0x4e20, 0x6d20, 0x6e6f, 0x7965, "\000" - IDC_FLAG2, 0x403, 26, 0 -0x2035, 0x7249, 0x6e6f, 0x6320, 0x7275, 0x6174, 0x6e69, 0x6e20, 0x6165, -0x2072, 0x6572, 0x6461, 0x0079, - IDC_FLAG2, 0x403, 26, 0 -0x2036, 0x6843, 0x6f72, 0x6f6e, 0x7073, 0x6568, 0x6572, 0x6e20, 0x6165, -0x2072, 0x6572, 0x6461, 0x0079, - IDC_FLAG2, 0x403, 39, 0 -0x2037, 0x654e, 0x7475, 0x6172, 0x206c, 0x776f, 0x736e, 0x2820, 0x4f43, -0x444e, 0x5449, 0x4f49, 0x294e, 0x4e20, 0x6f20, 0x2066, 0x7974, 0x6570, -0x5820, "\000" IDC_DATA, 0x403, 65, 0 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, @@ -2824,10 +2791,6 @@ END IDD_TRIGGEROPTIONS DLGINIT BEGIN - IDC_TRIGGERTYPE, 0x403, 13, 0 -0x2030, 0x202d, 0x7453, 0x6e61, 0x6164, 0x6472, "\000" - IDC_TRIGGERTYPE, 0x403, 14, 0 -0x2032, 0x202d, 0x6552, 0x6570, 0x7461, 0x6e69, 0x0067, IDC_HOUSE, 0x403, 13, 0 0x2030, 0x202d, 0x7453, 0x6e61, 0x6164, 0x6472, "\000" IDC_HOUSE, 0x403, 14, 0 @@ -2835,15 +2798,6 @@ BEGIN 0 END -IDD_GLOBALS DLGINIT -BEGIN - IDC_VALUE, 0x403, 10, 0 -0x2030, 0x202d, 0x6c43, 0x6165, 0x0072, - IDC_VALUE, 0x403, 8, 0 -0x2031, 0x202d, 0x6553, 0x0074, - 0 -END - #if defined(APSTUDIO_INVOKED) || defined(RA2_MODE) #if defined(APSTUDIO_INVOKED) IDD_TEAMTYPES$(RA2_MODE) DLGINIT @@ -3627,6 +3581,56 @@ BEGIN END #endif +IDD_DYNAMICLOAD AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_GLOBALS AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_TAGS AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_AITRIGGERTYPESENABLE AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_AITRIGGERADD AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_SEARCHWAYPOINT AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_NEWRA2HOUSE AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_USERSCRIPTS AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_ALL AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_INPUTBOX AFX_DIALOG_LAYOUT +BEGIN + 0 +END + ///////////////////////////////////////////////////////////////////////////// // diff --git a/MissionEditor/NewRA2HouseDlg.cpp b/MissionEditor/NewRA2HouseDlg.cpp index e765f8e..61d2966 100644 --- a/MissionEditor/NewRA2HouseDlg.cpp +++ b/MissionEditor/NewRA2HouseDlg.cpp @@ -68,6 +68,8 @@ BOOL CNewRA2HouseDlg::OnInitDialog() { CDialog::OnInitDialog(); + translateUI(); + CComboBox* country = (CComboBox*)GetDlgItem(IDC_COUNTRY); for (auto const& [seq, id] : rules[HOUSES]) { @@ -81,3 +83,12 @@ BOOL CNewRA2HouseDlg::OnInitDialog() return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben } + +void CNewRA2HouseDlg::translateUI() +{ + TranslateWindowCaption(*this, "NewRA2HouseDlgCaption"); + + TranslateDlgItem(*this, IDC_NEWHOUSE_PARERNT, "NewRA2HouseDlgChooseParent"); + TranslateDlgItem(*this, IDOK, "OK"); + TranslateDlgItem(*this, IDCANCEL, "Cancel"); +} \ No newline at end of file diff --git a/MissionEditor/NewRA2HouseDlg.h b/MissionEditor/NewRA2HouseDlg.h index 2645af6..4d57a2a 100644 --- a/MissionEditor/NewRA2HouseDlg.h +++ b/MissionEditor/NewRA2HouseDlg.h @@ -47,15 +47,15 @@ public: // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CNewRA2HouseDlg) protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV-Unterstützung + virtual BOOL OnInitDialog() override; //}}AFX_VIRTUAL // Implementierung protected: - + void translateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CNewRA2HouseDlg) - virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; diff --git a/MissionEditor/SearchWaypointDlg.cpp b/MissionEditor/SearchWaypointDlg.cpp index 617dae6..ae32b69 100644 --- a/MissionEditor/SearchWaypointDlg.cpp +++ b/MissionEditor/SearchWaypointDlg.cpp @@ -25,6 +25,7 @@ #include "finalsun.h" #include "SearchWaypointDlg.h" #include "variables.h" +#include "functions.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -66,6 +67,8 @@ BOOL CSearchWaypointDlg::OnInitDialog() { CDialog::OnInitDialog(); + translateUI(); + CListBox& ctrl = *(CListBox*)GetDlgItem(IDC_WAYPOINTS); while (ctrl.DeleteString(0) != LB_ERR); @@ -91,10 +94,20 @@ void CSearchWaypointDlg::OnOK() int sel = ctrl.GetCurSel(); - if (sel < 0) m_WaypointIndex = -1; - else { + if (sel < 0) { + m_WaypointIndex = -1; + } else { m_WaypointIndex = ctrl.GetItemData(sel); } CDialog::OnOK(); } + +void CSearchWaypointDlg::translateUI() +{ + TranslateWindowCaption(*this, "SearchWaypointDlgCaption"); + + TranslateDlgItem(*this, IDC_SEARCH_WP_WP, "SearchWaypointDlgWaypoints"); + TranslateDlgItem(*this, IDOK, "SearchWaypointDlgOk"); + TranslateDlgItem(*this, IDCANCEL, "SearchWaypointDlgCancel"); +} \ No newline at end of file diff --git a/MissionEditor/SearchWaypointDlg.h b/MissionEditor/SearchWaypointDlg.h index 0309766..10d8a16 100644 --- a/MissionEditor/SearchWaypointDlg.h +++ b/MissionEditor/SearchWaypointDlg.h @@ -48,16 +48,18 @@ public: // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CSearchWaypointDlg) protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV-Unterstützung + virtual BOOL OnInitDialog() override; + virtual void OnOK() override; //}}AFX_VIRTUAL // Implementierung protected: + void translateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CSearchWaypointDlg) - virtual BOOL OnInitDialog(); - virtual void OnOK(); + //}}AFX_MSG DECLARE_MESSAGE_MAP() }; diff --git a/MissionEditor/SpecialFlags.cpp b/MissionEditor/SpecialFlags.cpp index 317c131..f09622d 100644 --- a/MissionEditor/SpecialFlags.cpp +++ b/MissionEditor/SpecialFlags.cpp @@ -121,8 +121,6 @@ void CSpecialFlags::UpdateDialog() m_Visceroids.SetWindowText(sec.GetString("Visceroids")); #ifdef RA2_MODE - SetDlgItemText(IDC_LTIBERIUMGROWS, "Ore grows:"); - SetDlgItemText(IDC_LTIBERIUMSPREADS, "Ore spreads:"); GetDlgItem(IDC_LTIBERIUMEXPLOSIVE)->ShowWindow(SW_HIDE); GetDlgItem(IDC_TIBERIUMEXPLOSIVE)->ShowWindow(SW_HIDE); GetDlgItem(IDC_HARVESTERIMMUNE)->ShowWindow(SW_HIDE); @@ -131,15 +129,46 @@ void CSpecialFlags::UpdateDialog() GetDlgItem(IDC_LMETEORITES)->ShowWindow(SW_HIDE); GetDlgItem(IDC_VISCEROIDS)->ShowWindow(SW_HIDE); GetDlgItem(IDC_LVISCEROIDS)->ShowWindow(SW_HIDE); - - SetDlgItemText(IDC_LFOGOFWAR, "Shroud:"); - SetDlgItemText(IDC_LIONSTORMS, "Weather Storms:"); #endif }; ///////////////////////////////////////////////////////////////////////////// // Behandlungsroutinen für Nachrichten CSpecialFlags +BOOL CSpecialFlags::OnInitDialog() +{ + auto const ret = CDialog::OnInitDialog(); + +#if defined(RA2_MODE) + SetDlgItemText(IDC_LTIBERIUMGROWS, "Ore grows:"); + SetDlgItemText(IDC_LTIBERIUMSPREADS, "Ore spreads:"); + SetDlgItemText(IDC_LFOGOFWAR, "Shroud:"); + SetDlgItemText(IDC_LIONSTORMS, "Weather Storms:"); +#endif + + TranslateUI(); + return ret; +} + +void CSpecialFlags::TranslateUI() +{ + TranslateWindowCaption(*this, "SpecialFlagsCaption"); + TranslateDlgItem(*this, IDC_DESC, "SpecialFlagsDesc"); + TranslateDlgItem(*this, IDC_LTIBERIUMGROWS, "SpecialFlagsTiberiumGrows"); + TranslateDlgItem(*this, IDC_LTIBERIUMSPREADS, "SpecialFlagsTiberiumSpread"); + TranslateDlgItem(*this, IDC_LTIBERIUMEXPLOSIVE, "SpecialFlagsTiberiumExplosive"); + TranslateDlgItem(*this, IDC_LDESTROYABLEBRIDGES, "SpecialFlagsTiberiumBridgeDestroyable"); + TranslateDlgItem(*this, IDC_LMCVDEPLOY, "SpecialFlagsMCVRedeploy"); + TranslateDlgItem(*this, IDC_LINITIALVETERAN, "SpecialFlagsInitialVeteran"); + TranslateDlgItem(*this, IDC_LFIXEDALLIANCE, "SpecialFlagsFixedAlliance"); + TranslateDlgItem(*this, IDC_LHARVESTERIMMUNE, "SpecialFlagsHarvesterImmune"); + TranslateDlgItem(*this, IDC_LINERT, "SpecialFlagsInert"); + TranslateDlgItem(*this, IDC_LFOGOFWAR, "SpecialFlagsFogOfWar"); + TranslateDlgItem(*this, IDC_LIONSTORMS, "SpecialFlagsIonStoms"); + TranslateDlgItem(*this, IDC_LMETEORITES, "SpecialFlagsMeteorites"); + TranslateDlgItem(*this, IDC_LVISCEROIDS, "SpecialFlagsVisceroids"); +} + void CSpecialFlags::OnEditchangeTiberiumgrows() { CIniFile& ini = Map->GetIniFile(); diff --git a/MissionEditor/SpecialFlags.h b/MissionEditor/SpecialFlags.h index 3d9ef95..3732f51 100644 --- a/MissionEditor/SpecialFlags.h +++ b/MissionEditor/SpecialFlags.h @@ -37,8 +37,8 @@ public: void UpdateDialog(); CSpecialFlags(CWnd* pParent = NULL); // Standardkonstruktor -// Dialogfelddaten - //{{AFX_DATA(CSpecialFlags) + // Dialogfelddaten + //{{AFX_DATA(CSpecialFlags) enum { IDD = IDD_SPECIALFLAGS }; CMyComboBox m_Visceroids; CMyComboBox m_TiberiumSpreads; @@ -60,11 +60,13 @@ public: // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CSpecialFlags) protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual BOOL OnInitDialog() override; + virtual void DoDataExchange(CDataExchange* pDX)override; // DDX/DDV-Unterstützung //}}AFX_VIRTUAL // Implementierung protected: + void TranslateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CSpecialFlags) diff --git a/MissionEditor/Structs.h b/MissionEditor/Structs.h index 9a57143..c90753d 100644 --- a/MissionEditor/Structs.h +++ b/MissionEditor/Structs.h @@ -270,17 +270,32 @@ struct SMUDGE_INFO }; #endif -/* -** Condition enumeration +/** +* Condtion Type enum */ -enum ConditionEnum { - COND_LT = 0, // less than - COND_LE, // less than or equal to - COND_EQ, // equal to - COND_GE, // greater than or equal to - COND_GT, // greater than - COND_NE, // not equal to - COND_COUNT +enum ConditionType { + COND_TYPE_NONE = 0, + COND_TYPE_ENEMY_OWNS, + COND_TYPE_SELF_OWNS, + COND_TYPE_ENEMY_YELLOW_POWR, + COND_TYPE_ENEMY_RED_POWR, + COND_TYPE_ENEMY_OWNS_SOME_MONEY, + COND_TYPE_IRON_CURTAIN_READY, + COND_TYPE_CHRONO_SPHERE_READY, + COND_TYPE_NEUTRAL_OWNS, +}; + +/** +* Condition Operator enumeration +*/ +enum ConditionOpEnum { + COND_OP_LT = 0, // less than + COND_OP_LE, // less than or equal to + COND_OP_EQ, // equal to + COND_OP_GE, // greater than or equal to + COND_OP_GT, // greater than + COND_OP_NE, // not equal to + COND_OP_COUNT }; struct AITrigInfo @@ -288,7 +303,7 @@ struct AITrigInfo union { struct { int Number; - ConditionEnum Condition; + ConditionOpEnum Condition; }; char Padding[32]; }; diff --git a/MissionEditor/TSOptions.cpp b/MissionEditor/TSOptions.cpp index 2f6df88..e8e9c38 100644 --- a/MissionEditor/TSOptions.cpp +++ b/MissionEditor/TSOptions.cpp @@ -64,9 +64,8 @@ void CTSOptions::DoDataExchange(CDataExchange* pDX) BEGIN_MESSAGE_MAP(CTSOptions, CDialog) - //{{AFX_MSG_MAP(CTSOptions) ON_BN_CLICKED(IDC_CHOOSE, OnChoose) - //}}AFX_MSG_MAP + ON_CBN_SELCHANGE(IDC_LANGUAGE, &CTSOptions::OnCbnSelchangeLanguage) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// @@ -77,8 +76,8 @@ void CTSOptions::OnChoose() const char* pFileName = "game.exe"; const char* pFileSearchPattern = "C&C EXE|game.exe|"; #if defined(RA2_MODE) - pFileName = yuri_mode? "ra2md.exe":"ra2.exe"; - pFileSearchPattern = yuri_mode ? "Yuri's Revenge EXE|ra2md.exe|": "Red Alert 2 EXE|ra2.exe|"; + pFileName = yuri_mode ? "ra2md.exe" : "ra2.exe"; + pFileSearchPattern = yuri_mode ? "Yuri's Revenge EXE|ra2md.exe|" : "Red Alert 2 EXE|ra2.exe|"; #else pFileName = "Sun.exe"; pFileSearchPattern = "Tiberian Sun EXE|Sun.exe|"; @@ -95,9 +94,7 @@ void CTSOptions::OnChoose() void CTSOptions::OnOK() { this->GetDlgItem(IDC_EDIT1)->GetWindowText(m_TSEXE); - int n = m_Language.GetItemData(m_Language.GetCurSel()); - - m_LanguageName = language["Languages"].Nth(n).second; + m_LanguageName = getLanguageSelected(); CDialog::OnOK(); } @@ -108,22 +105,62 @@ BOOL CTSOptions::OnInitDialog() m_TSExe.SetWindowText((LPCTSTR)theApp.m_Options.TSExe); - if (theApp.m_Options.bSearchLikeTS) m_LikeTS = 0; - else m_LikeTS = 1; + m_LikeTS = !theApp.m_Options.bSearchLikeTS; - m_PreferLocalTheaterFiles = theApp.m_Options.bPreferLocalTheaterFiles ? TRUE : FALSE; + m_PreferLocalTheaterFiles = theApp.m_Options.bPreferLocalTheaterFiles; - UpdateData(FALSE); + int englishIdx = 0; + int selectedLanIdx = -1; auto const& languageSec = language["Languages"]; for (auto i = 0; i < languageSec.Size(); i++) { auto const& def = languageSec.Nth(i).second; auto const& lang = language.GetString(def + "Header", "Name"); m_Language.SetItemData(m_Language.AddString(lang), i); if (lang == "English") { - m_Language.SetCurSel(i); + englishIdx = i; + } + if (def == theApp.m_Options.LanguageName) { + selectedLanIdx = i; } } + if (selectedLanIdx < 0) { + selectedLanIdx = englishIdx; + } + m_Language.SetCurSel(selectedLanIdx); + + updateUI(); + UpdateData(FALSE); + return TRUE; } + + +void CTSOptions::OnCbnSelchangeLanguage() +{ + theApp.m_Options.LanguageName = getLanguageSelected(); + updateUI(); +} + +void CTSOptions::updateUI() +{ + TranslateWindowCaption(*this, "OptionsCaption"); + + TranslateDlgItem(*this, IDC_DESC, "OptionsDesc"); + TranslateDlgItem(*this, IDC_CHOOSE, "OptionsBrowse"); + TranslateDlgItem(*this, IDC_OPTIONS_LAN_TXT, "OptionsLanguage"); + TranslateDlgItem(*this, IDC_OPTIONS_SUPPORT_TXT, "OptionsSupportSettings"); + TranslateDlgItem(*this, IDC_RULESLIKETS, "OptionsSupportMissionsAndMods"); + TranslateDlgItem(*this, IDC_ONLYORIGINAL, "OptionsSupportOriginalRA2Only"); + TranslateDlgItem(*this, IDC_PREFER_LOCAL_THEATER_FILES, "OptionsPreferFA2TheaterSettings"); +} + +CString CTSOptions::getLanguageSelected() +{ + if (!language["Languages"].Size()) { + return "English"; + } + int n = m_Language.GetItemData(m_Language.GetCurSel()); + return language["Languages"].Nth(n).second; +} diff --git a/MissionEditor/TSOptions.h b/MissionEditor/TSOptions.h index b50930b..e6c4430 100644 --- a/MissionEditor/TSOptions.h +++ b/MissionEditor/TSOptions.h @@ -44,7 +44,7 @@ public: enum { IDD = IDD_TSOPTIONS }; CComboBox m_Language; CEdit m_TSExe; - int m_LikeTS; + BOOL m_LikeTS; //}}AFX_DATA @@ -52,20 +52,21 @@ public: // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CTSOptions) protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV-Unterstützung + virtual void OnOK() override; + virtual BOOL OnInitDialog() override; //}}AFX_VIRTUAL // Implementierung -protected: + DECLARE_MESSAGE_MAP() // Generierte Nachrichtenzuordnungsfunktionen - //{{AFX_MSG(CTSOptions) + afx_msg void OnChoose(); - virtual void OnOK(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -private: + afx_msg void OnCbnSelchangeLanguage(); + + void updateUI(); + CString getLanguageSelected(); }; //{{AFX_INSERT_LOCATION}} diff --git a/MissionEditor/Tags.cpp b/MissionEditor/Tags.cpp index 523eadd..d9d55d0 100644 --- a/MissionEditor/Tags.cpp +++ b/MissionEditor/Tags.cpp @@ -51,6 +51,13 @@ CTags::~CTags() { } +BOOL CTags::OnInitDialog() +{ + auto const ret = CDialog::OnInitDialog(); + translateUI(); + return ret; +} + void CTags::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); @@ -117,6 +124,23 @@ void CTags::UpdateDialog() } +void CTags::translateUI() +{ + TranslateWindowCaption(*this, "TagsCaption"); + TranslateDlgItem(*this, IDC_DESC, "TagsDesc"); + TranslateDlgItem(*this, IDC_TAGS_CUR_TXT, "TagsCurrent"); + TranslateDlgItem(*this, IDC_ADD, "TagsAdd"); + TranslateDlgItem(*this, IDC_DELETE, "TagsDelete"); + TranslateDlgItem(*this, IDC_TAGS_NAME, "TagsName"); + TranslateDlgItem(*this, IDC_TAGS_REPEAT, "TagsRepeat"); + TranslateDlgItem(*this, IDC_TAGS_TRIGGER, "TagsTrigger"); + TranslateDlgItem(*this, IDC_TAGS_DESC_2, "TagsExpaination"); + + m_Repeat.InsertString(0, TranslateStringACP("0 - Make the trigger work only once")); + m_Repeat.InsertString(1, TranslateStringACP("1 - All entities attached")); + m_Repeat.InsertString(2, TranslateStringACP("2 - Make the trigger repeating")); +} + void CTags::OnSelchangeTag() { CIniFile& ini = Map->GetIniFile(); diff --git a/MissionEditor/Tags.h b/MissionEditor/Tags.h index cd27fe3..db1f667 100644 --- a/MissionEditor/Tags.h +++ b/MissionEditor/Tags.h @@ -54,11 +54,13 @@ public: // Der Klassen-Assistent generiert virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CTags) protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual BOOL OnInitDialog() override; + virtual void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV-Unterstützung //}}AFX_VIRTUAL // Implementierung protected: + void translateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CTags) afx_msg void OnSelchangeTag(); diff --git a/MissionEditor/TaskForce.cpp b/MissionEditor/TaskForce.cpp index b12daaa..886cfd5 100644 --- a/MissionEditor/TaskForce.cpp +++ b/MissionEditor/TaskForce.cpp @@ -468,7 +468,9 @@ void CTaskForce::OnDeletetaskforce() } auto const tf = getCurrrentID(); int res; - res = MessageBox("Are you sure to delete the selected task force? If you delete it, make sure to eliminate ANY references to this task force in team-types.", "Delete task force", MB_YESNO); + auto const title = TranslateStringACP("Delete task force"); + auto const content = TranslateStringACP("TaskforceDeleteMsgDesc"); + res = MessageBox(content, title, MB_YESNO); if (res == IDNO) { return; } diff --git a/MissionEditor/TriggerActionsDlg.cpp b/MissionEditor/TriggerActionsDlg.cpp index 281f111..1440fba 100644 --- a/MissionEditor/TriggerActionsDlg.cpp +++ b/MissionEditor/TriggerActionsDlg.cpp @@ -63,6 +63,27 @@ CTriggerActionsDlg::CTriggerActionsDlg(CWnd* pParent /*=NULL*/) } +BOOL CTriggerActionsDlg::OnInitDialog() +{ + auto const ret = CDialog::OnInitDialog(); + + TranslateUI(); + + return ret; +} + +void CTriggerActionsDlg::TranslateUI() +{ + TranslateDlgItem(*this, IDC_ACTION_CUR_TXT, "TriggerActionCurrent"); + TranslateDlgItem(*this, IDC_NEWACTION, "TriggerActionNew"); + TranslateDlgItem(*this, IDC_DELETEACTION, "TriggerActionDelete"); + TranslateDlgItem(*this, IDC_ACTION_OPT_TXT, "TriggerActionOptions"); + TranslateDlgItem(*this, IDC_ACTION_TYPE_TXT, "TriggerActionType"); + TranslateDlgItem(*this, IDC_ACTION_PARAM_TXT, "TriggerActionParams"); + TranslateDlgItem(*this, IDC_ACTION_VAL_TXT, "TriggerActionValue"); + TranslateDlgItem(*this, IDC_ACTION_DESC, "TriggerActionDesc"); +} + void CTriggerActionsDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); @@ -243,10 +264,11 @@ void CTriggerActionsDlg::OnEditchangeActiontype() if (atoi(GetParam(eventdata, 7)) == 1) { - if (bNoWP) + if (bNoWP) { m_Parameter.SetItemData(m_Parameter.AddString(TranslateStringACP("Number")), -1); - else + } else { m_Parameter.SetItemData(m_Parameter.AddString(TranslateStringACP("Waypoint")), -1); + } } m_ParamValue.SetWindowText(""); @@ -360,9 +382,13 @@ void CTriggerActionsDlg::OnEditchangeParamvalue() { CIniFile& ini = Map->GetIniFile(); - if (m_currentTrigger.GetLength() == 0) return; + if (m_currentTrigger.GetLength() == 0) { + return; + } int selev = m_Action.GetCurSel(); - if (selev < 0) return; + if (selev < 0) { + return; + } int curev = m_Action.GetItemData(selev); int curselparam = m_Parameter.GetCurSel(); @@ -437,14 +463,24 @@ void CTriggerActionsDlg::OnNewaction() void CTriggerActionsDlg::OnDeleteaction() { CIniFile& ini = Map->GetIniFile(); - if (m_currentTrigger.GetLength() == 0) return; + if (m_currentTrigger.GetLength() == 0) { + return; + } int sel2 = m_Action.GetCurSel(); - if (sel2 < 0) return; - int curev = m_Action.GetItemData(sel2); - if (MessageBox("Do you really want to delete this action?", "Delete action", MB_YESNO) == IDNO) return; + if (sel2 < 0) { + return; + } + int curev = m_Action.GetItemData(sel2); + auto const title = TranslateStringACP("Delete action"); + auto const content = TranslateStringACP("Do you really want to delete this action?"); + + if (MessageBox(content, title, MB_YESNO) == IDNO) { + return; + } + auto sec = ini.TryGetSection("Actions"); ASSERT(sec != nullptr); diff --git a/MissionEditor/TriggerActionsDlg.h b/MissionEditor/TriggerActionsDlg.h index 92b62c2..afe3f10 100644 --- a/MissionEditor/TriggerActionsDlg.h +++ b/MissionEditor/TriggerActionsDlg.h @@ -54,11 +54,13 @@ public: // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CTriggerActionsDlg) protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual BOOL OnInitDialog() override; + virtual void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV-Unterstützung //}}AFX_VIRTUAL // Implementierung protected: + void TranslateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CTriggerActionsDlg) diff --git a/MissionEditor/TriggerEditorDlg.cpp b/MissionEditor/TriggerEditorDlg.cpp index 66b5a48..a715151 100644 --- a/MissionEditor/TriggerEditorDlg.cpp +++ b/MissionEditor/TriggerEditorDlg.cpp @@ -120,7 +120,7 @@ BOOL CTriggerEditorDlg::OnInitDialog() m_TriggerActions.SetWindowPos(NULL, 10, top, r.right - 20, bottom, SWP_NOZORDER); return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben + // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben } void CTriggerEditorDlg::UpdateDialog() @@ -203,11 +203,17 @@ void CTriggerEditorDlg::OnDeletetrigger() CIniFile& ini = Map->GetIniFile(); int sel = m_Trigger.GetCurSel(); - if (sel < 0) return; + if (sel < 0) { + return; + } int curtrig = m_Trigger.GetItemData(sel); - int res = MessageBox("If you want to delete all attached tags, too, press 'Yes'.\nIf you don´t want to delete these tags, press 'No'.\nIf you want to cancel deletion of the trigger, press 'Cancel'.\n\nNote: CellTags will never be deleted using this function", "Delete trigger", MB_YESNOCANCEL); - if (res == IDCANCEL) return; + auto const title = TranslateStringACP("Delete trigger"); + auto const content = EscapeString(TranslateStringACP("TriggerDeleteTip")); + int res = MessageBox(content, title, MB_YESNOCANCEL); + if (res == IDCANCEL) { + return; + } auto const& triggerId = ini["Triggers"].Nth(curtrig).first; diff --git a/MissionEditor/TriggerEventsDlg.cpp b/MissionEditor/TriggerEventsDlg.cpp index b31d864..fae0efe 100644 --- a/MissionEditor/TriggerEventsDlg.cpp +++ b/MissionEditor/TriggerEventsDlg.cpp @@ -47,6 +47,14 @@ CTriggerEventsDlg::CTriggerEventsDlg(CWnd* pParent /*=NULL*/) //}}AFX_DATA_INIT } +BOOL CTriggerEventsDlg::OnInitDialog() +{ + auto const ret = CDialog::OnInitDialog(); + + TranslateUI(); + + return ret; +} void CTriggerEventsDlg::DoDataExchange(CDataExchange* pDX) { @@ -72,6 +80,18 @@ BEGIN_MESSAGE_MAP(CTriggerEventsDlg, CDialog) //}}AFX_MSG_MAP END_MESSAGE_MAP() +void CTriggerEventsDlg::TranslateUI() +{ + TranslateDlgItem(*this, IDC_EVENT_CUR_TXT, "TriggerEventCurrent"); + TranslateDlgItem(*this, IDC_NEWEVENT, "TriggerEventNew"); + TranslateDlgItem(*this, IDC_DELETEEVENT, "TriggerEventDelete"); + TranslateDlgItem(*this, IDC_EVENT_OPT_TXT, "TriggerEventOptions"); + TranslateDlgItem(*this, IDC_EVENT_TYPE_TXT, "TriggerEventType"); + TranslateDlgItem(*this, IDC_EVENT_PARAM_TXT, "TriggerEventParams"); + TranslateDlgItem(*this, IDC_EVENT_VAL_TXT, "TriggerEventParamValue"); + TranslateDlgItem(*this, IDC_EVENT_DESC, "TriggerEventDesc"); +} + ///////////////////////////////////////////////////////////////////////////// // Behandlungsroutinen für Nachrichten CTriggerEventsDlg @@ -160,7 +180,9 @@ void CTriggerEventsDlg::OnDeleteevent() return; } int curev = m_Event.GetItemData(sel2); - if (MessageBox("Do you really want to delete this event?", "Delete event", MB_YESNO) == IDNO) { + auto const title = TranslateStringACP("Delete event"); + auto const content = TranslateStringACP("Do you really want to delete this event?"); + if (MessageBox(content, title, MB_YESNO) == IDNO) { return; } diff --git a/MissionEditor/TriggerEventsDlg.h b/MissionEditor/TriggerEventsDlg.h index 3f7aecb..f429fd3 100644 --- a/MissionEditor/TriggerEventsDlg.h +++ b/MissionEditor/TriggerEventsDlg.h @@ -56,11 +56,13 @@ public: // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CTriggerEventsDlg) protected: + virtual BOOL OnInitDialog() override; virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung //}}AFX_VIRTUAL // Implementierung protected: + void TranslateUI(); // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CTriggerEventsDlg) diff --git a/MissionEditor/TriggerOptionsDlg.cpp b/MissionEditor/TriggerOptionsDlg.cpp index f0587e5..0eac96e 100644 --- a/MissionEditor/TriggerOptionsDlg.cpp +++ b/MissionEditor/TriggerOptionsDlg.cpp @@ -278,19 +278,27 @@ BOOL CTriggerOptionsDlg::PreTranslateMessage(MSG* pMsg) BOOL CTriggerOptionsDlg::OnInitDialog() { - CDialog::OnInitDialog(); + auto const ret = CDialog::OnInitDialog(); { - SetDlgItemText(IDC_TRIGGER_OPTION_TYPE_STR, GetLanguageStringACP("TriggerOptionType")); - SetDlgItemText(IDC_TRIGGER_OPTION_NAME, GetLanguageStringACP("TriggerOptionName")); - SetDlgItemText(IDC_TRIGGER_OPTION_HOUSE, GetLanguageStringACP("TriggerOptionHouse")); - SetDlgItemText(IDC_TRIGGER_OPTION_ATTACHED_TRIGGER, GetLanguageStringACP("TriggerOptionAttachedTrigger")); - SetDlgItemText(IDC_TRIGGER_OPTION_TRIGGER_DIS_TIP, GetLanguageStringACP("TriggerOptionDisableTip")); + TranslateDlgItem(*this, IDC_TRIGGER_OPTION_TYPE_STR, "TriggerOptionType"); + TranslateDlgItem(*this, IDC_TRIGGER_OPTION_NAME, "TriggerOptionName"); + TranslateDlgItem(*this, IDC_TRIGGER_OPTION_HOUSE, "TriggerOptionHouse"); + TranslateDlgItem(*this, IDC_TRIGGER_OPTION_ATTACHED_TRIGGER, "TriggerOptionAttachedTrigger"); + TranslateDlgItem(*this, IDC_TRIGGER_OPTION_TRIGGER_DIS_TIP, "TriggerOptionDisableTip"); + TranslateDlgItem(*this, IDC_DISABLED, "TriggerOptionDisabled"); + TranslateDlgItem(*this, IDC_EASY, "TriggerOptionEasy"); + TranslateDlgItem(*this, IDC_MEDIUM, "TriggerOptionMedium"); + TranslateDlgItem(*this, IDC_HARD, "TriggerOptionHard"); + + m_TriggerType.InsertString(0, TranslateStringACP("0 - Standard")); + m_TriggerType.InsertString(1, TranslateStringACP("1 - All Attached")); + m_TriggerType.InsertString(2, TranslateStringACP("2 - Repeating")); m_tooltip.Create(this); m_tooltip.Activate(TRUE); m_tooltip.AddTool(GetDlgItem(IDC_HOUSE), GetLanguageStringACP("TT_TriggerHouse")); } - return TRUE; + return ret; } void CTriggerOptionsDlg::OnDisabled() diff --git a/MissionEditor/Triggers.cpp b/MissionEditor/Triggers.cpp index db7eeff..72d4ced 100644 --- a/MissionEditor/Triggers.cpp +++ b/MissionEditor/Triggers.cpp @@ -1285,7 +1285,9 @@ void CTriggers::OnDeleteevent() if (sel2 < 0) { return; } - if (MessageBox("Do you really want to delete this event?", "Delete event", MB_YESNO) == IDNO) { + auto const title = TranslateStringACP("Delete event"); + auto const content = TranslateStringACP("Do you really want to delete this event?"); + if (MessageBox(content, title, MB_YESNO) == IDNO) { return; } @@ -1361,10 +1363,17 @@ void CTriggers::OnDeleteaction() CIniFile& ini = Map->GetIniFile(); int sel = m_Trigger.GetCurSel(); - if (sel < 0) return; + if (sel < 0) { + return; + } int sel2 = m_Action.GetCurSel(); - if (sel2 < 0) return; - if (MessageBox("Do you really want to delete this action?", "Delete action", MB_YESNO) == IDNO) { + if (sel2 < 0) { + return; + } + + auto const title = TranslateStringACP("Delete action"); + auto const content = TranslateStringACP("Do you really want to delete this action?"); + if (MessageBox(content, title, MB_YESNO) == IDNO) { return; } diff --git a/MissionEditor/UserScriptsDlg.cpp b/MissionEditor/UserScriptsDlg.cpp index a05a989..7b16a13 100644 --- a/MissionEditor/UserScriptsDlg.cpp +++ b/MissionEditor/UserScriptsDlg.cpp @@ -82,11 +82,12 @@ private: CString filename; }; -CUserScript::CUserScript() +CUserScript::CUserScript(): + error(0), + errortext{ 0 }, + functioncount(0), + functiondata(nullptr) { - functioncount = 0; - functiondata = NULL; - } CUserScript::~CUserScript() @@ -908,12 +909,16 @@ void CUserScriptsDlg::OnOK() // check bool if (paramcount > 1) { if (params[1].GetLength() > 0) { - if (!IsValSet(params[1])) goto nextline; + if (!IsValSet(params[1])) { + goto nextline; + } } } - int res = MessageBox(params[0], "Continue?", MB_YESNO); - if (res == IDNO) break; + int res = MessageBox(TranslateStringACP(params[0]), TranslateStringACP("Continue?"), MB_YESNO); + if (res == IDNO) { + break; + } } else if (name == ID_MESSAGE) { if (paramcount < 2) { ReportScriptError(i); @@ -2689,6 +2694,8 @@ BOOL CUserScriptsDlg::OnInitDialog() { CDialog::OnInitDialog(); + translateUI(); + int k; CFileFind ff; @@ -2713,6 +2720,19 @@ BOOL CUserScriptsDlg::OnInitDialog() // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben } +void CUserScriptsDlg::translateUI() +{ + TranslateWindowCaption(*this, "UserScriptsDlgCaption"); + + TranslateDlgItem(*this, IDC_USR_SCRIPTS_DESC, "UserScriptsDlgDesc"); + TranslateDlgItem(*this, IDC_USR_SCRIPTS_AVA, "UserScriptsDlgAvailable"); + + TranslateDlgItem(*this, IDC_USR_SCRIPTS_REPORT, "UserScriptsDlgReport"); + + TranslateDlgItem(*this, IDOK, "UserScriptsDlgOK"); + TranslateDlgItem(*this, IDCANCEL, "UserScriptsDlgCancel"); +} + void CUserScriptsDlg::ReportScriptError(int line) { char c[50]; diff --git a/MissionEditor/UserScriptsDlg.h b/MissionEditor/UserScriptsDlg.h index e81f404..ad94bf5 100644 --- a/MissionEditor/UserScriptsDlg.h +++ b/MissionEditor/UserScriptsDlg.h @@ -50,6 +50,8 @@ public: //{{AFX_VIRTUAL(CUserScriptsDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual void OnOK() override; + virtual BOOL OnInitDialog() override; //}}AFX_VIRTUAL // Implementierung @@ -57,8 +59,7 @@ protected: // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CUserScriptsDlg) - virtual void OnOK(); - virtual BOOL OnInitDialog(); + void translateUI(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; diff --git a/MissionEditor/WaypointID.cpp b/MissionEditor/WaypointID.cpp index 3fe365d..ebb580b 100644 --- a/MissionEditor/WaypointID.cpp +++ b/MissionEditor/WaypointID.cpp @@ -26,6 +26,7 @@ #include "WaypointID.h" #include "mapdata.h" #include "variables.h" +#include "functions.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -68,10 +69,9 @@ void CWaypointID::OnFree() { CIniFile& ini = Map->GetIniFile(); - int i; CString freen; - for (i = 0; i > -1; i++) { + for (auto i = 0; ; i++) { char d[50]; itoa(i, d, 10); if (ini.GetString("Waypoints", d).IsEmpty()) { @@ -100,8 +100,21 @@ BOOL CWaypointID::OnInitDialog() { CDialog::OnInitDialog(); + translateUI(); + OnFree(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben } + +void CWaypointID::translateUI() +{ + TranslateWindowCaption(*this, "CreateWaypointDlgCaption"); + + TranslateDlgItem(*this, IDC_DESC, "CreateWaypointDlgDesc"); + TranslateDlgItem(*this, IDC_LID, "CreateWaypointDlgID"); + TranslateDlgItem(*this, IDC_FREE, "CreateWaypointDlgFree"); + TranslateDlgItem(*this, IDOK, "CreateWaypointDlgOk"); + TranslateDlgItem(*this, IDCANCEL, "CreateWaypointDlgCancel"); +} \ No newline at end of file diff --git a/MissionEditor/WaypointID.h b/MissionEditor/WaypointID.h index 79011ff..d1b2398 100644 --- a/MissionEditor/WaypointID.h +++ b/MissionEditor/WaypointID.h @@ -49,16 +49,17 @@ public: //{{AFX_VIRTUAL(CWaypointID) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung + virtual void OnOK() override; + virtual BOOL OnInitDialog() override; //}}AFX_VIRTUAL // Implementierung protected: - // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CWaypointID) afx_msg void OnFree(); - virtual void OnOK(); - virtual BOOL OnInitDialog(); + + void translateUI(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; diff --git a/MissionEditor/data/FinalAlert2/FAData.ini b/MissionEditor/data/FinalAlert2/FAData.ini index aac77ed..b76ae4b 100644 --- a/MissionEditor/data/FinalAlert2/FAData.ini +++ b/MissionEditor/data/FinalAlert2/FAData.ini @@ -922,55 +922,57 @@ vertic_cornerleft_0=21 ; Name, ListType, [Code] [ParamTypes] -1=Unused,0,1;not listed in FA2 -0=Unused,0 -1=Unknown,0 -2=House,1 -3=Local variable,20 -4=Time,0 -5=Credits,0 -6=Number,0 -7=Teamtype,2 -8=Building,6 -9=Aircraft,5 -10=Infantry,4 -11=Unit,3 -12=Movie,7 -13=Text,8 -14=Trigger,9 -15=Enabled,10 -16=Sound,11 -17=Theme,12 -18=Speech,13 -19=Steps,0 -20=Super weapon,14 -21=Left,0 -22=Top,0 -23=Right,0 -24=Bottom,0 -25=Animation,15 -26=Particle,16 -27=Duration,0 -28=Speed,0 -29=Meteor size,29 -30=Waypoint,17 -31=Crate type,18 -32=Speech bubble,19 -33=String,21 -34=Action,9 -35=Global variable,27 -36=Special Weapon,14 -37=Activated,10 -38=Tag,22 -39=Techtype,0 -40=Quarry,0 -41=Weapon,24 -42=Light behavior,25 -43=Event,9 -44=Shower,26 -45=Float value,0 -46=Techtype,29;,2 -47=Building,28 -48=Number,0,2 +0=未使用,0 +1=未知,0 +2=所属方,1 +3=局部变量,20 +4=时间,0 +5=积分,0 +6=数值,0 +7=小队类型,2 +8=建筑,6 +9=飞行器,5 +10=步兵,4 +11=单位,3 +12=电影,7 +13=文本,8 +14=触发,9 +15=允许,10 +16=声音,11 +17=乐曲,12 +18=语音,13 +19=步骤,0 +20=超级武器,14 +21=左,0 +22=上,0 +23=宽,0 +24=高,0 +25=动画,15 +26=粒子,16 +27=持续时间,0 +28=速度,0 +29=Voxel碎片ID号,29 +30=路径点,17 +31=木箱类型,18 +32=语音提示框,19 +33=字符,21 +34=行为,9 +35=全局变量,27 +36=特定武器,14 +37=已激活,10 +38=关联标记,22 +39=科技类型,0 +40=来源,0 +41=武器,24 +42=发光行为,25 +43=事件,9 +44=阵雨,26 +45=浮点值,0 +46=科技类型,29 +47=建筑,28 +48=数值,0,2 +49=像素动画,23 +50=影片,7 [ScriptParams] 0=占位,0 @@ -1086,73 +1088,72 @@ vertic_cornerleft_0=21 ; NOTE: To overwrite TS events with RA2 special ones, add the new event to the [EventsRA2] section. ; NOTE: ID must be the same like # [EventsRA2] -0=-No Event-,0,0,0,0,This is a null event. There is no need to ever use this in a real trigger.,0,1,0 -1=Entered by...,0,2,0,0,Triggers when an infantry or vehicle enters the attached object. Typically this trigger is attached to a building or a cell.,0,1,1 -2=Spied upon,0,0,0,0,Detects when a spy has entered the attached building.,0,1,2 -3=Thieved by...,0,2,0,0,Triggers when a thief steals money from the specified house.,0,1,3 -4=Discovered by player,0,0,0,0,Detects when the attached object has been discovered by the player. Discovered means reavealed from under the shroud.,0,1,4 -5=House Discovered...,0,2,0,0,Triggers when the specified house has any of its units or buildings discovered by the player.,0,1,5 -6=Attacked by any house,0,0,0,0,Triggers when the attached unit is attacked in some manner. Incidental damage or friendly fire does not count.,0,1,6 -7=Destroyed by any house,0,0,0,0,Triggers when the attached object has been destroyed. Destroyed by incidental damage or friendly fire doesn't count.,0,1,7 -8=Any Event,0,0,0,0,When used alone%1 it will force the trigger to spring immediately.,0,1,8 -9=Destroyed%1 Units%1 All...,0,2,0,0,Triggers when all units of the specified house have been destroyed. Typically used for end of game conditions.,0,1,9 -10=Destroyed%1 Buildings%1 All...,0,2,0,0,Triggers when all buildings of the specified side have been destroyed. Typically used for end of game conditions.,0,1,10 -11=Destroyed%1 All...,0,2,0,0,Triggers when all objects owned by the specified house have been destroyed. This is the normal (destroy everyone) trigger condition for end of game.,0,1,11 -12=Credits exceed...,0,6,0,0,Triggers when the house (for this trigger) credit total exceeds this specified amount.,0,1,12 -13=Elapsed Time...,0,6,0,0,Triggers when the elapsed time has expired. This time is initialized when the trigger is created. Timer is reset whenever trigger is sprung when trigger is 'persistant'.,0,1,13 -14=Mission Timer Expired,0,0,0,0,Triggers when the global mission timer (as displayed on the screen) has reached zero.,0,1,14 -15=Destroyed%1 Buildings%1 #...,0,6,0,0,Triggers when the number of buildings%1 owned by the trigger's specified house%1 have been destroyed.,0,1,15 -16=Destroyed%1 Units%1 #...,0,6,0,0,Triggers when the number of units%1 owned by the trigger's specified house%1 have been destroyed.,0,1,16 -17=No Factories left,0,0,0,0,Triggers when there are no factories left for the house specified in the trigger.,0,1,17 -18=Civilians Evacuated,0,0,0,0,Triggers when civilians have been evacuated (left the map).,0,1,18 -19=Build Building Type...,0,8,0,0,When the trigger's house builds the building type specified%1 then this event will spring.,0,1,19 -20=Build Unit Type...,0,11,0,0,When the trigger's house builds the unit type specified%1 then this event will spring.,0,1,20 -21=Build Infantry Type...,0,10,0,0,When the trigger's house builds the infantry type specified%1 then this event will spring.,0,1,21 -22=Build Aircraft Type...,0,9,0,0,When the trigger's house builds the aircraft type specified%1 then this event will spring.,0,1,22 -23=Leaves map (team)...,-1,7,0,0,Triggers when the specified team leaves the map. If the team is destroyed%1 it won't trigger. If all but one member is destroyed and that last member leaves the map%1 it WILL spring.,0,1,23 -24=Zone Entry by...,0,2,0,0,Triggers when a unit of the dpecified house enters the same zone that this trigger is located in. This trigger must be located in a cell and only a cell.,0,1,24 -25=Crosses Horizontal Line...,0,2,0,0,Triggers when a unit of the specified house crosses the horizontal line as indicated by the location of this trigger. This trigger must be placed in a cell.,0,1,25 -26=Crosses Vertical Line...,0,2,0,0,Triggers when a unit of the specified house crosses the vertical line as indicated by the location of this trigger. This trigger must be placed in a cell.,0,1,26 -27=Global is set...,0,35,0,0,Triggers when the specifed global (named in Globals.INI) is turned on.,0,1,27 -28=Global is clear...,0,35,0,0,Triggers when the specified global (named in Globals.INI) is turned off.,0,1,28 -29=Destroyed by anything [not infiltrate],0,0,0,0,Triggers when attached object is destroyed%1 but not if it infiltrates a building/unit.,0,1,29 -30=Low Power...,0,2,0,0,Triggers when the specified house's power falls below 100% level.,0,1,30 -31=Bridge destroyed,0,0,0,0,Triggers when the attached bridge is destroyed. A bridge is considered destroyed when an impassable gap is created in the bridge.,0,1,31 -32=Building exists...,0,8,0,0,Triggers when the building (owned by the house of this trigger) specified exists on the map. This works for buildings that are preexisting or constructed by deploying.,0,1,32 -33=Selected by player,0,0,0,0,Triggers when the unit is selected by the player. Use in single-player only.,0,1,33 -34=Comes near waypoint...,0,30,0,0,Triggers when the object comes near the specified waypoint.,0,1,34 -35=Enemy In Spotlight...,0,0,0,0,Triggers when an enemy unit enters the spotlight cast by the attached building.,0,1,35 -36=Local is set...,0,3,0,0,Triggers when the specifed local is turned on.,0,1,36 -37=Local is clear...,0,3,0,0,Triggers when the specified local is turned off.,0,1,37 -38=First damaged (combat only),0,0,0,0,Triggers when first suffering from combat damage from combat damage only.,0,1,38 -39=Half health (combat only),0,0,0,0,Triggers when damaged to half health >from combat damage only.,0,1,39 -40=Quarter health (combat only),0,0,0,0,Triggers when damaged to quarter health from combat damage only.,0,1,40 -41=First damaged (any source),0,0,0,0,Triggers when first suffering from combat damage from any source.,0,1,41 -42=Half health (any source),0,0,0,0,Triggers when damaged to half health >from any source.,0,1,42 -43=Quarter health (any source),0,0,0,0,Triggers when damaged to quarter health from any source.,0,1,43 -44=Attacked by (house)...,0,2,0,0,When attacked by some unit of specified house.,0,1,44 -45=Ambient light <= ...,0,6,0,0,Triggers when the ambient light drops below a certain level. Use numbers between 0 and 100.,0,1,45 -46=Ambient light >= ...,0,6,0,0,Triggers when the ambient light rises above a certain level. Use numbers between 0 and 100.,0,1,46 -47=Elapsed Scenario Time...,0,6,0,0,When time has elapsed since start of scenario.,0,1,47 -48=Destroyed by anything,0,0,0,0,Triggers when destroyed by anything what-so-ever.,0,1,48 -49=Pickup Crate,0,0,0,0,When crate is picked up object the trigger is attached to.,0,1,49 -50=Pickup Crate (any),0,0,0,0,When crate is picked up by any unit.,0,1,50 -51=Random delay...,0,6,0,0,Delays a random time between 50 and 150 percent of time specified.,0,1,51 -52=Credits below...,0,6,0,0,Triggers when the house (for this trigger) credit total is below this specified amount.,0,1,52 -53=Spy entering as House...,0,2,0,0,Triggers if a spy disguised as house specified enters this.,0,1,53 -54=Spy entering as Infantry...,0,10,0,0,Triggers if a spy disguised as this type of infantry enters.,0,1,54 -55=Destroyed%1 Units%1 Naval...,0,2,0,0,Triggers when all naval units of the specified house have been destroyed. Typically used for end of game conditions.,0,1,55 -56=Destroyed%1 Units%1 Land...,0,2,0,0,Triggers when all land units of the specified house have been destroyed. Typically used for end of game conditions.,0,1,56 -57=Building does not exist,0,8,0,0,Triggers when the building (owned by the house of this trigger) specified does not exist on the map.,0,1,57 +0=-无事件-,0,0,0,0,这是一个空的事件,无意义。请选择需要的事件。,0,1,0 +1=进入事件...,0,2,0,0,当步兵或车辆进入关联的对象时,事件被触发。此触发可关联到一所建筑或一个单元(使用“放置于地图上”按钮)。可用于工程师、间谍进入建筑,但空中单位不会触发此条件。,0,1,1 +2=侦察开始(无用),0,0,0,0,当间谍进入关联的建筑,开始侦察。,0,0,2 +3=偷窃行动(无用),0,2,0,0,当一名小偷从特定的建筑中偷窃金钱时此事件被触发。,0,0,3 +4=被游戏者发现,0,0,0,0,当关联的对象被游戏者发现时触发此事件,被发现意味着要显示附近的地图区域。,0,1,4 +5=作战方被发现...,0,2,0,0,当特定的某一作战方的任一单位或建筑被游戏者发现时触发此事件。,0,1,5 +6=受到任一作战方攻击,0,0,0,0,当单位受到一些方式的攻击时,触发此事件。间接损伤或友军开火不包括在内。,0,1,6 +7=被任一作战方摧毁,0,0,0,0,当关联的对象被摧毁时触发些事件。间接或友军开火造成被毁不包括在内。,0,1,7 +8=任何事件,0,0,0,0,当单独%1使用时,立即强制触发此事件。此动作跟流逝时间 数值1 相似。,0,1,8 +9=被摧毁%1 单位%1 全部...,0,2,0,0,当特定作战方的所有单位被摧毁时触发此事件。典型使用在游戏的结束条件中。,0,1,9 +10=被摧毁%1 建筑%1 全部...,0,2,0,0,当特定作战方的所有建筑被摧毁时触发此事件。典型使用在游戏的结束条件中。,0,1,10 +11=被摧毁%1 全部...,0,2,0,0,当特定作战方的所有对象被摧毁时触发此事件。这是常规的游戏结束触发事件(全部摧毁)。,0,1,11 +12=金钱超过...,0,6,0,0,当与事件关联的作战方的金钱超过特定值触发此事件。,0,1,12 +13=流逝时间...,0,6,0,0,当流逝的时间达到特定值触发此事件。当触发器建立时该时间初始化,当触发器持续不变或被触发时,计时器复位。,0,1,13 +14=任务时间已到,0,0,0,0,当全局的任务时间(显示在屏幕右下角)倒计时为零时触发此事件。,0,1,14 +15=被摧毁%1 建筑%1 (数量为#)...,0,6,0,0,当特定数量的%1建筑(由此触发事件特定作战方%1所有)被摧毁。,0,1,15 +16=被摧毁%1 单位%1 (数量为#)...,0,6,0,0,当特定数量的%1单位(由此触发事件特定作战方%1所有)被摧毁。,0,1,16 +17=不再有工厂,0,0,0,0,当此触发事件特定的的作战方不会再有带有Factory=的工厂(建造场,车间,空指部,兵营等)时触发此事件。一般作为 9卖掉全部建筑 的条件。,0,1,17 +18=平民撤离(无用),0,0,0,0,当平民撤离时(离开地图)触发此事件。,0,0,18 +19=建造特定类型的建筑...,0,8,0,0,当触发事件的作战方建造特定的%1类型的建筑时触发此事件。,0,1,19 +20=生产特定类型的车辆...,0,11,0,0,当触发事件的作战方生产特定的科技类型的车辆时触发此事件。,0,1,20 +21=生产特定类型的步兵...,0,10,0,0,当触发事件的作战方生产特定的步兵类单位时触发此事件。,0,1,21 +22=生产特定类型的飞机...,0,9,0,0,当触发事件的作战方生产特定的%1飞行类单位时此事件被触发。,0,1,22 +23=离开地图(小队)...,-1,7,0,0,当特定的小队离开地图时事件触发。如果小队被摧毁则不会触发事件。如果小队除一个成员名其他已被全部摧毁,而这一成员离开了地图,那么事件将被触发。,0,1,23 +24=进入某区域...,0,2,0,0,当特定作战方的一单位进入上述这一触发事件定位区域,事件被触发。此触发事件必须被定位于一个单元中,只能是一个单元。,0,1,24 +25=越过水平线...,0,2,0,0,当特定作战方的一单位越过此触发事件特定的区域水平线时,事件触发。此触发事件必须放置于一个单元内。,0,1,25 +26=越过垂直线...,0,2,0,0,当特定作战方的一单位越过此触发事件特定的区域垂直线时,事件触发。此触发事件必须放置于一个单元内。,0,1,26 +27=全局开启...,0,35,0,0,当特定的全局变量开启[1]时,事件触发。,0,1,27 +28=全局关闭...,0,35,0,0,当特定的全局变量关闭[0]时,事件触发。,0,1,28 +29=被任何事物摧毁(不包括间谍渗透),0,0,0,0,当关联对象被摧毁%1时,事件触发。不包括渗透入建筑或单位。,0,1,29 +30=电力不足...,0,2,0,0,当特定作战方停电时,事件触发。,0,1,30 +31=桥梁被摧毁,0,0,0,0,当特定的桥梁当出现缺口不能通行时,事件触发。此触发必须被用单元标记放置在目标桥梁的下方(只能放置一个单元标记)。,0,1,31 +32=建筑存在...,0,8,0,0,当此触发事件作战方有特定建筑存在于地图上时,事件触发。此建筑可以是以前就有的或由基地建造的。,0,1,32 +33=被游戏者选定,0,2,0,0,当单位被游戏者选定时,事件触发。仅使用于单位任务中。,0,1,33 +34=到达路径点附近...,48,30,0,0,当对象到达特定的路径点附近时,事件触发。参数表示距离路径点的范围半径,0,1,34 +35=敌人进入局部照明区...,0,0,0,0,当一个敌人单位进入关联建筑物投射的局部照明区时,事件触发。,0,1,35 +36=局部开启...,0,3,0,0,当特定的局部变量开启(1)时,事件触发。,0,1,36 +37=局部关闭...,0,3,0,0,当特定的局部变量关闭(0)时,事件触发。,0,1,37 +38=首次受损(仅指战斗),0,0,0,0,仅指作战时初次受到损伤时,事件触发。,0,1,38 +39=一半生命值(仅指战斗),0,0,0,0,仅指作战时受到损伤而只有一半生命值时,事件触发。,0,1,39 +40=四分之一生命值(仅指战斗),0,0,0,0,仅指作战时受到损伤而只有四分之一生命值时,事件触发。,0,1,40 +41=首次受损(任何来源),0,0,0,0,当受到任何来源的攻击而初次受损时,事件触发。,0,1,41 +42=一半生命值(任何来源),0,0,0,0,当受到任何来源的攻击而只有一半生命值时,事件触发。,0,1,42 +43=四分之一生命值(任何来源),0,0,0,0,当受到任何来源的攻击而只有四分之一生命值时,事件触发。,0,1,43 +44=受到攻击(作战方)...,0,2,0,0,当遭到特定作战方的某些单位的攻击时,事件触发。,0,1,44 +45=环境照明 <=(小于)...,0,6,0,0,当环境照明亮度低于或等于某一确定值时,事件触发。可用值介于 0 到 100之间。,0,1,45 +46=环境照明 >=(大于)...,0,6,0,0,当环境照明亮度超过或等于某一确定值时,事件触发。可用值介于 0 到 100之间。,0,1,46 +47=流逝的情节时间...,0,6,0,0,从剧情开始计算游戏的流逝时间。,0,1,47 +48=被任何事物摧毁,0,0,0,0,当被任何事物摧毁时,事件触发。此触发不能关联到航母上,否则其子机被摧毁后再摧毁航母,事件不会触发。但先摧毁航母,事件可以触发。,0,1,48 +49=关联对象拾得木箱,0,0,0,0,当此事件关联对象拾得木箱时,事件触发。,0,1,49 +50=任何单位拾得木箱,0,0,0,0,当任何单位拾得木箱时,事件触发。,0,1,50 +51=随机延时...,0,6,0,0,进行随机延时,时间值介于特定值的 50% 到 150%。联机地图使用该条件容易因为各玩家时间不对应造成“重新连线错误”。。,0,1,51 +52=金钱低于...,0,6,0,0,当此事件作战方金钱值低于特定值时,事件触发。,0,1,52 +53=间谍伪装进入(无用)...,0,2,0,0,当间谍伪装为特定作战方单位进入时,事件触发。,0,0,53 +54=间谍伪装步兵进入(无用)...,0,10,0,0,当间谍伪装为特定步兵类单位进入时,事件触发。,0,0,54 +55=被摧毁%1 单位%1 海军...,0,2,0,0,当特定作战方的所有海军单位被摧毁时,事件触发。典型应用于游戏结束条件中。,0,1,55 +56=被摧毁%1 单位%1 陆军...,0,2,0,0,当特定作战方的所有陆军单位被摧毁时,事件触发。典型应用于游戏结束条件中。,0,1,56 +57=建筑不再存在,0,8,0,0,当特定的建筑(归属于此事件作战方)不再存在于地图上时,事件触发。,0,1,57 ; YR -58=Power Full...,0,2,0,0,Triggers if the specified house's power is at 100%.,0,1,58,1 -59=Entered or Overflown By...,0,2,0,0,Triggers when unit%1 infantry%1 or aircraft move over this cell. ,0,1,59,1 +58=充足能量供应...,0,2,0,0,当特定参战方的电力充足时,事件触发。,0,1,58,1 +59=进入或飞越...,0,2,0,0,当单位%1 步兵%1 或飞行器移动进入或飞越此单元时,事件触发。属于进入事件的拓展版,但不能关联建筑。,0,1,59,1 ; 60 and 61 are tricky! They use code + 2 params... param type 46 includes the code 2, which is put in front of the 2 parameters -60=TechType Exists,48,46,0,0,True if there are at least this many of this type%1 belonging to anyone,0,1,60,1 -61=TechType does not Exist,48,46,0,0,True if there are none of these on the map at all. Number doesn't mean anything.,0,1,61,1 - +60=科技类型存在,48,46,0,0,地图上该科技存在的(无论所属方)数量大于等于设定值,则触发。此触发计算“正在建造中的物体”。,0,1,60,1 +61=科技类型不存在,48,46,0,0,如果地图上(包括进入载具和建筑的)此类科技的数量小于设定值,则触发,数值设为0没有意义。此触发计算“正在建造中的物体”。,0,1,61,1 ; action format: ; #=Description, P1 type, P2 type, P3 type, P4 type, P5Type, P6Type, uses waypoint, uses tag, Obsolete, used in TS, used in RA2, ID, [YR only - optional] @@ -1161,156 +1162,154 @@ vertic_cornerleft_0=21 ; NOTE: To overwrite TS actions with RA2 special ones, add the new action to the [ActionsRA2] section. ; NOTE: ID must be the same like # [ActionsRA2] -0=-No Action-,0,0,0,0,0,0,0,0,0,This is a null action. It will do nothing and is equivalent to not having an action at all. Why use it?,0,1,0 -1=Winner is...,0,2,0,0,0,0,0,0,0,The winner will be forced to be the house specified. The game will end immediately. Typically%1 the player's house is specified.,0,1,1 -2=Loser is...,0,2,0,0,0,0,0,0,0,The loser will be force to be the house specified. The game will end immediately. Typically%1 the player's house is specified.,0,1,2 -3=Production Begins...,0,2,0,0,0,0,0,0,0,The computer's house (as specified) will begin production of units and structures.,0,1,3 -4=Create Team...,-1,7,0,0,0,0,0,0,0,Creates a team of the type specified (owned by the house of this trigger). The team member are NOT automatically created however.,0,1,4 -5=Destroy Team...,-1,7,0,0,0,0,0,0,0,Destroys all instances of the team type specified. The units in those existing teams will remain and be available for recruiting into other teams.,0,1,5 -6=All to Hunt...,0,2,0,0,0,0,0,0,0,Forces all units%1 of the house specified%1 into 'hunt' mode. They will seek out and destroy their enemies.,0,1,6 -7=Reinforcement (team)...,-1,7,0,0,0,0,0,0,0,Create a reinforcement of the specified team. The members of the team WILL be created magically by this action.,0,1,7 -8=Drop Zone Flare (waypoint)...,0,30,0,0,0,0,0,0,0,Display a drop zone flair at the waypoint specified. The map will also be reaveald around that location.,0,1,8 -9=Fire Sale...,0,2,0,0,0,0,0,0,0,Cause all buildings of the specified house to be sold (for cash and prizes). Typically this is used in the final assault by the computer.,0,1,9 -10=Play Movie...,0,12,0,0,0,0,0,0,0,Displays the specified movie (full screen). The game is paused while this occurs and resumes normally after it completes.,0,1,10 -11=Text Trigger...,-4,13,0,0,0,0,0,0,0,Display the text identified by the string file