Commit 6c580ba1 authored by Adam Leyshon's avatar Adam Leyshon
Browse files

Merge branch 'develop' into 'master'

0.18.1.0 released.

See merge request GWP/Release!5
parents 8e85ed84 9a9a9a7a
<?xml version="1.0"?>
<!-- Generated by NAntBuilder v2.0 -->
<project default="A17">
<property name="ModName" value="GlitterWorldPrime [A17]" />
<property name="ModPath" value="F:\Games\RimWorld1557Win\Mods\Glitterworld Prime A17\" />
<!-- Name: 'ModOutput' Value: 'C:\Users\aleyshon\Desktop\Mod\GlitterWorldPrime [A17] Debug\' -->
<property name="ModOutput" value="C:\Users\aleyshon\Desktop\Mod\GlitterWorldPrime [A17] Debug\" />
<property name="ModBinary" value="${ModPath}\Assemblies\GlitterWorld Prime.dll" />
<property name="MSBuildPath" value="C:\Program Files (x86)\MSBuild\14.0\Bin\Msbuild.exe" />
<property name="SteamModFolder" value="E:\Games\Steam\steamapps\common\RimWorld\Mods" />
<target name="A17">
<echo message="Building default target " />
<!-- Build Debug -->
<exec program="${MSBuildPath}">
<arg value="${ModPath}\Glitterworld Prime.sln" />
<arg value="/t:Clean,Build" />
<arg value="/p:Configuration=Debug" />
</exec>
<!-- Set Git Output File -->
<property name="git.output.file" value="${path::get-temp-path()}\sha1.txt" />
<!-- Get Git SHA -->
<exec program="git.exe" commandline="rev-parse --short HEAD" workingdir="${ModPath}" output="${git.output.file}" />
<!-- Get SHA from File -->
<loadfile file="${git.output.file}" property="git.output" />
<!-- Cleanup Git Output -->
<property name="ModSHA" value="${string::trim(git.output)}" />
<!-- Copy About Folder -->
<copy todir="${ModOutput}\About" overwrite="True">
<fileset basedir="${ModPath}\About" />
</copy>
<!-- Load About.xml -->
<loadfile file="${ModOutput}\About\About.xml" property="ModAbout">
<filterchain>
<replacetokens>
<token key="SHAHASH" value="${ModSHA}" />
</replacetokens>
</filterchain>
</loadfile>
<!-- Save About.xml -->
<echo message="${ModAbout}" file="${ModOutput}\About\About.xml" />
<!-- Get Version Info -->
<property name="ModBinaryVersion" value="${assemblyname::get-version(assemblyname::get-assembly-name(ModBinary))}" />
<!-- Load Version.xml -->
<loadfile file="${ModOutput}\About\Version.xml" property="ModVersion">
<filterchain>
<replacetokens>
<token key="Version" value="${ModBinaryVersion}" />
</replacetokens>
</filterchain>
</loadfile>
<!-- Save Version.xml -->
<echo message="${ModVersion}" file="${ModOutput}\About\Version.xml" />
<!-- Copy Assemblies -->
<copy todir="${ModOutput}\Assemblies" overwrite="True">
<fileset basedir="${ModPath}\Assemblies">
<include name="*.dll" />
</fileset>
</copy>
<!-- Copy Defs -->
<copy todir="${ModOutput}\Defs" overwrite="True">
<fileset basedir="${ModPath}\Defs" />
</copy>
<!-- Copy Textures -->
<copy todir="${ModOutput}\Textures" overwrite="True">
<fileset basedir="${ModPath}\Textures" />
</copy>
<zip zipfile="${ModOutput}\..\..\${ModName} Build ${ModSHA}.zip" if="False">
<fileset prefix="${ModName}" basedir="${ModOutput}">
<include name="**/*" />
</fileset>
</zip>
<delete dir="${SteamModFolder}\${ModName}" />
<!-- Copy Mod to Steam -->
<copy todir="${SteamModFolder}\${ModName}\" overwrite="True">
<fileset basedir="${ModOutput}" />
</copy>
</target>
</project>
<?xml version="1.0"?>
<!-- Generated by NAntBuilder v2.0 -->
<project default="A17">
<property name="ModName" value="GlitterWorldPrime [A17]" />
<property name="ModPath" value="F:\Games\RimWorld1557Win\Mods\Glitterworld Prime A17\" />
<property name="ModOutput" value="C:\Users\aleyshon\Desktop\Mod\GlitterWorldPrime [A17]\" />
<property name="ModBinary" value="${ModPath}\Assemblies\GlitterWorld Prime.dll" />
<property name="MSBuildPath" value="C:\Program Files (x86)\MSBuild\14.0\Bin\Msbuild.exe" />
<property name="SteamModFolder" value="E:\Games\Steam\steamapps\common\RimWorld\Mods" />
<target name="A17">
<echo message="Building default target " />
<!-- Build Release -->
<exec program="${MSBuildPath}">
<arg value="${ModPath}\Glitterworld Prime.sln" />
<arg value="/t:Clean,Build" />
<arg value="/p:Configuration=Release" />
</exec>
<!-- Set Git Output File -->
<property name="git.output.file" value="${path::get-temp-path()}\sha1.txt" />
<!-- Get Git SHA -->
<exec program="git.exe" commandline="rev-parse --short HEAD" workingdir="${ModPath}" output="${git.output.file}" />
<!-- Get SHA from File -->
<loadfile file="${git.output.file}" property="git.output" />
<!-- Cleanup Git Output -->
<property name="ModSHA" value="${string::trim(git.output)}" />
<!-- Copy About Folder -->
<copy todir="${ModOutput}\About" overwrite="True">
<fileset basedir="${ModPath}\About" />
</copy>
<!-- Load About.xml -->
<loadfile file="${ModOutput}\About\About.xml" property="ModAbout">
<filterchain>
<replacetokens>
<token key="SHAHASH" value="${ModSHA}" />
</replacetokens>
</filterchain>
</loadfile>
<!-- Save About.xml -->
<echo message="${ModAbout}" file="${ModOutput}\About\About.xml" />
<!-- Get Version Info -->
<property name="ModBinaryVersion" value="${assemblyname::get-version(assemblyname::get-assembly-name(ModBinary))}" />
<!-- Load Version.xml -->
<loadfile file="${ModOutput}\About\Version.xml" property="ModVersion">
<filterchain>
<replacetokens>
<token key="Version" value="${ModBinaryVersion}" />
</replacetokens>
</filterchain>
</loadfile>
<!-- Save Version.xml -->
<echo message="${ModVersion}" file="${ModOutput}\About\Version.xml" />
<!-- Copy Assemblies -->
<copy todir="${ModOutput}\Assemblies" overwrite="True">
<fileset basedir="${ModPath}\Assemblies">
<include name="*.dll" />
</fileset>
</copy>
<!-- Copy Defs -->
<copy todir="${ModOutput}\Defs" overwrite="True">
<fileset basedir="${ModPath}\Defs" />
</copy>
<!-- Copy Textures -->
<copy todir="${ModOutput}\Textures" overwrite="True">
<fileset basedir="${ModPath}\Textures" />
</copy>
<zip zipfile="${ModOutput}\..\..\${ModName} Build ${ModSHA}.zip">
<fileset prefix="${ModName}" basedir="${ModOutput}">
<include name="**/*" />
</fileset>
</zip>
<delete dir="${SteamModFolder}\${ModName}" />
<!-- Copy Mod to Steam -->
<copy todir="${SteamModFolder}\${ModName}\" overwrite="True">
<fileset basedir="${ModOutput}" />
</copy>
</target>
</project>
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>GlitterWorld Prime [B18]</name>
<name>GlitterWorld Prime [B19]</name>
<author>TwistedSoul / TheCodeCache.NET</author>
<targetVersion>0.18.0</targetVersion>
<targetVersion>0.19.0</targetVersion>
<url>https://www.thecodecache.net</url>
<description>
Build: @SHAHASH@ \n
&lt;color=orange&gt;&lt;b&gt;Warning: &lt;/b&gt; \n
While care has been taken to make sure stuff works, \n
Your items can be lost if the trade with the server fails.&lt;/color&gt;\n
By using this mod you acknowledge this and accept the risk.
Anything you want, delivered anywhere in the universe in under 24 earth hours!
</description>
</ModMetaData>
1206654786
\ No newline at end of file
1515842571
\ No newline at end of file
<?xml version="1.0"?>
<!-- Generated by NAntBuilder v2.0 -->
<project default="B18">
<property name="ModName" value="GlitterWorldPrime [B18]" />
<property name="ModPath" value="F:\Games\RimWorld1722Win\Mods\Glitterworld Prime B18\" />
<!-- Name: 'ModOutput' Value: 'C:\Users\aleyshon\Desktop\Mod\GlitterWorldPrime [B18]\' -->
<property name="ModOutput" value="C:\Users\aleyshon\Desktop\Mod\GlitterWorldPrime [B18]\" />
<property name="ModBinary" value="${ModPath}\Assemblies\GlitterWorld Prime.dll" />
<property name="MSBuildPath" value="C:\Program Files (x86)\MSBuild\14.0\Bin\Msbuild.exe" />
<property name="SteamModFolder" value="E:\Games\Steam\steamapps\common\RimWorld\Mods" />
<target name="B18">
<echo message="Building default target " />
<!-- Build Release -->
<exec program="${MSBuildPath}">
<arg value="${ModPath}\Glitterworld Prime.sln" />
<arg value="/t:Clean,Build" />
<arg value="/p:Configuration=Release B18" />
</exec>
<!-- Set Git Output File -->
<property name="git.output.file" value="${path::get-temp-path()}\sha1.txt" />
<!-- Get Git SHA -->
<exec program="git.exe" commandline="rev-parse --short HEAD" workingdir="${ModPath}" output="${git.output.file}" />
<!-- Get SHA from File -->
<loadfile file="${git.output.file}" property="git.output" />
<!-- Cleanup Git Output -->
<property name="ModSHA" value="${string::trim(git.output)}" />
<!-- Copy About Folder -->
<copy todir="${ModOutput}\About" overwrite="True">
<fileset basedir="${ModPath}\About" />
</copy>
<!-- Load About.xml -->
<loadfile file="${ModOutput}\About\About.xml" property="ModAbout">
<filterchain>
<replacetokens>
<token key="SHAHASH" value="${ModSHA}" />
</replacetokens>
</filterchain>
</loadfile>
<!-- Save About.xml -->
<echo message="${ModAbout}" file="${ModOutput}\About\About.xml" />
<!-- Get Version Info -->
<property name="ModBinaryVersion" value="${assemblyname::get-version(assemblyname::get-assembly-name(ModBinary))}" />
<!-- Load Version.xml -->
<loadfile file="${ModOutput}\About\Version.xml" property="ModVersion">
<filterchain>
<replacetokens>
<token key="Version" value="${ModBinaryVersion}" />
</replacetokens>
</filterchain>
</loadfile>
<!-- Save Version.xml -->
<echo message="${ModVersion}" file="${ModOutput}\About\Version.xml" />
<!-- Copy Assemblies -->
<copy todir="${ModOutput}\Assemblies" overwrite="True">
<fileset basedir="${ModPath}\Assemblies">
<include name="*.dll" />
</fileset>
</copy>
<!-- Copy Defs -->
<copy todir="${ModOutput}\Defs" overwrite="True">
<fileset basedir="${ModPath}\Defs" />
</copy>
<!-- Copy Textures -->
<copy todir="${ModOutput}\Textures" overwrite="True">
<fileset basedir="${ModPath}\Textures" />
</copy>
<zip zipfile="${ModOutput}\..\..\${ModName} Build ${ModSHA}.zip">
<fileset prefix="${ModName}" basedir="${ModOutput}">
<include name="**/*" />
</fileset>
</zip>
<delete dir="${SteamModFolder}\${ModName}" />
<!-- Copy Mod to Steam -->
<copy todir="${SteamModFolder}\${ModName}\" overwrite="True">
<fileset basedir="${ModOutput}" />
</copy>
</target>
</project>
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<ThingDef ParentName="BuildingBase">
<defName>PrimeUplink</defName>
<label>prime uplink satellite</label>
<thingClass>Glitterworld_Prime.Building_PrimeUplink</thingClass>
<size>(2,2)</size>
<graphicData>
<texPath>Things/Buildings/PrimeUplink</texPath>
<graphicClass>Graphic_Single</graphicClass>
<drawSize>2</drawSize>
</graphicData>
<altitudeLayer>Building</altitudeLayer>
<passability>Impassable</passability>
<terrainAffordanceNeeded>Medium</terrainAffordanceNeeded>
<statBases>
<MaxHitPoints>75</MaxHitPoints>
<WorkToBuild>800</WorkToBuild>
<Flammability>0.5</Flammability>
<Mass>5</Mass>
</statBases>
<description>Required for trading with GlitterWorld Prime.</description>
<drawerType>MapMeshAndRealTime</drawerType>
<drawPlaceWorkersWhileSelected>true</drawPlaceWorkersWhileSelected>
<fillPercent>0.5</fillPercent>
<costList>
<Steel>100</Steel>
<ComponentIndustrial>6</ComponentIndustrial>
</costList>
<comps>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>200</basePowerConsumption>
<shortCircuitInRain>false</shortCircuitInRain>
</li>
<li Class="CompProperties_Breakdownable"/>
</comps>
<leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
<designationCategory>Misc</designationCategory>
<rotatable>false</rotatable>
<researchPrerequisites>
<li>MicroelectronicsBasics</li>
</researchPrerequisites>
</ThingDef>
</Defs>
\ No newline at end of file
......@@ -7,9 +7,10 @@
<graphicData>
<texPath>Things/Buildings/PrimeConsole</texPath>
<graphicClass>Graphic_Single</graphicClass>
<drawSize>(5,4)</drawSize>
<drawSize>(1,2)</drawSize>
<damageData>
<rect>(0,0,3,1.8)</rect>
<cornerTL>Damage/Corner</cornerTL>
<cornerTR>Damage/Corner</cornerTR>
<cornerBL>Damage/Corner</cornerBL>
<cornerBR>Damage/Corner</cornerBR>
</damageData>
......@@ -26,10 +27,10 @@
<Flammability>1.0</Flammability>
</statBases>
<description>Allows placing of orders with GlitterWorld Prime</description>
<size>(3,2)</size>
<size>(1,2)</size>
<costList>
<Steel>120</Steel>
<ComponentIndustrial>4</ComponentIndustrial>
<Steel>200</Steel>
<ComponentIndustrial>6</ComponentIndustrial>
</costList>
<interactionCellOffset>(0,0,2)</interactionCellOffset>
<hasInteractionCell>true</hasInteractionCell>
......@@ -41,7 +42,7 @@
<comps>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>200</basePowerConsumption>
<basePowerConsumption>80</basePowerConsumption>
<shortCircuitInRain>true</shortCircuitInRain>
</li>
<li Class="CompProperties_Flickable"/>
......
......@@ -7,14 +7,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glitterworld Prime", "Glitt
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug B18|Any CPU = Debug B18|Any CPU
Release B18|Any CPU = Release B18|Any CPU
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1976D016-8918-48C9-A54E-4D9EF7F200B7}.Debug B18|Any CPU.ActiveCfg = Debug B18|Any CPU
{1976D016-8918-48C9-A54E-4D9EF7F200B7}.Debug B18|Any CPU.Build.0 = Debug B18|Any CPU
{1976D016-8918-48C9-A54E-4D9EF7F200B7}.Release B18|Any CPU.ActiveCfg = Release B18|Any CPU
{1976D016-8918-48C9-A54E-4D9EF7F200B7}.Release B18|Any CPU.Build.0 = Release B18|Any CPU
{1976D016-8918-48C9-A54E-4D9EF7F200B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1976D016-8918-48C9-A54E-4D9EF7F200B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1976D016-8918-48C9-A54E-4D9EF7F200B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1976D016-8918-48C9-A54E-4D9EF7F200B7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RimWorld;
using Verse;
namespace Glitterworld_Prime
{
class Building_PrimeUplink : Building
{
public static bool HasUplink(Map map)
{
var poweredList = new List<Thing>();
var alllist = map.listerThings.ThingsOfDef(DefDatabase<ThingDef>.GetNamed("PrimeUplink"));
foreach (var uplinkThing in alllist)
{
var trader = uplinkThing.TryGetComp<CompPowerTrader>();
if (trader != null && trader.PowerOn)
{
poweredList.Add(uplinkThing);
}
}
return poweredList.Count > 0;
}
}
}
......@@ -54,44 +54,55 @@ namespace Glitterworld_Prime
if (!Utilities.HasBaseNameBeenSet(myPawn.Map))
{
var floatMenuOption1 =
new FloatMenuOption("Base name has been set or Map not owned by Player".Translate(), null);
new FloatMenuOption("GWPNeedBaseName".Translate(), null);
floatMenuOptions = new List<FloatMenuOption>
{
floatMenuOption1
};
return floatMenuOptions;
}
// At this point, There's no order, We can reach the console and it's not reserved.
floatMenuOptions = new List<FloatMenuOption>();
var tradeship = mapComponent.GetTradeShip();
var communicable = (ICommunicable) tradeship; // Cast trader as ICommunicable;
if (communicable != null)
Action action = delegate
{
Action action = delegate
if (!Building_PrimeUplink.HasUplink(myPawn.Map))
{
if (!Building_OrbitalTradeBeacon.AllPowered(Map).Any())
{
Messages.Message("MessageNeedBeaconToTradeWithShip".Translate(), this,
MessageTypeDefOf.RejectInput);
return;
}
var job = new Job(JobDefOf.UseCommsConsole, this);
job.commTarget = communicable;
myPawn.jobs.TryTakeOrderedJob(job, JobTag.Misc);
PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.OpeningComms, KnowledgeAmount.Total);
};
floatMenuOptions.Add(FloatMenuUtility.DecoratePrioritizedTask(
new FloatMenuOption(tradeship.TraderName, action, MenuOptionPriority.InitiateSocial, null, null, 0f,
null, null), myPawn, this, "ReservedBy"));
}
Messages.Message("GWPNeedUplink".Translate(), this,
MessageTypeDefOf.RejectInput);
return;
}
if (!Building_OrbitalTradeBeacon.AllPowered(Map).Any())
{
Messages.Message("MessageNeedBeaconToTradeWithShip".Translate(), this,
MessageTypeDefOf.RejectInput);
return;
}
var job = new Job(JobDefOf.UseCommsConsole, this) {commTarget = communicable};
myPawn.jobs.TryTakeOrderedJob(job, JobTag.Misc);
PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.OpeningComms, KnowledgeAmount.Total);
};
#if DEBUG
floatMenuOptions.Add(FloatMenuUtility.DecoratePrioritizedTask(
new FloatMenuOption("Dump Thing data", Tools.DumpThingData.DumpData, MenuOptionPriority.InitiateSocial, null, null, 0f,
null, null), myPawn, this, "ReservedBy"));
#endif
floatMenuOptions.Add(FloatMenuUtility.DecoratePrioritizedTask(
new FloatMenuOption(tradeship.TraderName, action, MenuOptionPriority.InitiateSocial, null, null, 0f,
null, null), myPawn, this, "ReservedBy"));
return floatMenuOptions;
}
public override void SpawnSetup(Map map, bool respawningAfterLoad)
{
base.SpawnSetup(map, respawningAfterLoad);
......@@ -99,4 +110,4 @@ namespace Glitterworld_Prime
#endregion
}
}
\ No newline at end of file
}
......@@ -3,7 +3,7 @@
// This file was created by TwistedSoul @ TheCodeCache.net
// You are free to inspect the mod but may not modify or redistribute without my express permission.
// However! If you would like to contribute to GWP please feel free to drop me a message.
// Glitterworld Prime, DialogPrimeCheckSubscription.cs, Created 2018-01-16
// Glitterworld Prime, DialogPrimeCheckSubscription.cs, Created 2018-07-22
#endregion
......@@ -124,7 +124,7 @@ namespace Glitterworld_Prime
break;
case DownloadStatus.Failed:
Messages.Message("GlitterWorld Prime Unavailable.", MessageTypeDefOf.NegativeEvent);
Messages.Message("GWPUnavailable".Translate(), MessageTypeDefOf.NegativeEvent);
Close();
break;
}
......@@ -157,17 +157,34 @@ namespace Glitterworld_Prime
_isDownloadComplete = DownloadStatus.Failed;
return;
}
// Get Unique Colony ID if one isn't set.
if (_mapComponent.ColonyId.NullOrEmpty())
if (!GlitterWorldApi.CreateNewColonyId(_player.Map))
#if DEBUG
LogWriter.WriteMessage($"User type is {Utilities.GetUserType()}");
LogWriter.WriteMessage($"User ID is {Utilities.GetUserId()}");
#endif
if (Utilities.GetUserType() == "Normal" && Utilities.GetUserId().NullOrEmpty())
{
var result = GlitterWorldApi.CreateUserId();
if (result == null)
{
_isDownloadComplete = DownloadStatus.Failed;
return;
}
Utilities.StoreUserId(result);
}
else
{
#if DEBUG
LogWriter.WriteMessage($"Not creating new ID");
#endif
}
// Update Colony MetaData
GlitterWorldApi.UploadColonyMetadata(_player.Map);
if (!GlitterWorldApi.SendColonyMeta(_player.Map))
{
_isDownloadComplete = DownloadStatus.Failed;
return;
}
// Check if the user has a subscription and how long is left.
_subscriptionMeta = GlitterWorldApi.GetSubscriptionData(_player.Map);
......@@ -187,10 +204,10 @@ namespace Glitterworld_Prime
private Dialog_MessageBox AskRenew(Action confirm, Action cancel)
{
var text1 = $"Resubscribe? This will cost {_subscriptionMeta.SubscriptionCost} Silver for 1 Quadrum.";
var text1 = $"{"GWPDialogSubscribe1".Translate()} {_subscriptionMeta.SubscriptionCost} {"GWPCurrency".Translate()} {"GWPDialogSubscribe2".Translate()} {"GWPSubscriptionDuration".Translate()}";
var text2 = "Confirm".Translate();
var text3 = "GoBack".Translate();
var text4 = "GlitterWorld Prime Subscription";
var text4 = "GWPDialogSubscribeTitle".Translate();
return new Dialog_MessageBox(text1, text2, confirm, text3, cancel, text4, false);
}
......@@ -198,10 +215,10 @@ namespace Glitterworld_Prime
private Dialog_MessageBox CannotAffordSub()
{
var s = new StringBuilder();
s.AppendLine("Your GlitterWorld Prime Subscription has ended");
s.AppendLine("But you cannot afford to renew, The cost is: ");
s.AppendLine($"{_subscriptionMeta.SubscriptionCost} Silver");
return new Dialog_MessageBox(s.ToString(), title: "Not enough Silver");
s.AppendLine("GWPDialgoCantAffordSubscription1".Translate());
s.AppendLine("GWPDialgoCantAffordSubscription2".Translate());
s.AppendLine($"{_subscriptionMeta.SubscriptionCost} {"GWPCurrency".Translate()}");
return new Dialog_MessageBox(s.ToString(), title: "GWPDialgoCantAffordSubscriptionTitle".Translate());
}
#endregion
......
......@@ -3,7 +3,7 @@
// This file was created by TwistedSoul @ TheCodeCache.net
// You are free to inspect the mod but may not modify or redistribute without my express permission.
// However! If you would like to contribute to GWP please feel free to drop me a message.
// Glitterworld Prime, DialogPrimeGetData.cs, Created 2017-11-18
// Glitterworld Prime, DialogPrimeGetData.cs, Created 2018-07-22
#endregion
......@@ -93,7 +93,7 @@ namespace Glitterworld_Prime
break;
case DownloadStatus.Failed:
Messages.Message("There was an error downloading the data", MessageTypeDefOf.NegativeEvent);
Messages.Message("GWPCantGetMarketData".Translate(), MessageTypeDefOf.NegativeEvent);
Close();
break;
}
......@@ -139,4 +139,4 @@ namespace Glitterworld_Prime
#endregion
}
}
\ No newline at end of file
}
......@@ -162,42 +162,47 @@ namespace Glitterworld_Prime
AcceptButtonSize.y);
if (Widgets.ButtonText(rect9, "AcceptButton".Translate(), true, false, true))
{
Action action = delegate
{
bool flag;
var tracker = Utilities.GetMapComponent(TradeSession.playerNegotiator.Map).OrderTracker;
if (TradeSession.deal.TryExecute(out flag))
{
if (flag)
{
var orderSuccess = tracker.TryPlaceOrder((TraderPrime) TradeSession.trader);
// Were we able to place the order?
if (orderSuccess)
{
// Yes, Plav a sound and record the trade deal for the pawn.
SoundDefOf.ExecuteTrade.PlayOneShotOnCamera(null);
var pawn = TradeSession.trader as Pawn;