From 6f578f0747936ba0b025722c116388e7fb5568e4 Mon Sep 17 00:00:00 2001 From: Mashy Date: Mon, 4 Nov 2019 14:33:06 +1000 Subject: [PATCH 1/4] init --- client/assets/styles/vbox.less | 2 +- client/src/components/instance.constructs.jsx | 2 +- client/src/components/vbox.component.jsx | 50 +++++++------------ 3 files changed, 19 insertions(+), 35 deletions(-) diff --git a/client/assets/styles/vbox.less b/client/assets/styles/vbox.less index fe62f0a2..0e0f9526 100644 --- a/client/assets/styles/vbox.less +++ b/client/assets/styles/vbox.less @@ -83,7 +83,7 @@ &.highlight { color: black; background: @white; - border: 1px solid @white; + // border: 1px solid @white; (this bangs around the vbox) // overwrite the classes on white svg elements svg { diff --git a/client/src/components/instance.constructs.jsx b/client/src/components/instance.constructs.jsx index 1e010061..a17aa221 100644 --- a/client/src/components/instance.constructs.jsx +++ b/client/src/components/instance.constructs.jsx @@ -223,7 +223,7 @@ function Construct(props) { const classes = `instance-construct ${mobileVisible ? 'visible' : ''}`; const avatarMouseOver = e => hoverInfo(e, `constructAvatar ${construct.name}`); return ( -
+
ev.preventDefault()} onDrop={onClick}>

hoverInfo(e, `constructName ${construct.name}`)}>{construct.name}

hoverInfo(e, 'constructSkills')} > diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index c2c1a51a..68f6dc5e 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -194,8 +194,6 @@ class Vbox extends preact.Component { e.stopPropagation(); setItemEquip(null); setCombiner([]); - - if (selected) return clearVboxSelected(); setInfo(vbox.free[group][index]); return setVboxSelected([group, index]); } @@ -217,28 +215,18 @@ class Vbox extends preact.Component { const classes = `${v.toLowerCase()} ${selected ? 'highlight' : ''} ${comboHighlight}`; - if (shapes[v]) { - return ( + const vboxObject = shapes[v] ? shapes[v]() : v; + return ( + ); } @@ -334,26 +322,19 @@ class Vbox extends preact.Component { const highlighted = combiner.indexOf(i) > -1; const border = buttons[removeTier(v)] ? buttons[removeTier(v)]() : ''; const classes = `${highlighted ? 'highlight' : border} ${comboHighlight}`; - if (shapes[v]) { - return ( + + const invObject = shapes[v] ? shapes[v]() : v; + + return ( +
- ); - } - - return ( - +
); } @@ -408,7 +389,10 @@ class Vbox extends preact.Component {
e.stopPropagation()} - style={vboxSelecting || (itemUnequip.length) ? { cursor: 'pointer' } : null}> + style={vboxSelecting || (itemUnequip.length) ? { cursor: 'pointer' } : null} + onDragOver={ev => ev.preventDefault()} + onDrop={inventoryClick} + >

e.target.scrollIntoView(true)} From 61b57827e314e221e1068d450893aeb4d2ddb98b Mon Sep 17 00:00:00 2001 From: Mashy Date: Mon, 4 Nov 2019 15:09:58 +1000 Subject: [PATCH 2/4] label --- client/src/components/vbox.component.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index 68f6dc5e..e9e8b8e7 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -326,7 +326,7 @@ class Vbox extends preact.Component { const invObject = shapes[v] ? shapes[v]() : v; return ( -
+
+ ); } From bb50037e0e99e7cf6f1c1e37a106bf7c17a1726b Mon Sep 17 00:00:00 2001 From: Mashy Date: Mon, 4 Nov 2019 16:02:48 +1000 Subject: [PATCH 3/4] drag equipped items --- client/assets/styles/instance.less | 7 ++++ client/src/components/instance.constructs.jsx | 36 ++++++++++--------- client/src/components/vbox.component.jsx | 3 +- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/client/assets/styles/instance.less b/client/assets/styles/instance.less index 0f05fc8b..841993a8 100644 --- a/client/assets/styles/instance.less +++ b/client/assets/styles/instance.less @@ -203,6 +203,9 @@ button { height: 3em; } + label { + display: flex; + } } .specs { @@ -228,6 +231,10 @@ font-size: 75%; line-height: initial; } + + label { + display: flex; + } } .stats { diff --git a/client/src/components/instance.constructs.jsx b/client/src/components/instance.constructs.jsx index a17aa221..ed43f62e 100644 --- a/client/src/components/instance.constructs.jsx +++ b/client/src/components/instance.constructs.jsx @@ -153,15 +153,17 @@ function Construct(props) { const classes = `${equipping ? 'equipping' : ''} ${!skill ? 'empty' : ''} ${border()}`; return ( - + ); }); @@ -195,13 +197,15 @@ function Construct(props) { return ( - + ); }); diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index e9e8b8e7..14cf1108 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -306,7 +306,8 @@ class Vbox extends preact.Component { // removing const combinerIndex = combiner.indexOf(i); if (combinerIndex > -1) { - return combinerChange(without(combiner, i)); + return true; + // return combinerChange(without(combiner, i)); } combiner.push(i); From 64ec68d823588d42c54eb8895e1e3868104d02f0 Mon Sep 17 00:00:00 2001 From: Mashy Date: Mon, 4 Nov 2019 16:35:28 +1000 Subject: [PATCH 4/4] fix recharge immunity bug --- server/src/skill.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/skill.rs b/server/src/skill.rs index 1f655e6d..313b21a3 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -1392,7 +1392,7 @@ fn sustain(source: &mut Construct, target: &mut Construct, mut results: Resoluti if red > 0 || blue > 0 { EventStages::PostOnly } else { EventStages::NoStages } } - _ => panic!("not recharge") + _ => EventStages::NoStages, }; results.push(Resolution::new(source, target).event(e).stages(stages)); @@ -1411,7 +1411,7 @@ fn intercept(source: &mut Construct, target: &mut Construct, mut results: Resolu if red > 0 || blue > 0 { EventStages::PostOnly } else { EventStages::NoStages } } - _ => panic!("not recharge") + _ => EventStages::NoStages, }; results.push(Resolution::new(source, target).event(e).stages(stages)); @@ -1712,8 +1712,8 @@ fn reflect(source: &mut Construct, target: &mut Construct, mut results: Resoluti Event::Recharge { red, blue, skill: _ } => { if red > 0 || blue > 0 { EventStages::PostOnly } else { EventStages::NoStages } - } - _ => panic!("not recharge") + }, + _ => EventStages::NoStages, }; results.push(Resolution::new(source, target).event(e).stages(stages)); return results;; @@ -1728,7 +1728,7 @@ fn recharge(source: &mut Construct, target: &mut Construct, mut results: Resolut if red > 0 || blue > 0 { EventStages::AllStages } else { EventStages::StartEnd } } - _ => panic!("not recharge") + _ => EventStages::NoStages, }; results.push(Resolution::new(source, target).event(e).stages(stages)); return results;