feat(editor): sound :)
This commit is contained in:
parent
3f44e38788
commit
2be964acda
3 changed files with 13 additions and 5 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -10,4 +10,7 @@
|
|||
/.cache
|
||||
|
||||
# Gdb
|
||||
/.gdb_history
|
||||
/.gdb_history
|
||||
|
||||
# Excluded assets
|
||||
/assets/excluded
|
|
@ -11,8 +11,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets LinguistTools)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools)
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Multimedia LinguistTools)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Multimedia LinguistTools)
|
||||
|
||||
|
||||
set(TS_FILES editor_en_US.ts)
|
||||
|
@ -64,7 +64,7 @@ else()
|
|||
endif()
|
||||
|
||||
target_include_directories(editor PUBLIC "../core/src" "../include")
|
||||
target_link_libraries(editor PRIVATE openblocks Qt${QT_VERSION_MAJOR}::Widgets)
|
||||
target_link_libraries(editor PRIVATE openblocks Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Multimedia)
|
||||
|
||||
# Qt6 does not include QOpenGLWidgets as part of Widgets base anymore, so
|
||||
# we have to include it manually
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <optional>
|
||||
#include <reactphysics3d/collision/RaycastInfo.h>
|
||||
#include <vector>
|
||||
#include <QSound>
|
||||
|
||||
#include "datatypes/cframe.h"
|
||||
#include "datatypes/vector.h"
|
||||
|
@ -370,8 +371,12 @@ void MainGLWidget::mousePressEvent(QMouseEvent* evt) {
|
|||
case Left: part->leftSurface = surface; break;
|
||||
case Bottom: part->bottomSurface = surface; break;
|
||||
case Front: part->frontSurface = surface; break;
|
||||
default: break;
|
||||
default: return;
|
||||
}
|
||||
|
||||
if (QFile::exists("./assets/excluded/electronicpingshort.wav"))
|
||||
QSound::play("./assets/excluded/electronicpingshort.wav");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue