Skip to content

Commit

Permalink
fix for fblo drag handle bug (#14993)
Browse files Browse the repository at this point in the history
* better wording for different dev versions
* drag handle now shown on external mods that can be moved
  • Loading branch information
insomnious authored Dec 11, 2023
1 parent 0a4f6f2 commit eb62129
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/app/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ class Application {
const state: IState = this.mStore.getState();
const lastVersion = state.app.appVersion || '0.0.0';

if (this.mFirstStart || (currentVersion === '0.0.1')) {
if (this.mFirstStart || (process.env.NODE_ENV === 'development')) {
// don't check version change in development builds or on first start
return Promise.resolve();
}
Expand Down
12 changes: 7 additions & 5 deletions src/extensions/about_dialog/views/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ class AboutPage extends ComponentEx<IProps, IComponentState> {
public componentDidMount() {
this.mMounted = true;

//this.mVersion = '1.8.5'; // force this to test

if (this.mVersion === '0.0.1') {
this.nextState.tag = 'Development';
// removing version check when in dev mode and moved to NODE_ENV instead
if (process.env.NODE_ENV === 'development') {
this.nextState.tag = 'Dev';
} else {
// if not development, lets see what is on github to determine if we are stable, beta or preview
github.releases()
.then(releases => {
if (this.mMounted) {
Expand All @@ -82,7 +82,9 @@ class AboutPage extends ComponentEx<IProps, IComponentState> {
this.nextState.changelog = thisRelease.body;
this.nextState.tag = thisRelease.prerelease ? 'Beta' : undefined;
} else {
this.nextState.tag = 'Unknown';
// no release found on github, so it's packaged but not distributed properly yet
// this could be on the mystery Next repo for testing
this.nextState.tag = 'Preview';
}
} catch (err) {
log('warn', 'Failed to parse release info', err.message);
Expand Down
9 changes: 5 additions & 4 deletions src/extensions/file_based_loadorder/views/ItemRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,19 @@ class ItemRenderer extends ComponentEx<IProps, {}> {
<Icon className='locked-entry-logo' name='locked'/>
) : null;

const dragHandleClasses = this.isLocked(item)
? 'drag-handle-icon undraggable' : 'drag-handle-icon';

return (
<ListGroupItem
key={key}
className={classes.join(' ')}
ref={this.props.item.setRef}
>
<Icon className='drag-handle-icon' name='drag-handle'/>
<Icon className={dragHandleClasses} name='drag-handle'/>
<p className='load-order-index'>{position}</p>
{this.renderValidationError()}

<p className='load-order-name'>{key}</p>

<p className='load-order-name'>{key}</p>
{this.renderExternalBanner(item)}
{checkBox()}
{lock()}
Expand Down
4 changes: 4 additions & 0 deletions src/extensions/mod_load_order/views/DefaultItemRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,17 @@ class DefaultItemRenderer extends ComponentEx<IProps, {}> {
)
: null;

const dragHandleClasses = item.locked
? 'drag-handle-icon undraggable' : 'drag-handle-icon';

return (
<ListGroupItem
ref={this.setRef}
key={key}
className={classes.join(' ')}
onContextMenu={this.props.onContextMenu}
>
<Icon className={dragHandleClasses} name='drag-handle'/>
<p className='load-order-index'>{position}</p>
<div>
{(!!item?.external) && this.renderExternalBanner()}
Expand Down
13 changes: 7 additions & 6 deletions src/stylesheets/vortex/page-mod-load-order.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
.entry-checkbox {
//margin-right: 15px;
//margin-left: auto;

// This shouldn't be necessary. But hey ho lets go.
&.disabled {
display: none;
Expand Down Expand Up @@ -106,12 +106,13 @@
background-color: $brand-primary;
}

&.external {

.drag-handle-icon {
visibility: hidden;
}
.drag-handle-icon.undraggable {
visibility: hidden;
//fill: red;
}

&.external {

.load-order-unmanaged-banner {

text-align: center;
Expand Down
2 changes: 1 addition & 1 deletion src/util/StyleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ if (ipcMain !== undefined) {
sassIndex = `$theme-path: "${pathToFileURL(themePath)}";\n` + sassIndex;

// development builds are always versioned as 0.0.1
const isDevel: boolean = getApplication().version === '0.0.1';
const isDevel: boolean = (process.env.NODE_ENV === 'development')

const assetsPath = path.join(getVortexPath('assets_unpacked'), 'css');
const modulesPath = getVortexPath('modules_unpacked');
Expand Down

0 comments on commit eb62129

Please sign in to comment.