diff --git a/client/cryps.css b/client/cryps.css index 0fde0862..d3e6830e 100644 --- a/client/cryps.css +++ b/client/cryps.css @@ -123,6 +123,14 @@ svg { stroke-width: 0; } +img { + object-fit: contain; + max-width: 100%; + max-height: 100%; + width: auto; + height: auto; +} + /* COLOURS */ @@ -597,6 +605,7 @@ table td svg { box-sizing: border-box; display: flex; flex-flow: column; + justify-content: flex-end; } .cryp-box .stats { @@ -671,9 +680,10 @@ table td svg { filter: blur(5px); } -text.combat-text { +.combat-text { + position: fixed; + top: 50%; fill: whitesmoke; - font-size: 5em; font-family: 'Jura'; } diff --git a/client/src/components/game.component.jsx b/client/src/components/game.component.jsx index a0dc3d74..36042656 100644 --- a/client/src/components/game.component.jsx +++ b/client/src/components/game.component.jsx @@ -1,9 +1,7 @@ const preact = require('preact'); const range = require('lodash/range'); -const molecule = require('./molecule'); - -const { STATS, eventClasses, getCombatText } = require('../utils'); +const { STATS, eventClasses, getCombatText, genAvatar } = require('../utils'); const GameCryp = require('./game.cryp'); const SkillBtn = require('./skill.btn'); @@ -146,18 +144,21 @@ function GamePanel(props) { const combatText = getCombatText(cryp, resolution); + const combatTextEl = combatText + ?
{combatText}
+ : null; + return (
selectSkillTarget(cryp.id)} > -
-
- {molecule(combatText)} -
{cryp.name}
-
-
+
+ +
attack
+
{cryp.name}
+
{stats}
diff --git a/client/src/components/game.cryp.jsx b/client/src/components/game.cryp.jsx index 9d04f6c7..5844c40e 100644 --- a/client/src/components/game.cryp.jsx +++ b/client/src/components/game.cryp.jsx @@ -4,7 +4,7 @@ const range = require('lodash/range'); const molecule = require('./molecule'); const actions = require('../actions'); -const { STATS, eventClasses, getCombatText } = require('../utils'); +const { STATS, eventClasses, getCombatText, genAvatar } = require('../utils'); const SkillBtn = require('./skill.btn'); @@ -88,8 +88,8 @@ function GameCryp(props) {
selectSkillTarget(cryp.id)} > - {molecule(combatText)} -
{cryp.name}
+ +
{cryp.name}
{skills} diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index dce4ec63..6eaf4517 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -177,7 +177,6 @@ function Info(args) { function scoreBoard() { const players = instance.players.map((p, i) => { const pText = playerText(p); - console.log(pText); return ( @@ -209,6 +208,10 @@ function Info(args) { ? infoVar(info) : null; + // const beginningHdr = instance.phase === 'Lobby' + // ?

game beginning...

+ // : null; + const instanceInfoClass = `instance-info ${!info[0] ? '' : 'hidden'}`; return ( diff --git a/client/src/components/instance.cryps.jsx b/client/src/components/instance.cryps.jsx index 9e1611c5..9c5b6b99 100644 --- a/client/src/components/instance.cryps.jsx +++ b/client/src/components/instance.cryps.jsx @@ -4,7 +4,7 @@ const range = require('lodash/range'); const mapValues = require('lodash/mapValues'); const molecule = require('./molecule'); -const { SPECS } = require('../utils'); +const { SPECS, genAvatar } = require('../utils'); const actions = require('../actions'); const SkillBtn = require('./skill.btn'); @@ -132,7 +132,7 @@ function Cryp(props) { >
- {molecule()} +
{cryp.name}
diff --git a/client/src/components/menu.component.jsx b/client/src/components/menu.component.jsx index b05c7acd..d9c52c00 100644 --- a/client/src/components/menu.component.jsx +++ b/client/src/components/menu.component.jsx @@ -3,7 +3,7 @@ const range = require('lodash/range'); const { NULL_UUID } = require('./../utils'); -const { stringSort } = require('./../utils'); +const { stringSort, genAvatar } = require('./../utils'); const molecule = require('./molecule'); const SpawnButton = require('./spawn.button'); @@ -123,9 +123,7 @@ function Menu(args) { className="menu-cryp" style={ { 'border-color': borderColour || 'whitesmoke' } } onClick={() => selectCryp(cryp.id)} > -
- {molecule()} -
+

{cryp.name}

diff --git a/client/src/socket.jsx b/client/src/socket.jsx index 548e7381..bed9d1d5 100644 --- a/client/src/socket.jsx +++ b/client/src/socket.jsx @@ -220,13 +220,11 @@ function createSocket(events) { const [structName, i] = response; clearTimeout(instanceStateTimeout); instanceStateTimeout = setTimeout(() => sendInstanceState(i.id), 1000); - console.log(instanceStateTimeout); events.setInstance(i); return true; } function clearInstanceStateTimeout() { - console.log('instance state timeout cleared'); clearTimeout(instanceStateTimeout); } diff --git a/client/src/utils.jsx b/client/src/utils.jsx index ed98d007..6632c931 100644 --- a/client/src/utils.jsx +++ b/client/src/utils.jsx @@ -39,9 +39,9 @@ const genAvatar = name => { for (let i = 0; i < name.length; i += 1) { const chr = name.charCodeAt(i); hash = ((hash << 5) - hash) + chr; - hash = hash & 10000; // We have avatars named 0-19 + hash = hash % 10000; } - return `sprite${hash}`; + return `${hash}`; }; function requestAvatar(name) { diff --git a/server/src/warden.rs b/server/src/warden.rs index cf92a9ea..6a2f976f 100644 --- a/server/src/warden.rs +++ b/server/src/warden.rs @@ -29,7 +29,6 @@ fn fetch_instances(mut tx: Transaction) -> Result { for mut instance in instances { let (instance, new_games) = instance.upkeep(); - println!("{:?} new games", new_games.len()); for game in new_games { game_write(&mut tx, &game)?; } @@ -40,14 +39,11 @@ fn fetch_instances(mut tx: Transaction) -> Result { } pub fn warden(db: Db) -> Result<(), Error> { - println!("upkeep beginning"); fetch_games(db.transaction()?)? .commit()?; fetch_instances(db.transaction()?)? .commit()?; - println!("upkeep done"); - Ok(()) } \ No newline at end of file