- Timestamp:
- 08/29/11 05:50:29 (13 years ago)
- Location:
- ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor
- Files:
-
- 5 edited
-
ScenarioEditor.cpp (modified) (2 diffs)
-
Sections/Map/Map.cpp (modified) (7 diffs)
-
Sections/Object/Object.cpp (modified) (2 diffs)
-
Sections/Player/Player.cpp (modified) (3 diffs)
-
Sections/Terrain/Terrain.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp
r10129 r10131 453 453 // the toolbar with the frame, and use OnCreateToolBar to construct our custom toolbar 454 454 // (this should be equivalent behavior on all platforms) 455 CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL, ID_Toolbar) ;455 CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL, ID_Toolbar)->Realize(); 456 456 457 457 // Set the default tool to be selected … … 540 540 toolbar->AddToolButton(_("Paint Terrain"), _("Paint terrain texture"), _T("paintterrain.png"), _T("PaintTerrain"), _T("")/*_T("TerrainSidebar")*/); 541 541 542 toolbar->Realize();543 544 542 return toolbar; 545 543 } -
ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp
r10117 r10131 148 148 gridSizer->AddGrowableCol(1); 149 149 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Reveal map")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 150 gridSizer->Add(new wxCheckBox(this, ID_MapReveal, wxEmptyString)); 150 gridSizer->Add(Tooltipped(new wxCheckBox(this, ID_MapReveal, wxEmptyString), 151 _("If checked, players won't need to explore"))); 151 152 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Game type")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 152 gridSizer->Add(new wxChoice(this, ID_MapType, wxDefaultPosition, wxDefaultSize, gameTypes), wxSizerFlags().Expand()); 153 gridSizer->Add(Tooltipped(new wxChoice(this, ID_MapType, wxDefaultPosition, wxDefaultSize, gameTypes), 154 _("Select the game type (or victory condition)")), wxSizerFlags().Expand()); 153 155 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Lock teams")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 154 gridSizer->Add(new wxCheckBox(this, ID_MapTeams, wxEmptyString)); 156 gridSizer->Add(Tooltipped(new wxCheckBox(this, ID_MapTeams, wxEmptyString), 157 _("NOT IMPLEMENTED"))); 155 158 sizer->Add(gridSizer, wxSizerFlags().Expand()); 156 159 … … 160 163 wxFlexGridSizer* kwGridSizer = new wxFlexGridSizer(2, 5, 5); 161 164 kwGridSizer->Add(new wxStaticText(this, wxID_ANY, _("Demo")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 162 kwGridSizer->Add(new wxCheckBox(this, ID_MapKW_Demo, wxEmptyString)); 165 kwGridSizer->Add(Tooltipped(new wxCheckBox(this, ID_MapKW_Demo, wxEmptyString), 166 _("If checked, map will only be visible using filters in game setup"))); 163 167 kwGridSizer->Add(new wxStaticText(this, wxID_ANY, _("Hidden")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 164 kwGridSizer->Add(new wxCheckBox(this, ID_MapKW_Hidden, wxEmptyString)); 168 kwGridSizer->Add(Tooltipped(new wxCheckBox(this, ID_MapKW_Hidden, wxEmptyString), 169 _("If checked, map will only be visible using filters in game setup"))); 165 170 keywordsSizer->Add(kwGridSizer); 166 171 sizer->Add(keywordsSizer, wxSizerFlags().Expand()); … … 263 268 m_MainSizer->Add(m_MapSettingsCtrl, wxSizerFlags().Expand()); 264 269 265 m_MainSizer->Add(new wxButton(this, ID_OpenPlayerPanel, _T("Player settings")), wxSizerFlags().Expand().Border(wxTOP, 16));266 267 270 { 268 271 ///////////////////////////////////////////////////////////////////////// … … 274 277 sizer->AddSpacer(5); 275 278 279 sizer->Add(new wxButton(this, ID_OpenPlayerPanel, _T("Change players")), wxSizerFlags().Expand()); 280 281 sizer->AddSpacer(5); 282 276 283 wxFlexGridSizer* gridSizer = new wxFlexGridSizer(2, 5, 5); 277 284 gridSizer->AddGrowableCol(1); … … 283 290 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Random seed")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 284 291 wxBoxSizer* seedSizer = new wxBoxSizer(wxHORIZONTAL); 285 seedSizer->Add(Tooltipped(new wxTextCtrl(this, ID_RandomSeed, _T("0"), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator(wxFILTER_NUMERIC)), _("Seed value for random map")), wxSizerFlags(1).Expand()); 286 seedSizer->Add(Tooltipped(new wxButton(this, ID_RandomReseed, _("R"), wxDefaultPosition, wxSize(24, -1)), _("New random seed"))); 292 seedSizer->Add(Tooltipped(new wxTextCtrl(this, ID_RandomSeed, _T("0"), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator(wxFILTER_NUMERIC)), 293 _("Seed value for random map")), wxSizerFlags(1).Expand()); 294 seedSizer->Add(Tooltipped(new wxButton(this, ID_RandomReseed, _("R"), wxDefaultPosition, wxSize(24, -1)), 295 _("New random seed"))); 287 296 gridSizer->Add(seedSizer, wxSizerFlags().Expand()); 288 297 … … 291 300 sizer->AddSpacer(5); 292 301 293 sizer->Add(new wxButton(this, ID_RandomGenerate, _("Generate map")), wxSizerFlags().Expand()); 294 295 m_MainSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 16)); 302 sizer->Add(Tooltipped(new wxButton(this, ID_RandomGenerate, _("Generate map")), 303 _("Run selected random map script")), wxSizerFlags().Expand()); 304 305 m_MainSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10)); 296 306 } 297 307 … … 301 311 wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Simulation test")); 302 312 wxGridSizer* gridSizer = new wxGridSizer(5); 303 gridSizer->Add(new wxButton(this, ID_SimPlay, _("Play")), wxSizerFlags().Expand()); 304 gridSizer->Add(new wxButton(this, ID_SimFast, _("Fast")), wxSizerFlags().Expand()); 305 gridSizer->Add(new wxButton(this, ID_SimSlow, _("Slow")), wxSizerFlags().Expand()); 306 gridSizer->Add(new wxButton(this, ID_SimPause, _("Pause")), wxSizerFlags().Expand()); 307 gridSizer->Add(new wxButton(this, ID_SimReset, _("Reset")), wxSizerFlags().Expand()); 313 gridSizer->Add(Tooltipped(new wxButton(this, ID_SimPlay, _("Play")), 314 _("Run the simulation at normal speed")), wxSizerFlags().Expand()); 315 gridSizer->Add(Tooltipped(new wxButton(this, ID_SimFast, _("Fast")), 316 _("Run the simulation at 8x speed")), wxSizerFlags().Expand()); 317 gridSizer->Add(Tooltipped(new wxButton(this, ID_SimSlow, _("Slow")), 318 _("Run the simulation at 1/8x speed")), wxSizerFlags().Expand()); 319 gridSizer->Add(Tooltipped(new wxButton(this, ID_SimPause, _("Pause")), 320 _("Pause the simulation")), wxSizerFlags().Expand()); 321 gridSizer->Add(Tooltipped(new wxButton(this, ID_SimReset, _("Reset")), 322 _("Reset the editor to initial state")), wxSizerFlags().Expand()); 308 323 sizer->Add(gridSizer, wxSizerFlags().Expand()); 309 324 UpdateSimButtons(); 310 m_MainSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 1 6));325 m_MainSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10)); 311 326 } 312 327 } -
ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp
r10123 r10131 114 114 wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL); 115 115 sizer->Add(new wxStaticText(this, wxID_ANY, _("Filter")), wxSizerFlags().Align(wxALIGN_CENTER)); 116 wxTextCtrl* objectFilter = new wxTextCtrl(this, ID_ObjectFilter);117 sizer->Add(objectFilter, wxSizerFlags().Expand().Proportion(1));116 sizer->Add(Tooltipped(new wxTextCtrl(this, ID_ObjectFilter), 117 _("Enter text to filter object list")), wxSizerFlags().Expand().Proportion(1)); 118 118 m_MainSizer->Add(sizer, wxSizerFlags().Expand()); 119 119 … … 194 194 void ObjectSidebar::ToggleViewer(wxCommandEvent& WXUNUSED(evt)) 195 195 { 196 // Change name of button 196 197 if (p->m_ActorViewerActive) 198 { 199 wxDynamicCast(FindWindow(ID_ToggleViewer), wxButton)->SetLabel(_("Switch to actor viewer")); 197 200 m_ScenarioEditor.GetToolManager().SetCurrentTool(_T(""), NULL); 201 } 198 202 else 203 { 204 wxDynamicCast(FindWindow(ID_ToggleViewer), wxButton)->SetLabel(_("Return to game view")); 199 205 m_ScenarioEditor.GetToolManager().SetCurrentTool(_T("ActorViewerTool"), NULL); 206 } 200 207 } 201 208 -
ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp
r10117 r10131 86 86 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Colour")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 87 87 wxButton* colourButton = new wxButton(this, ID_PlayerColour); 88 gridSizer->Add(Tooltipped(colourButton, _("Set player colour")), wxSizerFlags(1).Expand().Align(wxALIGN_RIGHT)); 88 gridSizer->Add(Tooltipped(colourButton, 89 _("Set player colour")), wxSizerFlags(1).Expand().Align(wxALIGN_RIGHT)); 89 90 m_Controls.colour = colourButton; 90 91 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Default AI")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 91 92 wxChoice* aiChoice = new wxChoice(this, wxID_ANY); 92 gridSizer->Add(Tooltipped(aiChoice, _("Select default AI")), wxSizerFlags(1).Expand().Align(wxALIGN_RIGHT)); 93 gridSizer->Add(Tooltipped(aiChoice, 94 _("Select default AI")), wxSizerFlags(1).Expand().Align(wxALIGN_RIGHT)); 93 95 m_Controls.ai = aiChoice; 94 96 … … 105 107 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Food")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 106 108 wxSpinCtrl* foodCtrl = new wxSpinCtrl(this, ID_PlayerFood, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, INT_MAX); 107 gridSizer->Add(Tooltipped(foodCtrl, _("Initial value of food resource")), wxSizerFlags().Expand()); 109 gridSizer->Add(Tooltipped(foodCtrl, 110 _("Initial value of food resource")), wxSizerFlags().Expand()); 108 111 m_Controls.food = foodCtrl; 109 112 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Wood")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 110 113 wxSpinCtrl* woodCtrl = new wxSpinCtrl(this, ID_PlayerWood, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, INT_MAX); 111 gridSizer->Add(Tooltipped(woodCtrl, _("Initial value of wood resource")), wxSizerFlags().Expand()); 114 gridSizer->Add(Tooltipped(woodCtrl, 115 _("Initial value of wood resource")), wxSizerFlags().Expand()); 112 116 m_Controls.wood = woodCtrl; 113 117 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Metal")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 114 118 wxSpinCtrl* metalCtrl = new wxSpinCtrl(this, ID_PlayerMetal, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, INT_MAX); 115 gridSizer->Add(Tooltipped(metalCtrl, _("Initial value of metal resource")), wxSizerFlags().Expand()); 119 gridSizer->Add(Tooltipped(metalCtrl, 120 _("Initial value of metal resource")), wxSizerFlags().Expand()); 116 121 m_Controls.metal = metalCtrl; 117 122 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Stone")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 118 123 wxSpinCtrl* stoneCtrl = new wxSpinCtrl(this, ID_PlayerStone, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, INT_MAX); 119 gridSizer->Add(Tooltipped(stoneCtrl, _("Initial value of stone resource")), wxSizerFlags().Expand()); 124 gridSizer->Add(Tooltipped(stoneCtrl, 125 _("Initial value of stone resource")), wxSizerFlags().Expand()); 120 126 m_Controls.stone = stoneCtrl; 121 127 gridSizer->Add(new wxStaticText(this, wxID_ANY, _("Pop limit")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); 122 128 wxSpinCtrl* popCtrl = new wxSpinCtrl(this, ID_PlayerPop, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, INT_MAX); 123 gridSizer->Add(Tooltipped(popCtrl, _("Population limit for this player")), wxSizerFlags().Expand()); 129 gridSizer->Add(Tooltipped(popCtrl, 130 _("Population limit for this player")), wxSizerFlags().Expand()); 124 131 m_Controls.pop = popCtrl; 125 132 … … 158 165 wxGridSizer* gridSizer = new wxGridSizer(3); 159 166 wxButton* cameraSet = new wxButton(this, ID_CameraSet, _("Set")); 160 gridSizer->Add(Tooltipped(cameraSet, _("Set player camera to this view")), wxSizerFlags().Expand()); 167 gridSizer->Add(Tooltipped(cameraSet, 168 _("Set player camera to this view")), wxSizerFlags().Expand()); 161 169 wxButton* cameraView = new wxButton(this, ID_CameraView, _("View")); 162 170 cameraView->Enable(false); 163 gridSizer->Add(Tooltipped(cameraView, _("View the player camera")), wxSizerFlags().Expand()); 171 gridSizer->Add(Tooltipped(cameraView, 172 _("View the player camera")), wxSizerFlags().Expand()); 164 173 wxButton* cameraClear = new wxButton(this, ID_CameraClear, _("Clear")); 165 174 cameraClear->Enable(false); 166 gridSizer->Add(Tooltipped(cameraClear, _("Clear player camera")), wxSizerFlags().Expand()); 175 gridSizer->Add(Tooltipped(cameraClear, 176 _("Clear player camera")), wxSizerFlags().Expand()); 167 177 cameraSizer->Add(gridSizer, wxSizerFlags().Expand()); 168 178 -
ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp
r10064 r10131 54 54 }; 55 55 56 // Helper function for adding tooltips 57 static wxWindow* Tooltipped(wxWindow* window, const wxString& tip) 58 { 59 window->SetToolTip(tip); 60 return window; 61 } 62 56 63 TerrainSidebar::TerrainSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer) : 57 64 Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer) … … 62 69 wxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Elevation tools")); 63 70 wxSizer* gridSizer = new wxGridSizer(3); 64 gridSizer->Add(new ToolButton(scenarioEditor.GetToolManager(), this, _("Modify"), _T("AlterElevation")), wxSizerFlags().Expand()); 65 gridSizer->Add(new ToolButton(scenarioEditor.GetToolManager(), this, _("Smooth"), _T("SmoothElevation")), wxSizerFlags().Expand()); 66 gridSizer->Add(new ToolButton(scenarioEditor.GetToolManager(), this, _("Flatten"), _T("FlattenElevation")), wxSizerFlags().Expand()); 71 gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), this, _("Modify"), _T("AlterElevation")), 72 _("Brush with left mouse buttons to raise terrain,\nright mouse button to lower it")), wxSizerFlags().Expand()); 73 gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), this, _("Smooth"), _T("SmoothElevation")), 74 _("Brush with left mouse button to smooth terrain,\nright mouse button to roughen it")), wxSizerFlags().Expand()); 75 gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), this, _("Flatten"), _T("FlattenElevation")), 76 _("Brush with left mouse button to flatten terrain")), wxSizerFlags().Expand()); 67 77 sizer->Add(gridSizer, wxSizerFlags().Expand()); 68 78 m_MainSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10)); … … 74 84 wxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Texture tools")); 75 85 wxSizer* gridSizer = new wxGridSizer(3); 76 gridSizer->Add(new ToolButton(scenarioEditor.GetToolManager(), this, _("Paint"), _T("PaintTerrain")), wxSizerFlags().Expand()); 77 gridSizer->Add(new ToolButton(scenarioEditor.GetToolManager(), this, _("Replace"), _T("ReplaceTerrain")), wxSizerFlags().Expand()); 78 gridSizer->Add(new ToolButton(scenarioEditor.GetToolManager(), this, _("Fill"), _T("FillTerrain")), wxSizerFlags().Expand()); 86 gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), this, _("Paint"), _T("PaintTerrain")), 87 _("Brush with left mouse button to paint texture dominantly,\nright mouse button to paint submissively")), wxSizerFlags().Expand()); 88 gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), this, _("Replace"), _T("ReplaceTerrain")), 89 _("Replace all of a terrain texture with a new one")), wxSizerFlags().Expand()); 90 gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), this, _("Fill"), _T("FillTerrain")), 91 _T("Bucket fill a patch of terrain texture with a new one")), wxSizerFlags().Expand()); 79 92 sizer->Add(gridSizer, wxSizerFlags().Expand()); 80 93 m_MainSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10)); … … 105 118 106 119 visSizer->Add(new wxStaticText(this, wxID_ANY, _("Passability")), wxSizerFlags().Align(wxALIGN_CENTER|wxALIGN_RIGHT)); 107 visSizer->Add(m_PassabilityChoice, wxSizerFlags().Expand()); 120 visSizer->Add(Tooltipped(m_PassabilityChoice, 121 _("View passability classes")), wxSizerFlags().Expand()); 108 122 109 123 visSizer->Add(new wxStaticText(this, wxID_ANY, _("Priorities")), wxSizerFlags().Align(wxALIGN_CENTER|wxALIGN_RIGHT)); 110 visSizer->Add(new wxCheckBox(this, ID_ShowPriorities, _(""))); 124 visSizer->Add(Tooltipped(new wxCheckBox(this, ID_ShowPriorities, _("")), 125 _("Show terrain texture priorities"))); 111 126 } 112 127 … … 165 180 // TODO: set default based on current map size 166 181 167 wxSingleChoiceDialog dlg(this, _("Select new map size. WARNING: This probably only works reliably on blank maps , and cannot be undone."),182 wxSingleChoiceDialog dlg(this, _("Select new map size. WARNING: This probably only works reliably on blank maps."), 168 183 _("Resize map"), sizeNames); 169 184 … … 245 260 // Add spaces into the displayed name so there are more wrapping opportunities 246 261 wxString labelText = name; 262 if (labelText.Len()) 263 labelText[0] = wxToupper(labelText[0]); 247 264 labelText.Replace(_T("_"), _T(" ")); 248 265 wxStaticText* label = new wxStaticText(m_ScrolledPanel, wxID_ANY, labelText, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER); … … 358 375 { 359 376 wxString visibleName = m_TerrainGroups[i]; 377 // Format name slightly 360 378 if (visibleName.Len()) 361 379 visibleName[0] = wxToupper(visibleName[0]); 380 visibleName.Replace(_T("_"), _T(" ")); 362 381 AddPage(new TextureNotebookPage(m_ScenarioEditor, this, m_TerrainGroups[i]), visibleName); 382 } 383 384 // On some platforms (wxOSX) there is no initial OnPageChanged event, so it loads with a blank page 385 // and setting selection to 0 won't trigger it either, so just force first page to display 386 // (this is safe because the sidebar has already been displayed) 387 if (GetPageCount() > 0) 388 { 389 static_cast<TextureNotebookPage*>(GetPage(0))->OnDisplay(); 363 390 } 364 391 }
Note:
See TracChangeset
for help on using the changeset viewer.
