wht
This commit is contained in:
parent
3088d104da
commit
e95d559edd
@ -81,15 +81,10 @@ function Construct(props) {
|
|||||||
sendUnequip,
|
sendUnequip,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const fullInfo = itemInfo.items.find(i => i.item === itemEquip);
|
|
||||||
const isSkill = fullInfo && fullInfo.skill;
|
|
||||||
const isSpec = fullInfo && fullInfo.spec;
|
|
||||||
const equipping = itemEquip && (isSkill || isSpec);
|
|
||||||
|
|
||||||
function onClick(e) {
|
function onClick(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (equipping) sendVboxApply(construct.id, itemEquip);
|
if (itemEquip !== null) sendVboxApply(construct.id, itemEquip);
|
||||||
setItemEquip(null);
|
setItemEquip(null);
|
||||||
return setActiveConstruct(construct);
|
return setActiveConstruct(construct);
|
||||||
}
|
}
|
||||||
@ -128,11 +123,13 @@ function Construct(props) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const classes = `${equipping ? 'equipping' : ''}`;
|
// const action = skill ? '' : 'action';
|
||||||
|
const equip = skillList.includes(vbox.bound[itemEquip]) && !skill ? 'equipping' : '';
|
||||||
|
const classes = `${equip}`;
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
key={i}
|
key={i}
|
||||||
disabled={!skill && !equipping}
|
disabled={!skill && itemEquip === null}
|
||||||
class={classes}
|
class={classes}
|
||||||
onClick={skillClick}
|
onClick={skillClick}
|
||||||
onDblClick={skillDblClick}
|
onDblClick={skillDblClick}
|
||||||
@ -142,7 +139,7 @@ function Construct(props) {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const specs = range(0, 3).map(i => {
|
const specs = range(0, 6).map(i => {
|
||||||
const s = construct.specs[i];
|
const s = construct.specs[i];
|
||||||
|
|
||||||
if (!s) {
|
if (!s) {
|
||||||
@ -155,6 +152,8 @@ function Construct(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const specInfo = itemInfo.items.find(i => i.item === s);
|
||||||
|
|
||||||
function specClick(e) {
|
function specClick(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setItemUnequip(s);
|
setItemUnequip(s);
|
||||||
|
|||||||
@ -4,6 +4,8 @@ const actions = require('./actions');
|
|||||||
function setupKeys(store) {
|
function setupKeys(store) {
|
||||||
console.log('binding keys');
|
console.log('binding keys');
|
||||||
key.unbind('esc');
|
key.unbind('esc');
|
||||||
|
|
||||||
|
key('esc', () => document.activeElement.blur());
|
||||||
key('esc', () => store.dispatch(actions.setCombiner([])));
|
key('esc', () => store.dispatch(actions.setCombiner([])));
|
||||||
key('esc', () => store.dispatch(actions.setReclaiming(false)));
|
key('esc', () => store.dispatch(actions.setReclaiming(false)));
|
||||||
key('esc', () => store.dispatch(actions.setActiveSkill(null)));
|
key('esc', () => store.dispatch(actions.setActiveSkill(null)));
|
||||||
|
|||||||
@ -697,7 +697,7 @@ pub fn instances_idle(tx: &mut Transaction) -> Result<Vec<Instance>, Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn instance_new(tx: &mut Transaction, account: &Account, construct_ids: Vec<Uuid>, name: String, pve: bool, password: Option<String>) -> Result<Instance, Error> {
|
pub fn instance_new(tx: &mut Transaction, account: &Account, construct_ids: Vec<Uuid>, name: String, pve: bool, _password: Option<String>) -> Result<Instance, Error> {
|
||||||
let mut instance = match pve {
|
let mut instance = match pve {
|
||||||
true => {
|
true => {
|
||||||
let bot = bot_player();
|
let bot = bot_player();
|
||||||
@ -716,6 +716,8 @@ pub fn instance_new(tx: &mut Transaction, account: &Account, construct_ids: Vec<
|
|||||||
instance.add_player(bot)?;
|
instance.add_player(bot)?;
|
||||||
instance.player_ready(bot_id)?;
|
instance.player_ready(bot_id)?;
|
||||||
|
|
||||||
|
instance.open = false;
|
||||||
|
|
||||||
instance
|
instance
|
||||||
},
|
},
|
||||||
false => Instance::new()
|
false => Instance::new()
|
||||||
@ -738,6 +740,10 @@ pub fn instance_join(tx: &mut Transaction, account: &Account, instance_id: Uuid,
|
|||||||
return Err(format_err!("incorrect player size. ({:})", 3));
|
return Err(format_err!("incorrect player size. ({:})", 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if instance.players.len() >= instance.max_players {
|
||||||
|
return Err(err_msg("game is full"));
|
||||||
|
}
|
||||||
|
|
||||||
let player = player_create(tx, Player::new(account.id, &account.name, constructs), instance.id, account)?;
|
let player = player_create(tx, Player::new(account.id, &account.name, constructs), instance.id, account)?;
|
||||||
|
|
||||||
instance.add_player(player)?;
|
instance.add_player(player)?;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user