Skip to content

Commit

Permalink
Added refresh function
Browse files Browse the repository at this point in the history
  • Loading branch information
apedley committed Sep 25, 2022
1 parent 4a15c50 commit 23b90ab
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.2.1 - 2022-09-25 - Refresh Items

- Added a function to refresh items

### 1.2.0 - 2022-09-24 - Always Listening

- Added a toggle-able `Always Listening` mode
Expand Down
3 changes: 3 additions & 0 deletions src/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ <h2>Custom Voice Commands</h2>
<li class="form-row">
<label for="stopFarming">Stop farming mode: </label><input id="stopFarming" type="text" />
</li>
<li class="form-row">
<label for="refresh">Refresh: </label><input id="refresh" type="text" />
</li>
</ul>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/ts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const DEFAULT_COMMANDS: Record<string, string[]> = {
postmaster: ['collect postmaster'],
startFarming: ['start farming mode'],
stopFarming: ['stop farming mode'],
refresh: ['refresh']
};

export type AlwaysListening = {
Expand Down
8 changes: 8 additions & 0 deletions src/ts/voiceDim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ const potentialActions: ActionFunction = {
store: handleStoreItem,
startFarming: handleStartFarmingMode,
stopFarming: handleStopFarmingMode,
refresh: handleRefresh,
maxPower: handleEquipMaxPower,
loadout: handleEquipLoadout,
postmaster: handleCollectPostmaster,
Expand Down Expand Up @@ -341,6 +342,13 @@ function handleStopFarmingMode() {
stopButton?.dispatchEvent(uiEvents.singleClick);
}

function handleRefresh() {
infoLog('voice dim', 'Refreshng');

const refreshButton = document.querySelector('button[title="Refresh Destiny Data [R]"]');
refreshButton?.dispatchEvent(uiEvents.singleClick);
}

async function handleEquipMaxPower() {
await openCurrentCharacterLoadoutMenu();
const xpath = "//span[contains(text(),'Max Power')]";
Expand Down

0 comments on commit 23b90ab

Please sign in to comment.