wht
This commit is contained in:
parent
3088d104da
commit
e95d559edd
@ -81,15 +81,10 @@ function Construct(props) {
|
||||
sendUnequip,
|
||||
} = 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) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
if (equipping) sendVboxApply(construct.id, itemEquip);
|
||||
if (itemEquip !== null) sendVboxApply(construct.id, itemEquip);
|
||||
setItemEquip(null);
|
||||
return setActiveConstruct(construct);
|
||||
}
|
||||
@ -128,11 +123,13 @@ function Construct(props) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const classes = `${equipping ? 'equipping' : ''}`;
|
||||
// const action = skill ? '' : 'action';
|
||||
const equip = skillList.includes(vbox.bound[itemEquip]) && !skill ? 'equipping' : '';
|
||||
const classes = `${equip}`;
|
||||
return (
|
||||
<button
|
||||
key={i}
|
||||
disabled={!skill && !equipping}
|
||||
disabled={!skill && itemEquip === null}
|
||||
class={classes}
|
||||
onClick={skillClick}
|
||||
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];
|
||||
|
||||
if (!s) {
|
||||
@ -155,6 +152,8 @@ function Construct(props) {
|
||||
);
|
||||
}
|
||||
|
||||
const specInfo = itemInfo.items.find(i => i.item === s);
|
||||
|
||||
function specClick(e) {
|
||||
e.stopPropagation();
|
||||
setItemUnequip(s);
|
||||
|
||||
@ -4,6 +4,8 @@ const actions = require('./actions');
|
||||
function setupKeys(store) {
|
||||
console.log('binding keys');
|
||||
key.unbind('esc');
|
||||
|
||||
key('esc', () => document.activeElement.blur());
|
||||
key('esc', () => store.dispatch(actions.setCombiner([])));
|
||||
key('esc', () => store.dispatch(actions.setReclaiming(false)));
|
||||
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 {
|
||||
true => {
|
||||
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.player_ready(bot_id)?;
|
||||
|
||||
instance.open = false;
|
||||
|
||||
instance
|
||||
},
|
||||
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));
|
||||
}
|
||||
|
||||
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)?;
|
||||
|
||||
instance.add_player(player)?;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user