Skip to content
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

feat: monsters and npcs spawns icons #58

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes
2 changes: 1 addition & 1 deletion icons/spawns.xpm → icons/monsters.xpm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* XPM */
static const char *spawns_xpm[] = {
static const char *monsters_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 54 1 ",
" c black",
Expand Down
Binary file added icons/npcs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 113 additions & 0 deletions icons/npcs.xpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/* XPM */
static const char *npcs_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 75 1 ",
" c black",
". c #000100",
"X c #010101",
"o c #000200",
"O c #010300",
"+ c #020202",
"@ c gray1",
"# c #030502",
"$ c #040603",
"% c #040404",
"& c gray2",
"* c #050704",
"= c #1F211E",
"- c #20221F",
"; c #222421",
": c #242623",
"> c #252724",
", c #292B28",
"< c #2A2C29",
"1 c #2D2F2C",
"2 c DimGray",
"3 c magenta",
"4 c #9FA19E",
"5 c #A0A29F",
"6 c gray64",
"7 c #A2A4A1",
"8 c #A3A5A2",
"9 c #A4A6A3",
"0 c #A4A4A4",
"q c gray65",
"w c #A7A7A7",
"e c #A6A8A5",
"r c #A9ABA8",
"t c #AAACA9",
"y c #DDDFDC",
"u c #E0E2DF",
"i c #E2E4E1",
"p c #E3E5E2",
"a c #E4E6E3",
"s c #E5E7E4",
"d c #E6E8E5",
"f c #E7E9E6",
"g c #E8EAE7",
"h c gray91",
"j c #E9E9E9",
"k c #E9EBE8",
"l c #EAEAEA",
"z c gray92",
"x c #EAECE9",
"c c #EBEDEA",
"v c #ECEEEB",
"b c gray93",
"n c #EDEFEC",
"m c #EEEEEE",
"M c #EEF0ED",
"N c #EFF1EE",
"B c #F0F2EF",
"V c #F1F3F0",
"C c #F2F4F1",
"Z c #F3F5F2",
"A c gray97",
"S c #F7F9F6",
"D c #F9F9F9",
"F c #F9FBF8",
"G c gray98",
"H c #FBFBFB",
"J c #FAFCF9",
"K c #FBFDFA",
"L c #FCFEFB",
"P c gray99",
"I c #FDFDFD",
"U c #FDFFFC",
"Y c #FEFFFD",
"T c #FEFEFE",
"R c white",
/* pixels */
"33333333333333333333333333333333",
"333333333333333 333333333333333",
"33333333333 22 33333333333",
"333333333 2RRRRRRRR2 333333333",
"3333333 2RRRRRRRRRRRR2 3333333",
"333333 2RRRRRRRRRRRRRRRR2 333333",
"33333 2RRRRRRRRRRRRRRRRRR2 33333",
"3333 2R #KRRRRRRRKLRLRRRRR2 3333",
"3333 RR k RRRSRKRGRRRRKRGRR 3333",
"333 2RR$dc #RRKRKRKRSRLRRR2 333",
"333 RRR rdcn7 # # RLRGRRR 333",
"33 2RRRR ZgpZccckZgat ARRRR2 33",
"33 RRRRR vdMdnddMkdngM7 RRRRR 33",
"33 RRRRR kcgcsVncsVgggc RRRRR 33",
"33 RRRR 9ccvcckcdBpnvck0 RRRR 33",
"3 2RRRR dckdVdcvdMMkndkk*RRRR2 3",
"3 2RRRR cdMBuvckcdsdBdVk RRRR2 3",
"33 RRRR cgvy1,c<-V,,pcgn RRRR 33",
"33 RRRR ckcB;:a=,d->Mckn RRRR 33",
"33 RRRR BcgMkcMMccckvsMk*RRRR 33",
"33 2RRR*4kgddvsscsMcaVd0 RRR2 33",
"333 RRRK cMncvnVcdccnan RRRR 333",
"333 2RRR 5vcgvksMcaMMae RRR2 333",
"3333 RRRG* 6kknkknkk0 RRRR 3333",
"3333 2RRRRG * * RRRRR2 3333",
"33333 2RRRRRRRRRRRRRRRRRR2 33333",
"333333 2RRRRRRRRRRRRRRRR2 333333",
"3333333 2RRRRRRRRRRRR2 3333333",
"333333333 2RRRRRRRR2 333333333",
"33333333333 22 33333333333",
"333333333333333 333333333333333",
"33333333333333333333333333333333"
};
9 changes: 6 additions & 3 deletions source/artprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
#include "../icons/toolbar_hooks.xpm"
#include "../icons/toolbar_pickupables.xpm"
#include "../icons/toolbar_moveables.xpm"
#include "../icons/spawns.xpm"
#include "../icons/monsters.xpm"
#include "../icons/npcs.xpm"
#include "../icons/house_exit.xpm"
#include "../icons/pickupable.xpm"
#include "../icons/moveable.xpm"
Expand Down Expand Up @@ -145,8 +146,10 @@ wxBitmap ArtProvider::CreateBitmap(const wxArtID &id, const wxArtClient &client,
return wxBitmap(mini_change_xpm);
}
} else if (client == wxART_OTHER) {
if (id == ART_SPAWNS) {
return wxBitmap(spawns_xpm);
if (id == ART_MONSTERS) {
return wxBitmap(monsters_xpm);
} else if (id == ART_NPCS) {
return wxBitmap(npcs_xpm);
} else if (id == ART_HOUSE_EXIT) {
return wxBitmap(house_exit_xpm);
} else if (id == ART_PICKUPABLE) {
Expand Down
3 changes: 2 additions & 1 deletion source/artprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
#define ART_PICKUPABLE_TOOLBAR wxART_MAKE_ART_ID(ART_PICKUPABLE_TOOLBAR)
#define ART_MOVEABLE_TOOLBAR wxART_MAKE_ART_ID(ART_MOVEABLE_TOOLBAR)

#define ART_SPAWNS wxART_MAKE_ART_ID(ART_SPAWNS)
#define ART_MONSTERS wxART_MAKE_ART_ID(ART_MONSTERS)
#define ART_NPCS wxART_MAKE_ART_ID(ART_NPCS)
#define ART_HOUSE_EXIT wxART_MAKE_ART_ID(ART_HOUSE_EXIT)
#define ART_PICKUPABLE wxART_MAKE_ART_ID(ART_PICKUPABLE)
#define ART_MOVEABLE wxART_MAKE_ART_ID(ART_MOVEABLE)
Expand Down
3 changes: 2 additions & 1 deletion source/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ bool GraphicManager::loadEditorSprites() {
nullptr
);

sprite_space[EDITOR_SPRITE_SPAWNS] = GameSprite::createFromBitmap(ART_SPAWNS);
sprite_space[EDITOR_SPRITE_MONSTERS] = GameSprite::createFromBitmap(ART_MONSTERS);
sprite_space[EDITOR_SPRITE_NPCS] = GameSprite::createFromBitmap(ART_NPCS);
sprite_space[EDITOR_SPRITE_HOUSE_EXIT] = GameSprite::createFromBitmap(ART_HOUSE_EXIT);
sprite_space[EDITOR_SPRITE_PICKUPABLE_ITEM] = GameSprite::createFromBitmap(ART_PICKUPABLE);
sprite_space[EDITOR_SPRITE_MOVEABLE_ITEM] = GameSprite::createFromBitmap(ART_MOVEABLE);
Expand Down
12 changes: 6 additions & 6 deletions source/map_drawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,14 +619,14 @@ void MapDrawer::DrawDraggingShadow() {
BlitCreature(draw_x, draw_y, tile->monster);
}
if (tile->spawnMonster && tile->spawnMonster->isSelected()) {
DrawIndicator(draw_x, draw_y, EDITOR_SPRITE_SPAWNS, 160, 160, 160, 160);
DrawIndicator(draw_x, draw_y, EDITOR_SPRITE_MONSTERS, 160, 160, 160, 160);
}

if (options.show_npcs && tile->npc && tile->npc->isSelected()) {
BlitCreature(draw_x, draw_y, tile->npc);
}
if (tile->spawnNpc && tile->spawnNpc->isSelected()) {
DrawIndicator(draw_x, draw_y, EDITOR_SPRITE_SPAWNS, 160, 160, 160, 160);
DrawIndicator(draw_x, draw_y, EDITOR_SPRITE_NPCS, 160, 160, 160, 160);
}
}
}
Expand Down Expand Up @@ -1733,17 +1733,17 @@ void MapDrawer::DrawTileIndicators(TileLocation* location) {

if (options.show_spawns_monster && tile->spawnMonster) {
if (tile->spawnMonster->isSelected()) {
DrawIndicator(x, y, EDITOR_SPRITE_SPAWNS, 128, 128, 128);
DrawIndicator(x, y, EDITOR_SPRITE_MONSTERS, 128, 128, 128);
} else {
DrawIndicator(x, y, EDITOR_SPRITE_SPAWNS);
DrawIndicator(x, y, EDITOR_SPRITE_MONSTERS);
}
}

if (tile->spawnNpc && options.show_spawns_npc) {
if (tile->spawnNpc->isSelected()) {
DrawIndicator(x, y, SPRITE_SPAWN_NPC, 128, 128, 128);
DrawIndicator(x, y, EDITOR_SPRITE_NPCS, 128, 128, 128);
} else {
DrawIndicator(x, y, SPRITE_SPAWN_NPC, 255, 255, 255);
DrawIndicator(x, y, EDITOR_SPRITE_NPCS, 255, 255, 255);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion source/sprites.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ enum {
EDITOR_SPRITE_SELECTION_GEM,
EDITOR_SPRITE_DRAWING_GEM,

EDITOR_SPRITE_SPAWNS,
EDITOR_SPRITE_MONSTERS,
EDITOR_SPRITE_NPCS,
EDITOR_SPRITE_HOUSE_EXIT,
EDITOR_SPRITE_PICKUPABLE_ITEM,
EDITOR_SPRITE_MOVEABLE_ITEM,
Expand Down
Loading