Skip to content

Commit

Permalink
Merge pull request DestinyItemManager#6550 from DestinyItemManager/re…
Browse files Browse the repository at this point in the history
…work-moves

Rework move amounts
  • Loading branch information
bhollis committed Mar 6, 2021
2 parents d29c9c6 + 0ade45d commit 66737cf
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 423 deletions.
12 changes: 1 addition & 11 deletions config/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@
},
"Help": {
"CannotMove": "Cannot move that item off this character.",
"Drag": "Hold shift to transfer a partial stack",
"NoStorage": "DIM can't store data",
"NoStorageMessage": "DIM can't store data in your browser. This can be caused by browsing in private or incognito mode, or when you have low disk space. You won't be able to log in to or use DIM."
},
Expand Down Expand Up @@ -594,10 +593,7 @@
"Weekly": "Weekly Challenge"
},
"MoveAmount": {
"DownStack": "Decrease down to the next full stack",
"MinusStack": "-Stack",
"PlusStack": "+Stack",
"UpStack": "Increase up to the next full stack"
"Amount": "Amount:"
},
"MovePopup": {
"Acquired": "This item is unlocked in collections.",
Expand Down Expand Up @@ -889,12 +885,6 @@
"UpdateErrorBody": "We had a problem saving your data to DIM Sync. We'll automatically try again later.",
"Usage": "DIM is using {{usage, humanBytes}} out of {{quota, humanBytes}} available to it on this device. This includes the downloaded Destiny item databases from Bungie.net."
},
"StoreBucket": {
"Add": "Add",
"FillStack": "Fill Stack ({{amount}})",
"HowMuch": "How many {{itemname}} to move?",
"Move": "Move"
},
"Tags": {
"Archive": "Archive",
"ClearTag": "Clear Tag",
Expand Down
2 changes: 0 additions & 2 deletions config/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,6 @@ module.exports = (env) => {
'$featureFlags.mobileInspect': JSON.stringify(true),
// Move the pull from button
'$featureFlags.movePullFromButton': JSON.stringify(env.dev),
// Enable move amounts
'$featureFlags.moveAmounts': JSON.stringify(env.release),
// Enable alternative inventory mode
'$featureFlags.altInventoryMode': JSON.stringify(!env.release),
// Enable search results
Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

* You can once again select how much of a stackable item to move, by editing the amount in the move popup before clicking a move button. Holding shift during drag no longer allows you to select the amount - you must do it from the buttons in the popup.

## 6.54.0 <span class="changelog-date">(2021-02-28)</span>

## 6.53.0 <span class="changelog-date">(2021-02-21)</span>
Expand Down
12 changes: 1 addition & 11 deletions src/app/inventory/DraggableInventoryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import clsx from 'clsx';
import React, { useRef, useState } from 'react';
import { ConnectDragSource, DragSource, DragSourceConnector, DragSourceSpec } from 'react-dnd';
import { BehaviorSubject } from 'rxjs';
import store from '../store/store';
import { stackableDrag } from './actions';
import { showDragGhost } from './drag-ghost-item';
import { DimItem } from './item-types';

Expand Down Expand Up @@ -54,10 +52,6 @@ const dragSpec: DragSourceSpec<Props, DragObject> = {
beginDrag(props) {
hideItemPopup();

if (props.item.maxStackSize > 1 && props.item.amount > 1 && !props.item.uniqueStack) {
store.dispatch(stackableDrag(true));
}

dragTimeout = requestAnimationFrame(() => {
dragTimeout = null;
document.body.classList.add('drag-perf-show');
Expand All @@ -68,15 +62,11 @@ const dragSpec: DragSourceSpec<Props, DragObject> = {
return { item: props.item };
},

endDrag(props) {
endDrag() {
if (dragTimeout !== null) {
cancelAnimationFrame(dragTimeout);
}

if (props.item.maxStackSize > 1 && props.item.amount > 1 && !props.item.uniqueStack) {
store.dispatch(stackableDrag(false));
}

document.body.classList.remove('drag-perf-show');

isDragging = false;
Expand Down
2 changes: 0 additions & 2 deletions src/app/inventory/Inventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { DestinyAccount } from '../accounts/destiny-account';
import GearPower from '../gear-power/GearPower';
import DragGhostItem from './DragGhostItem';
import { storesLoadedSelector } from './selectors';
import StackableDragHelp from './StackableDragHelp';
import { useLoadStores } from './store/hooks';

interface ProvidedProps {
Expand Down Expand Up @@ -57,7 +56,6 @@ function Inventory({ storesLoaded, account, isPhonePortrait }: Props) {
return (
<ErrorBoundary name="Inventory">
<Stores account={account} />
{$featureFlags.moveAmounts && <StackableDragHelp />}
<DragPerformanceFix />
{account.destinyVersion === 2 && <GearPower />}
{$featureFlags.mobileInspect && isPhonePortrait && <MobileInspect />}
Expand Down
23 changes: 0 additions & 23 deletions src/app/inventory/MoveAmountPopupContainer.scss

This file was deleted.

93 changes: 0 additions & 93 deletions src/app/inventory/MoveAmountPopupContainer.tsx

This file was deleted.

56 changes: 0 additions & 56 deletions src/app/inventory/StackableDragHelp.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions src/app/inventory/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,3 @@ export const setItemHashNote = createAction('tag_notes/SET_HASH_NOTE')<{

/** Clear out tags and notes for items that no longer exist. Argument is the list of inventory item IDs to remove. */
export const tagCleanup = createAction('tag_notes/CLEANUP')<string[]>();

/** Notify that a stackable stack has begun or ended dragging. A bit overkill to put this in redux but eh. */
export const stackableDrag = createAction('stackable_drag/DRAG')<boolean>();
1 change: 0 additions & 1 deletion src/app/inventory/move-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export function moveItemTo(

// Select how much of a stack to move
if (
$featureFlags.moveAmounts &&
chooseAmount &&
item.maxStackSize > 1 &&
item.amount > 1 &&
Expand Down
11 changes: 0 additions & 11 deletions src/app/inventory/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ export interface InventoryState {
*/
readonly newItems: Set<string>;
readonly newItemsLoaded: boolean;

/** Are we currently dragging a stack? */
readonly isDraggingStack: boolean;
}

export type InventoryAction = ActionType<typeof actions>;
Expand All @@ -56,7 +53,6 @@ const initialState: InventoryState = {
currencies: [],
newItems: new Set(),
newItemsLoaded: false,
isDraggingStack: false,
};

export const inventory: Reducer<InventoryState, InventoryAction | AccountsAction> = (
Expand Down Expand Up @@ -119,13 +115,6 @@ export const inventory: Reducer<InventoryState, InventoryAction | AccountsAction
newItems: new Set(),
};

// Stack dragging
case getType(actions.stackableDrag):
return {
...state,
isDraggingStack: action.payload,
};

case getType(setCurrentAccount):
return initialState;

Expand Down
9 changes: 2 additions & 7 deletions src/app/item-actions/ItemMoveLocations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,8 @@ export default function ItemMoveLocations({
</>
)}

{$featureFlags.moveAmounts && item.destinyVersion === 1 && maximum > 1 && (
<ItemMoveAmount
amount={amount}
maximum={maximum}
maxStackSize={item.maxStackSize}
onAmountChanged={setAmount}
/>
{maximum > 1 && (
<ItemMoveAmount amount={amount} maximum={maximum} onAmountChanged={setAmount} />
)}
</>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/item-popup/DesktopItemActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default function DesktopItemActions({ item }: { item: DimItem }) {
<LoadoutActionButton item={item} label={!sidecarCollapsed} />
<InfuseActionButton item={item} label={!sidecarCollapsed} />

{!sidecarCollapsed && <ItemMoveLocations item={item} splitVault={true} />}
{!sidecarCollapsed && <ItemMoveLocations key={item.index} item={item} splitVault={true} />}
</div>
);
}
11 changes: 11 additions & 0 deletions src/app/item-popup/ItemMoveAmount.m.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.moveAmount {
margin: 6px 8px;
display: flex;
flex-direction: column;
label {
margin-bottom: 2px;
}
input[type='text'] {
width: 3em;
}
}
7 changes: 7 additions & 0 deletions src/app/item-popup/ItemMoveAmount.m.scss.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file is automatically generated.
// Please do not change this file!
interface CssExports {
'moveAmount': string;
}
export const cssExports: CssExports;
export default cssExports;
28 changes: 0 additions & 28 deletions src/app/item-popup/ItemMoveAmount.scss

This file was deleted.

Loading

0 comments on commit 66737cf

Please sign in to comment.