Added tree, grass, cosmetic plant, flooring, fruit tree to read tile
parent
6c6c7bdecf
commit
c4bdfe2784
|
@ -255,12 +255,11 @@ namespace stardew_access
|
||||||
HoeDirt dirt = (HoeDirt)terrain.Get();
|
HoeDirt dirt = (HoeDirt)terrain.Get();
|
||||||
if (dirt.crop != null)
|
if (dirt.crop != null)
|
||||||
{
|
{
|
||||||
string cropName = Game1.objectInformation[dirt.crop.indexOfHarvest];
|
string cropName = Game1.objectInformation[dirt.crop.indexOfHarvest].Split('/')[0];
|
||||||
cropName = cropName.Substring(0, cropName.IndexOf("/"));
|
|
||||||
string toSpeak = $"{cropName}";
|
string toSpeak = $"{cropName}";
|
||||||
|
|
||||||
bool isWatered = dirt.state.Value == HoeDirt.watered;
|
bool isWatered = dirt.state.Value == HoeDirt.watered;
|
||||||
bool isHarvestable = dirt.crop.fullyGrown.Get();
|
bool isHarvestable = dirt.crop.fullyGrown.Value;
|
||||||
|
|
||||||
if(isWatered)
|
if(isWatered)
|
||||||
toSpeak = "Watered " + toSpeak;
|
toSpeak = "Watered " + toSpeak;
|
||||||
|
@ -271,7 +270,92 @@ namespace stardew_access
|
||||||
ScreenReader.say(toSpeak, true);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -346,13 +346,11 @@ namespace stardew_access.Patches
|
||||||
bool isNextArrowPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Right);
|
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 isPrevArrowPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Left);
|
||||||
|
|
||||||
bool isLPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.L);
|
if (isNextArrowPressed && !isRunning)
|
||||||
bool isJPressed = Game1.input.GetKeyboardState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.J);
|
|
||||||
if ((isNextArrowPressed || isLPressed ) && !isRunning)
|
|
||||||
{
|
{
|
||||||
_ = CycleThroughItems(true, ___nameBox, ___farmnameBox, ___favThingBox, ___skipIntroButton, ___okButton, ___backButton);
|
_ = 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);
|
_ = CycleThroughItems(false, ___nameBox, ___farmnameBox, ___favThingBox, ___skipIntroButton, ___okButton, ___backButton);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"Name": "Stardew Access",
|
"Name": "Stardew Access",
|
||||||
"Author": "Mohammad Shoaib",
|
"Author": "Mohammad Shoaib",
|
||||||
"Version": "1.0.4-beta",
|
"Version": "1.0.5-beta",
|
||||||
"Description": "An accessibility mod with screen reader support!",
|
"Description": "An accessibility mod with screen reader support!",
|
||||||
"UniqueID": "shoaib.stardewaccess",
|
"UniqueID": "shoaib.stardewaccess",
|
||||||
"EntryDll": "stardew-access.dll",
|
"EntryDll": "stardew-access.dll",
|
||||||
|
|
Loading…
Reference in New Issue