forked from HarbourMasters/Shipwright
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update z64item.h with names from decomp
- Loading branch information
1 parent
fe90ad0
commit f406491
Showing
87 changed files
with
2,103 additions
and
1,887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const C_FILES_REGEX = /.+(\.cpp|\.c|\.inc|\.h)$/; | ||
|
||
const z64itemMap = { | ||
// EquipmentType | ||
'EQUIP_SWORD': 'EQUIP_TYPE_SWORD', | ||
'EQUIP_SHIELD': 'EQUIP_TYPE_SHIELD', | ||
'EQUIP_TUNIC': 'EQUIP_TYPE_TUNIC', | ||
'EQUIP_BOOTS': 'EQUIP_TYPE_BOOTS', | ||
// UpgradeType | ||
'UPG_STICKS': 'UPG_DEKU_STICKS', | ||
'UPG_NUTS': 'UPG_DEKU_NUTS', | ||
// QuestItem | ||
'QUEST_GERUDO_CARD': 'QUEST_GERUDOS_CARD', | ||
'QUEST_HEART_PIECE': 'QUEST_HEART_PIECE_COUNT', | ||
// DungeonItem | ||
'DUNGEON_KEY_BOSS': 'DUNGEON_BOSS_KEY', | ||
// InventorySlot | ||
'SLOT_STICK': 'SLOT_DEKU_STICK', | ||
'SLOT_NUT': 'SLOT_DEKU_NUT', | ||
'SLOT_LENS': 'SLOT_LENS_OF_TRUTH', | ||
'SLOT_BEAN': 'SLOT_MAGIC_BEAN', | ||
// ItemID | ||
'ITEM_STICK': 'ITEM_DEKU_STICK', | ||
'ITEM_NUT': 'ITEM_DEKU_NUT', | ||
'ITEM_OCARINA_TIME': 'ITEM_OCARINA_OF_TIME', | ||
'ITEM_LENS': 'ITEM_LENS_OF_TRUTH', | ||
'ITEM_BEAN': 'ITEM_MAGIC_BEAN', | ||
'ITEM_BOTTLE': 'ITEM_BOTTLE_EMPTY', | ||
'ITEM_POTION_RED': 'ITEM_BOTTLE_POTION_RED', | ||
'ITEM_POTION_GREEN': 'ITEM_BOTTLE_POTION_GREEN', | ||
'ITEM_POTION_BLUE': 'ITEM_BOTTLE_POTION_BLUE', | ||
'ITEM_FAIRY': 'ITEM_BOTTLE_FAIRY', | ||
'ITEM_FISH': 'ITEM_BOTTLE_FISH', | ||
'ITEM_MILK_BOTTLE': 'ITEM_BOTTLE_MILK_FULL', | ||
'ITEM_LETTER_RUTO': 'ITEM_BOTTLE_RUTOS_LETTER', | ||
'ITEM_BLUE_FIRE': 'ITEM_BOTTLE_BLUE_FIRE', | ||
'ITEM_BUG': 'ITEM_BOTTLE_BUG', | ||
'ITEM_BIG_POE': 'ITEM_BOTTLE_BIG_POE', | ||
'ITEM_MILK_HALF': 'ITEM_BOTTLE_MILK_HALF', | ||
'ITEM_POE': 'ITEM_BOTTLE_POE', | ||
'ITEM_LETTER_ZELDA': 'ITEM_ZELDAS_LETTER', | ||
'ITEM_MASK_BUNNY': 'ITEM_MASK_BUNNY_HOOD', | ||
'ITEM_SAW': 'ITEM_POACHERS_SAW', | ||
'ITEM_SWORD_BROKEN': 'ITEM_BROKEN_GORONS_SWORD', | ||
'ITEM_FROG': 'ITEM_EYEBALL_FROG', | ||
'ITEM_EYEDROPS': 'ITEM_EYE_DROPS', | ||
'ITEM_BOW_ARROW_FIRE': 'ITEM_BOW_FIRE', | ||
'ITEM_BOW_ARROW_ICE': 'ITEM_BOW_ICE', | ||
'ITEM_BOW_ARROW_LIGHT': 'ITEM_BOW_LIGHT', | ||
'ITEM_SWORD_BGS': 'ITEM_SWORD_BIGGORON', | ||
'ITEM_BRACELET': 'ITEM_STRENGTH_GORONS_BRACELET', | ||
'ITEM_GAUNTLETS_SILVER': 'ITEM_STRENGTH_SILVER_GAUNTLETS', | ||
'ITEM_GAUNTLETS_GOLD': 'ITEM_STRENGTH_GOLD_GAUNTLETS', | ||
'ITEM_SWORD_KNIFE': 'ITEM_GIANTS_KNIFE', | ||
'ITEM_WALLET_ADULT': 'ITEM_ADULTS_WALLET', | ||
'ITEM_WALLET_GIANT': 'ITEM_GIANTS_WALLET', | ||
'ITEM_SEEDS': 'ITEM_DEKU_SEEDS', | ||
'ITEM_GERUDO_CARD': 'ITEM_GERUDOS_CARD', | ||
'ITEM_KEY_BOSS': 'ITEM_DUNGEON_BOSS_KEY', | ||
'ITEM_COMPASS': 'ITEM_DUNGEON_COMPASS', | ||
'ITEM_KEY_SMALL': 'ITEM_SMALL_KEY', | ||
'ITEM_MAGIC_SMALL': 'ITEM_MAGIC_JAR_SMALL', | ||
'ITEM_MAGIC_LARGE': 'ITEM_MAGIC_JAR_BIG', | ||
'ITEM_SINGLE_MAGIC': 'ITEM_INVALID_1', | ||
'ITEM_DOUBLE_MAGIC': 'ITEM_INVALID_2', | ||
'ITEM_DOUBLE_DEFENSE': 'ITEM_INVALID_3', | ||
'ITEM_HEART': 'ITEM_RECOVERY_HEART', | ||
'ITEM_STICKS_5': 'ITEM_DEKU_STICKS_5', | ||
'ITEM_STICKS_10': 'ITEM_DEKU_STICKS_10', | ||
'ITEM_NUTS_5': 'ITEM_DEKU_NUTS_5', | ||
'ITEM_NUTS_10': 'ITEM_DEKU_NUTS_10', | ||
'ITEM_ARROWS_SMALL': 'ITEM_ARROWS_5', | ||
'ITEM_ARROWS_MEDIUM': 'ITEM_ARROWS_10', | ||
'ITEM_ARROWS_LARGE': 'ITEM_ARROWS_30', | ||
'ITEM_SEEDS_30': 'ITEM_DEKU_SEEDS_30', | ||
'ITEM_STICK_UPGRADE_20': 'ITEM_DEKU_STICK_UPGRADE_20', | ||
'ITEM_STICK_UPGRADE_30': 'ITEM_DEKU_STICK_UPGRADE_30', | ||
'ITEM_NUT_UPGRADE_30': 'ITEM_DEKU_NUT_UPGRADE_30', | ||
'ITEM_NUT_UPGRADE_40': 'ITEM_DEKU_NUT_UPGRADE_40', | ||
// GetItemID | ||
'GI_NUTS_5': 'GI_DEKU_NUTS_5', | ||
'GI_STICKS_1': 'GI_DEKU_STICKS_1', | ||
'GI_LENS': 'GI_LENS_OF_TRUTH', | ||
'GI_LETTER_ZELDA': 'GI_ZELDAS_LETTER', | ||
'GI_OCARINA_OOT': 'GI_OCARINA_OF_TIME', | ||
'GI_BOTTLE': 'GI_BOTTLE_EMPTY', | ||
'GI_POTION_RED': 'GI_BOTTLE_POTION_RED', | ||
'GI_POTION_GREEN': 'GI_BOTTLE_POTION_GREEN', | ||
'GI_POTION_BLUE': 'GI_BOTTLE_POTION_BLUE', | ||
'GI_FAIRY': 'GI_BOTTLE_FAIRY', | ||
'GI_MILK_BOTTLE': 'GI_BOTTLE_MILK_FULL', | ||
'GI_LETTER_RUTO': 'GI_BOTTLE_RUTOS_LETTER', | ||
'GI_BEAN': 'GI_MAGIC_BEAN', | ||
'GI_MASK_BUNNY': 'GI_MASK_BUNNY_HOOD', | ||
'GI_SAW': 'GI_POACHERS_SAW', | ||
'GI_SWORD_BROKEN': 'GI_BROKEN_GORONS_SWORD', | ||
'GI_FROG': 'GI_EYEBALL_FROG', | ||
'GI_EYEDROPS': 'GI_EYE_DROPS', | ||
'GI_GAUNTLETS_SILVER': 'GI_SILVER_GAUNTLETS', | ||
'GI_GAUNTLETS_GOLD': 'GI_GOLD_GAUNTLETS', | ||
'GI_SCALE_GOLD': 'GI_SCALE_GOLDEN', | ||
'GI_GERUDO_CARD': 'GI_GERUDOS_CARD', | ||
'GI_SEEDS_5': 'GI_DEKU_SEEDS_5', | ||
'GI_KEY_BOSS': 'GI_BOSS_KEY', | ||
'GI_MAP': 'GI_DUNGEON_MAP', | ||
'GI_KEY_SMALL': 'GI_SMALL_KEY', | ||
'GI_MAGIC_SMALL': 'GI_MAGIC_JAR_SMALL', | ||
'GI_MAGIC_LARGE': 'GI_MAGIC_JAR_LARGE', | ||
'GI_HEART': 'GI_RECOVERY_HEART', | ||
'GI_ARROWS_SMALL': 'GI_ARROWS_5', | ||
'GI_ARROWS_MEDIUM': 'GI_ARROWS_10', | ||
'GI_ARROWS_LARGE': 'GI_ARROWS_30', | ||
'GI_BRACELET': 'GI_GORONS_BRACELET', | ||
'GI_SWORD_BGS': 'GI_SWORD_BIGGORON', | ||
'GI_STICKS_5': 'GI_DEKU_STICKS_5', | ||
'GI_STICKS_10': 'GI_DEKU_STICKS_10', | ||
'GI_NUTS_5_2': 'GI_DEKU_NUTS_5_2', | ||
'GI_NUTS_10': 'GI_DEKU_NUTS_10', | ||
'GI_SEEDS_30': 'GI_DEKU_SEEDS_30', | ||
'GI_FISH': 'GI_BOTTLE_FISH', | ||
'GI_BUGS': 'GI_BOTTLE_BUGS', | ||
'GI_BLUE_FIRE': 'GI_BOTTLE_BLUE_FIRE', | ||
'GI_POE': 'GI_BOTTLE_POE', | ||
'GI_BIG_POE': 'GI_BOTTLE_BIG_POE', | ||
'GI_STICK_UPGRADE_20': 'GI_DEKU_STICK_UPGRADE_20', | ||
'GI_STICK_UPGRADE_30': 'GI_DEKU_STICK_UPGRADE_30', | ||
'GI_NUT_UPGRADE_30': 'GI_DEKU_NUT_UPGRADE_30', | ||
'GI_NUT_UPGRADE_40': 'GI_DEKU_NUT_UPGRADE_40', | ||
// GetItemDrawID | ||
'GID_BOTTLE': 'GID_BOTTLE_EMPTY', | ||
'GID_KEY_SMALL': 'GID_SMALL_KEY', | ||
'GID_HEART': 'GID_RECOVERY_HEART', | ||
'GID_KEY_BOSS': 'GID_BOSS_KEY', | ||
'GID_NUTS': 'GID_DEKU_NUTS', | ||
'GID_STICK': 'GID_DEKU_STICK', | ||
'GID_MAGIC_SMALL': 'GID_MAGIC_JAR_SMALL', | ||
'GID_MAGIC_LARGE': 'GID_MAGIC_JAR_LARGE', | ||
'GID_GERUDO_CARD': 'GID_GERUDOS_CARD', | ||
'GID_ARROWS_SMALL': 'GID_ARROWS_5', | ||
'GID_ARROWS_MEDIUM': 'GID_ARROWS_10', | ||
'GID_ARROWS_LARGE': 'GID_ARROWS_30', | ||
'GID_OCARINA_TIME': 'GID_OCARINA_OF_TIME', | ||
'GID_MILK': 'GID_BOTTLE_MILK_FULL', | ||
'GID_LENS': 'GID_LENS_OF_TRUTH', | ||
'GID_POTION_GREEN': 'GID_BOTTLE_POTION_GREEN', | ||
'GID_POTION_RED': 'GID_BOTTLE_POTION_RED', | ||
'GID_POTION_BLUE': 'GID_BOTTLE_POTION_BLUE', | ||
'GID_LETTER_ZELDA': 'GID_ZELDAS_LETTER', | ||
'GID_BEAN': 'GID_MAGIC_BEAN', | ||
'GID_SAW': 'GID_POACHERS_SAW', | ||
'GID_SWORD_BGS': 'GID_SWORD_BIGGORON', | ||
'GID_CHICKEN': 'GID_CUCCO', | ||
'GID_LETTER_RUTO': 'GID_BOTTLE_RUTOS_LETTER', | ||
'GID_SEEDS': 'GID_DEKU_SEEDS', | ||
'GID_GAUNTLETS_SILVER': 'GID_SILVER_GAUNTLETS', | ||
'GID_GAUNTLETS_GOLD': 'GID_GOLD_GAUNTLETS', | ||
'GID_MASK_BUNNY': 'GID_MASK_BUNNY_HOOD', | ||
'GID_EYEDROPS': 'GID_EYE_DROPS', | ||
'GID_SWORD_BROKEN': 'GID_BROKEN_GORONS_SWORD', | ||
'GID_BRACELET': 'GID_GORONS_BRACELET', | ||
'GID_FROG': 'GID_EYEBALL_FROG', | ||
// ExchangeItemID | ||
'EXCH_ITEM_LETTER_ZELDA': 'EXCH_ITEM_ZELDAS_LETTER', | ||
'EXCH_ITEM_BEAN': 'EXCH_ITEM_MAGIC_BEAN', | ||
'EXCH_ITEM_SAW': 'EXCH_ITEM_POACHERS_SAW', | ||
'EXCH_ITEM_SWORD_BROKEN': 'EXCH_ITEM_BROKEN_GORONS_SWORD', | ||
'EXCH_ITEM_FROG': 'EXCH_ITEM_EYEBALL_FROG', | ||
'EXCH_ITEM_EYEDROPS': 'EXCH_ITEM_EYE_DROPS', | ||
'EXCH_ITEM_MASK_BUNNY': 'EXCH_ITEM_MASK_BUNNY_HOOD', | ||
'EXCH_ITEM_FISH': 'EXCH_ITEM_BOTTLE_FISH', | ||
'EXCH_ITEM_BLUE_FIRE': 'EXCH_ITEM_BOTTLE_BLUE_FIRE', | ||
'EXCH_ITEM_BUG': 'EXCH_ITEM_BOTTLE_BUG', | ||
'EXCH_ITEM_POE': 'EXCH_ITEM_BOTTLE_POE', | ||
'EXCH_ITEM_BIG_POE': 'EXCH_ITEM_BOTTLE_BIG_POE', | ||
'EXCH_ITEM_LETTER_RUTO': 'EXCH_ITEM_BOTTLE_RUTOS_LETTER', | ||
} | ||
|
||
const maps = [z64itemMap]; | ||
|
||
// Regex patterns to match and replace | ||
function processFile(filePath) { | ||
const content = fs.readFileSync(filePath, 'utf8'); | ||
let updatedContent = content; | ||
|
||
maps.forEach((map) => { | ||
Object.keys(map).forEach((before) => { | ||
const after = map[before]; | ||
const beforeRegex = new RegExp(`\\b${before}\\b`, 'g'); | ||
updatedContent = updatedContent.replace(beforeRegex, after); | ||
}); | ||
}); | ||
|
||
fs.writeFileSync(filePath, updatedContent, 'utf8'); | ||
} | ||
|
||
// Recursive function to process files in a directory | ||
function processFiles(dirPath) { | ||
const files = fs.readdirSync(dirPath); | ||
|
||
files.forEach((file) => { | ||
const filePath = path.join(dirPath, file); | ||
const stat = fs.statSync(filePath); | ||
|
||
if (stat.isDirectory() && !filePath.match(/\.git$/)) { | ||
processFiles(filePath); | ||
} else if (C_FILES_REGEX.test(file)) { | ||
processFile(filePath); | ||
} | ||
}); | ||
} | ||
|
||
// Start processing files in the directory | ||
processFiles(__dirname); |
Submodule libultraship
updated
10 files
+1 −1 | .github/workflows/build-validation.yml | |
+3 −52 | src/Context.cpp | |
+1 −2 | src/Context.h | |
+5 −10 | src/config/ConsoleVariable.cpp | |
+2 −0 | src/controller/SDLController.cpp | |
+26 −14 | src/graphic/Fast3D/gfx_dxgi.cpp | |
+2 −18 | src/graphic/Fast3D/gfx_sdl2.cpp | |
+1 −4 | src/resource/Archive.cpp | |
+3 −52 | src/window/gui/Gui.cpp | |
+0 −1 | src/window/gui/Gui.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.