@@ -16,7 +16,7 @@ public class BuildPanel : DragPanel
16
16
void Start ( )
17
17
{
18
18
MainCamera . buildPanel = this ;
19
- GetComponent < RectTransform > ( ) . anchoredPosition = new Vector2 ( 0f , MainCamera . topPanel . GetComponent < RectTransform > ( ) . rect . height * - 1f ) ;
19
+ GetComponent < RectTransform > ( ) . anchoredPosition = new Vector2 ( 50f , - 100f ) ;
20
20
buildButton . interactable = false ;
21
21
hide ( ) ;
22
22
}
@@ -33,13 +33,14 @@ public void onBuildClick()
33
33
//if (Game.player.economy.allowsFactoryBuildingByGovernment())
34
34
{
35
35
bool buildSomething = false ;
36
- var resourceToBuild = selectedFactoryType . getBuildNeeds ( ) ;
36
+
37
37
if ( Economy . isMarket . checkIftrue ( Game . Player ) )
38
38
//if (Game.player.economy.status == Economy.StateCapitalism)
39
39
//have money /resource
40
40
{
41
- Value cost = Game . market . getCost ( resourceToBuild ) ;
42
- cost . add ( Options . factoryMoneyReservPerLevel ) ;
41
+ //Value cost = Game.market.getCost(resourceToBuild);
42
+ //cost.add(Options.factoryMoneyReservePerLevel);
43
+ Value cost = selectedFactoryType . getMinimalMoneyToBuild ( ) ;
43
44
if ( Game . Player . canPay ( cost ) )
44
45
{
45
46
var factory = new Factory ( Game . selectedProvince , Game . Player , selectedFactoryType ) ;
@@ -52,6 +53,7 @@ public void onBuildClick()
52
53
else // non market
53
54
{
54
55
//todo remove grain connection
56
+ var resourceToBuild = selectedFactoryType . getBuildNeeds ( ) ;
55
57
Storage needFood = resourceToBuild . getFirstStorage ( Product . Grain ) ;
56
58
if ( Game . Player . countryStorageSet . has ( needFood ) )
57
59
{
@@ -82,7 +84,7 @@ public void refresh()
82
84
{
83
85
sb . Clear ( ) ;
84
86
sb . Append ( "Build " ) . Append ( selectedFactoryType ) ;
85
- var cost = Game . market . getCost ( selectedFactoryType . getBuildNeeds ( ) ) ;
87
+ var cost = selectedFactoryType . getMinimalMoneyToBuild ( ) ;
86
88
sb . Append ( "\n \n Resources to build: " ) . Append ( selectedFactoryType . getBuildNeeds ( ) ) . Append ( " cost: " ) . Append ( cost ) ;
87
89
sb . Append ( "\n Everyday resource input: " ) . Append ( selectedFactoryType . resourceInput ) ;
88
90
0 commit comments