Permalink
Browse files

Chat log

  • Loading branch information...
1 parent dd486fe commit 6c6bc69c65360c948a416f951ec27c8480531702 Robert Edström committed Aug 21, 2011
View
3 frontend/public/js/clubmate-components.js
@@ -118,7 +118,8 @@ CM.Components = function() {
$clear(textEntity.resetTimeout);
}
textEntity.text(text);
- textEntity.resetTimeout = setTimeout(function() {textEntity.text(obj.options.alias ? obj.options.alias : '');}, 3000);
+ $('chatLog').innerHTML += '<br />' + text;
+ textEntity.resetTimeout = setTimeout(function() {textEntity.text(obj.options.alias ? obj.options.alias : '');}, CM.Settings.ClearMessageTimeout);
this.UpdateEntitiesPositions();
}
});
View
1 frontend/public/js/clubmate-settings.js
@@ -14,6 +14,7 @@ CM.Settings = {
SpritePath: '/images/',
MapWidth: 40,
MapHeight: 28,
+ ClearMessageTimeout: 5000,
CacheAhead: 5 //How many tiles the player has to move in to a chunk to start loading the adjacent ones
};
View
5 frontend/public/js/clubmate.js
@@ -46,8 +46,9 @@ CM.UIManager = function() {
Crafty.scene('main');
Crafty.viewport.x = CM.Settings.xOffset*CM.Settings.TileWidth;
Crafty.viewport.y = CM.Settings.yOffset*CM.Settings.TileHeight;
- var chatField = new Element('input', {id: 'chatField', type: 'text'});
- chatField.inject($('controlPanel'));
+ var chatField = new Element('input', {id: 'chatField', type: 'text', autocomplete: 'off'});
+ var chatLog = new Element('div', {id: 'chatLog'});
+ $('controlPanel').adopt(chatField, chatLog);
var keyboardListener = new Keyboard({
active: true
});
View
2 frontend/views/index.html
@@ -30,7 +30,7 @@
<canvas id="canvas" width="160" height="160" />
</div>
<div id="controlPanel"></div>
- <div id="status"></div>
+ <div id="status" style="display: none;"></div>
<footer>
</footer>

0 comments on commit 6c6bc69

Please sign in to comment.