From 3c91e03e9e242c13e36bb3848fdee77cabff8938 Mon Sep 17 00:00:00 2001 From: Chris Morris Date: Sat, 14 Apr 2012 18:46:30 +0000 Subject: [PATCH] playerBoughtCargo and playerSoldCargo world events Also add commodity-name translations for the modern names for multi-word goods git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4851 127b21dd-08f5-0310-b4b7-95ae10353056 --- Resources/Config/descriptions.plist | 6 +++++- src/Core/Entities/PlayerEntity.m | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Resources/Config/descriptions.plist b/Resources/Config/descriptions.plist index 0bca5993..41968b78 100644 --- a/Resources/Config/descriptions.plist +++ b/Resources/Config/descriptions.plist @@ -1313,7 +1313,11 @@ "commodity-name platinum" = "Platinum"; "commodity-name gem-stones" = "Gem-Stones"; "commodity-name alien items" = "Alien Items"; - + // Commodity names: new spellings + "commodity-name liquor_wines" = "Liquor/Wines"; + "commodity-name gem_stones" = "Gem-Stones"; + "commodity-name alien_items" = "Alien Items"; + // autosave filename identifier "autosave-commander-suffix" = " (autosave)"; diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m index 07e5f731..161d1843 100644 --- a/src/Core/Entities/PlayerEntity.m +++ b/src/Core/Entities/PlayerEntity.m @@ -7335,6 +7335,8 @@ static NSString *last_outfitting_key=nil; shipCommodityData = [[NSArray arrayWithArray:manifest] retain]; if ([UNIVERSE autoSave]) [UNIVERSE setAutoSaveNow:YES]; + + [self doScriptEvent:OOJSID("playerBoughtCargo") withArguments:[NSArray arrayWithObjects:CommodityTypeToString(index), [NSNumber numberWithInt:purchase], [NSNumber numberWithInt: pricePerUnit], nil]]; return YES; } @@ -7379,6 +7381,8 @@ static NSString *last_outfitting_key=nil; if ([UNIVERSE autoSave]) [UNIVERSE setAutoSaveNow:YES]; + [self doScriptEvent:OOJSID("playerSoldCargo") withArguments:[NSArray arrayWithObjects:CommodityTypeToString(index), [NSNumber numberWithInt:sell], [NSNumber numberWithInt: pricePerUnit], nil]]; + return YES; }