mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Fix sidepanel layout in Atlas
In many places there are missing gaps/borders and where there are there are almost random values used (2/3/4/5/8/10/15). Add missing and standardize on using gaps 5 and 10 pixel only. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
1250ca1dac
commit
0b7e502837
6 changed files with 164 additions and 132 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -79,15 +79,19 @@ CinemaSidebar::CinemaSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarCo
|
|||
commonSizer->Add(gridSizer, wxSizerFlags().Expand());
|
||||
|
||||
// Paths list panel
|
||||
wxStaticBoxSizer* pathsSizer = new wxStaticBoxSizer(wxVERTICAL, commonSizer->GetStaticBox(), _T("Paths"));
|
||||
commonSizer->Add(pathsSizer, wxSizerFlags().Proportion(1).Expand());
|
||||
wxStaticBoxSizer* pathsBoxSizer = new wxStaticBoxSizer(wxVERTICAL, commonSizer->GetStaticBox(), _T("Paths"));
|
||||
wxStaticBox* pathsBox = pathsBoxSizer->GetStaticBox();
|
||||
commonSizer->Add(pathsBoxSizer, wxSizerFlags().Proportion(1).Expand().Border(wxALL, 5));
|
||||
wxFlexGridSizer* pathsSizer = new wxFlexGridSizer(1, 5, 5);
|
||||
pathsSizer->AddGrowableCol(0);
|
||||
pathsBoxSizer->Add(pathsSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
|
||||
pathsSizer->Add(m_PathList = new wxListBox(pathsSizer->GetStaticBox(), ID_PathsList, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE | wxLB_SORT), wxSizerFlags().Proportion(1).Expand());
|
||||
pathsSizer->Add(m_PathList = new wxListBox(pathsBox, ID_PathsList, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE | wxLB_SORT), wxSizerFlags().Proportion(1).Expand());
|
||||
commonSizer->AddSpacer(3);
|
||||
pathsSizer->Add(Tooltipped(new wxButton(pathsSizer->GetStaticBox(), ID_DeletePath, _("Delete")), _T("Delete selected path")), wxSizerFlags().Expand());
|
||||
pathsSizer->Add(Tooltipped(new wxButton(pathsBox, ID_DeletePath, _("Delete")), _T("Delete selected path")), wxSizerFlags().Expand());
|
||||
|
||||
pathsSizer->Add(m_NewPathName = new wxTextCtrl(pathsSizer->GetStaticBox(), wxID_ANY), wxSizerFlags().Expand());
|
||||
pathsSizer->Add(new wxButton(pathsSizer->GetStaticBox(), ID_AddPath, _("Add")), wxSizerFlags().Expand());
|
||||
pathsSizer->Add(m_NewPathName = new wxTextCtrl(pathsBox, wxID_ANY), wxSizerFlags().Expand());
|
||||
pathsSizer->Add(new wxButton(pathsBox, ID_AddPath, _("Add")), wxSizerFlags().Expand());
|
||||
}
|
||||
|
||||
void CinemaSidebar::OnFirstDisplay()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -72,7 +72,7 @@ public:
|
|||
SetSizer(m_Sizer);
|
||||
|
||||
m_Slider = new wxSlider(m_Sizer->GetStaticBox(), -1, 0, 0, range);
|
||||
m_Sizer->Add(m_Slider, wxSizerFlags().Expand());
|
||||
m_Sizer->Add(m_Slider, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
}
|
||||
|
||||
void OnSettingsChange(const AtlasMessage::sEnvironmentSettings& WXUNUSED(env))
|
||||
|
|
@ -119,7 +119,7 @@ public:
|
|||
m_Combo = new wxComboBox(
|
||||
m_Sizer->GetStaticBox(), -1, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxArrayString(), wxCB_READONLY),
|
||||
m_Sizer->Add(m_Combo, wxSizerFlags().Expand());
|
||||
m_Sizer->Add(m_Combo, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
}
|
||||
|
||||
void SetChoices(const std::vector<std::wstring>& choices)
|
||||
|
|
@ -174,7 +174,7 @@ public:
|
|||
SetSizer(m_Sizer);
|
||||
|
||||
m_Button = new wxButton(m_Sizer->GetStaticBox(), -1);
|
||||
m_Sizer->Add(m_Button, wxSizerFlags().Expand());
|
||||
m_Sizer->Add(m_Button, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
}
|
||||
|
||||
void OnSettingsChange(const AtlasMessage::sEnvironmentSettings& WXUNUSED(env))
|
||||
|
|
@ -244,69 +244,85 @@ EnvironmentSidebar::EnvironmentSidebar(
|
|||
scrolledWindow->SetSizer(scrollSizer);
|
||||
m_MainSizer->Add(scrolledWindow, wxSizerFlags().Proportion(1).Expand());
|
||||
|
||||
wxStaticBoxSizer* waterSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Water settings"));
|
||||
scrollSizer->Add(waterSizer, wxSizerFlags().Expand());
|
||||
wxFlexGridSizer* gridSizer = new wxFlexGridSizer(1, 10, 10);
|
||||
gridSizer->AddGrowableCol(0);
|
||||
scrollSizer->Add(gridSizer, wxSizerFlags().Expand());
|
||||
|
||||
wxStaticBoxSizer* waterBoxSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Water settings"));
|
||||
wxStaticBox* waterBox = waterBoxSizer->GetStaticBox();
|
||||
gridSizer->Add(waterBoxSizer, wxSizerFlags().Expand());
|
||||
wxFlexGridSizer* waterSizer = new wxFlexGridSizer(1, 10, 10);
|
||||
waterSizer->AddGrowableCol(0);
|
||||
waterBoxSizer->Add(waterSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
waterSizer->Add(new wxButton(
|
||||
waterSizer->GetStaticBox(), ID_RecomputeWaterData, _("Reset Water Data")), wxSizerFlags().Expand());
|
||||
waterBox, ID_RecomputeWaterData, _("Reset Water Data")), wxSizerFlags().Expand());
|
||||
waterSizer->Add(m_WaterTypeList = new VariableListBox(
|
||||
waterSizer->GetStaticBox(), _("Water Type"), g_EnvironmentSettings.watertype), wxSizerFlags().Expand());
|
||||
waterBox, _("Water Type"), g_EnvironmentSettings.watertype), wxSizerFlags().Expand());
|
||||
waterSizer->Add(new VariableSliderBox(
|
||||
waterSizer->GetStaticBox(), _("Water height"), g_EnvironmentSettings.waterheight, 0.f, 1.2f), wxSizerFlags().Expand());
|
||||
waterBox, _("Water height"), g_EnvironmentSettings.waterheight, 0.f, 1.2f), wxSizerFlags().Expand());
|
||||
waterSizer->Add(new wxButton(
|
||||
waterSizer->GetStaticBox(), ID_PickWaterHeight, _("Pick Water Height")), wxSizerFlags().Expand());
|
||||
waterBox, ID_PickWaterHeight, _("Pick Water Height")), wxSizerFlags().Expand());
|
||||
waterSizer->Add(new VariableSliderBox(
|
||||
waterSizer->GetStaticBox(), _("Water waviness"), g_EnvironmentSettings.waterwaviness, 0.f, 10.f), wxSizerFlags().Expand());
|
||||
waterBox, _("Water waviness"), g_EnvironmentSettings.waterwaviness, 0.f, 10.f), wxSizerFlags().Expand());
|
||||
waterSizer->Add(new VariableSliderBox(
|
||||
waterSizer->GetStaticBox(), _("Water murkiness"), g_EnvironmentSettings.watermurkiness, 0.f, 1.f), wxSizerFlags().Expand());
|
||||
waterBox, _("Water murkiness"), g_EnvironmentSettings.watermurkiness, 0.f, 1.f), wxSizerFlags().Expand());
|
||||
waterSizer->Add(new VariableSliderBox(
|
||||
waterSizer->GetStaticBox(), _("Wind angle"), g_EnvironmentSettings.windangle, -static_cast<float>(M_PI), static_cast<float>(M_PI)), wxSizerFlags().Expand());
|
||||
waterBox, _("Wind angle"), g_EnvironmentSettings.windangle, -static_cast<float>(M_PI), static_cast<float>(M_PI)), wxSizerFlags().Expand());
|
||||
waterSizer->Add(new VariableColorBox(
|
||||
waterSizer->GetStaticBox(), _("Water color"), g_EnvironmentSettings.watercolor), wxSizerFlags().Expand());
|
||||
waterBox, _("Water color"), g_EnvironmentSettings.watercolor), wxSizerFlags().Expand());
|
||||
waterSizer->Add(new VariableColorBox(
|
||||
waterSizer->GetStaticBox(), _("Water tint"), g_EnvironmentSettings.watertint), wxSizerFlags().Expand());
|
||||
waterBox, _("Water tint"), g_EnvironmentSettings.watertint), wxSizerFlags().Expand());
|
||||
|
||||
std::vector<std::wstring> list;
|
||||
list.push_back(L"ocean"); list.push_back(L"lake"); list.push_back(L"clap");
|
||||
m_WaterTypeList->SetChoices(list);
|
||||
|
||||
|
||||
wxStaticBoxSizer* sunSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Sun / lighting settings"));
|
||||
scrollSizer->Add(sunSizer, wxSizerFlags().Expand().Border(wxTOP, 8));
|
||||
wxStaticBoxSizer* sunBoxSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Sun / lighting settings"));
|
||||
wxStaticBox* sunBox = sunBoxSizer->GetStaticBox();
|
||||
gridSizer->Add(sunBoxSizer, wxSizerFlags().Expand());
|
||||
wxFlexGridSizer* sunSizer = new wxFlexGridSizer(1, 10, 10);
|
||||
sunSizer->AddGrowableCol(0);
|
||||
sunBoxSizer->Add(sunSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
|
||||
sunSizer->Add(new VariableSliderBox(
|
||||
sunSizer->GetStaticBox(), _("Sun rotation"), g_EnvironmentSettings.sunrotation, -static_cast<float>(M_PI), static_cast<float>(M_PI)), wxSizerFlags().Expand());
|
||||
sunBox, _("Sun rotation"), g_EnvironmentSettings.sunrotation, -static_cast<float>(M_PI), static_cast<float>(M_PI)), wxSizerFlags().Expand());
|
||||
sunSizer->Add(new VariableSliderBox(
|
||||
sunSizer->GetStaticBox(), _("Sun elevation"), g_EnvironmentSettings.sunelevation, -static_cast<float>(M_PI) / 2.0f, static_cast<float>(M_PI) / 2.0f), wxSizerFlags().Expand());
|
||||
sunBox, _("Sun elevation"), g_EnvironmentSettings.sunelevation, -static_cast<float>(M_PI) / 2.0f, static_cast<float>(M_PI) / 2.0f), wxSizerFlags().Expand());
|
||||
sunSizer->Add(new VariableSliderBox(
|
||||
sunSizer->GetStaticBox(), _("Sun overbrightness"), g_EnvironmentSettings.sunoverbrightness, 1.0f, 3.0f), wxSizerFlags().Expand());
|
||||
sunBox, _("Sun overbrightness"), g_EnvironmentSettings.sunoverbrightness, 1.0f, 3.0f), wxSizerFlags().Expand());
|
||||
sunSizer->Add(new LightControl(
|
||||
sunSizer->GetStaticBox(), wxSize(150, 150), g_EnvironmentSettings));
|
||||
sunBox, wxSize(150, 150), g_EnvironmentSettings), wxSizerFlags().Align(wxALIGN_CENTER));
|
||||
sunSizer->Add(new VariableColorBox(
|
||||
sunSizer->GetStaticBox(), _("Sun color"), g_EnvironmentSettings.suncolor), wxSizerFlags().Expand());
|
||||
sunBox, _("Sun color"), g_EnvironmentSettings.suncolor), wxSizerFlags().Expand());
|
||||
sunSizer->Add(m_SkyList = new VariableListBox(
|
||||
sunSizer->GetStaticBox(), _("Sky set"), g_EnvironmentSettings.skyset), wxSizerFlags().Expand());
|
||||
sunBox, _("Sky set"), g_EnvironmentSettings.skyset), wxSizerFlags().Expand());
|
||||
sunSizer->Add(new VariableSliderBox(
|
||||
sunSizer->GetStaticBox(), _("Fog Factor"), g_EnvironmentSettings.fogfactor, 0.0f, 0.01f), wxSizerFlags().Expand());
|
||||
sunBox, _("Fog Factor"), g_EnvironmentSettings.fogfactor, 0.0f, 0.01f), wxSizerFlags().Expand());
|
||||
sunSizer->Add(new VariableSliderBox(
|
||||
sunSizer->GetStaticBox(), _("Fog Thickness"), g_EnvironmentSettings.fogmax, 0.5f, 0.0f), wxSizerFlags().Expand());
|
||||
sunBox, _("Fog Thickness"), g_EnvironmentSettings.fogmax, 0.5f, 0.0f), wxSizerFlags().Expand());
|
||||
sunSizer->Add(new VariableColorBox(
|
||||
sunSizer->GetStaticBox(), _("Fog color"), g_EnvironmentSettings.fogcolor), wxSizerFlags().Expand());
|
||||
sunBox, _("Fog color"), g_EnvironmentSettings.fogcolor), wxSizerFlags().Expand());
|
||||
sunSizer->Add(new VariableColorBox(
|
||||
sunSizer->GetStaticBox(), _("Ambient color"), g_EnvironmentSettings.ambientcolor), wxSizerFlags().Expand());
|
||||
sunBox, _("Ambient color"), g_EnvironmentSettings.ambientcolor), wxSizerFlags().Expand());
|
||||
|
||||
wxStaticBoxSizer* postProcSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Post-processing settings"));
|
||||
scrollSizer->Add(postProcSizer, wxSizerFlags().Expand().Border(wxTOP, 8));
|
||||
wxStaticBoxSizer* postProcBoxSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Post-processing settings"));
|
||||
wxStaticBox* postProcBox = postProcBoxSizer->GetStaticBox();
|
||||
gridSizer->Add(postProcBoxSizer, wxSizerFlags().Expand());
|
||||
wxFlexGridSizer* postProcSizer = new wxFlexGridSizer(1, 10, 10);
|
||||
postProcSizer->AddGrowableCol(0);
|
||||
postProcBoxSizer->Add(postProcSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
|
||||
postProcSizer->Add(m_PostEffectList = new VariableListBox(
|
||||
postProcSizer->GetStaticBox(), _("Post Effect"), g_EnvironmentSettings.posteffect), wxSizerFlags().Expand());
|
||||
postProcBox, _("Post Effect"), g_EnvironmentSettings.posteffect), wxSizerFlags().Expand());
|
||||
postProcSizer->Add(new VariableSliderBox(
|
||||
postProcSizer->GetStaticBox(), _("Brightness"), g_EnvironmentSettings.brightness, -0.5f, 0.5f), wxSizerFlags().Expand());
|
||||
postProcBox, _("Brightness"), g_EnvironmentSettings.brightness, -0.5f, 0.5f), wxSizerFlags().Expand());
|
||||
postProcSizer->Add(new VariableSliderBox(
|
||||
postProcSizer->GetStaticBox(), _("Contrast (HDR)"), g_EnvironmentSettings.contrast, 0.5f, 1.5f), wxSizerFlags().Expand());
|
||||
postProcBox, _("Contrast (HDR)"), g_EnvironmentSettings.contrast, 0.5f, 1.5f), wxSizerFlags().Expand());
|
||||
postProcSizer->Add(new VariableSliderBox(
|
||||
postProcSizer->GetStaticBox(), _("Saturation"), g_EnvironmentSettings.saturation, 0.0f, 2.0f), wxSizerFlags().Expand());
|
||||
postProcBox, _("Saturation"), g_EnvironmentSettings.saturation, 0.0f, 2.0f), wxSizerFlags().Expand());
|
||||
postProcSizer->Add(new VariableSliderBox(
|
||||
postProcSizer->GetStaticBox(), _("Bloom"), g_EnvironmentSettings.bloom, 0.2f, 0.0f), wxSizerFlags().Expand());
|
||||
postProcBox, _("Bloom"), g_EnvironmentSettings.bloom, 0.2f, 0.0f), wxSizerFlags().Expand());
|
||||
|
||||
m_Conn = g_EnvironmentSettings.RegisterObserver(0, &SendToGame);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -180,40 +180,40 @@ MapSettingsControl::MapSettingsControl(wxWindow* parent, ScenarioEditor& scenari
|
|||
|
||||
void MapSettingsControl::CreateWidgets()
|
||||
{
|
||||
wxStaticBoxSizer* sizer = static_cast<wxStaticBoxSizer*>(GetSizer());
|
||||
wxStaticBoxSizer* topSizer = static_cast<wxStaticBoxSizer*>(GetSizer());
|
||||
wxStaticBox* topBox = topSizer->GetStaticBox();
|
||||
|
||||
wxFlexGridSizer* grid = new wxFlexGridSizer(1, 5, 5);
|
||||
grid->AddGrowableCol(0);
|
||||
|
||||
topSizer->Add(grid, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Map settings
|
||||
wxBoxSizer* nameSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
nameSizer->Add(new wxStaticText(sizer->GetStaticBox(), wxID_ANY, _("Name")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL));
|
||||
nameSizer->Add(8, 0);
|
||||
nameSizer->Add(Tooltipped(new wxTextCtrl(sizer->GetStaticBox(), ID_MapName),
|
||||
nameSizer->Add(new wxStaticText(topBox, wxID_ANY, _("Name")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL));
|
||||
nameSizer->AddSpacer(8);
|
||||
nameSizer->Add(Tooltipped(new wxTextCtrl(topBox, ID_MapName),
|
||||
_("Displayed name of the map")), wxSizerFlags().Proportion(1));
|
||||
sizer->Add(nameSizer, wxSizerFlags().Expand());
|
||||
grid->Add(nameSizer, wxSizerFlags().Expand());
|
||||
|
||||
sizer->Add(0, 2);
|
||||
|
||||
sizer->Add(new wxStaticText(sizer->GetStaticBox(), wxID_ANY, _("Description")));
|
||||
sizer->Add(Tooltipped(new wxTextCtrl(sizer->GetStaticBox(), ID_MapDescription, wxEmptyString, wxDefaultPosition, wxSize(-1, 100), wxTE_MULTILINE),
|
||||
grid->Add(new wxStaticText(topBox, wxID_ANY, _("Description")));
|
||||
grid->Add(Tooltipped(new wxTextCtrl(topBox, ID_MapDescription, wxEmptyString, wxDefaultPosition, wxSize(-1, 100), wxTE_MULTILINE),
|
||||
_("Short description used on the map selection screen")), wxSizerFlags().Expand());
|
||||
|
||||
sizer->AddSpacer(5);
|
||||
|
||||
wxFlexGridSizer* gridSizer = new wxFlexGridSizer(2, 5, 5);
|
||||
gridSizer->AddGrowableCol(1);
|
||||
|
||||
// TODO: have preview selector tool?
|
||||
gridSizer->Add(new wxStaticText(sizer->GetStaticBox(), wxID_ANY, _("Preview")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
|
||||
gridSizer->Add(Tooltipped(new wxTextCtrl(sizer->GetStaticBox(), ID_MapPreview, wxEmptyString),
|
||||
gridSizer->Add(new wxStaticText(topBox, wxID_ANY, _("Preview")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
|
||||
gridSizer->Add(Tooltipped(new wxTextCtrl(topBox, ID_MapPreview, wxEmptyString),
|
||||
_("Texture used for map preview")), wxSizerFlags().Expand());
|
||||
CREATE_CHECKBOX(sizer->GetStaticBox(), gridSizer, "Reveal map", "If checked, players won't need to explore", ID_MapReveal);
|
||||
CREATE_CHECKBOX(sizer->GetStaticBox(), gridSizer, "Ally view", "If checked, players will be able to see what their teammates see and won't need to research cartography", ID_MapAlly);
|
||||
CREATE_CHECKBOX(sizer->GetStaticBox(), gridSizer, "Lock teams", "If checked, teams will be locked", ID_MapTeams);
|
||||
sizer->Add(gridSizer, wxSizerFlags().Expand());
|
||||
CREATE_CHECKBOX(topBox, gridSizer, "Reveal map", "If checked, players won't need to explore", ID_MapReveal);
|
||||
CREATE_CHECKBOX(topBox, gridSizer, "Ally view", "If checked, players will be able to see what their teammates see and won't need to research cartography", ID_MapAlly);
|
||||
CREATE_CHECKBOX(topBox, gridSizer, "Lock teams", "If checked, teams will be locked", ID_MapTeams);
|
||||
grid->Add(gridSizer, wxSizerFlags().Expand());
|
||||
|
||||
sizer->AddSpacer(5);
|
||||
|
||||
wxStaticBoxSizer* victoryConditionSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Victory Conditions"));
|
||||
wxStaticBoxSizer* victoryConditionSizer = new wxStaticBoxSizer(wxVERTICAL, topBox, _("Victory Conditions"));
|
||||
wxFlexGridSizer* vcGridSizer = new wxFlexGridSizer(2, 0, 5);
|
||||
vcGridSizer->AddGrowableCol(1);
|
||||
|
||||
|
|
@ -234,20 +234,21 @@ void MapSettingsControl::CreateWidgets()
|
|||
CREATE_CHECKBOX(victoryConditionSizer->GetStaticBox(), vcGridSizer, title, "Select " + title + " victory condition.", index);
|
||||
}
|
||||
|
||||
victoryConditionSizer->Add(vcGridSizer);
|
||||
sizer->Add(victoryConditionSizer, wxSizerFlags().Expand());
|
||||
victoryConditionSizer->Add(vcGridSizer, wxSizerFlags().Border(wxALL, 5));
|
||||
grid->Add(victoryConditionSizer, wxSizerFlags().Expand());
|
||||
|
||||
sizer->AddSpacer(5);
|
||||
//sizer->AddSpacer(5);
|
||||
|
||||
wxStaticBoxSizer* keywordsSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Keywords"));
|
||||
wxStaticBoxSizer* keywordsSizer = new wxStaticBoxSizer(wxVERTICAL, topBox, _("Keywords"));
|
||||
wxStaticBox* keywordsBox = keywordsSizer->GetStaticBox();
|
||||
wxFlexGridSizer* kwGridSizer = new wxFlexGridSizer(4, 5, 15);
|
||||
CREATE_CHECKBOX(keywordsSizer->GetStaticBox(), kwGridSizer, "Demo", "If checked, map will only be visible using filters in game setup", ID_MapKW_Demo);
|
||||
CREATE_CHECKBOX(keywordsSizer->GetStaticBox(), kwGridSizer, "Naval", "If checked, map will only be visible using filters in game setup", ID_MapKW_Naval);
|
||||
CREATE_CHECKBOX(keywordsSizer->GetStaticBox(), kwGridSizer, "New", "If checked, the map will appear in the list of new maps", ID_MapKW_New);
|
||||
CREATE_CHECKBOX(keywordsSizer->GetStaticBox(), kwGridSizer, "Trigger", "If checked, the map will appear in the list of maps with trigger scripts", ID_MapKW_Trigger);
|
||||
CREATE_CHECKBOX(keywordsBox, kwGridSizer, "Demo", "If checked, map will only be visible using filters in game setup", ID_MapKW_Demo);
|
||||
CREATE_CHECKBOX(keywordsBox, kwGridSizer, "Naval", "If checked, map will only be visible using filters in game setup", ID_MapKW_Naval);
|
||||
CREATE_CHECKBOX(keywordsBox, kwGridSizer, "New", "If checked, the map will appear in the list of new maps", ID_MapKW_New);
|
||||
CREATE_CHECKBOX(keywordsBox, kwGridSizer, "Trigger", "If checked, the map will appear in the list of maps with trigger scripts", ID_MapKW_Trigger);
|
||||
|
||||
keywordsSizer->Add(kwGridSizer);
|
||||
sizer->Add(keywordsSizer, wxSizerFlags().Expand());
|
||||
keywordsSizer->Add(kwGridSizer, wxSizerFlags().Border(wxALL, 5));
|
||||
grid->Add(keywordsSizer, wxSizerFlags().Expand());
|
||||
}
|
||||
|
||||
void MapSettingsControl::ReadFromEngine()
|
||||
|
|
@ -477,7 +478,9 @@ void MapSettingsControl::SendToEngine()
|
|||
MapSidebar::MapSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer)
|
||||
: Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer), m_SimState(SimInactive)
|
||||
{
|
||||
wxSizer* scrollSizer = new wxBoxSizer(wxVERTICAL);
|
||||
wxFlexGridSizer* scrollSizer = new wxFlexGridSizer(1, 5, 5);
|
||||
scrollSizer->AddGrowableCol(0);
|
||||
|
||||
wxScrolledWindow* scrolledWindow = new wxScrolledWindow(this);
|
||||
scrolledWindow->SetScrollRate(10, 10);
|
||||
scrolledWindow->SetSizer(scrollSizer);
|
||||
|
|
@ -489,47 +492,49 @@ MapSidebar::MapSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContaine
|
|||
{
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Random map settings
|
||||
wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Random map"));
|
||||
scrollSizer->Add(sizer, wxSizerFlags().Expand());
|
||||
wxStaticBoxSizer* topSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Random map"));
|
||||
wxStaticBox* topBox = topSizer->GetStaticBox();
|
||||
|
||||
sizer->Add(new wxChoice(sizer->GetStaticBox(), ID_RandomScript), wxSizerFlags().Expand());
|
||||
wxFlexGridSizer* grid = new wxFlexGridSizer(1, 10, 10);
|
||||
grid->AddGrowableCol(0);
|
||||
|
||||
sizer->AddSpacer(5);
|
||||
topSizer->Add(grid, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
sizer->Add(new wxButton(sizer->GetStaticBox(), ID_OpenPlayerPanel, _T("Change players")), wxSizerFlags().Expand());
|
||||
scrollSizer->Add(topSizer, wxSizerFlags().Expand());
|
||||
|
||||
grid->Add(new wxChoice(topBox, ID_RandomScript), wxSizerFlags().Expand());
|
||||
|
||||
grid->Add(new wxButton(topBox, ID_OpenPlayerPanel, _T("Change players")), wxSizerFlags().Expand());
|
||||
|
||||
sizer->AddSpacer(5);
|
||||
|
||||
wxFlexGridSizer* gridSizer = new wxFlexGridSizer(2, 5, 5);
|
||||
gridSizer->AddGrowableCol(1);
|
||||
|
||||
gridSizer->Add(new wxStaticText(sizer->GetStaticBox(), wxID_ANY, _("Biome")),
|
||||
gridSizer->Add(new wxStaticText(topBox, wxID_ANY, _("Biome")),
|
||||
wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
|
||||
gridSizer->Add(new wxChoice(sizer->GetStaticBox(), ID_RandomBiome), wxSizerFlags().Expand());
|
||||
gridSizer->Add(new wxChoice(topBox, ID_RandomBiome), wxSizerFlags().Expand());
|
||||
|
||||
gridSizer->Add(new wxStaticText(sizer->GetStaticBox(), wxID_ANY, _("Player Placement")),
|
||||
gridSizer->Add(new wxStaticText(topBox, wxID_ANY, _("Player Placement")),
|
||||
wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
|
||||
gridSizer->Add(new wxChoice(sizer->GetStaticBox(), ID_PlayerPlacement), wxSizerFlags().Expand());
|
||||
gridSizer->Add(new wxChoice(topBox, ID_PlayerPlacement), wxSizerFlags().Expand());
|
||||
|
||||
wxChoice* sizeChoice = new wxChoice(sizer->GetStaticBox(), ID_RandomSize);
|
||||
gridSizer->Add(new wxStaticText(sizer->GetStaticBox(), wxID_ANY, _("Map size")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
|
||||
wxChoice* sizeChoice = new wxChoice(topBox, ID_RandomSize);
|
||||
gridSizer->Add(new wxStaticText(topBox, wxID_ANY, _("Map size")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
|
||||
gridSizer->Add(sizeChoice, wxSizerFlags().Expand());
|
||||
|
||||
CREATE_CHECKBOX(sizer->GetStaticBox(), gridSizer, "Nomad", "Place only some units instead of starting bases.", ID_RandomNomad);
|
||||
CREATE_CHECKBOX(topBox, gridSizer, "Nomad", "Place only some units instead of starting bases.", ID_RandomNomad);
|
||||
|
||||
gridSizer->Add(new wxStaticText(sizer->GetStaticBox(), wxID_ANY, _("Random seed")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
|
||||
gridSizer->Add(new wxStaticText(topBox, wxID_ANY, _("Random seed")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
|
||||
wxBoxSizer* seedSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
seedSizer->Add(Tooltipped(new wxTextCtrl(sizer->GetStaticBox(), ID_RandomSeed, _T("0"), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator(wxFILTER_NUMERIC)),
|
||||
seedSizer->Add(Tooltipped(new wxTextCtrl(topBox, ID_RandomSeed, _T("0"), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator(wxFILTER_NUMERIC)),
|
||||
_("Seed value for random map")), wxSizerFlags(1).Expand());
|
||||
seedSizer->Add(Tooltipped(new wxButton(sizer->GetStaticBox(), ID_RandomReseed, _("R"), wxDefaultPosition, wxSize(40, -1)),
|
||||
seedSizer->Add(Tooltipped(new wxButton(topBox, ID_RandomReseed, _("R"), wxDefaultPosition, wxSize(40, -1)),
|
||||
_("New random seed")));
|
||||
gridSizer->Add(seedSizer, wxSizerFlags().Expand());
|
||||
|
||||
sizer->Add(gridSizer, wxSizerFlags().Expand());
|
||||
grid->Add(gridSizer, wxSizerFlags().Expand());
|
||||
|
||||
sizer->AddSpacer(5);
|
||||
|
||||
sizer->Add(Tooltipped(new wxButton(sizer->GetStaticBox(), ID_RandomGenerate, _("Generate map")),
|
||||
grid->Add(Tooltipped(new wxButton(topBox, ID_RandomGenerate, _("Generate map")),
|
||||
_("Run selected random map script")), wxSizerFlags().Expand());
|
||||
}
|
||||
|
||||
|
|
@ -537,28 +542,30 @@ MapSidebar::MapSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContaine
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// Misc tools
|
||||
wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Misc tools"));
|
||||
sizer->Add(new wxButton(sizer->GetStaticBox(), ID_ResizeMap, _("Resize/Recenter map")), wxSizerFlags().Expand());
|
||||
scrollSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10));
|
||||
sizer->Add(new wxButton(sizer->GetStaticBox(), ID_ResizeMap, _("Resize/Recenter map")), wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
scrollSizer->Add(sizer, wxSizerFlags().Expand());
|
||||
}
|
||||
|
||||
{
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Simulation buttons
|
||||
wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Simulation test"));
|
||||
scrollSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 8));
|
||||
wxStaticBoxSizer* topSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Simulation test"));
|
||||
wxStaticBox* topBox = topSizer->GetStaticBox();
|
||||
|
||||
wxGridSizer* gridSizer = new wxGridSizer(5);
|
||||
gridSizer->Add(Tooltipped(new wxButton(sizer->GetStaticBox(), ID_SimPlay, _("Play"), wxDefaultPosition, wxSize(48, -1)),
|
||||
scrollSizer->Add(topSizer, wxSizerFlags().Expand());
|
||||
|
||||
wxGridSizer* gridSizer = new wxGridSizer(5, 5, 5);
|
||||
gridSizer->Add(Tooltipped(new wxButton(topBox, ID_SimPlay, _("Play"), wxDefaultPosition, wxSize(48, -1)),
|
||||
_("Run the simulation at normal speed")), wxSizerFlags().Expand());
|
||||
gridSizer->Add(Tooltipped(new wxButton(sizer->GetStaticBox(), ID_SimFast, _("Fast"), wxDefaultPosition, wxSize(48, -1)),
|
||||
gridSizer->Add(Tooltipped(new wxButton(topBox, ID_SimFast, _("Fast"), wxDefaultPosition, wxSize(48, -1)),
|
||||
_("Run the simulation at 8x speed")), wxSizerFlags().Expand());
|
||||
gridSizer->Add(Tooltipped(new wxButton(sizer->GetStaticBox(), ID_SimSlow, _("Slow"), wxDefaultPosition, wxSize(48, -1)),
|
||||
gridSizer->Add(Tooltipped(new wxButton(topBox, ID_SimSlow, _("Slow"), wxDefaultPosition, wxSize(48, -1)),
|
||||
_("Run the simulation at 1/8x speed")), wxSizerFlags().Expand());
|
||||
gridSizer->Add(Tooltipped(new wxButton(sizer->GetStaticBox(), ID_SimPause, _("Pause"), wxDefaultPosition, wxSize(48, -1)),
|
||||
gridSizer->Add(Tooltipped(new wxButton(topBox, ID_SimPause, _("Pause"), wxDefaultPosition, wxSize(48, -1)),
|
||||
_("Pause the simulation")), wxSizerFlags().Expand());
|
||||
gridSizer->Add(Tooltipped(new wxButton(sizer->GetStaticBox(), ID_SimReset, _("Reset"), wxDefaultPosition, wxSize(48, -1)),
|
||||
gridSizer->Add(Tooltipped(new wxButton(topBox, ID_SimReset, _("Reset"), wxDefaultPosition, wxSize(48, -1)),
|
||||
_("Reset the editor to initial state")), wxSizerFlags().Expand());
|
||||
sizer->Add(gridSizer, wxSizerFlags().Expand());
|
||||
topSizer->Add(gridSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
UpdateSimButtons();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -180,8 +180,8 @@ public:
|
|||
_("Select AI")), wxSizerFlags(1).Expand().Align(wxALIGN_RIGHT));
|
||||
m_Controls.ai = aiChoice;
|
||||
|
||||
playerInfoSizer->Add(gridSizer, wxSizerFlags(1).Expand());
|
||||
sizer->Add(playerInfoSizer, wxSizerFlags().Expand().Border(wxTOP, 10));
|
||||
playerInfoSizer->Add(gridSizer, wxSizerFlags(1).Expand().Border(wxALL, 5));
|
||||
sizer->Add(playerInfoSizer, wxSizerFlags().Expand().Border(wxTOP, 5));
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -226,7 +226,7 @@ public:
|
|||
_("Population limit for this player")), wxSizerFlags().Expand());
|
||||
m_Controls.pop = popCtrl;
|
||||
|
||||
resourceSizer->Add(gridSizer, wxSizerFlags(1).Expand());
|
||||
resourceSizer->Add(gridSizer, wxSizerFlags(1).Expand().Border(wxALL, 5));
|
||||
sizer->Add(resourceSizer, wxSizerFlags().Expand().Border(wxTOP, 10));
|
||||
}
|
||||
{
|
||||
|
|
@ -246,7 +246,7 @@ public:
|
|||
teamCtrl->Append(_T("4"));
|
||||
boxSizer->Add(teamCtrl);
|
||||
m_Controls.team = teamCtrl;
|
||||
diplomacySizer->Add(boxSizer, wxSizerFlags(1).Expand());
|
||||
diplomacySizer->Add(boxSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
|
||||
// TODO: possibly have advanced panel where each player's diplomacy can be set?
|
||||
// Advanced panel
|
||||
|
|
@ -261,7 +261,7 @@ public:
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// Camera
|
||||
wxStaticBoxSizer* cameraSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Starting Camera"));
|
||||
wxGridSizer* gridSizer = new wxGridSizer(3);
|
||||
wxGridSizer* gridSizer = new wxGridSizer(3, 5, 5);
|
||||
wxButton* cameraSet = new wxButton(cameraSizer->GetStaticBox(), ID_CameraSet, _("Set"), wxDefaultPosition, wxSize(48, -1));
|
||||
gridSizer->Add(Tooltipped(cameraSet,
|
||||
_("Set player camera to cameraSizer->GetStaticBox() view")), wxSizerFlags().Expand());
|
||||
|
|
@ -273,7 +273,7 @@ public:
|
|||
cameraClear->Enable(false);
|
||||
gridSizer->Add(Tooltipped(cameraClear,
|
||||
_("Clear player camera")), wxSizerFlags().Expand());
|
||||
cameraSizer->Add(gridSizer, wxSizerFlags().Expand());
|
||||
cameraSizer->Add(gridSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
|
||||
sizer->Add(cameraSizer, wxSizerFlags().Expand().Border(wxTOP, 10));
|
||||
}
|
||||
|
|
@ -592,19 +592,20 @@ PlayerSettingsControl::PlayerSettingsControl(wxWindow* parent, ScenarioEditor& s
|
|||
// To prevent recursion, don't handle GUI events right now
|
||||
m_InGUIUpdate = true;
|
||||
|
||||
wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Player settings"));
|
||||
SetSizer(sizer);
|
||||
wxStaticBoxSizer* topSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Player settings"));
|
||||
wxStaticBox* topBox = topSizer->GetStaticBox();
|
||||
SetSizer(topSizer);
|
||||
|
||||
wxBoxSizer* boxSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
boxSizer->Add(new wxStaticText(sizer->GetStaticBox(), wxID_ANY, _("Num players")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL));
|
||||
wxSpinCtrl* numPlayersSpin = new wxSpinCtrl(sizer->GetStaticBox(), ID_NumPlayers, wxEmptyString, wxDefaultPosition, wxSize(40, -1));
|
||||
boxSizer->Add(new wxStaticText(topBox, wxID_ANY, _("Num players")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL));
|
||||
boxSizer->AddSpacer(10);
|
||||
wxSpinCtrl* numPlayersSpin = new wxSpinCtrl(topBox, ID_NumPlayers, wxEmptyString, wxDefaultPosition, wxSize(40, -1));
|
||||
numPlayersSpin->SetValue(MAX_NUM_PLAYERS);
|
||||
numPlayersSpin->SetRange(1, MAX_NUM_PLAYERS);
|
||||
boxSizer->Add(numPlayersSpin);
|
||||
sizer->Add(boxSizer, wxSizerFlags().Expand().Proportion(0));
|
||||
sizer->AddSpacer(5);
|
||||
m_Players = new PlayerNotebook(sizer->GetStaticBox());
|
||||
sizer->Add(m_Players, wxSizerFlags().Expand().Proportion(1));
|
||||
topSizer->Add(boxSizer, wxSizerFlags().Expand().Proportion(0).Border(wxALL, 5));
|
||||
m_Players = new PlayerNotebook(topBox);
|
||||
topSizer->Add(m_Players, wxSizerFlags().Expand().Proportion(1).Border(wxALL, 5));
|
||||
|
||||
m_InGUIUpdate = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ public:
|
|||
SetSizer(m_Sizer);
|
||||
|
||||
// Use placeholder bitmap for now
|
||||
m_Sizer->Add(new wxStaticBitmap(m_Sizer->GetStaticBox(), wxID_ANY, wxNullBitmap), wxSizerFlags(1).Expand());
|
||||
m_Sizer->Add(new wxStaticBitmap(m_Sizer->GetStaticBox(), wxID_ANY, wxNullBitmap), wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
}
|
||||
|
||||
void LoadPreview()
|
||||
|
|
@ -152,6 +152,8 @@ public:
|
|||
// Check for invalid/missing texture - shouldn't happen
|
||||
if (!wxString(qry.preview->name.c_str()).IsEmpty())
|
||||
{
|
||||
wxFlexGridSizer* sizer = new wxFlexGridSizer(1, 5, 5);
|
||||
|
||||
// Construct the wrapped-text label
|
||||
wxStaticText* label = new wxStaticText(m_Sizer->GetStaticBox(), wxID_ANY, FormatTextureName(*qry.preview->name), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
|
||||
label->Wrap(m_Sizer->GetSize().GetX());
|
||||
|
|
@ -164,8 +166,10 @@ public:
|
|||
wxImage img(qry.preview->imageWidth, qry.preview->imageHeight, buf);
|
||||
|
||||
wxStaticBitmap* bitmap = new wxStaticBitmap(m_Sizer->GetStaticBox(), wxID_ANY, wxBitmap(img), wxDefaultPosition, wxSize(qry.preview->imageWidth, qry.preview->imageHeight), wxBORDER_SIMPLE);
|
||||
m_Sizer->Add(bitmap, wxSizerFlags(1).Align(wxALIGN_CENTER));
|
||||
m_Sizer->Add(label, wxSizerFlags().Expand());
|
||||
|
||||
sizer->Add(bitmap, wxSizerFlags().Align(wxALIGN_CENTER));
|
||||
sizer->Add(label, wxSizerFlags().Align(wxALIGN_CENTER));
|
||||
m_Sizer->Add(sizer, wxSizerFlags().Align(wxALIGN_CENTER).Border(wxALL, 5));
|
||||
|
||||
// We have to force the sidebar to layout manually
|
||||
GetParent()->GetParent()->Layout();
|
||||
|
|
@ -228,7 +232,7 @@ TerrainSidebar::TerrainSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebar
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// Terrain elevation
|
||||
wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Elevation tools"));
|
||||
wxSizer* gridSizer = new wxGridSizer(4);
|
||||
wxSizer* gridSizer = new wxGridSizer(4, 5, 5);
|
||||
gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), sizer->GetStaticBox(), _("Modify"), _T("AlterElevation"), wxSize(48, -1)),
|
||||
_("Brush with left mouse buttons to raise terrain,\nright mouse button to lower it")), wxSizerFlags().Expand());
|
||||
gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), sizer->GetStaticBox(), _("Ridge"), _T("PikeElevation"), wxSize(48, -1)),
|
||||
|
|
@ -237,22 +241,22 @@ TerrainSidebar::TerrainSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebar
|
|||
_("Brush with left mouse button to smooth terrain,\nright mouse button to roughen it")), wxSizerFlags().Expand());
|
||||
gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), sizer->GetStaticBox(), _("Flatten"), _T("FlattenElevation"), wxSize(48, -1)),
|
||||
_("Brush with left mouse button to flatten terrain")), wxSizerFlags().Expand());
|
||||
sizer->Add(gridSizer, wxSizerFlags().Expand());
|
||||
scrollSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10));
|
||||
sizer->Add(gridSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
scrollSizer->Add(sizer, wxSizerFlags().Expand());
|
||||
}
|
||||
|
||||
{
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Terrain texture
|
||||
wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Texture tools"));
|
||||
wxSizer* gridSizer = new wxGridSizer(3);
|
||||
wxSizer* gridSizer = new wxGridSizer(3, 5, 5);
|
||||
gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), sizer->GetStaticBox(), _("Paint"), _T("PaintTerrain"), wxSize(48, -1)),
|
||||
_("Brush with left mouse button to paint texture dominantly,\nright mouse button to paint submissively.\nShift-left-click for eyedropper tool")), wxSizerFlags().Expand());
|
||||
gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), sizer->GetStaticBox(), _("Replace"), _T("ReplaceTerrain"), wxSize(48, -1)),
|
||||
_("Replace all of a terrain texture with a new one")), wxSizerFlags().Expand());
|
||||
gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), sizer->GetStaticBox(), _("Fill"), _T("FillTerrain"), wxSize(48, -1)),
|
||||
_T("Bucket fill a patch of terrain texture with a new one")), wxSizerFlags().Expand());
|
||||
sizer->Add(gridSizer, wxSizerFlags().Expand());
|
||||
sizer->Add(gridSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
scrollSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10));
|
||||
}
|
||||
|
||||
|
|
@ -262,7 +266,7 @@ TerrainSidebar::TerrainSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebar
|
|||
wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Brush"));
|
||||
|
||||
m_TexturePreview = new TexturePreviewPanel(sizer->GetStaticBox());
|
||||
sizer->Add(m_TexturePreview, wxSizerFlags(1).Expand());
|
||||
sizer->Add(m_TexturePreview, wxSizerFlags(1).Expand().Border(wxALL, 5));
|
||||
|
||||
g_Brush_Elevation.CreateUI(sizer->GetStaticBox(), sizer);
|
||||
scrollSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10));
|
||||
|
|
@ -276,7 +280,7 @@ TerrainSidebar::TerrainSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebar
|
|||
|
||||
wxFlexGridSizer* visSizer = new wxFlexGridSizer(2, 5, 5);
|
||||
visSizer->AddGrowableCol(1);
|
||||
sizer->Add(visSizer, wxSizerFlags().Expand());
|
||||
sizer->Add(visSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
|
||||
wxArrayString defaultChoices;
|
||||
defaultChoices.Add(_("(none)"));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -252,7 +252,7 @@ void Brush::CreateUI(wxWindow* parent, wxSizer* sizer)
|
|||
shapes.Add(_("Circle"));
|
||||
shapes.Add(_("Square"));
|
||||
// TODO (maybe): get rid of the extra static box, by not using wxRadioBox
|
||||
sizer->Add(new BrushShapeCtrl(parent, shapes, *this), wxSizerFlags().Expand());
|
||||
sizer->Add(new BrushShapeCtrl(parent, shapes, *this), wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
|
||||
sizer->AddSpacer(5);
|
||||
|
||||
|
|
@ -263,5 +263,5 @@ void Brush::CreateUI(wxWindow* parent, wxSizer* sizer)
|
|||
spinnerSizer->Add(new BrushSizeCtrl(parent, *this), wxSizerFlags().Expand());
|
||||
spinnerSizer->Add(new wxStaticText(parent, wxID_ANY, _("Strength")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT));
|
||||
spinnerSizer->Add(new BrushStrengthCtrl(parent, *this), wxSizerFlags().Expand());
|
||||
sizer->Add(spinnerSizer, wxSizerFlags().Expand());
|
||||
sizer->Add(spinnerSizer, wxSizerFlags().Expand().Border(wxALL, 5));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue