Merge branch 'develop' into force-landscape

This commit is contained in:
ntr 2019-11-05 12:35:27 +11:00
commit 06a62ca3ae
21 changed files with 214 additions and 120 deletions

View File

@ -1 +1 @@
1.7.0
1.7.1

View File

@ -36,7 +36,6 @@
- Strike + SpeedRR -> StrikeSpeed (strike has Y% more speed)
- Strike + LifeRR -> StrikeLife (Strike recharges X% of damage as red life)
* equip from shop (buy and equip without putting in your inventory) for bases
* move item from one construct to another
* ACP
@ -89,7 +88,6 @@ $$$
* Highlight (dota) colour
* fx colours + styles
* ??? (PROBS NOT) drag and drop buy / equip / unequip items ???
* modules
* troll life -> dmg
* prince of peace

View File

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

View File

@ -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 {

View File

@ -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 {

View File

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

View File

@ -1,4 +1,5 @@
module.exports = { // This will need to be edited if we change server recipes
// This will need to be edited if we change server recipes
module.exports = {
// Attack
Strike: () => 'red-border',
Blast: () => 'blue-border',
@ -7,7 +8,7 @@ module.exports = { // This will need to be edited if we change server recipes
Slay: () => 'red-green-border',
Siphon: () => 'blue-green-border',
// Stun
Link: () => 'blue-greenborder',
Link: () => 'blue-green-border',
Bash: () => 'red-border',
Sleep: () => 'green-border',
Ruin: () => 'blue-border',
@ -31,9 +32,9 @@ module.exports = { // This will need to be edited if we change server recipes
Restrict: () => 'red-border',
Purge: () => 'green-border',
Silence: () => 'blue-border',
Curse: () => 'red-green-border',
Invert: () => 'red-green-border',
Decay: () => 'blue-green-border',
Invert: () => 'red-blue-border',
Curse: () => 'red-blue-border',
// // Lifes Upgrades
// LifeGG: () => 'green-border',

View File

@ -20,9 +20,15 @@ const addState = connect(
account,
itemInfo,
itemEquip,
itemUnequip,
vboxSelected,
tutorial,
} = state;
function sendVboxAcceptEquip(constructId) {
return ws.sendVboxAcceptEquip(instance.id, vboxSelected[0], vboxSelected[1], constructId);
}
function sendVboxApply(constructId, i) {
return ws.sendVboxApply(instance.id, constructId, i);
}
@ -31,14 +37,22 @@ const addState = connect(
return ws.sendVboxUnequip(instance.id, constructId, item);
}
function sendVboxUnequipApply(targetConstructId) {
return ws.sendVboxUnequipApply(instance.id, itemUnequip[0], itemUnequip[1], targetConstructId);
}
return {
instance,
player,
account,
sendVboxAcceptEquip,
sendVboxUnequipApply,
sendVboxApply,
itemInfo,
itemEquip,
itemUnequip,
sendUnequip,
vboxSelected,
tutorial,
};
},
@ -75,20 +89,23 @@ function Construct(props) {
construct,
iter,
itemEquip,
itemUnequip,
instance,
player,
vboxSelected,
tutorial,
// Static Info
itemInfo,
// Function Calls
sendVboxApply,
sendVboxAcceptEquip,
sendVboxUnequipApply,
sendUnequip,
setActiveConstruct,
setItemUnequip,
setItemEquip,
setInfo,
} = props;
const { vbox } = player;
const duplicateSkill = construct.skills.length !== 0 && construct.skills.every(sk => {
@ -97,14 +114,16 @@ function Construct(props) {
return sk.skill === vbox.bound[itemEquip];
});
const tutorialDisableEquip = tutorialShouldDisableEquip(tutorial, iter, instance, construct);
function onClick(e) {
e.stopPropagation();
e.preventDefault();
if (duplicateSkill || tutorialDisableEquip) return true;
if (itemEquip !== null) sendVboxApply(construct.id, itemEquip);
if (itemEquip !== null) return sendVboxApply(construct.id, itemEquip);
if (vboxSelected[0]) return sendVboxAcceptEquip(construct.id);
if (itemUnequip.length && itemUnequip[0] !== construct.id) return sendVboxUnequipApply(construct.id);
setItemEquip(null);
return setActiveConstruct(construct);
setItemUnequip([]);
return true;
}
function hoverInfo(e, info) {
@ -151,6 +170,10 @@ function Construct(props) {
const classes = `${equipping ? 'equipping' : ''} ${!skill ? 'empty' : ''} ${border()}`;
return (
<label onDragStart={ev => {
ev.dataTransfer.setData('text', '');
skillClick(ev);
}} key={i} draggable="true" onDragEnd={() => setItemUnequip([])}>
<button
key={i}
disabled={!skill && !equipping}
@ -160,6 +183,7 @@ function Construct(props) {
onMouseOver={e => hoverInfo(e, skill && skill.skill)} >
{s}
</button>
</label>
);
});
@ -193,6 +217,7 @@ function Construct(props) {
return (
<label onDragStart={specClick} key={i} draggable="true" onDragEnd={() => setItemUnequip([])}>
<button
key={i}
onClick={specClick}
@ -200,6 +225,7 @@ function Construct(props) {
onMouseOver={e => hoverInfo(e, s)} >
{shapes[s]()}
</button>
</label>
);
});
@ -221,7 +247,7 @@ function Construct(props) {
const classes = `instance-construct`;
const avatarMouseOver = e => hoverInfo(e, `constructAvatar ${construct.name}`);
return (
<div key={construct.id} class={classes} onClick={onClick}>
<div key={construct.id} class={classes} onClick={onClick} onDragOver={ev => ev.preventDefault()} onDrop={onClick}>
<ConstructAvatar construct={construct} mouseOver={avatarMouseOver}/>
<h2 class="name" onMouseOver={e => hoverInfo(e, `constructName ${construct.name}`)}>{construct.name}</h2>
<div class="skills" onMouseOver={e => hoverInfo(e, 'constructSkills')} >
@ -240,10 +266,12 @@ function Construct(props) {
class InstanceConstructs extends preact.Component {
shouldComponentUpdate(newProps) {
if (newProps.itemEquip !== this.props.itemEquip) return true;
if (newProps.itemUnequip !== this.props.itemUnequip) return true;
if (newProps.tutorial !== this.props.tutorial) return true;
// JSON or Array objects
if (newProps.player !== this.props.player) return true;
if (newProps.instance !== this.props.instance) return true;
if (newProps.vboxSelected !== this.props.vboxSelected) return true;
return false;
}
@ -251,15 +279,19 @@ class InstanceConstructs extends preact.Component {
const {
// Changing state variables
itemEquip,
itemUnequip,
instance,
player,
tutorial,
vboxSelected,
// Static data
itemInfo,
// Function calls
setInfo,
setActiveConstruct,
sendVboxApply,
sendVboxAcceptEquip,
sendVboxUnequipApply,
setVboxHighlight,
setItemUnequip,
setItemEquip,
@ -277,16 +309,20 @@ class InstanceConstructs extends preact.Component {
iter: i,
construct: player.constructs[i],
itemEquip,
itemUnequip,
instance,
setItemUnequip,
setItemEquip,
player,
sendVboxApply,
sendVboxAcceptEquip,
sendVboxUnequipApply,
setInfo,
setActiveConstruct,
itemInfo,
setVboxHighlight,
sendUnequip,
vboxSelected,
tutorial,
});
});

View File

@ -28,6 +28,7 @@ const addState = connect(
}
function sendVboxAccept(group, index) {
document.activeElement.blur();
return ws.sendVboxAccept(instance.id, group, index);
}
@ -190,8 +191,6 @@ class Vbox extends preact.Component {
e.stopPropagation();
setItemEquip(null);
setCombiner([]);
if (selected) return clearVboxSelected();
setInfo(vbox.free[group][index]);
return setVboxSelected([group, index]);
}
@ -213,28 +212,20 @@ class Vbox extends preact.Component {
const classes = `${v.toLowerCase()} ${selected ? 'highlight' : ''} ${comboHighlight}`;
if (shapes[v]) {
const vboxObject = shapes[v] ? shapes[v]() : v;
return (
<label draggable='true'
onDragStart={ev => ev.dataTransfer.setData('text', '')}
onDragEnd={clearVboxSelected}>
<button
class={classes}
onMouseOver={e => vboxHover(e, v)}
onMouseDown={onClick}
onClick={e => e.stopPropagation()}
onDblClick={onDblClick} >
{shapes[v]()}
</button>
);
}
return (
<button
class={classes}
onMouseDown={onClick}
onClick={e => e.stopPropagation()}
onDblClick={onDblClick}
onMouseOver={e => vboxHover(e, v)}>
{v}
> {vboxObject}
</button>
</label>
);
}
@ -314,7 +305,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);
@ -330,26 +322,22 @@ 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]) {
const invObject = shapes[v] ? shapes[v]() : v;
return (
<label
draggable='true'
onDragStart={ev => ev.dataTransfer.setData('text', '')}
onDragEnd={() => combinerChange([])}>
<button
class={classes}
onMouseOver={e => vboxHover(e, v)}
onClick={e => e.stopPropagation()}
onMouseDown={onClick}>
{shapes[v]()}
</button>
);
}
return (
<button
class={classes}
onMouseDown={onClick}
onClick={e => e.stopPropagation()}
onMouseOver={e => vboxHover(e, v)}>
{v}
{invObject}
</button>
</label>
);
}
@ -404,7 +392,10 @@ class Vbox extends preact.Component {
<div class={inventoryClass}
onMouseDown={inventoryClick}
onClick={e => e.stopPropagation()}
style={vboxSelecting || (itemUnequip.length) ? { cursor: 'pointer' } : null}>
style={vboxSelecting || (itemUnequip.length) ? { cursor: 'pointer' } : null}
onDragOver={ev => ev.preventDefault()}
onDrop={inventoryClick}
>
<div class="vbox-hdr">
<h3
onTouchStart={e => e.target.scrollIntoView(true)}

View File

@ -190,6 +190,7 @@ function registerEvents(store) {
store.dispatch(actions.setItemEquip(null));
store.dispatch(actions.setItemUnequip([]));
store.dispatch(actions.setVboxHighlight([]));
store.dispatch(actions.setVboxSelected([]));
}
function setAccountInstances(v) {

View File

@ -82,6 +82,11 @@ function createSocket(events) {
events.clearInstance();
}
function sendVboxAcceptEquip(instanceId, group, index, constructId) {
send(['VboxAcceptEquip', { instance_id: instanceId, group, index, construct_id: constructId }]);
events.clearInstance();
}
function sendVboxApply(instanceId, constructId, index) {
send(['VboxApply', { instance_id: instanceId, construct_id: constructId, index }]);
events.clearInstance();
@ -92,6 +97,11 @@ function createSocket(events) {
events.clearInstance();
}
function sendVboxUnequipApply(instanceId, constructId, target, targetConstructId) {
send(['VboxUnequipApply', { instance_id: instanceId, construct_id: constructId, target, target_construct_id: targetConstructId }]);
events.clearInstance();
}
function sendVboxDiscard(instanceId) {
send(['VboxDiscard', { instance_id: instanceId }]);
events.clearInstance();
@ -99,7 +109,7 @@ function createSocket(events) {
function sendVboxCombine(instanceId, indices) {
send(['VboxCombine', { instance_id: instanceId, indices }]);
events.clearCombiner();
events.clearInstance();
}
function sendVboxReclaim(instanceId, index) {
@ -382,11 +392,13 @@ function createSocket(events) {
sendInstanceChat,
sendVboxAccept,
sendVboxAcceptEquip,
sendVboxApply,
sendVboxReclaim,
sendVboxCombine,
sendVboxDiscard,
sendVboxUnequip,
sendVboxUnequipApply,
sendItemInfo,

View File

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

View File

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

View File

@ -67,13 +67,13 @@ pub fn select(db: &Db, id: Uuid) -> Result<Account, Error> {
pub fn chat_wheel(_db: &Db, _id: Uuid) -> Result<Vec<String>, Error> {
return Ok(vec![
"gl".to_string(),
"hf".to_string(),
"gg".to_string(),
"thx".to_string(),
"nice".to_string(),
"glhf".to_string(),
"hmm".to_string(),
"ok".to_string(),
"rekt".to_string(),
"thx".to_string(),
"nice".to_string(),
"...".to_string(),
])
}

View File

@ -274,6 +274,10 @@ pub fn smile(id: Uuid) -> Result<Uuid, Error> {
("M0,0 L50,25 M50,0 L0,25", 1), // x
("M0,0 L50,12.5 L0,25", 1), // >
("M50,0 L0,12.5 L50,25", 1), // <
("M0,0 L0,25 L50,25", 1), // L
("M50,0 L50,25 L0,25", 1), // J
("M0,0 L50,0 M50,6.25 L50,12.5 M50,18.75 L50,25", 1), // ;
("M12.5,0 L37.5,0 L37.5,25 L12.5,25 L12.5,0", 1), // o
];
let eye_left_dist = WeightedIndex::new(eyes_left.iter().map(|v| v.1))?;
@ -283,10 +287,14 @@ pub fn smile(id: Uuid) -> Result<Uuid, Error> {
("M150,0 L175,25 L200,0", 1), // v
("M150,25 L175,0 L200,25", 1), // ^
("M150,0 L200,0", 1), // -
("M150,25 L200,25", 1), // -
("M150,25 L200,25", 1), // _
("M150,0 L200,25 M200,0 L150,25", 1), // x
("M150,0 L200,12.5 L150,25", 1), // >
("M200,0 L150,12.5 L200,25", 1), // <
("M150,0 L150,25 L200,25", 1), // L
("M200,0 L200,25 L150,25", 1), // J
("M150,0 L200,0 M150,6.25 L150,12.5 M150,18.75 L150,25", 1), // ;
("M162.5,0 L187.5,0 L187.5,25 L162.5,25 L162.5,0", 1), // o
];
let eye_right_dist= WeightedIndex::new(eyes_right.iter().map(|v| v.1))?;
@ -297,8 +305,15 @@ pub fn smile(id: Uuid) -> Result<Uuid, Error> {
("M50,75 L150,75 L150,100 L50,100 L50,75", 1), // box
("M50,75 L75,100 L100,75 L125,100 L150,75", 1), // w
("M50,75 L75,75 L75,87.5 M75,75 L125,75 L125,87.5 M125,75 L150,75", 1), // vamp
("M50,75 L150,75 M50,75 L50,87.5 M75,75 L75,87.5 M100,75 L100,87.5 M125,75 L125,87.5 M150,75 L150,87.5", 1), // mm
("M75,75 L125,75 L125,100 L75,100 L75,75", 1), // o
("M50,75 L150,100 M150,75 L50,100", 1), // x
("M50,75 L150,75 L150,100 L125,100 L125,75", 1), // p
("M50,75 L150,75 M50,75 L50,100 L75,100 L75,75", 1), // d
// ("M50,75 L50,100 L150,100 L150,75", 1), // u
("M50,100 L50,75 L150,75 L150,100", 1), // n
("M50,75 L50,100 L150,75 L150,100", 1), // Z
("M50,87.5 L100,75 L150,87.5 L100,100 L50,87.5", 1), // Z
];
let mouth_dist = WeightedIndex::new(mouths.iter().map(|v| v.1))?;

View File

@ -473,10 +473,10 @@ impl Instance {
Ok(self)
}
pub fn vbox_accept(mut self, account: Uuid, group: usize, index: usize) -> Result<Instance, Error> {
pub fn vbox_accept(mut self, account: Uuid, group: usize, index: usize, construct_id: Option<Uuid>) -> Result<Instance, Error> {
self.vbox_action_allowed(account)?;
self.account_player(account)?
.vbox_accept(group, index)?;
.vbox_accept(group, index, construct_id)?;
Ok(self)
}
@ -501,10 +501,10 @@ impl Instance {
Ok(self)
}
pub fn vbox_unequip(mut self, account: Uuid, target: Item, construct_id: Uuid) -> Result<Instance, Error> {
pub fn vbox_unequip(mut self, account: Uuid, target: Item, construct_id: Uuid, target_construct_id: Option<Uuid>) -> Result<Instance, Error> {
self.vbox_action_allowed(account)?;
self.account_player(account)?
.vbox_unequip(target, construct_id)?;
.vbox_unequip(target, construct_id, target_construct_id)?;
Ok(self)
}
}

View File

@ -943,6 +943,11 @@ impl Item {
}
}
// !!!!!!
// IF YOU CHANGE A COMBO
// BE SURE TO EDIT BUTTONS.JSX TOO
// !!!!!!
fn combo(&self) -> Vec<Item> {
match self {
Item::Intercept => vec![Item::Buff, Item::Red, Item::Red],

View File

@ -256,8 +256,12 @@ impl Player {
Ok(self)
}
pub fn vbox_accept(&mut self, group: usize, index: usize) -> Result<&mut Player, Error> {
self.vbox.accept(group, index)?;
pub fn vbox_accept(&mut self, group: usize, index: usize, construct_id: Option<Uuid>) -> Result<&mut Player, Error> {
self.vbox.accept(group, index, construct_id)?;
if construct_id.is_some() {
let equip_index = self.vbox.bound.len() - 1;
self.vbox_apply(equip_index, construct_id.expect("no construct"))?;
}
Ok(self)
}
@ -320,8 +324,8 @@ impl Player {
Ok(self)
}
pub fn vbox_unequip(&mut self, target: Item, construct_id: Uuid) -> Result<&mut Player, Error> {
if self.vbox.bound.len() >= 9 {
pub fn vbox_unequip(&mut self, target: Item, construct_id: Uuid, target_construct_id: Option<Uuid>) -> Result<&mut Player, Error> {
if self.vbox.bound.len() >= 9 && !target_construct_id.is_some() {
return Err(err_msg("too many items bound"));
}
@ -354,7 +358,12 @@ impl Player {
}
self.vbox.bound.push(target);
self.vbox.bound.sort_unstable();
if target_construct_id.is_some() {
let equip_index = self.vbox.bound.len() - 1;
self.vbox_apply(equip_index, target_construct_id.expect("no construct"))?;
}
// self.vbox.bound.sort_unstable();
Ok(self)
}

View File

@ -1,6 +1,5 @@
use std::time::{Instant};
use std::thread::{spawn, sleep};
use std::time;
use std::thread::{spawn};
use std::str;
@ -113,10 +112,12 @@ pub enum RpcRequest {
InstanceChat { instance_id: Uuid, index: usize },
VboxAccept { instance_id: Uuid, group: usize, index: usize },
VboxAcceptEquip { instance_id: Uuid, group: usize, index: usize, construct_id: Uuid },
VboxDiscard { instance_id: Uuid },
VboxCombine { instance_id: Uuid, indices: Vec<usize> },
VboxApply { instance_id: Uuid, construct_id: Uuid, index: usize },
VboxUnequip { instance_id: Uuid, construct_id: Uuid, target: Item },
VboxUnequipApply { instance_id: Uuid, construct_id: Uuid, target: Item, target_construct_id: Uuid },
VboxReclaim { instance_id: Uuid, index: usize },
}
@ -235,7 +236,10 @@ impl Connection {
Ok(instance_abandon(&mut tx, account, instance_id)?),
RpcRequest::VboxAccept { instance_id, group, index } =>
Ok(RpcMessage::InstanceState(vbox_accept(&mut tx, account, instance_id, group, index)?)),
Ok(RpcMessage::InstanceState(vbox_accept(&mut tx, account, instance_id, group, index, None)?)),
RpcRequest::VboxAcceptEquip { instance_id, group, index, construct_id } =>
Ok(RpcMessage::InstanceState(vbox_accept(&mut tx, account, instance_id, group, index, Some(construct_id))?)),
RpcRequest::VboxApply { instance_id, construct_id, index } =>
Ok(RpcMessage::InstanceState(vbox_apply(&mut tx, account, instance_id, construct_id, index)?)),
@ -250,7 +254,10 @@ impl Connection {
Ok(RpcMessage::InstanceState(vbox_reclaim(&mut tx, account, instance_id, index)?)),
RpcRequest::VboxUnequip { instance_id, construct_id, target } =>
Ok(RpcMessage::InstanceState(vbox_unequip(&mut tx, account, instance_id, construct_id, target)?)),
Ok(RpcMessage::InstanceState(vbox_unequip(&mut tx, account, instance_id, construct_id, target, None)?)),
RpcRequest::VboxUnequipApply { instance_id, construct_id, target, target_construct_id } =>
Ok(RpcMessage::InstanceState(vbox_unequip(&mut tx, account, instance_id, construct_id, target, Some(target_construct_id))?)),
RpcRequest::MtxConstructSpawn {} =>
Ok(RpcMessage::ConstructSpawn(mtx::new_construct(&mut tx, account)?)),

View File

@ -1392,7 +1392,10 @@ fn sustain(source: &mut Construct, target: &mut Construct, mut results: Resoluti
if red > 0 || blue > 0 { EventStages::PostOnly }
else { EventStages::NoStages }
}
_ => panic!("not recharge")
_ => {
warn!("no recharge event found {:?}", e);
EventStages::NoStages
}
};
results.push(Resolution::new(source, target).event(e).stages(stages));
@ -1411,7 +1414,10 @@ fn intercept(source: &mut Construct, target: &mut Construct, mut results: Resolu
if red > 0 || blue > 0 { EventStages::PostOnly }
else { EventStages::NoStages }
}
_ => panic!("not recharge")
_ => {
warn!("no recharge event found {:?}", e);
EventStages::NoStages
}
};
results.push(Resolution::new(source, target).event(e).stages(stages));
@ -1713,7 +1719,10 @@ fn reflect(source: &mut Construct, target: &mut Construct, mut results: Resoluti
if red > 0 || blue > 0 { EventStages::PostOnly }
else { EventStages::NoStages }
}
_ => panic!("not recharge")
_ => {
warn!("no recharge event found {:?}", e);
EventStages::NoStages
}
};
results.push(Resolution::new(source, target).event(e).stages(stages));
return results;;
@ -1728,7 +1737,10 @@ fn recharge(source: &mut Construct, target: &mut Construct, mut results: Resolut
if red > 0 || blue > 0 { EventStages::AllStages }
else { EventStages::StartEnd }
}
_ => panic!("not recharge")
_ => {
warn!("no recharge event found {:?}", e);
EventStages::NoStages
}
};
results.push(Resolution::new(source, target).event(e).stages(stages));
return results;

View File

@ -99,8 +99,8 @@ impl Vbox {
self
}
pub fn accept(&mut self, i: usize, j: usize) -> Result<&mut Vbox, Error> {
if self.bound.len() >= 9 {
pub fn accept(&mut self, i: usize, j: usize, construct_id: Option<Uuid>) -> Result<&mut Vbox, Error> {
if self.bound.len() >= 9 && !construct_id.is_some() {
return Err(err_msg("too many items bound"));
}
@ -130,7 +130,7 @@ impl Vbox {
pub fn bot_accept(&mut self, i: usize) -> Result<&mut Vbox, Error> {
let buy_index = self.free[i].iter().position(|item| item.is_some());
self.accept(i, buy_index.expect("no valid buys"))
self.accept(i, buy_index.expect("no valid buys"), None)
}
pub fn reclaim(&mut self, i: usize) -> Result<&mut Vbox, Error> {
@ -181,9 +181,9 @@ pub fn vbox_discard(tx: &mut Transaction, account: &Account, instance_id: Uuid)
return instance_update(tx, instance);
}
pub fn vbox_accept(tx: &mut Transaction, account: &Account, instance_id: Uuid, group: usize, index: usize) -> Result<Instance, Error> {
pub fn vbox_accept(tx: &mut Transaction, account: &Account, instance_id: Uuid, group: usize, index: usize, construct_id: Option<Uuid>) -> Result<Instance, Error> {
let instance = instance_get(tx, instance_id)?
.vbox_accept(account.id, group, index)?;
.vbox_accept(account.id, group, index, construct_id)?;
return instance_update(tx, instance);
}
@ -205,9 +205,9 @@ pub fn vbox_apply(tx: &mut Transaction, account: &Account, instance_id: Uuid, co
return instance_update(tx, instance);
}
pub fn vbox_unequip(tx: &mut Transaction, account: &Account, instance_id: Uuid, construct_id: Uuid, target: Item) -> Result<Instance, Error> {
pub fn vbox_unequip(tx: &mut Transaction, account: &Account, instance_id: Uuid, construct_id: Uuid, target: Item, target_construct_id: Option<Uuid>) -> Result<Instance, Error> {
let instance = instance_get(tx, instance_id)?
.vbox_unequip(account.id, target, construct_id)?;
.vbox_unequip(account.id, target, construct_id, target_construct_id)?;
return instance_update(tx, instance);
}