Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix: [StationMap] Re-enabled Sell-Button for cablenetworks and satell…
…ites
  • Loading branch information
GWRon committed Feb 20, 2018
1 parent 6b1a62c commit fc5354a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 28 deletions.
55 changes: 29 additions & 26 deletions source/game.screen.stationmap.bmx
Expand Up @@ -824,19 +824,21 @@ Type TGameGUICableNetworkPanel Extends TGameGUIBasicStationmapPanel


if TStationCableNetworkUplink(TScreenHandler_StationMap.selectedStation)
local provider:TStationMap_BroadcastProvider = TScreenHandler_StationMap.selectedStation.GetProvider()
'disable action button if subscription not possible
if provider
if provider.CanSubscribeChannel(GetPlayerBase().playerID, -1) <= 0 or provider.IsSubscribedChannel(GetPlayerBase().playerID)
Select provider.CanSubscribeChannel(GetPlayerBase().playerID, -1)
case -1
actionButton.SetValue(GetLocale("CHANNEL_IMAGE_TOO_LOW"))
case -2
actionButton.SetValue(GetLocale("CHANNEL_LIMIT_REACHED"))
End Select
actionButton.Disable()
else
actionButton.Enable()
if TScreenHandler_StationMap.IsInBuyActionMode()
local provider:TStationMap_BroadcastProvider = TScreenHandler_StationMap.selectedStation.GetProvider()
'disable action button if subscription not possible
if provider
if provider.CanSubscribeChannel(GetPlayerBase().playerID, -1) <= 0 or provider.IsSubscribedChannel(GetPlayerBase().playerID)
Select provider.CanSubscribeChannel(GetPlayerBase().playerID, -1)
case -1
actionButton.SetValue(GetLocale("CHANNEL_IMAGE_TOO_LOW"))
case -2
actionButton.SetValue(GetLocale("CHANNEL_LIMIT_REACHED"))
End Select
actionButton.Disable()
else
actionButton.Enable()
endif
endif
endif
EndIf
Expand Down Expand Up @@ -1169,19 +1171,20 @@ endrem


if TScreenHandler_StationMap.selectedStation

'disable action button if subscription not possible
if openFrame
actionButton.Enable()
if selectedSatellite
if selectedSatellite.CanSubscribeChannel(GetPlayerBase().playerID, -1) <= 0 or selectedSatellite.IsSubscribedChannel(GetPlayerBase().playerID)
Select selectedSatellite.CanSubscribeChannel(GetPlayerBase().playerID, -1)
case -1
actionButton.SetValue(GetLocale("CHANNEL_IMAGE_TOO_LOW"))
case -2
actionButton.SetValue(GetLocale("CHANNEL_LIMIT_REACHED"))
End Select
actionButton.Disable()
if TScreenHandler_StationMap.IsInBuyActionMode()
'disable action button if subscription not possible
if openFrame
actionButton.Enable()
if selectedSatellite
if selectedSatellite.CanSubscribeChannel(GetPlayerBase().playerID, -1) <= 0 or selectedSatellite.IsSubscribedChannel(GetPlayerBase().playerID)
Select selectedSatellite.CanSubscribeChannel(GetPlayerBase().playerID, -1)
case -1
actionButton.SetValue(GetLocale("CHANNEL_IMAGE_TOO_LOW"))
case -2
actionButton.SetValue(GetLocale("CHANNEL_LIMIT_REACHED"))
End Select
actionButton.Disable()
endif
endif
endif
endif
Expand Down
7 changes: 5 additions & 2 deletions source/game.stationmap.bmx
Expand Up @@ -659,7 +659,7 @@ Type TStationMapCollection
local c:Double = populationCableShareData.GetInterpolatedValue(t)
local s:Double = populationSatelliteShareData.GetInterpolatedValue(t)
local sum:Double = a + c + s
print "year="+y+" antenna="+ Rset(MathHelper.NumberToString(a*100,1),5)+"%"+" cable="+Rset(MathHelper.NumberToString(c*100,1),5)+"%"+" satellite="+RSet(MathHelper.NumberToString(s*100,1),5)+"%"+ " sum="+RSet(MathHelper.NumberToString(sum*100,1),6)+"%"
print "year="+y+" antenna="+ Rset(MathHelper.NumberToString(a*100,1),5)+"%"+" cable="+Rset(MathHelper.NumberToString(c*100,1),5)+"%"+" satellite="+RSet(MathHelper.NumberToString(s,1),5)+"%"+ " sum="+RSet(MathHelper.NumberToString(sum*100,1),6)+"%"
Next
end
endrem
Expand Down Expand Up @@ -2710,6 +2710,9 @@ Type TStationBase Extends TOwnedGameObject {_exposeToLua="selected"}
'display broadcast permission price?
If showPermissionPriceText > 0
tooltipH :+ 2*textH
EndIf

If showPermissionPriceText > 0 or cantGetSectionPermissionReason <= 0
tooltipW :+ 40
EndIf

Expand Down Expand Up @@ -2760,7 +2763,7 @@ Type TStationBase Extends TOwnedGameObject {_exposeToLua="selected"}
if provider then minImage = provider.minimumChannelImage

GetBitmapFontManager().baseFont.draw(GetLocale("CHANNEL_IMAGE")+" ("+GetLocale("PROVIDER")+"): ", textX, textY)
GetBitmapFontManager().baseFontBold.drawBlock(MathHelper.NumberToString(minImage*100,2)+" %", textX, textY-1, textW, 20, ALIGN_RIGHT_TOP, new TColor.Create(255,150,150))
GetBitmapFontManager().baseFontBold.drawBlock(MathHelper.NumberToString(minImage,2)+" %", textX, textY-1, textW, 20, ALIGN_RIGHT_TOP, new TColor.Create(255,150,150))
textY:+ textH
EndIf

Expand Down

0 comments on commit fc5354a

Please sign in to comment.