Skip to content

Commit

Permalink
Merge pull request #17 from Sandman534/develop16
Browse files Browse the repository at this point in the history
Updated probability code, magic bait, expanded window and tackle display
  • Loading branch information
Hackswell authored Apr 23, 2024
2 parents 362765e + 5aef12c commit e964544
Show file tree
Hide file tree
Showing 13 changed files with 332 additions and 166 deletions.
6 changes: 2 additions & 4 deletions JoysOfEfficiency/Automation/HarvestAutomation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Microsoft.Xna.Framework;
using StardewValley;
using StardewValley.GameData.Crops;
using StardewValley.Internal;
using StardewValley.ItemTypeDefinitions;
using StardewValley.Objects;
using StardewValley.TerrainFeatures;
using StardewValley.Tools;
Expand Down Expand Up @@ -150,17 +152,13 @@ public static void ToggleBlacklistUnderCursor()
return;

if (dirt.crop == null)
{
Util.ShowHudMessage("There is no crop under the cursor");
}
else
{
string cropID = dirt.crop.indexOfHarvest.Value;
string name = ItemRegistry.ResolveMetadata(cropID)?.GetParsedData().DisplayName;
if (name == "")
{
return;
}

string text = ToggleBlackList(dirt.crop)
? $"{name} has been added to AutoHarvest exception"
Expand Down
4 changes: 4 additions & 0 deletions JoysOfEfficiency/Core/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ internal class Config
public SButton ToggleAfkFishing { get; set; } = SButton.End;

public bool FishingInfo { get; set; } = true;
public bool FishingTackleInfo { get; set; } = false;
public bool TackleBoxAttach { get; set; } = false;
public Point TackleBoxCoordinates { get; set; } = new Point(40, 500);

public bool AutoGate { get; set; } = true;

Expand Down Expand Up @@ -140,6 +143,7 @@ internal class Config

//Fishing Probabilities
public bool FishingProbabilitiesInfo { get; set; } = false;
public int ProbBoxMaxFish { get; set; } = 10;
public Point ProbBoxCoordinates { get; set; } = new Point(40, 500);
public bool MorePreciseProbabilities { get; set; } = true;
public int TrialOfExamine { get; set; } = 10;
Expand Down
2 changes: 1 addition & 1 deletion JoysOfEfficiency/EventHandler/GraphicsEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void OnRenderHud(object sender, RenderingHudEventArgs args)
{
GiftInformationTooltip.DrawTooltip();
}
if (Conf.FishingProbabilitiesInfo && Game1.player.CurrentTool is FishingRod rod && rod.isFishing)
if (Game1.player.CurrentTool is FishingRod rod && rod.isFishing)
{
FishingProbabilitiesBox.PrintFishingInfo();
}
Expand Down
406 changes: 262 additions & 144 deletions JoysOfEfficiency/Huds/FishingProbabilitiesBox.cs

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions JoysOfEfficiency/Menus/JoeMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ internal JoeMenu(int width, int height)
tab.AddOptionsElement(new ModifiedCheckBox("AutoEat", 10, Config.AutoEat, OnCheckboxValueChanged));
tab.AddOptionsElement(new ModifiedSlider("StaminaToEatRatio", 1, (int)(Config.StaminaToEatRatio * 10), 1, 8, OnSliderValueChanged, () => !Config.AutoEat, Format));
tab.AddOptionsElement(new ModifiedSlider("HealthToEatRatio", 2, (int)(Config.HealthToEatRatio * 10), 1, 8, OnSliderValueChanged, () => !Config.AutoEat, Format));
tab.AddOptionsElement(new ModifiedCheckBox("DontEatThat", 43, Config.DontEatThat, OnCheckboxValueChanged));
tab.AddOptionsElement(new ModifiedCheckBox("DontEatThat", 45, Config.DontEatThat, OnCheckboxValueChanged));

tab.AddOptionsElement(new EmptyLabel());
tab.AddOptionsElement(new LabelComponent("Auto Harvest"));
Expand Down Expand Up @@ -212,10 +212,17 @@ internal JoeMenu(int width, int height)
tab.AddOptionsElement(new EmptyLabel());
tab.AddOptionsElement(new LabelComponent("Fishing Probabilities Information"));
tab.AddOptionsElement(new ModifiedCheckBox("FishingProbabilitiesInfo", 26, Config.FishingProbabilitiesInfo, OnCheckboxValueChanged));
tab.AddOptionsElement(new ModifiedSlider("ProbBoxMaxFish", 19, Config.ProbBoxMaxFish, 5, 25, OnSliderValueChanged));
tab.AddOptionsElement(new ModifiedClickListener(this, "ProbBoxLocation", 0, Config.ProbBoxCoordinates.X, Config.ProbBoxCoordinates.Y, translation, OnSomewhereClicked, OnStartListeningClick));
tab.AddOptionsElement(new ModifiedCheckBox("MorePreciseProbabilities", 37, Config.MorePreciseProbabilities, OnCheckboxValueChanged, i => !Config.FishingProbabilitiesInfo));
tab.AddOptionsElement(new ModifiedSlider("TrialOfExamine", 15, Config.TrialOfExamine, 1, 50, OnSliderValueChanged, () => !(Config.FishingProbabilitiesInfo && Config.MorePreciseProbabilities)));

tab.AddOptionsElement(new EmptyLabel());
tab.AddOptionsElement(new LabelComponent("Fishing Tackle Information"));
tab.AddOptionsElement(new ModifiedCheckBox("FishingTackleInfo", 43, Config.FishingTackleInfo, OnCheckboxValueChanged));
tab.AddOptionsElement(new ModifiedCheckBox("TackleBoxAttach", 44, Config.TackleBoxAttach, OnCheckboxValueChanged));
tab.AddOptionsElement(new ModifiedClickListener(this, "TackleBoxLocation", 2, Config.TackleBoxCoordinates.X, Config.TackleBoxCoordinates.Y, translation, OnSomewhereClicked, OnStartListeningClick));

tab.AddOptionsElement(new EmptyLabel());
tab.AddOptionsElement(new LabelComponent("Show Shipping Price"));
tab.AddOptionsElement(new ModifiedCheckBox("EstimateShippingPrice", 28, Config.EstimateShippingPrice, OnCheckboxValueChanged));
Expand Down Expand Up @@ -296,6 +303,9 @@ private void OnSomewhereClicked(int index, Point point)
case 1:
Config.PriceBoxCoordinates = point;
break;
case 2:
Config.TackleBoxCoordinates = point;
break;
default: return;
}
InstanceHolder.WriteConfig();
Expand Down Expand Up @@ -365,7 +375,9 @@ private void OnCheckboxValueChanged(int index, bool value)
case 40: Config.BreakRocks = value; break;
case 41: Config.ChopTwigs = value; break;
case 42: Config.AutoDepositSeedMaker = value; break;
case 43: Config.DontEatThat = value; break;
case 43: Config.FishingTackleInfo = value; break;
case 44: Config.TackleBoxAttach = value; break;
case 45: Config.DontEatThat = value; break;
default: return;
}
InstanceHolder.WriteConfig();
Expand All @@ -391,6 +403,7 @@ private void OnSliderValueChanged(int index, int value)
case 16: Config.RadiusFarmCleanup = value; break;
case 17: Config.ThrowPower = value / 10.0f; break;
case 18: Config.ThresholdStaminaPercentage = value; break;
case 19: Config.ProbBoxMaxFish = value; break;
default: return;
}

Expand Down
4 changes: 4 additions & 0 deletions JoysOfEfficiency/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
"options.FishInfo": "Zeige stets die Infobox fürs Fischen",
"options.FishingInfo": "Zeigt die Infobox beim Fischen",
"options.FishingProbabilitiesInfo": "Zeige die Wahrscheinlichkeit der Fische",
"options.FishingTackleInfo": "Ziehen Sie aktuelle Köder und Bobber",
"options.TackleBoxAttach": "Befestigen Sie die Angelbox an der Fischwahrscheinlichkeitsbox",
"options.TackleBoxLocation": "Koordinaten oben links für das Informationsfeld",
"options.ProbBoxMaxFish": "Anzahl der Fische pro Spalte",
"options.GiftInformation": "Zeige den Tooltip für Geschenke",
"options.HealthToEatRatio": "Automatisches Essen, um Gesundheit aufzufüllent",
"options.IdleTimeout": "Leerlauf-Timeout für das Pausieren des Spiels",
Expand Down
9 changes: 7 additions & 2 deletions JoysOfEfficiency/i18n/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,20 @@
"options.ChopTwigs": "Chop twigs (Axe)",
"options.PriceBoxCoordinates": "Top-left coordinates for the information box",

"options.FishingTackleInfo": "Draw current bait and bobbers",
"options.TackleBoxAttach": "Attach the tackle box to fish probabilities box",
"options.TackleBoxLocation": "Top-left coordinates for the information box",
"options.ProbBoxMaxFish": "Number of fish per column",

"options.ThrowPower": "Bobber throwing strength",
"options.ThresholdStaminaPersentage": "Stamina threshold to stop fishing",

"options.ToggleAFKFishing": "Toggle AFK Fishing mode",
"options.ToggleAFKFishing": "Toggle AFK Fishing mode",

"hud.afk.passedout": "You stopped fishing because you passed out.",
"hud.afk.on": "AFK Fishing enabled.",
"hud.afk.off": "AFK Fishing disabled.",
"hud.afk.tired": "You stopped fishing because you felt tired.",
"hud.afk.tired": "You stopped fishing because you felt tired.",

"options.flower": "Flower:{0}",
"options.R": "R",
Expand Down
4 changes: 4 additions & 0 deletions JoysOfEfficiency/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
"options.FishInfo": "Dibujar información de peces",
"options.FishingInfo": "Dibujar el cuadro de información de pesca",
"options.FishingProbabilitiesInfo": "Dibujar probabilidades de pesca",
"options.FishingTackleInfo": "Dibujar cebos y bobbers actuales",
"options.TackleBoxAttach": "Adjunte la caja de aparejos a la caja de probabilidades de pescar.",
"options.TackleBoxLocation": "Coordenadas superior izquierda para el cuadro de información.",
"options.ProbBoxMaxFish": "Número de peces por columna",
"options.GiftInformation": "Mostrar información de regalos",
"options.HealthToEatRatio": "Salud para comer auto",
"options.IdleTimeout": "Tiempo de espera para pausar el juego",
Expand Down
4 changes: 4 additions & 0 deletions JoysOfEfficiency/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
"options.FindHoeFromInventory": "クワをインベントリから探す",
"options.FishingInfo": "釣りの情報を表示",
"options.FishingProbabilitiesInfo": "釣りの確率を表示",
"options.FishingTackleInfo": "現在のベイトと浮きを描く",
"options.TackleBoxAttach": "タックルボックスを魚の確率ボックスに取り付ける",
"options.TackleBoxLocation": "情報ボックスの左上の座標",
"options.ProbBoxMaxFish": "列ごとの魚の数",
"options.GiftInformation": "贈り物情報を表示",
"options.HealthToEatRatio": "体力しきい値",
"options.IdleTimeout": "一時停止までの時間",
Expand Down
8 changes: 6 additions & 2 deletions JoysOfEfficiency/i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
"options.FishInfo": "물고기 정보 상자 보기",
"options.FishingInfo": "물고기 정보 상자 보기",
"options.FishingProbabilitiesInfo": "낚시 확률 표시",
"options.FishingTackleInfo": "현재 미끼와 찌 그리기",
"options.TackleBoxAttach": "물고기 확률 상자에 태클 상자를 부착합니다.",
"options.TackleBoxLocation": "정보 상자의 왼쪽 상단 좌표",
"options.ProbBoxMaxFish": "열당 물고기 수",
"options.GiftInformation": "선물 정보 표시 (선물할 것을 선택 후 NPC 위로 가져 가면 정보 표시)",
"options.HealthToEatRatio": "자동 먹기 체력 최대치 값",
"options.IdleTimeout": "게임 일시 정지를 위한 유휴 초과 시간",
Expand Down Expand Up @@ -92,8 +96,8 @@
"hud.afk.passedout": "기절했기 때문에 낚시가 중단되었습니다.",
"hud.afk.on": "AFK 낚시가 활성화되었습니다.",
"hud.afk.off": "AFK 낚시가 비활성화되었습니다.",
"hud.afk.tired": "피곤해서 낚시가 중단되었습니다.",
"hud.afk.tired": "피곤해서 낚시가 중단되었습니다.",

"options.flower": "꽃:{0}",
"options.R": "R",
"options.G": "G",
Expand Down
4 changes: 4 additions & 0 deletions JoysOfEfficiency/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
"options.FishInfo": "Mostrar informação dos peixes",
"options.FishingInfo": "Mostrar informação de pesca",
"options.FishingProbabilitiesInfo": "Mostrar probabilidades de pesca",
"options.FishingTackleInfo": "Desenhe iscas e bobbers atuais",
"options.TackleBoxAttach": "Anexe a caixa de equipamento à caixa de probabilidades de pesca",
"options.TackleBoxLocation": "Coordenadas no canto superior esquerdo da caixa de informações",
"options.ProbBoxMaxFish": "Número de peixes por coluna",
"options.GiftInformation": "Mostrar dicas de informações sobre presentes",
"options.HealthToEatRatio": "Limite de saúde para comer automaticamente",
"options.IdleTimeout": "Tempo limite inativo para pausar o jogo",
Expand Down
16 changes: 10 additions & 6 deletions JoysOfEfficiency/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
"button.awaiting": "Нажмите любую кнопку, чтобы назначить её...",
"button.conflict": "Нажатая вами Кнопка уже используется",
"button.esc": "Нажмите Esc для Отмены",

"estimatedprice.title": "Примерная Стоимость",

"fishinfo.quality": "Качество: ",
"fishinfo.size": "Размер: {0}дюймов",
"fishinfo.species": "Особь: {0}",
"fishinfo.treasure.appear": "Сокровище появилось!",
"fishinfo.treasure.caught": "Сокровище поймано!",
"fishinfo.treasure.incoming": "Сокровище через {0:f1}с.",
"fishinfo.price": "Цена продажи:{0}G",

"hud.paused": "Игра на паузе.",

"ladder": "Лестница появилась!",

"location.awaiting": "Нажмите, чтобы выбрать локацию.",

"monsters.tally": "{0}: {1} убито",

"options.AnimalHarvestRadius": "Дальность поиска животных (в тайлах)",
"options.AutoAnimalDoor": "Автоматически Открывать/Закрывать Двери Животных",
"options.AutoCollectCollectibles": "Автоматически собирать дикие растения поблизости",
Expand Down Expand Up @@ -59,6 +59,10 @@
"options.FishInfo": "Показывать окошко с информацией по рыбе",
"options.FishingInfo": "Показывать окошко с информацией по рыбе",
"options.FishingProbabilitiesInfo": "Показывать вероятность ловли рыбы",
"options.FishingTackleInfo": "Нарисуйте текущую наживку и поплавки.",
"options.TackleBoxAttach": "Прикрепите коробку для снастей к коробке вероятности вылова рыбы.",
"options.TackleBoxLocation": "Координаты верхнего левого информационного окна",
"options.ProbBoxMaxFish": "Количество рыб в столбце",
"options.GiftInformation": "Показывать Окошко с Информацией по Подаркам",
"options.HealthToEatRatio": "Порог Здоровья",
"options.IdleTimeout": "Длительность простоя перед паузой",
Expand Down Expand Up @@ -89,11 +93,11 @@
"options.B": "B",
"options.previewColor": "Просмотр Оттенка:",
"options.register": "Учитывать",

"flower.register": "{0} цветов будет объединяться.",
"flower.unregister": "{0} цветов больше не будет объединяться.",
"flower.vanilla": "Нельзя не учитывать обычные цветы.",

"quality.gold": "Золотое",
"quality.iridium": "Иридиевое",
"quality.normal": "Нормальное",
Expand Down
14 changes: 9 additions & 5 deletions JoysOfEfficiency/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"button.esc": "按 Esc 取消",

"estimatedprice.title": "预估价格",

"fishinfo.quality": "品质: ",
"fishinfo.size": "尺寸: {0} 厘米",
"fishinfo.species": "品种: {0}",
Expand All @@ -18,7 +18,7 @@
"ladder": "梯子出现了!",

"location.awaiting": "单击某处以指定所需的位置。",

"monsters.tally": "{0}:{1} 击杀",

"options.AnimalHarvestRadius": "搜索动物的地图格半径",
Expand Down Expand Up @@ -59,6 +59,10 @@
"options.FishInfo": "显示钓鱼信息",
"options.FishingInfo": "显示钓鱼信息",
"options.FishingProbabilitiesInfo": "显示鱼的上竿几率",
"options.FishingTackleInfo": "绘制当前的鱼饵和浮标",
"options.TackleBoxAttach": "将钓具盒连接到鱼类概率盒",
"options.TackleBoxLocation": "信息框的左上角坐标",
"options.ProbBoxMaxFish": "每列的鱼数",
"options.GiftInformation": "显示礼物提示",
"options.HealthToEatRatio": "自动进食阈值(生命值)",
"options.IdleTimeout": "暂停游戏的空闲超时",
Expand All @@ -83,16 +87,16 @@
"options.BreakRocks": "打破小石头(镐)",
"options.ChopTwigs": "砍树枝(斧头)",
"options.PriceBoxCoordinates": "信息框的左上角坐标",

"options.ThrowPower": "鱼钩投掷力度",
"options.ThresholdStaminaPersentage": "停止钓鱼的体力值",

"options.ToggleAFKFishing": "切换 AFK 钓鱼模式",
"options.ToggleAFKFishing": "切换 AFK 钓鱼模式",

"hud.afk.passedout": "已停止钓鱼,因为你昏过去了。",
"hud.afk.on": "AFK 钓鱼模式开启",
"hud.afk.off": "AFK 钓鱼模式关闭",
"hud.afk.tired": "已停止钓鱼,因为你累了。",
"hud.afk.tired": "已停止钓鱼,因为你累了。",

"options.flower": "花:{0}",
"options.R": "R",
Expand Down

0 comments on commit e964544

Please sign in to comment.