~kalon33/corsix-th/master

« back to all changes in this revision

Viewing changes to CorsixTH/Lua/dialogs/fullscreen/progress_report.lua

  • Committer: corsixth.bot at gmail
  • Date: 2014-03-31 23:30:23 UTC
  • Revision ID: svn-v4:c39591fa-788f-11de-a72b-d90af8dea425:trunk:2687
Remove trailing whitespaces in .h, .cpp, .c and .lua files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    self:close()
46
46
    return
47
47
  end
48
 
  
 
48
 
49
49
  self.default_button_sound = "selectx.wav"
50
 
  
 
50
 
51
51
  -- Selected hospital number
52
52
  self.selected = 1
53
53
 
65
65
    end
66
66
    if world_goals[crit_name].lose_value then
67
67
      world_goals[crit_name].red = false
68
 
      
 
68
 
69
69
      if cur_value < world_goals[crit_name].boundary then
70
70
        world_goals[crit_name].red = true
71
71
        res_value = world_goals[crit_name].lose_value
95
95
      x = x + 30
96
96
    end
97
97
  end
98
 
  
 
98
 
99
99
  self:addPanel(0, 606, 447):makeButton(0, 0, 26, 26, 8, self.close):setTooltip(_S.tooltip.status.close)
100
 
  
 
100
 
101
101
  -- Own and competitor hospital buttons
102
102
  local function btn_handler(num)
103
103
    return --[[persistable:progress_report_hospital_button]] function()
114
114
      :setTooltip(tooltip(num))
115
115
      :enable(num == 1)
116
116
  end
117
 
  
 
117
 
118
118
  for i = 1, math.min(#world.hospitals, 4) do
119
119
    make_hosp_button(i)
120
120
  end
121
 
  
 
121
 
122
122
  self:makeTooltip(_S.tooltip.status.population_chart .. " " .. _S.misc.not_yet_implemented, 433, 64, 578, 179)
123
123
  self:makeTooltip(_S.tooltip.status.happiness, 433, 179, 578, 209)
124
124
  self:makeTooltip(_S.tooltip.status.thirst, 433, 209, 578, 239)
125
125
  self:makeTooltip(_S.tooltip.status.warmth, 433, 239, 578, 270)
126
 
  
 
126
 
127
127
  self.warning = self:addPanel(7, 252, 295)
128
128
  self.warning.visible = false
129
129
  -- TODO: 6 gray
147
147
  self.panel_sprites:draw(canvas, 5, x + x_min + width * happiness, y + 193)
148
148
  self.panel_sprites:draw(canvas, 5, x + x_min + width * thirst, y + 223)
149
149
  self.panel_sprites:draw(canvas, 5, x + x_min + width * warmth, y + 254)
150
 
  
 
150
 
151
151
  if world.free_build_mode then
152
152
    self.normal_font:drawWrapped(canvas, _S.progress_report.free_build, x + 265, y + 194, 150, "center")
153
153
  end
154
154
 
155
 
  -- Possibly show warning that it's too cold, too hot, patients not happy 
 
155
  -- Possibly show warning that it's too cold, too hot, patients not happy
156
156
  -- or if theres need to build drink machines as folks are thirsty.  Only show one at a time though!
157
157
  -- TODO the levels may need adjustment
158
158
  local msg = self.ui.hospital.show_progress_screen_warnings
179
179
function UIProgressReport:draw(canvas, x, y)
180
180
  self.background:draw(canvas, self.x + x, self.y + y)
181
181
  UIFullscreen.draw(self, canvas, x, y)
182
 
  
 
182
 
183
183
  x, y = self.x + x, self.y + y
184
184
  local app      = self.ui.app
185
185
  local hospital = self.ui.hospital
186
186
  local world    = hospital.world
187
187
  local world_goals = world.goals
188
 
  
 
188
 
189
189
  -- Names of the players playing
190
190
  local ly = 73
191
191
  for pnum, player in ipairs(world.hospitals) do
193
193
    font:draw(canvas, player.name:upper(), x + 272, y + ly)
194
194
    ly = ly + 25
195
195
  end
196
 
  
 
196
 
197
197
  -- Draw the vertical bars for the winning conditions
198
198
  local lx = 270
199
199
  for i, tab in ipairs(world_goals) do
224
224
  end
225
225
 
226
226
  self:drawMarkers(canvas, x, y)
227
 
      
228
 
  self.normal_font:draw(canvas, _S.progress_report.header .. " " 
 
227
 
 
228
  self.normal_font:draw(canvas, _S.progress_report.header .. " "
229
229
  .. (world.year + 1999), x + 227, y + 40, 400, 0)
230
230
  self.small_font:draw(canvas, _S.progress_report.win_criteria:upper(), x + 263, y + 172)
231
 
  self.small_font:draw(canvas, _S.progress_report.percentage_pop:upper() .. " " 
 
231
  self.small_font:draw(canvas, _S.progress_report.percentage_pop:upper() .. " "
232
232
  .. (hospital.population*100) .. "%", x + 450, y + 65)
233
233
end