Skip to content

Commit

Permalink
Merge branch 'one-hour-one-life' of github.com:Dallinger/Griduniverse…
Browse files Browse the repository at this point in the history
… into issue/238-multi-participant-trans
  • Loading branch information
silviot committed Aug 16, 2023
2 parents 3afe48d + 338af7b commit c6fc451
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 9 deletions.
1 change: 1 addition & 0 deletions dlgr/griduniverse/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ rows = 100
window_rows = 20
window_columns = 20
use_identicons = true
show_chatroom = true

[HIT Configuration]
title = Griduniverse
Expand Down
24 changes: 21 additions & 3 deletions dlgr/griduniverse/static/scripts/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,10 +756,17 @@ function bindGameKeys(socket) {
}
}

function isChatting() {
return $("#message").is(':focus');
}

directions.forEach(function(direction) {
Mousetrap.bind(
direction,
function(e) {
if (isChatting()) {
return;
}
e.preventDefault();
if (direction === lastDirection) {
return;
Expand All @@ -780,6 +787,9 @@ function bindGameKeys(socket) {
Mousetrap.bind(
direction,
function(e) {
if (isChatting()) {
return;
}
e.preventDefault();
if (direction) {
clearInterval(repeatIntervalId);
Expand All @@ -791,7 +801,11 @@ function bindGameKeys(socket) {

});

Mousetrap.bind("space", function () {
Mousetrap.bind("space", function (e) {
if (isChatting()) {
return;
}
e.preventDefault();
var msg_type;
var ego = players.ego();
var position = ego.position;
Expand Down Expand Up @@ -832,7 +846,11 @@ function bindGameKeys(socket) {
socket.send(msg);
});

Mousetrap.bind("d", function () {
Mousetrap.bind("d", function (e) {
if (isChatting()) {
return;
}
e.preventDefault();
var ego = players.ego();
var position = ego.position;
var currentItem = ego.currentItem;
Expand Down Expand Up @@ -1428,7 +1446,7 @@ $(document).ready(function() {
return Math.floor(pix / (settings.block_size + settings.padding));
};

$("form").submit(function() {
$("form").on('submit', function() {
var chatmessage = $("#message").val().trim(),
msg;

Expand Down
24 changes: 21 additions & 3 deletions dlgr/griduniverse/static/scripts/dist/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dlgr/griduniverse/static/scripts/dist/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dlgr/griduniverse/static/scripts/dist/difi.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dlgr/griduniverse/static/scripts/dist/questionnaire.js.map

Large diffs are not rendered by default.

0 comments on commit c6fc451

Please sign in to comment.