mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Merge branch 'release/2.9.15'
This commit is contained in:
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "coriolis_shipyard",
|
"name": "coriolis_shipyard",
|
||||||
"version": "2.9.14",
|
"version": "2.9.15",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "coriolis_shipyard",
|
"name": "coriolis_shipyard",
|
||||||
"version": "2.9.14",
|
"version": "2.9.15",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/EDCD/coriolis"
|
"url": "https://github.com/EDCD/coriolis"
|
||||||
|
|||||||
@@ -355,6 +355,8 @@ export default class Coriolis extends React.Component {
|
|||||||
<footer>
|
<footer>
|
||||||
<div className="right cap">
|
<div className="right cap">
|
||||||
<a href="https://github.com/EDCD/coriolis" target="_blank" title="Coriolis Github Project">{window.CORIOLIS_VERSION} - {window.CORIOLIS_DATE}</a>
|
<a href="https://github.com/EDCD/coriolis" target="_blank" title="Coriolis Github Project">{window.CORIOLIS_VERSION} - {window.CORIOLIS_DATE}</a>
|
||||||
|
<br/>
|
||||||
|
<a href={"https://github.com/EDCD/coriolis/compare/edcd:develop@{" + window.CORIOLIS_DATE + "}...edcd:develop"} target="_blank" title={"Coriolis Commits since" + window.CORIOLIS_DATE}>Commits since last release ({window.CORIOLIS_DATE})</a>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</div>;
|
</div>;
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
|||||||
warning: PropTypes.func,
|
warning: PropTypes.func,
|
||||||
firstSlotId: PropTypes.string,
|
firstSlotId: PropTypes.string,
|
||||||
lastSlotId: PropTypes.string,
|
lastSlotId: PropTypes.string,
|
||||||
|
activeSlotId: PropTypes.string,
|
||||||
slotDiv: PropTypes.object
|
slotDiv: PropTypes.object
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -255,11 +256,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
|||||||
});
|
});
|
||||||
let eventHandlers;
|
let eventHandlers;
|
||||||
|
|
||||||
if (disabled || active) {
|
if (disabled) {
|
||||||
/**
|
|
||||||
* ToDo: possibly create an "activeSlotId" variable to allow
|
|
||||||
* focus to be set on active slot when slot menu is opened
|
|
||||||
*/
|
|
||||||
eventHandlers = {
|
eventHandlers = {
|
||||||
onKeyDown: this._keyDown.bind(this, null),
|
onKeyDown: this._keyDown.bind(this, null),
|
||||||
onKeyUp: this._keyUp.bind(this, null)
|
onKeyUp: this._keyUp.bind(this, null)
|
||||||
@@ -271,6 +268,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
|||||||
* Will be used to keep focus inside the <ul> on Tab and Shift-Tab while it is visible
|
* Will be used to keep focus inside the <ul> on Tab and Shift-Tab while it is visible
|
||||||
*/
|
*/
|
||||||
if (this.firstSlotId == null) this.firstSlotId = sortedModules[i].id;
|
if (this.firstSlotId == null) this.firstSlotId = sortedModules[i].id;
|
||||||
|
if (active) this.activeSlotId = sortedModules[i].id;
|
||||||
this.lastSlotId = sortedModules[i].id;
|
this.lastSlotId = sortedModules[i].id;
|
||||||
|
|
||||||
let showDiff = this._showDiff.bind(this, mountedModule, m);
|
let showDiff = this._showDiff.bind(this, mountedModule, m);
|
||||||
@@ -300,8 +298,8 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
|||||||
elems.push(<br key={'b' + m.grp + i} />);
|
elems.push(<br key={'b' + m.grp + i} />);
|
||||||
itemsOnThisRow = 0;
|
itemsOnThisRow = 0;
|
||||||
}
|
}
|
||||||
let tbIdx = (classes.indexOf('disabled') < 0 && classes.indexOf('active') < 0) ? 0 : undefined;
|
let tbIdx = (classes.indexOf('disabled') < 0) ? 0 : undefined;
|
||||||
elems.push(
|
elems.push(
|
||||||
<li key={m.id} data-id={m.id} className={classes} {...eventHandlers} tabIndex={tbIdx} ref={slotItem => this.slotItems[m.id] = slotItem}>
|
<li key={m.id} data-id={m.id} className={classes} {...eventHandlers} tabIndex={tbIdx} ref={slotItem => this.slotItems[m.id] = slotItem}>
|
||||||
{mount}
|
{mount}
|
||||||
{(mount ? ' ' : '') + m.class + m.rating + (m.missile ? '/' + m.missile : '') + (m.name ? ' ' + translate(m.name) : '')}
|
{(mount ? ' ' : '') + m.class + m.rating + (m.missile ? '/' + m.missile : '') + (m.name ? ' ' + translate(m.name) : '')}
|
||||||
@@ -372,7 +370,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
|||||||
|
|
||||||
_keyDown(select, event) {
|
_keyDown(select, event) {
|
||||||
var className = event.currentTarget.attributes['class'].value;
|
var className = event.currentTarget.attributes['class'].value;
|
||||||
if (event.key == 'Enter' && className.indexOf('disabled') < 0 && className.indexOf('active') < 0) {
|
if (event.key == 'Enter' && className.indexOf('disabled') < 0 && className.indexOf('active') < 0) {
|
||||||
select();
|
select();
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -452,28 +450,26 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
|||||||
/**
|
/**
|
||||||
* Scroll to mounted (if it exists) module group on mount
|
* Scroll to mounted (if it exists) module group on mount
|
||||||
*/
|
*/
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (this.groupElem) { // Scroll to currently selected group
|
if (this.groupElem) { // Scroll to currently selected group
|
||||||
this.node.scrollTop = this.groupElem.offsetTop;
|
this.node.scrollTop = this.groupElem.offsetTop;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
if (this.slotItems) {
|
* Set focus on active or first slot element, if applicable.
|
||||||
/**
|
*/
|
||||||
* Set focus on first focusable slot <li> after component mounts. May want to consider
|
if (this.slotItems[this.activeSlotId]) {
|
||||||
* changing this to the Active item instead.
|
this.slotItems[this.activeSlotId].focus();
|
||||||
*/
|
} else if (this.slotItems[this.firstSlotId]) {
|
||||||
this.slotItems[this.firstSlotId].focus();
|
this.slotItems[this.firstSlotId].focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
/**
|
||||||
|
* Set focus to slot element ref (if we have one) after modules component unmounts
|
||||||
|
*/
|
||||||
if(this.props.slotDiv) {
|
if(this.props.slotDiv) {
|
||||||
console.log("AvailableModulesMenu component will unmount. Set focus to slot");
|
|
||||||
this.props.slotDiv.focus();
|
this.props.slotDiv.focus();
|
||||||
} else {
|
|
||||||
console.log("AvailableModulesMenu component will unmount. No slotDiv prop present.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -505,6 +505,9 @@ export default class Header extends TranslatedComponent {
|
|||||||
return (
|
return (
|
||||||
<header>
|
<header>
|
||||||
{this.props.appCacheUpdate && <div id="app-update" onClick={() => window.location.reload() }>{translate('PHRASE_UPDATE_RDY')}</div>}
|
{this.props.appCacheUpdate && <div id="app-update" onClick={() => window.location.reload() }>{translate('PHRASE_UPDATE_RDY')}</div>}
|
||||||
|
{this.props.appCache ? <a className={"view-changes"} href={"https://github.com/EDCD/coriolis/compare/edcd:develop@{" + window.CORIOLIS_DATE + "}...edcd:develop"} target="_blank">
|
||||||
|
{"View Release Changes"}
|
||||||
|
</a> : null}
|
||||||
<Link className='l' href='/' style={{ marginRight: '1em' }} title='Home'><CoriolisLogo className='icon xl' /></Link>
|
<Link className='l' href='/' style={{ marginRight: '1em' }} title='Home'><CoriolisLogo className='icon xl' /></Link>
|
||||||
|
|
||||||
<div className='l menu'>
|
<div className='l menu'>
|
||||||
|
|||||||
@@ -407,6 +407,11 @@ export default class ModificationsMenu extends TranslatedComponent {
|
|||||||
let haveBlueprint = false;
|
let haveBlueprint = false;
|
||||||
let blueprintTt;
|
let blueprintTt;
|
||||||
let blueprintCv;
|
let blueprintCv;
|
||||||
|
//TODO: Fix this to actually find the correct blueprint.
|
||||||
|
if (!m.blueprint || !m.blueprint.name || !m.blueprint.fdname || !Modifications.modules[m.grp].blueprints || !Modifications.modules[m.grp].blueprints[m.blueprint.fdname]) {
|
||||||
|
this.props.ship.clearModuleBlueprint(m);
|
||||||
|
this.props.ship.clearModuleSpecial(m);
|
||||||
|
}
|
||||||
if (m.blueprint && m.blueprint.name && Modifications.modules[m.grp].blueprints[m.blueprint.fdname].grades[m.blueprint.grade]) {
|
if (m.blueprint && m.blueprint.name && Modifications.modules[m.grp].blueprints[m.blueprint.fdname].grades[m.blueprint.grade]) {
|
||||||
blueprintLabel = translate(m.blueprint.name) + ' ' + translate('grade') + ' ' + m.blueprint.grade;
|
blueprintLabel = translate(m.blueprint.name) + ' ' + translate('grade') + ' ' + m.blueprint.grade;
|
||||||
haveBlueprint = true;
|
haveBlueprint = true;
|
||||||
|
|||||||
@@ -437,12 +437,15 @@ export default class Ship {
|
|||||||
m.blueprint = bp;
|
m.blueprint = bp;
|
||||||
this.clearModifications(m);
|
this.clearModifications(m);
|
||||||
// Set any hidden items for the blueprint now
|
// Set any hidden items for the blueprint now
|
||||||
const features = m.blueprint.grades[m.blueprint.grade].features;
|
if (m.blueprint.grades[m.blueprint.grade] && m.blueprint.grades[m.blueprint.grade].features) {
|
||||||
for (const featureName in features) {
|
const features = m.blueprint.grades[m.blueprint.grade].features;
|
||||||
if (Modifications.modifications[featureName].hidden) {
|
for (const featureName in features) {
|
||||||
this.setModification(m, featureName, bp.grades[bp.grade].features[featureName][0]);
|
if (Modifications.modifications[featureName].hidden) {
|
||||||
|
this.setModification(m, featureName, bp.grades[bp.grade].features[featureName][0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateModificationsString();
|
this.updateModificationsString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,20 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.view-changes {
|
||||||
|
position: fixed;
|
||||||
|
top: 3em;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 3em;
|
||||||
|
z-index: 3;
|
||||||
|
line-height: 3em;
|
||||||
|
text-align: center;
|
||||||
|
background-color: @bg;
|
||||||
|
color: @warning;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
background-color: @bg;
|
background-color: @bg;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user