-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow editor switch entities #3236
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for the most part, just a few nitpicks.
The commit message is a bit unclear, it should be reworded to "Allow switching the editor's entities". Make your changes and run git commit --amend
.
if(!pEditor->Graphics()->LoadPNG(&ImgInfo, pFileName, StorageType)) | ||
return; | ||
|
||
if((ImgInfo.m_Width % 16) || (ImgInfo.m_Height % 16)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove these brackets
if((ImgInfo.m_Width % 16) || (ImgInfo.m_Height % 16)) | |
if(ImgInfo.m_Width % 16 || ImgInfo.m_Height % 16) |
@@ -726,6 +728,8 @@ bool CEditor::PopupEvent(void *pContext, CUIRect View) | |||
pEditor->UI()->DoLabel(&Label, "The map currently contains unsaved data; you may want to save it before you create a new map.\nContinue anyway?", 10.0f, TEXTALIGN_LEFT, Label.w-10.0f); | |||
else if(pEditor->m_PopupEventType == POPEVENT_SAVE) | |||
pEditor->UI()->DoLabel(&Label, "This file already exists.\nDo you want to overwrite it?", 10.0f, TEXTALIGN_LEFT); | |||
else if(pEditor->m_PopupEventType == POPEVENT_ENTITIES) | |||
pEditor->UI()->DoLabel(&Label, "The width or height of the entities texture is not divisible by 16", 10.0f, TEXTALIGN_LEFT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pEditor->UI()->DoLabel(&Label, "The width or height of the entities texture is not divisible by 16", 10.0f, TEXTALIGN_LEFT); | |
pEditor->UI()->DoLabel(&Label, "The dimensions of the entities image are not divisible by 16", 10.0f, TEXTALIGN_LEFT); |
@@ -1282,6 +1287,14 @@ bool CEditor::PopupMenuFile(void *pContext, CUIRect View) | |||
return true; | |||
} | |||
|
|||
View.HSplitTop(10.0f, &Slot, &View); | |||
View.HSplitTop(12.0f, &Slot, &View); | |||
if(pEditor->DoButton_MenuItem(&s_EntitiesButton, "Load Entities", 0, &Slot, 0, "Load a image as the editor game entities")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Load entities" looks much more natural
if(pEditor->DoButton_MenuItem(&s_EntitiesButton, "Load Entities", 0, &Slot, 0, "Load a image as the editor game entities")) | |
if(pEditor->DoButton_MenuItem(&s_EntitiesButton, "Load entities", 0, &Slot, 0, "Load an image as the editor's game entities")) |
Why
Many mods have their own entities.In the past, if we needed to switch the entities, we need use the mod's entities.png to take the vanilla entities.png. Also, it spent more time to switch entities.


This PR solve that problem, be different from DDNet, mapper put their entities images in %APPDATA%/editor, and they need to press this button to open a file dialog
Then they could choose entities files
The Vanilla entities file is a link of data/editor/entities.png