~kalon33/corsix-th/master

« back to all changes in this revision

Viewing changes to CorsixTH/Lua/dialogs/fullscreen/hospital_policy.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:
36
36
    self:close()
37
37
    return
38
38
  end
39
 
  
 
39
 
40
40
  local hosp = ui.hospital
41
41
  self.hospital = hosp
42
 
  
 
42
 
43
43
  local --[[persistable:hospital_policy_allow_staff]] function allowStaff(name, state, btn)
44
44
    if name == "Allow" then
45
45
      if self.prohibit_button.toggled then -- Changing setting from prohibit to allow
57
57
      end
58
58
    end
59
59
  end
60
 
  
 
60
 
61
61
  -- Buttons
62
62
  self:addPanel(0, 607, 447):makeButton(0, 0, 26, 26, 6, self.close):setTooltip(_S.tooltip.policy.close)
63
63
  self.allow_button = self:addPanel(0, 348, 379):makeToggleButton(0, 0, 48, 17, 4, allowStaff, "Allow"):setTooltip(_S.tooltip.policy.staff_leave) -- Allow staff to move
64
64
  self.prohibit_button = self:addPanel(0, 395, 379):makeToggleButton(0, 0, 48, 17, 5, allowStaff, "Prohibit"):setTooltip(_S.tooltip.policy.staff_stay) -- Prohibit staff to move
65
 
  
 
65
 
66
66
  if self.hospital.policies["staff_allowed_to_move"] then
67
67
    self.allow_button:toggle()
68
68
  else
69
69
    self.prohibit_button:toggle()
70
70
  end
71
 
  
 
71
 
72
72
  -- Slider positions
73
73
  local guess = 129 + hosp.policies["guess_cure"]*299
74
74
  local home = 129 + hosp.policies["send_home"]*299
75
75
  local stop = 124 + (hosp.policies["stop_procedure"] - 1)*299
76
76
  local staffroom = 149 + hosp.policies["goto_staffroom"]*250
77
 
  
 
77
 
78
78
  -- Sliders
79
79
  self.sliders = {}
80
80
  self.sliders["guess_cure"] = self:addPanel(2, guess, 119, 82, 44)
82
82
  self.sliders["stop_procedure"] = self:addPanel(3, stop, 210, 92, 28)
83
83
  self.sliders["goto_staffroom"] = self:addPanel(3, staffroom, 285, 92, 28)
84
84
  self.sliders["guess_cure"].min_x = home
85
 
  self.sliders["guess_cure"].total_min_x = 129 -- Needed to get the correct value set when 
 
85
  self.sliders["guess_cure"].total_min_x = 129 -- Needed to get the correct value set when
86
86
  -- windows is closed.
87
87
  self.sliders["guess_cure"].max_x = 428
88
88
  self.sliders["send_home"].min_x = 129
93
93
  self.sliders["stop_procedure"].addition = true -- This value goes from 1 to 2.
94
94
  self.sliders["goto_staffroom"].min_x = 149
95
95
  self.sliders["goto_staffroom"].max_x = 399
96
 
  
 
96
 
97
97
  -- Tooltips for slider bars
98
98
  self:makeTooltip(_S.tooltip.policy.diag_procedure,   161, 119, 479, 174)
99
99
  self:makeTooltip(_S.tooltip.policy.diag_termination, 161, 210, 479, 249)
104
104
  self.background:draw(canvas, self.x + x, self.y + y)
105
105
  UIFullscreen.draw(self, canvas, x, y)
106
106
  x, y = self.x + x, self.y + y
107
 
  
 
107
 
108
108
  local text = self.text_font
109
109
  local label = self.label_font
110
110
 
117
117
  label:draw(canvas, _S.policy.sliders.stop, x + added_x, y + added_y + 2, 92, 0)
118
118
  added_x, added_y = self.sliders["goto_staffroom"].x, self.sliders["goto_staffroom"].y
119
119
  label:draw(canvas, _S.policy.sliders.staff_room, x + added_x, y + added_y + 2, 92, 0)
120
 
  
 
120
 
121
121
  -- All other text
122
122
  text:draw(canvas, _S.policy.header,            x + 160, y + 78, 300, 0)
123
123
  text:draw(canvas, _S.policy.diag_procedure,    x + 161, y + 100)