Merge branch 'release/1.12.3'

This commit is contained in:
ntr 2020-01-19 12:33:49 +10:00
commit cbcf73b241
12 changed files with 34 additions and 13 deletions

View File

@ -1 +1 @@
1.12.2 1.12.3

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-client", "name": "mnml-client",
"version": "1.12.2", "version": "1.12.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -85,6 +85,10 @@
.effects { .effects {
align-self: flex-start; align-self: flex-start;
} }
&.highlight {
animation: highlight 1s infinite alternate;
}
} }
.game-construct .name { .game-construct .name {
@ -93,6 +97,15 @@
} }
} }
@keyframes highlight {
from {
background: @black;
}
to {
background: @silver;
}
}
.game-construct { .game-construct {
display: grid; display: grid;

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-client", "name": "mnml-client",
"version": "1.12.2", "version": "1.12.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -15,6 +15,7 @@ const addState = connect(
ws, ws,
game, game,
authenticated,
activeSkill, activeSkill,
animFocus, animFocus,
resolution, resolution,
@ -28,6 +29,8 @@ const addState = connect(
} }
return { return {
game,
authenticated,
activeSkill, activeSkill,
animFocus, animFocus,
resolution, resolution,
@ -51,6 +54,8 @@ class GameConstruct extends preact.Component {
render() { render() {
const { const {
// Changing state variables // Changing state variables
authenticated,
game,
activeSkill, activeSkill,
animFocus, animFocus,
resolution, resolution,
@ -75,16 +80,18 @@ class GameConstruct extends preact.Component {
const unfocus = animFocus && !animFocus.includes(construct.id) ? 'unfocus' : ''; const unfocus = animFocus && !animFocus.includes(construct.id) ? 'unfocus' : '';
const targeted = game.stack.find(c => c.target === construct.id);
const highlight = !authenticated && !targeted && activeSkill ? 'highlight' : '';
const crypSkills = player const crypSkills = player
? <div class="skills"> {range(0, 3).map(j => <SkillBtn key={j} construct={construct} i={j} />)} </div> ? <div class="skills"> {range(0, 3).map(j => <SkillBtn key={j} construct={construct} i={j} />)} </div>
: <div></div>; : <div></div>;
return ( return (
<div <div
onClick={() => selectSkillTarget(construct.id)} onClick={() => selectSkillTarget(construct.id)}
style={ activeSkill ? { cursor: 'pointer' } : {}} style={ activeSkill ? { cursor: 'pointer' } : {}}
class={`game-construct ${ko} ${koEvent()} ${unfocus}`}> class={`game-construct ${ko} ${koEvent()} ${unfocus} ${highlight}`}>
<div class="left"> <div class="left">
{crypSkills} {crypSkills}
<ConstructEffectBox construct={construct} /> <ConstructEffectBox construct={construct} />

View File

@ -86,7 +86,9 @@ function GameCtrlBtns(args) {
quit(); quit();
} }
const readyBtn = <button disabled={animating} class="ready" onClick={() => sendReady()}>Ready</button>; const noTargets = !authenticated && game.stack.length === 0;
const readyBtn = <button disabled={animating || noTargets} class="ready" onClick={() => sendReady()}>Ready</button>;
const quitBtn = <button disabled={animating} class="quit" onClick={quitClick}>Back</button>; const quitBtn = <button disabled={animating} class="quit" onClick={quitClick}>Back</button>;
return ( return (

View File

@ -95,7 +95,7 @@ function Play(args) {
type="submit"> type="submit">
Invite Invite
</button> </button>
<figcaption>Play against friend</figcaption> <figcaption>Play against a friend</figcaption>
</figure> </figure>
); );

View File

@ -1,6 +1,6 @@
[package] [package]
name = "mnml_core" name = "mnml_core"
version = "1.12.2" version = "1.12.3"
authors = ["ntr <ntr@smokestack.io>", "mashy <mashy@mnml.gg>"] authors = ["ntr <ntr@smokestack.io>", "mashy <mashy@mnml.gg>"]
[dependencies] [dependencies]

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-ops", "name": "mnml-ops",
"version": "1.12.2", "version": "1.12.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -1,6 +1,6 @@
[package] [package]
name = "mnml" name = "mnml"
version = "1.12.2" version = "1.12.3"
authors = ["ntr <ntr@smokestack.io>"] authors = ["ntr <ntr@smokestack.io>"]
[dependencies] [dependencies]

View File

@ -105,7 +105,6 @@ pub fn shapes_write(id: Uuid) -> Result<Uuid, Error> {
let shape_dist = WeightedIndex::new(shapes.iter().map(|v| v.1))?; let shape_dist = WeightedIndex::new(shapes.iter().map(|v| v.1))?;
let n_shapes_items = [ let n_shapes_items = [
(1, 1),
(2, 2), (2, 2),
(3, 5), (3, 5),
(4, 10), (4, 10),
@ -113,10 +112,10 @@ pub fn shapes_write(id: Uuid) -> Result<Uuid, Error> {
]; ];
let num_dist = WeightedIndex::new(n_shapes_items.iter().map(|v| v.1))?; let num_dist = WeightedIndex::new(n_shapes_items.iter().map(|v| v.1))?;
let n_shapes = num_dist.sample(&mut rng) as usize; let n_shapes = num_dist.sample(&mut rng) as usize;
let h = rng.gen_range(0, 360);
write!(&mut svg, "<svg xmlns='http://www.w3.org/2000/svg' version='1.1' viewBox='-250 -250 500 500' width='1000' height='1000'><g>")?; write!(&mut svg, "<svg xmlns='http://www.w3.org/2000/svg' version='1.1' viewBox='-250 -250 500 500' width='1000' height='1000'><g>")?;
for i in 0..n_shapes + 1 { for i in 0..n_shapes + 1 {
let h = rng.gen_range(0, 360);
let s = s_dist.sample(&mut rng) as usize; let s = s_dist.sample(&mut rng) as usize;
let l = l_dist.sample(&mut rng) as usize; let l = l_dist.sample(&mut rng) as usize;
let colour = format!("hsl({:}, {:}%, {:}%)", h, s, l); let colour = format!("hsl({:}, {:}%, {:}%)", h, s, l);

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-studios", "name": "mnml-studios",
"version": "1.12.2", "version": "1.12.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {