diff options
| author | oy <Tom_Adams@web.de> | 2010-11-17 19:46:50 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-11-17 19:46:50 +0100 |
| commit | d94355729da4677f7bc7dcc59adcce33dfc7e2b4 (patch) | |
| tree | f749d18c64f88b2d1e17d08b8f2753420b18859d /src/game/editor | |
| parent | 4383e1093398816a925794c1778974e29a35983c (diff) | |
| download | zcatch-d94355729da4677f7bc7dcc59adcce33dfc7e2b4.tar.gz zcatch-d94355729da4677f7bc7dcc59adcce33dfc7e2b4.zip | |
added icons in the demo browser and the editor's file dialog. Closes #209
Diffstat (limited to 'src/game/editor')
| -rw-r--r-- | src/game/editor/ed_editor.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp index 867049e1..8beb6339 100644 --- a/src/game/editor/ed_editor.cpp +++ b/src/game/editor/ed_editor.cpp @@ -16,6 +16,7 @@ #include <game/client/ui.h> #include <game/gamecore.h> #include <game/client/render.h> +#include <game/generated/client_data.h> #include "ed_editor.h" #include <game/client/lineinput.h> @@ -2136,7 +2137,7 @@ static void EditorListdirCallback(const char *pName, int IsDir, int StorageType, if(IsDir) str_format(Item.m_aName, sizeof(Item.m_aName), "%s/", pName); else - str_format(Item.m_aName, min(static_cast<int>(sizeof(Item.m_aName)), Length+1), " %s", pName); + str_copy(Item.m_aName, pName, min(static_cast<int>(sizeof(Item.m_aName)), Length+1)); Item.m_IsDir = IsDir != 0; Item.m_IsLink = false; Item.m_StorageType = StorageType; @@ -2149,9 +2150,18 @@ void CEditor::AddFileDialogEntry(int Index, CUIRect *pView) if(m_FilesCur-1 < m_FilesStartAt || m_FilesCur >= m_FilesStopAt) return; - CUIRect Button; + CUIRect Button, FileIcon; pView->HSplitTop(15.0f, &Button, pView); pView->HSplitTop(2.0f, 0, pView); + Button.VSplitLeft(Button.h, &FileIcon, &Button); + Button.VSplitLeft(5.0f, 0, &Button); + + Graphics()->TextureSet(g_pData->m_aImages[IMAGE_FILEICONS].m_Id); + Graphics()->QuadsBegin(); + RenderTools()->SelectSprite(m_FileList[Index].m_IsDir?SPRITE_FILE_FOLDER:SPRITE_FILE_MAP2); + IGraphics::CQuadItem QuadItem(FileIcon.x, FileIcon.y, FileIcon.w, FileIcon.h); + Graphics()->QuadsDrawTL(&QuadItem, 1); + Graphics()->QuadsEnd(); if(DoButton_File((void*)(10+(int)Button.y), m_FileList[Index].m_aName, m_FilesSelectedIndex == Index, &Button, 0, 0)) { |