diff --git a/stardew-access/ModEntry.cs b/stardew-access/ModEntry.cs index adffb0c..025f840 100644 --- a/stardew-access/ModEntry.cs +++ b/stardew-access/ModEntry.cs @@ -255,12 +255,11 @@ namespace stardew_access HoeDirt dirt = (HoeDirt)terrain.Get(); if (dirt.crop != null) { - string cropName = Game1.objectInformation[dirt.crop.indexOfHarvest]; - cropName = cropName.Substring(0, cropName.IndexOf("/")); + string cropName = Game1.objectInformation[dirt.crop.indexOfHarvest].Split('/')[0]; string toSpeak = $"{cropName}"; bool isWatered = dirt.state.Value == HoeDirt.watered; - bool isHarvestable = dirt.crop.fullyGrown.Get(); + bool isHarvestable = dirt.crop.fullyGrown.Value; if(isWatered) toSpeak = "Watered " + toSpeak; @@ -271,7 +270,92 @@ namespace stardew_access ScreenReader.say(toSpeak, true); } } + else if(terrain.Get() is Bush) + { + string toSpeak = "Bush"; + monitor.Log(toSpeak, LogLevel.Debug); + ScreenReader.say(toSpeak, true); + } + else if(terrain.Get() is CosmeticPlant) + { + CosmeticPlant cosmeticPlant = (CosmeticPlant)terrain.Get(); + string toSpeak = cosmeticPlant.textureName().ToLower(); + if (toSpeak.Contains("terrain")) + toSpeak.Replace("terrain", ""); + + if (toSpeak.Contains("feature")) + toSpeak.Replace("feature", ""); + + monitor.Log(toSpeak, LogLevel.Debug); + ScreenReader.say(toSpeak, true); + } + else if (terrain.Get() is Flooring) + { + Flooring flooring = (Flooring)terrain.Get(); + bool isPathway = flooring.isPathway.Get(); + bool isSteppingStone = flooring.isSteppingStone.Get(); + + string toSpeak = "Flooring"; + + if (isPathway) + toSpeak = "Pathway"; + + if (isSteppingStone) + toSpeak = "Stepping Stone"; + + monitor.Log(toSpeak, LogLevel.Debug); + ScreenReader.say(toSpeak, true); + } + else if (terrain.Get() is FruitTree) + { + FruitTree fruitTree = (FruitTree)terrain.Get(); + string toSpeak = Game1.objectInformation[fruitTree.treeType].Split('/')[0]; + + monitor.Log(toSpeak, LogLevel.Debug); + ScreenReader.say(toSpeak, true); + } + else if (terrain.Get() is ResourceClump) + { + ResourceClump resourceClump = (ResourceClump)terrain.Get(); + string toSpeak = Game1.objectInformation[resourceClump.parentSheetIndex].Split('/')[0]; + + monitor.Log(toSpeak, LogLevel.Debug); + ScreenReader.say(toSpeak, true); + } + else if (terrain.Get() is Grass) + { + Grass grass = (Grass)terrain.Get(); + string toSpeak = "Grass"; + + monitor.Log(toSpeak, LogLevel.Debug); + ScreenReader.say(toSpeak, true); + } + else if (terrain.Get() is Tree) + { + Tree tree = (Tree)terrain.Get(); + int treeType = tree.treeType; + int stage = tree.growthStage.Value; + string toSpeak = ""; + + if (Game1.player.getEffectiveSkillLevel(2) >= 1) + { + toSpeak = Game1.objectInformation[308 + (int)treeType].Split('/')[0]; + } + else if (Game1.player.getEffectiveSkillLevel(2) >= 1 && (int)treeType <= 3) + { + toSpeak = Game1.objectInformation[308 + (int)treeType].Split('/')[0]; + } + else if (Game1.player.getEffectiveSkillLevel(2) >= 1 && (int)treeType == 8) + { + toSpeak = Game1.objectInformation[292 + (int)treeType].Split('/')[0]; + } + + toSpeak += $", {stage} stage"; + + monitor.Log(toSpeak, LogLevel.Debug); + ScreenReader.say(toSpeak, true); + } } } } diff --git a/stardew-access/Patches/MenuPatch.cs b/stardew-access/Patches/MenuPatch.cs index af40c5e..f1d346f 100644 --- a/stardew-access/Patches/MenuPatch.cs +++ b/stardew-access/Patches/MenuPatch.cs @@ -346,13 +346,11 @@ namespace stardew_access.Patches bool isNextArrowPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Right); bool isPrevArrowPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Left); - bool isLPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.L); - bool isJPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.J); - if ((isNextArrowPressed || isLPressed ) && !isRunning) + if (isNextArrowPressed && !isRunning) { _ = CycleThroughItems(true, ___nameBox, ___farmnameBox, ___favThingBox, ___skipIntroButton, ___okButton, ___backButton); } - else if ((isPrevArrowPressed || isJPressed) && !isRunning) + else if (isPrevArrowPressed && !isRunning) { _ = CycleThroughItems(false, ___nameBox, ___farmnameBox, ___favThingBox, ___skipIntroButton, ___okButton, ___backButton); } diff --git a/stardew-access/manifest.json b/stardew-access/manifest.json index 58efbaf..2b1cb45 100644 --- a/stardew-access/manifest.json +++ b/stardew-access/manifest.json @@ -1,7 +1,7 @@ { "Name": "Stardew Access", "Author": "Mohammad Shoaib", - "Version": "1.0.4-beta", + "Version": "1.0.5-beta", "Description": "An accessibility mod with screen reader support!", "UniqueID": "shoaib.stardewaccess", "EntryDll": "stardew-access.dll",