Skip to content

Commit

Permalink
Update ero detection app (#36)
Browse files Browse the repository at this point in the history
* Update ero detection app

Include girl and type of ero

* Split Ero App into two and better translations

Default Ero App that just points out location and "premium" app that shows girl and type of action

* Shop interface fix

Made the ero detection app actually an upgradeable purchase
  • Loading branch information
TheyCantKnowMe authored Jul 16, 2022
1 parent 8e68fa0 commit 2e9a179
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions src/KKS_MoreStoreItems/Features/EroDetectorFeat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,36 @@ public class EroDetectorFeat : IFeature
{
private static ConfigEntry<bool> _notifyMast;
private static ConfigEntry<bool> _notifyLesb;
private static string _infoTextPrefixMast = "{0}は{1}でオナニーしている";
private static string _infoTextPrefixLesb = "{0}は{1}でレズのセックスしている";
private static string _infoTextPrefix = "エロ活動:{0}";

public bool ApplyFeature(ref CompositeDisposable disp, MoreShopItemsPlugin inst)
{
const string itemName = "Ero Detection App";
const string itemUpgradeName = "Upgraded Ero Detection App";

disp.Add(StoreApi.RegisterShopItem(
itemId: MoreShopItemsPlugin.DetectorItemId,
itemName: itemName,
explaination: "A phone app that notifies you about erotic activities happening around the island. It's fully automatic and gives estimated locations.",
explaination: "A phone app that notifies you about erotic activities happening around the island. It's fully automatic and gives estimated locations. Further upgrade lets you see who and what is being done",
shopType: StoreApi.ShopType.NightOnly,
itemBackground: StoreApi.ShopBackground.Yellow,
itemCategory: 3,
stock: 1,
stock: 2,
resetsDaily: false,
cost: 200,
sort: 500));
sort: 500,
numText: "{0} available upgrades"));

disp.Add(Harmony.CreateAndPatchAll(typeof(EroDetectorFeat)));

_notifyMast = inst.Config.Bind(itemName, "Notification on masturbation", true, "If the item is purchased, show a notification whenever any NPC starts a masturbation action.");
_notifyLesb = inst.Config.Bind(itemName, "Notification on lesbian", true, "If the item is purchased, show a notification whenever any NPC starts a lesbian action.");

TranslationHelper.TranslateAsync(_infoTextPrefix, s => _infoTextPrefix = s);
TranslationHelper.TranslateAsync(_infoTextPrefixMast, s => _infoTextPrefixMast = s);
TranslationHelper.TranslateAsync(_infoTextPrefixLesb, s => _infoTextPrefixLesb = s);

return true;
}
Expand All @@ -61,7 +67,28 @@ private static void WaitPointDataChangedHook(Base __instance, Base.WaitPointData
//if (ActionScene.initialized && ActionScene.instance.Player.mapNo != mapNo)
if (ActionScene.instance.Map.infoDic.TryGetValue(mapNo, out var param))
{
InformationUI.SetAsync(string.Format(_infoTextPrefix, param.DisplayName), InformationUI.Mode.Normal).Forget();
var location = "";
TranslationHelper.TryTranslate(param.DisplayName,out location);

if (StoreApi.GetItemAmountBought(MoreShopItemsPlugin.DetectorItemId) > 1)
{
TranslationHelper.TranslateAsync(npc.charaData.Name, s =>
{
if (npc.isOnanism)
{
InformationUI.SetAsync(string.Format(_infoTextPrefixMast, s, location), InformationUI.Mode.Normal).Forget();
}
else if (npc.isLesbian)
{
InformationUI.SetAsync(string.Format(_infoTextPrefixLesb, s, location), InformationUI.Mode.Normal).Forget();
}
return;
});
return;
}

InformationUI.SetAsync(string.Format(_infoTextPrefix, location), InformationUI.Mode.Normal).Forget();

}
}
}
Expand Down

0 comments on commit 2e9a179

Please sign in to comment.