~kalon33/corsix-th/master

« back to all changes in this revision

Viewing changes to CorsixTH/Lua/dialogs/patient.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:
32
32
 
33
33
function UIPatient:UIPatient(ui, patient)
34
34
  self:Window()
35
 
  
 
35
 
36
36
  local app = ui.app
37
37
  self.esc_closes = true
38
38
  self.ui = ui
44
44
  self.font = app.gfx:loadFont("QData", "Font74V") -- Font used in the treatment history
45
45
  self.patient = patient
46
46
  self.visible_diamond = ui:makeVisibleDiamond(75, 76)
47
 
  
 
47
 
48
48
  self:addPanel(320,  15,   0) -- Graph top
49
49
  self:addPanel(321,  15,  61) -- Graph bottom
50
50
 
58
58
  self:addPanel(323,   0, 201) -- View circle top
59
59
  self:addPanel(324,   0, 254) -- View circle bottom
60
60
  self:addPanel(325, 147,  21):makeButton(0, 0, 24, 24, 326, self.close):setTooltip(_S.tooltip.patient_window.close)
61
 
  
 
61
 
62
62
  -- If the patient has been diagnosed the "guess cure" button is not visible and
63
63
  -- if the patient is going home it is not possible to kick him/her anymore.
64
64
  self:addPanel(411, 14 + 132, 61 + 19):makeButton(0, 0, 25, 31, 412, self.viewQueue):setTooltip(_S.tooltip.patient_window.queue)
74
74
 
75
75
  self.guess_button = self:addPanel(413, 14 + 117, 61 + 58):makeButton(0, 0, 38, 38, 414, self.guessDisease):setTooltip(_S.tooltip.patient_window.abort_diagnosis)
76
76
  self.guess_blanker = self:addColourPanel(14 + 115, 61 + 56, 45, 45, 113, 117, 170)
77
 
  
 
77
 
78
78
  -- Set correct initial visibility/enabledness of the three buttons and their blankers
79
79
  self:updateInformation()
80
 
  
 
80
 
81
81
  self:makeTooltip(_S.tooltip.patient_window.happiness, 33, 117, 124, 141)
82
82
  self:makeTooltip(_S.tooltip.patient_window.thirst,    33, 141, 124, 169)
83
83
  self:makeTooltip(_S.tooltip.patient_window.warmth,    33, 169, 124, 203)
84
 
  
 
84
 
85
85
  -- Non-rectangular tooltip has to be realized with dynamic tooltip at the moment
86
86
  self:makeDynamicTooltip(--[[persistable:patient_window_center_tooltip]]function(x, y)
87
87
    if is_in_view_circle(x, y) then
88
88
      return _S.tooltip.patient_window.center_view
89
89
    end
90
90
  end, 17, 216, 92, 292)
91
 
  
 
91
 
92
92
  -- Always add this because of a race condition if the user clicks a patient
93
93
  -- that's already going home, then clicks another, the handler is left empty. Bad.
94
94
  -- Just do a going_home check when called.
132
132
  px, py = self.ui.limitPointToDiamond(px, py, self.visible_diamond, true)
133
133
  self.ui.app.map:draw(canvas, px, py, 75, 76, x + 17, y + 216)
134
134
  Window.draw(self, canvas, x_, y_)
135
 
  
136
 
  -- The patients happiness. Each bar is by default half way if the actual value 
 
135
 
 
136
  -- The patients happiness. Each bar is by default half way if the actual value
137
137
  -- cannot be found.
138
138
  local happiness_bar_width = 22
139
139
  if patient.attributes["happiness"] then
291
291
  end
292
292
  patient:setDiagnosed(true)
293
293
  patient:setNextAction({
294
 
    name = "seek_room", 
 
294
    name = "seek_room",
295
295
    room_type = patient.disease.treatment_rooms[1],
296
296
    treatment_room = true,
297
297
  }, 1)