Commit 3a9345c6 authored by Leeor Dicker's avatar Leeor Dicker

- Added different mouse pointers for edit modes to make it more obvious what...

- Added different mouse pointers for edit modes to make it more obvious what state the editor is in.
- Added separators to the ToolBar.
- Stripped PNG's of known bad iCCP profiles. Still get a few warnings but not like it was before.
parent 620df282
data/sys/bullet_edit.png

3.13 KB | W: | H:

data/sys/bullet_edit.png

453 Bytes | W: | H:

data/sys/bullet_edit.png
data/sys/bullet_edit.png
data/sys/bullet_edit.png
data/sys/bullet_edit.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/collision.png

2.86 KB | W: | H:

data/sys/collision.png

193 Bytes | W: | H:

data/sys/collision.png
data/sys/collision.png
data/sys/collision.png
data/sys/collision.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/collision_show.png

3.23 KB | W: | H:

data/sys/collision_show.png

472 Bytes | W: | H:

data/sys/collision_show.png
data/sys/collision_show.png
data/sys/collision_show.png
data/sys/collision_show.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/erase.png

3.32 KB | W: | H:

data/sys/erase.png

630 Bytes | W: | H:

data/sys/erase.png
data/sys/erase.png
data/sys/erase.png
data/sys/erase.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/eraser.png

1.4 KB | W: | H:

data/sys/eraser.png

932 Bytes | W: | H:

data/sys/eraser.png
data/sys/eraser.png
data/sys/eraser.png
data/sys/eraser.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_b.png

2.78 KB | W: | H:

data/sys/layer_b.png

113 Bytes | W: | H:

data/sys/layer_b.png
data/sys/layer_b.png
data/sys/layer_b.png
data/sys/layer_b.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_b_edit.png

3.16 KB | W: | H:

data/sys/layer_b_edit.png

459 Bytes | W: | H:

data/sys/layer_b_edit.png
data/sys/layer_b_edit.png
data/sys/layer_b_edit.png
data/sys/layer_b_edit.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_b_show.png

3.08 KB | W: | H:

data/sys/layer_b_show.png

394 Bytes | W: | H:

data/sys/layer_b_show.png
data/sys/layer_b_show.png
data/sys/layer_b_show.png
data/sys/layer_b_show.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_bd.png

2.78 KB | W: | H:

data/sys/layer_bd.png

115 Bytes | W: | H:

data/sys/layer_bd.png
data/sys/layer_bd.png
data/sys/layer_bd.png
data/sys/layer_bd.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_bd_edit.png

3.15 KB | W: | H:

data/sys/layer_bd_edit.png

460 Bytes | W: | H:

data/sys/layer_bd_edit.png
data/sys/layer_bd_edit.png
data/sys/layer_bd_edit.png
data/sys/layer_bd_edit.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_bd_show.png

3.1 KB | W: | H:

data/sys/layer_bd_show.png

395 Bytes | W: | H:

data/sys/layer_bd_show.png
data/sys/layer_bd_show.png
data/sys/layer_bd_show.png
data/sys/layer_bd_show.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_d.png

2.78 KB | W: | H:

data/sys/layer_d.png

115 Bytes | W: | H:

data/sys/layer_d.png
data/sys/layer_d.png
data/sys/layer_d.png
data/sys/layer_d.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_d_edit.png

3.16 KB | W: | H:

data/sys/layer_d_edit.png

460 Bytes | W: | H:

data/sys/layer_d_edit.png
data/sys/layer_d_edit.png
data/sys/layer_d_edit.png
data/sys/layer_d_edit.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_d_show.png

3.1 KB | W: | H:

data/sys/layer_d_show.png

400 Bytes | W: | H:

data/sys/layer_d_show.png
data/sys/layer_d_show.png
data/sys/layer_d_show.png
data/sys/layer_d_show.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_fg.png

2.78 KB | W: | H:

data/sys/layer_fg.png

115 Bytes | W: | H:

data/sys/layer_fg.png
data/sys/layer_fg.png
data/sys/layer_fg.png
data/sys/layer_fg.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_fg_edit.png

3.16 KB | W: | H:

data/sys/layer_fg_edit.png

458 Bytes | W: | H:

data/sys/layer_fg_edit.png
data/sys/layer_fg_edit.png
data/sys/layer_fg_edit.png
data/sys/layer_fg_edit.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/layer_fg_show.png

3.11 KB | W: | H:

data/sys/layer_fg_show.png

399 Bytes | W: | H:

data/sys/layer_fg_show.png
data/sys/layer_fg_show.png
data/sys/layer_fg_show.png
data/sys/layer_fg_show.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/map.png

686 Bytes | W: | H:

data/sys/map.png

654 Bytes | W: | H:

data/sys/map.png
data/sys/map.png
data/sys/map.png
data/sys/map.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/next.png

3.04 KB | W: | H:

data/sys/next.png

386 Bytes | W: | H:

data/sys/next.png
data/sys/next.png
data/sys/next.png
data/sys/next.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/normal.png

3.13 KB | W: | H:

data/sys/normal.png

419 Bytes | W: | H:

data/sys/normal.png
data/sys/normal.png
data/sys/normal.png
data/sys/normal.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/palette.png

856 Bytes | W: | H:

data/sys/palette.png

839 Bytes | W: | H:

data/sys/palette.png
data/sys/palette.png
data/sys/palette.png
data/sys/palette.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/prev.png

3.07 KB | W: | H:

data/sys/prev.png

385 Bytes | W: | H:

data/sys/prev.png
data/sys/prev.png
data/sys/prev.png
data/sys/prev.png
  • 2-up
  • Swipe
  • Onion skin
data/sys/save.png

3.24 KB | W: | H:

data/sys/save.png

602 Bytes | W: | H:

data/sys/save.png
data/sys/save.png
data/sys/save.png
data/sys/save.png
  • 2-up
  • Swipe
  • Onion skin
data/tsets/001.png

90.9 KB | W: | H:

data/tsets/001.png

58.4 KB | W: | H:

data/tsets/001.png
data/tsets/001.png
data/tsets/001.png
data/tsets/001.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -19,7 +19,10 @@ std::map<EditState, Cell::TileLayer> StateToLayer; /**< Translation table betwee
EditorState::EditorState(const string& mapPath):
mMousePointer(Utility<Configuration>::get().option(CONFIG_UI_MOUSE_POINTER_IMAGE)),
mMousePointer(nullptr),
mPointer_Normal("sys/normal.png"),
mPointer_Fill("sys/fill.png"),
mPointer_Eraser("sys/eraser.png"),
mFont("fonts/ui-normal.png", 7, 9, 0),
mLinkCell(nullptr),
mMap(mapPath),
......@@ -37,7 +40,10 @@ EditorState::EditorState(const string& mapPath):
EditorState::EditorState(const string& name, const string& mapPath, const string& tsetPath, int w, int h):
mMousePointer(Utility<Configuration>::get().option(CONFIG_UI_MOUSE_POINTER_IMAGE)),
mMousePointer(nullptr),
mPointer_Normal("sys/normal.png"),
mPointer_Fill("sys/fill.png"),
mPointer_Eraser("sys/eraser.png"),
mFont("fonts/ui-normal.png", 7, 9, 0),
mLinkCell(nullptr),
mMap(name, tsetPath, w, h),
......@@ -78,6 +84,8 @@ void EditorState::initialize()
initUi();
mMousePointer = &mPointer_Normal;
// Fill tables
fillTables();
......@@ -89,8 +97,6 @@ void EditorState::initialize()
Utility<EventHandler>::get().mouseButtonDown().Connect(this, &EditorState::onMouseDown);
Utility<EventHandler>::get().quit().Connect(this, &EditorState::onQuit);
/// \todo Minimap init here
mMap.viewport(Rectangle_2d(0, 32, Utility<Renderer>::get().width(), Utility<Renderer>::get().height() - 32));
}
......@@ -248,7 +254,7 @@ State* EditorState::update()
r.drawTextShadow(mFont, "Map File: " + mMapSavePath, r.screenCenterX() - (mFont.width("Map File: " + mMapSavePath) / 2), r.height() - (mFont.height() + 2), 1, 255, 255, 255, 0, 0, 0);
r.drawImage(mMousePointer, mMouseCoords.x(), mMouseCoords.y());
r.drawImage(*mMousePointer, mMouseCoords.x(), mMouseCoords.y());
return mReturnState;
}
......@@ -687,6 +693,16 @@ void EditorState::toolbar_event(ToolBar::ToolBarAction _act)
case ToolBar::TOOLBAR_TILE_PALETTE_TOGGLE:
mTilePalette.hidden(!mToolBar.show_tilepalette());
break;
case ToolBar::TOOLBAR_TOOL_PENCIL:
mMousePointer = &mPointer_Normal;
break;
case ToolBar::TOOLBAR_TOOL_FILL:
mMousePointer = &mPointer_Fill;
break;
case ToolBar::TOOLBAR_TOOL_ERASER:
mMousePointer = &mPointer_Eraser;
break;
default:
break;
}
......
......@@ -106,7 +106,11 @@ private:
Font mFont;
Image mMousePointer;
Image* mMousePointer;
Image mPointer_Normal;
Image mPointer_Fill;
Image mPointer_Eraser;
// PRIMITIVES
Point_2d mMouseCoords;
......
......@@ -158,6 +158,16 @@ void ToolBar::onKeyDown(KeyCode code, KeyModifier mod, bool repeat)
}
void drawSeparator(Button& btn, int margin)
{
//bevelBox(btn.positionX() + btn.width() + margin, btn.positionY(), 2, btn.height());
Renderer& r = Utility<Renderer>::get();
r.drawLine(btn.positionX() + btn.width() + margin, btn.positionY(), btn.positionX() + btn.width() + margin, btn.positionY() + btn.height(), 130, 130, 130);
r.drawLine(btn.positionX() + btn.width() + margin + 1, btn.positionY(), btn.positionX() + btn.width() + margin + 1, btn.positionY() + btn.height(), 200, 200, 200);
}
void ToolBar::update()
{
Renderer& r = Utility<Renderer>::get();
......@@ -167,16 +177,22 @@ void ToolBar::update()
btnSave.update();
drawSeparator(btnSave, 9);
btnPencil.update();
btnFill.update();
btnErase.update();
drawSeparator(btnErase, 9);
btnLayerBase.update();
btnLayerBaseDetail.update();
btnLayerDetail.update();
btnLayerForeground.update();
btnLayerCollision.update();
drawSeparator(btnLayerCollision, 9);
btnLayerBaseToggle.update();
btnLayerBaseDetailToggle.update();
btnLayerDetailToggle.update();
......@@ -286,6 +302,8 @@ void ToolBar::btnPencil_Clicked()
btnPencil.toggle(true);
btnFill.toggle(false);
btnErase.toggle(false);
mToolbarEvent(TOOLBAR_TOOL_PENCIL);
}
......@@ -294,6 +312,8 @@ void ToolBar::btnFill_Clicked()
btnPencil.toggle(false);
btnFill.toggle(true);
btnErase.toggle(false);
mToolbarEvent(TOOLBAR_TOOL_FILL);
}
......@@ -302,6 +322,9 @@ void ToolBar::btnErase_Clicked()
btnPencil.toggle(false);
btnFill.toggle(false);
btnErase.toggle(true);
mToolbarEvent(TOOLBAR_TOOL_ERASER);
}
......
......@@ -25,7 +25,10 @@ public:
TOOLBAR_LAYER_FOREGROUND_TOGGLE,
TOOLBAR_LAYER_COLLISION_TOGGLE,
TOOLBAR_MINIMAP_TOGGLE,
TOOLBAR_TILE_PALETTE_TOGGLE
TOOLBAR_TILE_PALETTE_TOGGLE,
TOOLBAR_TOOL_PENCIL,
TOOLBAR_TOOL_FILL,
TOOLBAR_TOOL_ERASER
};
typedef Gallant::Signal1<ToolBarAction> ToolBarEvent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment