ResourceBrowser additions and app icons

This commit is contained in:
Jack Andersen 2016-01-26 14:44:22 -10:00
parent 3b7037bccc
commit e74c753bd1
19 changed files with 134 additions and 19 deletions

View File

@ -20,8 +20,16 @@ atdna(atdna_Space.cpp Space.hpp)
atdna(atdna_ResourceBrowser.cpp ResourceBrowser.hpp) atdna(atdna_ResourceBrowser.cpp ResourceBrowser.hpp)
atdna(atdna_ModelViewer.cpp ModelViewer.hpp) atdna(atdna_ModelViewer.cpp ModelViewer.hpp)
add_executable(urde WIN32 if(WIN32)
main.cpp set(PLAT_SRCS platforms/win/urde.rc)
elseif(APPLE)
set(PLAT_SRCS platforms/mac/mainicon.icns)
set_source_files_properties(platforms/mac/mainicon.icns PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
endif()
add_executable(urde WIN32 MACOSX_BUNDLE
main.cpp ${PLAT_SRCS}
Space.hpp Space.cpp atdna_Space.cpp Space.hpp Space.cpp atdna_Space.cpp
SplashScreen.hpp SplashScreen.cpp SplashScreen.hpp SplashScreen.cpp
ResourceBrowser.hpp ResourceBrowser.cpp atdna_ResourceBrowser.cpp ResourceBrowser.hpp ResourceBrowser.cpp atdna_ResourceBrowser.cpp
@ -42,3 +50,6 @@ target_link_libraries(urde
LogVisor AthenaLibYaml Boo ${PNG_LIB} squish xxhash Math LogVisor AthenaLibYaml Boo ${PNG_LIB} squish xxhash Math
${ZLIB_LIBRARIES} ${LZO_LIB} ${ZLIB_LIBRARIES} ${LZO_LIB}
${BOO_SYS_LIBS}) ${BOO_SYS_LIBS})
set_target_properties(urde PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/platforms/mac/Info.plist")

View File

@ -13,18 +13,19 @@ bool ResourceBrowser::navigateToPath(const HECL::ProjectPath& pathIn)
m_comps = m_path.getPathComponents(); m_comps = m_path.getPathComponents();
HECL::DirectoryEnumerator dEnum(m_path.getAbsolutePath(), HECL::DirectoryEnumerator::Mode::DirsThenFilesSorted, HECL::DirectoryEnumerator dEnum(m_path.getAbsolutePath(),
HECL::DirectoryEnumerator::Mode::DirsThenFilesSorted,
m_state.sortColumn==State::SortColumn::Size, m_state.sortColumn==State::SortColumn::Size,
m_state.sortDir==Specter::SortDirection::Descending, m_state.sortDir==Specter::SortDirection::Descending,
true); true);
m_fileListingBind.updateListing(dEnum); m_fileListingBind.updateListing(dEnum);
if (m_pathButtons)
m_pathButtons->setButtons(m_comps);
if (m_view) if (m_view)
{ {
m_view->m_fileListing.m_view->selectRow(-1); m_view->m_fileListing.m_view->selectRow(-1);
m_view->m_fileListing.m_view->updateData(); m_view->m_fileListing.m_view->updateData();
m_view->m_pathButtons.m_view->setButtons(m_comps);
m_view->updateSize(); m_view->updateSize();
} }
@ -52,18 +53,33 @@ void ResourceBrowser::pathButtonActivated(size_t idx)
navigateToPath(HECL::ProjectPath(*m_vm.project(), dir)); navigateToPath(HECL::ProjectPath(*m_vm.project(), dir));
} }
void ResourceBrowser::View::mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mod)
{
m_fileListing.mouseDown(coord, button, mod);
}
void ResourceBrowser::View::mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mod)
{
m_fileListing.mouseUp(coord, button, mod);
}
void ResourceBrowser::View::mouseMove(const boo::SWindowCoord& coord)
{
m_fileListing.mouseMove(coord);
}
void ResourceBrowser::View::mouseLeave(const boo::SWindowCoord& coord)
{
m_fileListing.mouseLeave(coord);
}
void ResourceBrowser::View::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) void ResourceBrowser::View::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub)
{ {
float pf = rootView().viewRes().pixelFactor(); Specter::View::resized(root, sub);
m_fileListing.m_view->resized(root, sub);
boo::SWindowRect pathRect = sub;
pathRect.location[0] += BROWSER_MARGIN * pf;
pathRect.location[1] += pathRect.size[1] - (BROWSER_MARGIN + 20) * pf;
m_pathButtons.m_view->resized(root, pathRect);
} }
void ResourceBrowser::View::draw(boo::IGraphicsCommandQueue* gfxQ) void ResourceBrowser::View::draw(boo::IGraphicsCommandQueue* gfxQ)
{ {
m_pathButtons.m_view->draw(gfxQ);
m_fileListing.m_view->draw(gfxQ); m_fileListing.m_view->draw(gfxQ);
} }

View File

@ -167,22 +167,27 @@ class ResourceBrowser : public Space, public Specter::IPathButtonsBinding
struct View : Specter::View struct View : Specter::View
{ {
ResourceBrowser& m_ro; ResourceBrowser& m_ro;
Specter::ViewChild<std::unique_ptr<Specter::PathButtons>> m_pathButtons;
Specter::ViewChild<std::unique_ptr<Specter::Table>> m_fileListing; Specter::ViewChild<std::unique_ptr<Specter::Table>> m_fileListing;
View(ResourceBrowser& ro, Specter::ViewResources& res) View(ResourceBrowser& ro, Specter::ViewResources& res)
: Specter::View(res, ro.m_vm.rootView()), m_ro(ro) : Specter::View(res, ro.m_vm.rootView()), m_ro(ro)
{ {
commitResources(res); commitResources(res);
m_pathButtons.m_view.reset(new Specter::PathButtons(res, *this, ro));
m_fileListing.m_view.reset(new Specter::Table(res, *this, &ro.m_fileListingBind, &ro.m_fileListingBind, 3)); m_fileListing.m_view.reset(new Specter::Table(res, *this, &ro.m_fileListingBind, &ro.m_fileListingBind, 3));
} }
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
void mouseMove(const boo::SWindowCoord&);
void mouseLeave(const boo::SWindowCoord&);
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
void draw(boo::IGraphicsCommandQueue* gfxQ); void draw(boo::IGraphicsCommandQueue* gfxQ);
}; };
std::unique_ptr<View> m_view; std::unique_ptr<View> m_view;
std::unique_ptr<Specter::PathButtons> m_pathButtons;
public: public:
ResourceBrowser(ViewManager& vm, Space* parent) ResourceBrowser(ViewManager& vm, Space* parent)
: Space(vm, Class::ResourceBrowser, parent), : Space(vm, Class::ResourceBrowser, parent),
@ -222,6 +227,12 @@ public:
return new ResourceBrowser(m_vm, parent, *this); return new ResourceBrowser(m_vm, parent, *this);
} }
void buildToolbarView(Specter::ViewResources &res, Specter::Toolbar &tb)
{
m_pathButtons.reset(new Specter::PathButtons(res, tb, *this, true));
tb.push_back(m_pathButtons.get(), 0);
}
Specter::View* buildContentView(Specter::ViewResources& res) Specter::View* buildContentView(Specter::ViewResources& res)
{ {
m_view.reset(new View(*this, res)); m_view.reset(new View(*this, res));
@ -232,6 +243,11 @@ public:
{ {
return true; return true;
} }
unsigned toolbarUnits() const
{
return 2;
}
}; };
} }

View File

@ -15,7 +15,7 @@ Specter::View* Space::buildSpaceView(Specter::ViewResources& res)
{ {
if (usesToolbar()) if (usesToolbar())
{ {
m_spaceView.reset(new Specter::Space(res, m_vm.rootView(), *this, Specter::Toolbar::Position::Bottom)); m_spaceView.reset(new Specter::Space(res, m_vm.rootView(), *this, Specter::Toolbar::Position::Bottom, toolbarUnits()));
Specter::View* sview = buildContentView(res); Specter::View* sview = buildContentView(res);
m_spaceView->setContentView(sview); m_spaceView->setContentView(sview);
Specter::Toolbar& tb = *m_spaceView->toolbar(); Specter::Toolbar& tb = *m_spaceView->toolbar();
@ -25,13 +25,13 @@ Specter::View* Space::buildSpaceView(Specter::ViewResources& res)
m_spaceSelectButton.reset(new Specter::Button(res, tb, &m_spaceSelectBind, "", classIcon, m_spaceSelectButton.reset(new Specter::Button(res, tb, &m_spaceSelectBind, "", classIcon,
Specter::Button::Style::Block, Specter::Button::Style::Block,
classColor?*classColor:Zeus::CColor::skWhite)); classColor?*classColor:Zeus::CColor::skWhite));
tb.push_back(m_spaceSelectButton.get()); tb.push_back(m_spaceSelectButton.get(), 0);
buildToolbarView(res, tb); buildToolbarView(res, tb);
return m_spaceView.get(); return m_spaceView.get();
} }
else else
{ {
m_spaceView.reset(new Specter::Space(res, m_vm.rootView(), *this, Specter::Toolbar::Position::None)); m_spaceView.reset(new Specter::Space(res, m_vm.rootView(), *this, Specter::Toolbar::Position::None, 0));
Specter::View* sview = buildContentView(res); Specter::View* sview = buildContentView(res);
m_spaceView->setContentView(sview); m_spaceView->setContentView(sview);
return m_spaceView.get(); return m_spaceView.get();

View File

@ -130,6 +130,7 @@ protected:
/* Structural control */ /* Structural control */
virtual bool usesToolbar() const {return false;} virtual bool usesToolbar() const {return false;}
virtual unsigned toolbarUnits() const {return 1;}
virtual void buildToolbarView(Specter::ViewResources& res, Specter::Toolbar& tb) {} virtual void buildToolbarView(Specter::ViewResources& res, Specter::Toolbar& tb) {}
virtual Specter::View* buildContentView(Specter::ViewResources& res)=0; virtual Specter::View* buildContentView(Specter::ViewResources& res)=0;
virtual Specter::View* buildSpaceView(Specter::ViewResources& res); virtual Specter::View* buildSpaceView(Specter::ViewResources& res);
@ -359,7 +360,7 @@ public:
void buildToolbarView(Specter::ViewResources& res, Specter::Toolbar& tb) void buildToolbarView(Specter::ViewResources& res, Specter::Toolbar& tb)
{ {
m_button.reset(new Specter::Button(res, tb, m_binding, m_buttonStr)); m_button.reset(new Specter::Button(res, tb, m_binding, m_buttonStr));
tb.push_back(m_button.get()); tb.push_back(m_button.get(), 0);
} }
Specter::View* buildContentView(Specter::ViewResources& res) Specter::View* buildContentView(Specter::ViewResources& res)

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=URDE
GenericName=Game Data Editor
Comment=Edit 3D assets from games by Retro Studios
Exec=urde
Icon=urde
Terminal=false
Type=Application
Categories=Graphics;3DGraphics;

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>URDE</string>
<key>CFBundleGetInfoString</key>
<string>Version BETA</string>
<key>NSHumanReadableCopyright</key>
<string>2015-2016 Antidote / Jackoalan</string>
<key>CFBundleIconFile</key>
<string>mainicon.icns</string>
<key>CFBundleIdentifier</key>
<string>io.github.AxioDL.URDE</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>URDE</string>
<key>CFBundleVersion</key>
<string>BETA</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View File

@ -0,0 +1,32 @@
#include "winver.h"
IDI_ICON1 ICON DISCARDABLE "mainicon.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGS 0x0L
FILEFLAGSMASK 0x3fL
FILEOS 0x00040004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "CompanyName", "Antidote / Jackoalan"
VALUE "FileDescription", "URDE"
VALUE "FileVersion", "BETA"
VALUE "LegalCopyright", "Copyright (C) 2015-2016 Antidote / Jackoalan"
VALUE "InternalName", "urde"
VALUE "OriginalFilename", "urde.exe"
VALUE "ProductName", "URDE"
VALUE "ProductVersion", "BETA"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1200
END
END

@ -1 +1 @@
Subproject commit 5ee63587e2f7c2b7b015ff9e1752606b3f5fe3cd Subproject commit f81dc3af510f56c5b5c065620859d7dca510d2bf