Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cf88be4
Import indicator
Psimage Sep 22, 2025
3537a1c
Add new features to `-commands` msg
Psimage Sep 22, 2025
3cb4e5b
Add README short summary
Psimage Sep 22, 2025
3b27de1
clarification
Psimage Sep 22, 2025
6df4d13
Remove `./dist` at `compileMap()`
Psimage Sep 23, 2025
08e6990
Fix indicator showing on invisible units
Psimage Sep 23, 2025
62bd331
Fix indicator too low on Murloc Flesheater
Psimage Sep 23, 2025
2a5f65c
Fix "Elder Jungle Stalker" missing indicator
Psimage Sep 23, 2025
adbc88b
comment `print`
Psimage Sep 23, 2025
4eec64d
Fix updateMaps.sh
Psimage Sep 23, 2025
89dc9fb
Fix loot indicator appearing on peasants if starting location is on a…
Psimage Sep 23, 2025
ac924c6
Fix a crash caused by spawning a unit at world bounds
Psimage Sep 23, 2025
bfd0004
Fix temp unit creation is causing minimap creep camp icon to appear
Psimage Sep 23, 2025
1ebd354
Add `Thanks` section
Psimage Sep 24, 2025
09308cd
Remove cleaning dist because it is modified at BUILD step (copy resou…
Psimage Sep 24, 2025
32bca2f
Add `Known issues` section
Psimage Sep 24, 2025
36686f6
Clarify loot preview command
Psimage Sep 24, 2025
ce1cf88
Remove "print loot" on ctrl+click (if pressing ctrl+enter, ctrl will …
Psimage Sep 24, 2025
26152e5
change commands names to "-loot*"
Psimage Sep 24, 2025
b0ef670
Reformat code
Psimage Sep 24, 2025
e6bc847
Add more known issues
Psimage Sep 24, 2025
34a8e68
Fix `indicator height` on Infernal
Psimage Sep 25, 2025
96d42d7
Add `observer mode` section to readme
Psimage Sep 25, 2025
6a49ace
Change to Kenshin icons
Psimage Sep 25, 2025
452bed2
cleanup
Psimage Sep 28, 2025
868cfdd
Use fixed war3-transformer from NPM
Psimage Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
target
package-lock.json
dist
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
52 changes: 52 additions & 0 deletions assets/main/loot-indicator/ui/loot-table-ui.fdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

Frame "SIMPLEBUTTON" "LI_ItemButton" {
UseActiveContext,
Width 0.039,
Height 0.039,

Texture "LI_ItemButton_Backdrop" {
}
}

Frame "SIMPLEFRAME" "LI_Tooltip" {
UseActiveContext,

Frame "BACKDROP" "LI_Tooltip_Box" {
UseActiveContext,
DecorateFileNames,
BackdropTileBackground,
BackdropBackground "ToolTipBackground",
BackdropCornerFlags "UL|UR|BL|BR|T|L|B|R",
BackdropCornerSize 0.01,
BackdropBackgroundSize 0.01,
BackdropBackgroundInsets 0.002 0.002 0.002 0.002,
BackdropEdgeFile "ToolTipBorder",
BackdropBlendAll,

Frame "TEXT" "LI_Tooltip_Title" {
UseActiveContext,
DecorateFileNames,
FontColor 1.0 1.0 1.0 1.0,
FontShadowColor 0.0 0.0 0.0 0.9,
FontShadowOffset 0.001 -0.001,
LayerStyle "IGNORETRACKEVENTS",
FrameFont "InfoPanelTextFont", 0.011, "",
FontJustificationH JUSTIFYLEFT,
}

Frame "BACKDROP" "LI_Tooltip_Separator" {
UseActiveContext,
BackdropBackground "replaceabletextures\teamcolor\teamcolor08",
}

Frame "TEXT" "LI_Tooltip_Description" {
UseActiveContext,
FrameFont "InfoPanelTextFont", 0.011, "",
FontColor 1.0 1.0 1.0 1.0,
FontShadowColor 0.0 0.0 0.0 0.9,
FontShadowOffset 0.001 -0.001,
LayerStyle "IGNORETRACKEVENTS",
DecorateFileNames,
}
}
}
2 changes: 2 additions & 0 deletions assets/main/loot-indicator/ui/ui.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
loot-indicator\ui\loot-table-ui.fdf

Binary file not shown.
Binary file not shown.
Binary file added assets/roc/loot-indicator/loot-indicator-tome.dds
Binary file not shown.
Binary file added assets/roc/loot-indicator/loot-indicator-tome.mdx
Binary file not shown.
52 changes: 52 additions & 0 deletions assets/roc/loot-indicator/ui/loot-table-ui.fdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

Frame "SIMPLEBUTTON" "LI_ItemButton" {
UseActiveContext,
Width 0.039,
Height 0.039,

Texture "LI_ItemButton_Backdrop" {
}
}

Frame "SIMPLEFRAME" "LI_Tooltip" {
UseActiveContext,

Frame "BACKDROP" "LI_Tooltip_Box" {
UseActiveContext,
DecorateFileNames,
BackdropTileBackground,
BackdropBackground "ToolTipBackground",
BackdropCornerFlags "UL|UR|BL|BR|T|L|B|R",
BackdropCornerSize 0.01,
BackdropBackgroundSize 0.01,
BackdropBackgroundInsets 0.002 0.002 0.002 0.002,
BackdropEdgeFile "ToolTipBorder",
BackdropBlendAll,

Frame "TEXT" "LI_Tooltip_Title" {
UseActiveContext,
DecorateFileNames,
FontColor 1.0 1.0 1.0 1.0,
FontShadowColor 0.0 0.0 0.0 0.9,
FontShadowOffset 0.001 -0.001,
LayerStyle "IGNORETRACKEVENTS",
FrameFont "InfoPanelTextFont", 0.011, "",
FontJustificationH JUSTIFYLEFT,
}

Frame "BACKDROP" "LI_Tooltip_Separator" {
UseActiveContext,
BackdropBackground "replaceabletextures\teamcolor\teamcolor08",
}

Frame "TEXT" "LI_Tooltip_Description" {
UseActiveContext,
FrameFont "InfoPanelTextFont", 0.011, "",
FontColor 1.0 1.0 1.0 1.0,
FontShadowColor 0.0 0.0 0.0 0.9,
FontShadowOffset 0.001 -0.001,
LayerStyle "IGNORETRACKEVENTS",
DecorateFileNames,
}
}
}
2 changes: 2 additions & 0 deletions assets/roc/loot-indicator/ui/ui.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
loot-indicator\ui\loot-table-ui.fdf

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@
"typescript": "5.8.2",
"typescript-to-lua": "^1.31.0",
"war3-objectdata-th": "^0.2.10",
"war3-transformer": "3.0.9",
"war3-transformer": "3.0.10",
"war3tstlhelper": "1.0.1",
"winston": "3.17.0"
"winston": "3.17.0",
"war3-types-strict": "0.1.3",
"mdx-m3-viewer-th": "5.13.3",
"@jamiephan/casclib": "2.0.0-dev.5",
"war3-model": "4.0.0"
},
"watch": {
"build:defs": {
Expand Down
52 changes: 52 additions & 0 deletions scripts/loot-indicator/items-db/extract-items-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import * as casclib from '@jamiephan/casclib'
import SlkFile from "mdx-m3-viewer-th/dist/cjs/parsers/slk/file"
import * as fs from 'fs-extra';
import {toArrayBuffer} from "../../utils";

const WC3_GAME_BASE_DIRECTORY = "D:\\Games\\Warcraft III";

interface ItemData {
//Comment is roughly a name, used it here just to give a rough view of what the item actually is.
//The actual in-game name is probably in _locales/enus.w3mod/itemstrings.txt
comment: string;
includeAsRandomChoice: boolean;
}

generateItemsData("extracted-items-data.json")

function generateItemsData(resultFilePath: string) {
const storageHandle = casclib.openStorageSync(WC3_GAME_BASE_DIRECTORY)
try {
const unitDataBuffer = casclib.readFileSync(storageHandle, "war3.w3mod:units\\itemdata.slk")
const itemDataSlk = new SlkFile();
itemDataSlk.load(unitDataBuffer.toString("utf8"));

let itemDataById = new Map<string, ItemData>()

//Header row
const headerRow = itemDataSlk.rows[0];
const columnName2Idx = headerRow.reduce((map, name, idx) =>
map.set(name, idx), new Map<string, number>())
const valueRows = itemDataSlk.rows.slice(1);

for (const row of valueRows) {
const id = row[columnName2Idx.get("itemID")!];
const comment = row[columnName2Idx.get("comment")!];
const includeAsRandomChoice = row[columnName2Idx.get("pickRandom")!] === "1";

itemDataById.set(id, {comment, includeAsRandomChoice});
}

fs.writeFileSync(resultFilePath, JSON.stringify(Object.fromEntries(itemDataById), null, 2))
console.log("Total items extracted: " + itemDataById.size)
} finally {
casclib.closeStorage(storageHandle);
}
}

function readFileFromCasc(storageHandle: any, filePath: string) {
// Sometimes `readFileSync()` returns buffer bigger then the file size, so we slice it
const buffer = casclib.readFileSync(storageHandle, filePath);
const size = casclib.findFilesSync(storageHandle, filePath)[0].fileSize;
return toArrayBuffer(buffer.subarray(0, size));
}
Loading