1
0
Fork 0

Item refactor (#1)

* Load item definitions from json

- Convert item registration code using regex

* Display item descriptions on hover

- Read descriptions from l10n file
- Only en_US is supported for now

* Add remaining missing materials

- Also add misc. weaponry & armor
- Rename and reorder items to match game
- Keep deprecated alternate names

* Add remaining missing key items

- Replace SpiritOrb image with more accurate one
- Fix positioning on MasterSword and PotLid images
- Add padding to more closely simulate in-game menu

* Rename Meal item type to Food to match game

* Add support for animated icons

- Add support for reading webp files
- Mark all potentially animated items in json
- Add animated icons only for SpiritOrb / TravelMedallion for now
- Add menu option but leave disabled by default

* Review feedback

* Move icon files into subdirectories

* Remove item enum in favor of building list from config

- Fix some incorrect item ordering
- Rename some generic item images

* Add remaining missing items

- Add 122 Weapons, 23 Bows, and 30 Shields
- Add 105 Armor and 189 Food
- Include alternate icons (e.g. charged OHO) for later use

* Clean up types and respond to review feedback

* Add .webp files to lint ignore

* Stupid linter
This commit is contained in:
elduende05 2022-07-13 19:23:00 -07:00 committed by GitHub
parent e364f18988
commit 61e4206e9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
710 changed files with 1527 additions and 216 deletions

View file

@ -28,6 +28,7 @@ ignore_exts = [
".ico", ".ico",
".ps1", ".ps1",
".wasm", ".wasm",
".webp",
".tar.gz", ".tar.gz",
".otf", ".otf",
".svg" ".svg"

View file

@ -86,6 +86,7 @@ h1 {
border: 1px solid #999999; border: 1px solid #999999;
box-sizing: border-box; box-sizing: border-box;
margin:1px; margin:1px;
padding:1px;
width:62px; width:62px;
height:62px; height:62px;
display:inline-block; display:inline-block;

View file

@ -33,6 +33,7 @@ export const App: React.FC = () => {
const [page, setPageInState] = useState<string>("#simulation"); const [page, setPageInState] = useState<string>("#simulation");
// Option States // Option States
const [interlaceInventory, setInterlaceInventory] = useState<boolean>(false); const [interlaceInventory, setInterlaceInventory] = useState<boolean>(false);
const [isIconAnimated, setIsIconAnimated] = useState<boolean>(false);
const [commands, setCommands] = useState<Command[]>(getDefaultCommands()); const [commands, setCommands] = useState<Command[]>(getDefaultCommands());
const [selectedSaveName, setSelectedSaveName] = useState<string>(""); const [selectedSaveName, setSelectedSaveName] = useState<string>("");
@ -258,13 +259,13 @@ export const App: React.FC = () => {
if (selectedSaveName === ""){ if (selectedSaveName === ""){
const manualSave = simulationStates[displayIndex].getManualSave(); const manualSave = simulationStates[displayIndex].getManualSave();
if(manualSave){ if(manualSave){
return <ItemList slots={manualSave.getDisplayedSlots()}/>; return <ItemList slots={manualSave.getDisplayedSlots(isIconAnimated)}/>;
} }
}else if(selectedSaveName){ }else if(selectedSaveName){
const namedSaves = simulationStates[displayIndex].getNamedSaves(); const namedSaves = simulationStates[displayIndex].getNamedSaves();
if(selectedSaveName in namedSaves){ if(selectedSaveName in namedSaves){
const save = namedSaves[selectedSaveName]; const save = namedSaves[selectedSaveName];
return <ItemList slots={save.getDisplayedSlots()}/>; return <ItemList slots={save.getDisplayedSlots(isIconAnimated)}/>;
} }
} }
return null; return null;
@ -288,6 +289,7 @@ export const App: React.FC = () => {
{displayIndex >= 0 && displayIndex < commands.length && {displayIndex >= 0 && displayIndex < commands.length &&
<DisplayPane <DisplayPane
overlaySave={interlaceInventory} overlaySave={interlaceInventory}
isIconAnimated={isIconAnimated}
displayIndex={displayIndex} displayIndex={displayIndex}
command={commands[displayIndex].getDisplayString()} command={commands[displayIndex].getDisplayString()}
simulationState={simulationStates[displayIndex]} simulationState={simulationStates[displayIndex]}
@ -310,6 +312,8 @@ export const App: React.FC = () => {
<OptionPage <OptionPage
interlaceInventory={interlaceInventory} interlaceInventory={interlaceInventory}
setInterlaceInventory={setInterlaceInventory} setInterlaceInventory={setInterlaceInventory}
isIconAnimated={isIconAnimated}
setIsIconAnimated={setIsIconAnimated}
commandText={commandText} commandText={commandText}
setCommandText={(value)=>{ setCommandText={(value)=>{
if(value !== commandText){ if(value !== commandText){

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Some files were not shown because too many files have changed in this diff Show more