Fix AssetBrowser movement - Add new icon
This commit is contained in:
BIN
media/res.aps
BIN
media/res.aps
Binary file not shown.
Binary file not shown.
2
src/external/blizzard-archive-library
vendored
2
src/external/blizzard-archive-library
vendored
Submodule src/external/blizzard-archive-library updated: 9990612b67...c4c9d75e93
@@ -122,7 +122,10 @@ namespace Noggit
|
||||
GIZMO_VISIBILITY = 0xf8cc,
|
||||
GIZMO_GLOBAL = 0xf8cd,
|
||||
GIZMO_LOCAL = 0xf8ce,
|
||||
GIZMO_VISIBILITY_ALL = 0xf8cf
|
||||
GIZMO_VISIBILITY_ALL = 0xf8cf,
|
||||
TOOL_LIGHT = 0xf8d0,
|
||||
VISIBILITY_VERTEX_PAINTER = 0xf8d1,
|
||||
VISIBILITY_CLIMB = 0xf8d2
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Noggit
|
||||
add_tool_icon(editing_mode::object, tr("Object Editor"), FontNoggit::TOOL_OBJECT_EDITOR);
|
||||
add_tool_icon(editing_mode::minimap, tr("Minimap Editor"), FontNoggit::TOOL_MINIMAP_EDITOR);
|
||||
add_tool_icon(editing_mode::stamp, tr("Stamp Mode"), FontNoggit::TOOL_STAMP);
|
||||
add_tool_icon(editing_mode::light, tr("Light Editor"), FontNoggit::TOOL_STAMP);
|
||||
add_tool_icon(editing_mode::light, tr("Light Editor"), FontNoggit::TOOL_LIGHT);
|
||||
add_tool_icon(editing_mode::scripting, tr("Scripting"), FontNoggit::INFO);
|
||||
add_tool_icon(editing_mode::chunk, tr("Chunk Manipulator"), FontNoggit::INFO);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,9 @@ void ModelViewer::wheelEvent(QWheelEvent* event)
|
||||
|
||||
void ModelViewer::keyReleaseEvent(QKeyEvent* event)
|
||||
{
|
||||
if (event->key() == Qt::Key_W || event->key() == Qt::Key_S)
|
||||
checkInputsSettings();
|
||||
|
||||
if (event->key() == _inputs[0] || event->key() == _inputs[1])
|
||||
{
|
||||
moving = 0.0f;
|
||||
}
|
||||
@@ -163,12 +165,12 @@ void ModelViewer::keyReleaseEvent(QKeyEvent* event)
|
||||
turn = 0.0f;
|
||||
}
|
||||
|
||||
if (event->key() == Qt::Key_D || event->key() == Qt::Key_A)
|
||||
if (event->key() == _inputs[2] || event->key() == _inputs[3])
|
||||
{
|
||||
strafing = 0.0f;
|
||||
}
|
||||
|
||||
if (event->key() == Qt::Key_Q || event->key() == Qt::Key_E)
|
||||
if (event->key() == _inputs[4] || event->key() == _inputs[5])
|
||||
{
|
||||
updown = 0.0f;
|
||||
}
|
||||
@@ -188,11 +190,13 @@ void ModelViewer::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
event->accept();
|
||||
|
||||
if (event->key() == Qt::Key_W)
|
||||
checkInputsSettings();
|
||||
|
||||
if (event->key() == _inputs[0])
|
||||
{
|
||||
moving = _move_sensitivity;
|
||||
}
|
||||
if (event->key() == Qt::Key_S)
|
||||
if (event->key() == _inputs[1])
|
||||
{
|
||||
moving = -_move_sensitivity;
|
||||
}
|
||||
@@ -215,20 +219,20 @@ void ModelViewer::keyPressEvent(QKeyEvent* event)
|
||||
turn = -_move_sensitivity;
|
||||
}
|
||||
|
||||
if (event->key() == Qt::Key_D)
|
||||
if (event->key() == _inputs[2])
|
||||
{
|
||||
strafing = _move_sensitivity;
|
||||
}
|
||||
if (event->key() == Qt::Key_A)
|
||||
if (event->key() == _inputs[3])
|
||||
{
|
||||
strafing = -_move_sensitivity;
|
||||
}
|
||||
|
||||
if (event->key() == Qt::Key_Q)
|
||||
if (event->key() == _inputs[4])
|
||||
{
|
||||
updown = _move_sensitivity;
|
||||
}
|
||||
if (event->key() == Qt::Key_E)
|
||||
if (event->key() == _inputs[5])
|
||||
{
|
||||
updown = -_move_sensitivity;
|
||||
}
|
||||
@@ -280,3 +284,16 @@ ModelViewer::~ModelViewer()
|
||||
{
|
||||
disconnect(_gl_guard_connection);
|
||||
}
|
||||
|
||||
void ModelViewer::checkInputsSettings()
|
||||
{
|
||||
QString _locale = _settings->value("keyboard_locale", "QWERTY").toString();
|
||||
|
||||
// default is QWERTY
|
||||
_inputs = std::array<Qt::Key, 6>{Qt::Key_W, Qt::Key_S, Qt::Key_D, Qt::Key_A, Qt::Key_Q, Qt::Key_E};
|
||||
|
||||
if (_locale == "AZERTY")
|
||||
{
|
||||
_inputs = std::array<Qt::Key, 6>{Qt::Key_Z, Qt::Key_S, Qt::Key_D, Qt::Key_Q, Qt::Key_A, Qt::Key_E};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,9 @@ namespace Noggit
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void focusOutEvent(QFocusEvent* event) override;
|
||||
|
||||
private:
|
||||
std::array<Qt::Key, 6> _inputs = { Qt::Key_W, Qt::Key_S, Qt::Key_D, Qt::Key_A, Qt::Key_Q, Qt::Key_E };
|
||||
void checkInputsSettings();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ ViewToolbar::ViewToolbar(MapView* mapView)
|
||||
setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
IconAction* climb_icon = new IconAction(FontNoggitIcon{FontNoggit::FAVORITE});
|
||||
IconAction* climb_icon = new IconAction(FontNoggitIcon{FontNoggit::VISIBILITY_CLIMB });
|
||||
|
||||
CheckBoxAction* climb_use_output_color_angle = new CheckBoxAction(tr("Display all angle color"));
|
||||
climb_use_output_color_angle->checkbox()->setChecked(false);
|
||||
@@ -79,8 +79,8 @@ ViewToolbar::ViewToolbar(MapView *mapView, ViewToolbar *tb)
|
||||
add_tool_icon(mapView, &mapView->_draw_hole_lines, tr("Hole lines"), FontNoggit::VISIBILITY_HOLE_LINES, tb);
|
||||
add_tool_icon(mapView, &mapView->_draw_wireframe, tr("Wireframe"), FontNoggit::VISIBILITY_WIREFRAME, tb);
|
||||
add_tool_icon(mapView, &mapView->_draw_contour, tr("Contours"), FontNoggit::VISIBILITY_CONTOURS, tb);
|
||||
add_tool_icon(mapView, &mapView->_draw_climb, tr("Climb"), FontNoggit::FAVORITE, tb, tb->_climb_secondary_tool);
|
||||
add_tool_icon(mapView, &mapView->_draw_vertex_color, tr("Vertex Color"), FontNoggit::FAVORITE, tb);
|
||||
add_tool_icon(mapView, &mapView->_draw_climb, tr("Climb"), FontNoggit::VISIBILITY_CLIMB, tb, tb->_climb_secondary_tool);
|
||||
add_tool_icon(mapView, &mapView->_draw_vertex_color, tr("Vertex Color"), FontNoggit::VISIBILITY_VERTEX_PAINTER, tb);
|
||||
|
||||
addSeparator();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user