diff --git a/source/tools/atlas/AtlasUI/ActorEditor/ActorEditor.cpp b/source/tools/atlas/AtlasUI/ActorEditor/ActorEditor.cpp index 8afd10efe8..6034eff29f 100644 --- a/source/tools/atlas/AtlasUI/ActorEditor/ActorEditor.cpp +++ b/source/tools/atlas/AtlasUI/ActorEditor/ActorEditor.cpp @@ -65,11 +65,12 @@ ActorEditor::ActorEditor(wxWindow* parent) materialsPanel->SetSizer(materialsSizer); -// m_Material = new wxTextCtrl(materialsPanel, wxID_ANY, _T("")); - wxArrayString materials; - AtObj list (Datafile::ReadList("materials")); - for (AtIter it = list["material"]; it.defined(); ++it) - materials.Add(it); + // Get the list of XML materials + wxArrayString materials = Datafile::EnumerateDataFiles(_T("mods/official/art/materials/"), _T("*.xml")); + // Extract the filenames and discard the path + for (size_t i = 0; i < materials.Count(); ++i) + materials[i] = wxFileName(materials[i]).GetFullName(); + m_Material = new wxComboBox(materialsPanel, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, materials); materialsSizer->Add(m_Material, wxSizerFlags().Border(wxALL, 2)); @@ -317,8 +318,8 @@ void ActorEditor::OnCreateEntity(wxCommandEvent& WXUNUSED(event)) wxString entityName = currentFilename.GetName(); // Work out where the entities are stored - wxFileName entityPath (_T("../data/mods/official/entities/")); - entityPath.MakeAbsolute(Datafile::GetSystemDirectory()); + wxFileName entityPath (_T("mods/official/entities/")); + entityPath.MakeAbsolute(Datafile::GetDataDirectory()); // Make sure the user knows what's going on static bool instructed = false; // only tell them once per session @@ -348,8 +349,8 @@ void ActorEditor::OnCreateEntity(wxCommandEvent& WXUNUSED(event)) return; // cancelled by user // Get this actor's filename, relative to actors/ - wxFileName actorPath (_T("../data/mods/official/art/actors/")); - actorPath.MakeAbsolute(Datafile::GetSystemDirectory()); + wxFileName actorPath (_T("mods/official/art/actors/")); + actorPath.MakeAbsolute(Datafile::GetDataDirectory()); wxFileName actorFilename (currentFilename); actorFilename.MakeRelativeTo(actorPath.GetFullPath()); @@ -375,3 +376,10 @@ void ActorEditor::OnCreateEntity(wxCommandEvent& WXUNUSED(event)) return; } } + +wxString ActorEditor::GetDefaultOpenDirectory() +{ + wxFileName dir (_T("mods/official/art/actors/"), wxPATH_UNIX); + dir.MakeAbsolute(Datafile::GetDataDirectory()); + return dir.GetPath(); +} diff --git a/source/tools/atlas/AtlasUI/ActorEditor/ActorEditor.h b/source/tools/atlas/AtlasUI/ActorEditor/ActorEditor.h index 478d9dee90..3ac16c8da8 100644 --- a/source/tools/atlas/AtlasUI/ActorEditor/ActorEditor.h +++ b/source/tools/atlas/AtlasUI/ActorEditor/ActorEditor.h @@ -17,6 +17,8 @@ protected: AtObj ExportData(); void ImportData(AtObj& in); + virtual wxString GetDefaultOpenDirectory(); + private: ActorEditorListCtrl* m_ActorEditorListCtrl; diff --git a/source/tools/atlas/AtlasUI/ActorEditor/AnimListEditor.cpp b/source/tools/atlas/AtlasUI/ActorEditor/AnimListEditor.cpp index 3cfba10d91..003dac448c 100644 --- a/source/tools/atlas/AtlasUI/ActorEditor/AnimListEditor.cpp +++ b/source/tools/atlas/AtlasUI/ActorEditor/AnimListEditor.cpp @@ -10,7 +10,7 @@ IMPLEMENT_DYNAMIC_CLASS(AnimListEditor, AtlasDialog); AnimListEditor::AnimListEditor() - : AtlasDialog(NULL, _("Animation editor")) + : AtlasDialog(NULL, _("Animation editor"), wxSize(480, 280)) { m_MainListBox = new AnimListEditorListCtrl(m_MainPanel); @@ -50,8 +50,8 @@ AnimListEditorListCtrl::AnimListEditorListCtrl(wxWindow* parent) AddColumnType(_("Anim name"), 100, "@name", new FieldEditCtrl_List("animations")); AddColumnType(_("File"), 200, "@file", new FieldEditCtrl_File(_T("art/animation/"), _("Animation files (*.psa)|*.psa|All files (*.*)|*.*"))); AddColumnType(_("Speed"), 50, "@speed", new FieldEditCtrl_Text()); - AddColumnType(_("Load"), 30, "@load", new FieldEditCtrl_Text()); - AddColumnType(_("Event"), 30, "@event", new FieldEditCtrl_Text()); + AddColumnType(_("Load"), 40, "@load", new FieldEditCtrl_Text()); + AddColumnType(_("Event"), 40, "@event", new FieldEditCtrl_Text()); } void AnimListEditorListCtrl::DoImport(AtObj& in) diff --git a/source/tools/atlas/AtlasUI/ActorEditor/PropListEditor.cpp b/source/tools/atlas/AtlasUI/ActorEditor/PropListEditor.cpp index ffe83808a1..b919b5616c 100644 --- a/source/tools/atlas/AtlasUI/ActorEditor/PropListEditor.cpp +++ b/source/tools/atlas/AtlasUI/ActorEditor/PropListEditor.cpp @@ -10,7 +10,7 @@ IMPLEMENT_DYNAMIC_CLASS(PropListEditor, AtlasDialog); PropListEditor::PropListEditor() - : AtlasDialog(NULL, _("Prop editor")) + : AtlasDialog(NULL, _("Prop editor"), wxSize(400, 280)) { m_MainListBox = new PropListEditorListCtrl(m_MainPanel); diff --git a/source/tools/atlas/AtlasUI/AtlasUI.vcproj b/source/tools/atlas/AtlasUI/AtlasUI.vcproj index 26542dc7b3..0a0d707a8b 100644 --- a/source/tools/atlas/AtlasUI/AtlasUI.vcproj +++ b/source/tools/atlas/AtlasUI/AtlasUI.vcproj @@ -66,7 +66,8 @@ OutputDirectory="..\..\..\..\binaries\system" IntermediateDirectory="..\..\..\..\build\workspaces\atlas\Release\ui" ConfigurationType="2" - CharacterSet="1"> + CharacterSet="1" + WholeProgramOptimization="FALSE"> , not recursively. + wxArrayString EnumerateDataFiles(const wxString& dir, const wxString& filter); }; \ No newline at end of file diff --git a/source/tools/atlas/AtlasUI/Misc/stdafx.h b/source/tools/atlas/AtlasUI/Misc/stdafx.h index 6deafe0e78..c2c2763f2b 100644 --- a/source/tools/atlas/AtlasUI/Misc/stdafx.h +++ b/source/tools/atlas/AtlasUI/Misc/stdafx.h @@ -18,6 +18,7 @@ #include "wx/filename.h" #include "wx/artprov.h" #include "wx/file.h" +#include "wx/dir.h" #include "wx/colordlg.h" #include "wx/regex.h" #include "wx/image.h" diff --git a/source/tools/atlas/AtlasUI/TODO.txt b/source/tools/atlas/AtlasUI/TODO.txt index 46ff035186..00befda7c0 100644 --- a/source/tools/atlas/AtlasUI/TODO.txt +++ b/source/tools/atlas/AtlasUI/TODO.txt @@ -35,6 +35,8 @@ General and/or unsorted miscellany: === +* Test/fix when running with large fonts, or weird XP styles + * Better copy and paste (e.g. between multiple instances of the program, and paste XML into other text-editing programs