mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
Added bindings for mouse clicks, fixed lights
This commit is contained in:
parent
b472626d8d
commit
b6a8358e9e
5 changed files with 13 additions and 7 deletions
|
|
@ -221,10 +221,10 @@ void PlayerController::updateInteraction(){
|
|||
vec3 norm;
|
||||
|
||||
bool xkey = Events::pressed(keycode::X);
|
||||
bool lclick = Events::jclicked(mousecode::BUTTON_1) ||
|
||||
(xkey && Events::clicked(mousecode::BUTTON_1));
|
||||
bool rclick = Events::jclicked(mousecode::BUTTON_2) ||
|
||||
(xkey && Events::clicked(mousecode::BUTTON_2));
|
||||
bool lclick = Events::jactive(BIND_PLAYER_ATTACK) ||
|
||||
(xkey && Events::active(BIND_PLAYER_ATTACK));
|
||||
bool rclick = Events::jactive(BIND_PLAYER_BUILD) ||
|
||||
(xkey && Events::active(BIND_PLAYER_BUILD));
|
||||
float maxDistance = 10.0f;
|
||||
if (xkey) {
|
||||
maxDistance *= 20.0f;
|
||||
|
|
@ -270,7 +270,7 @@ void PlayerController::updateInteraction(){
|
|||
lighting->onBlockSet(x,y,z, player->choosenBlock);
|
||||
}
|
||||
}
|
||||
if (Events::jclicked(mousecode::BUTTON_3)){
|
||||
if (Events::jactive(BIND_PLAYER_PICK)){
|
||||
player->choosenBlock = chunks->get(x,y,z)->id;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue