CorsixTH / CorsixTH

Open source clone of Theme Hospital
Other
3.98k stars 358 forks source link

[Bug] Serious radiation patients are not green in door queue dialogs #2266

Open tobylane opened 1 year ago

tobylane commented 1 year ago

Describe the issue

I can't confirm that they did appear green in the original game's door queue dialogs, but it makes sense.

Steps to Reproduce

  1. On level 12, or any level with serious radiation possible, use the cheat for all research.

  2. Build and staff a decontamination room. Generate multiple serious radiation patients and send them in.

  3. Open the door queue dialog while they wait to enter.

Expected Behaviour

They have the green animation as they do in the world and the patient view.

Save Game

Serious.sav.zip

CorsixTH Version

f25dc639a549e (Oct 2)

Operating System

macOS

Theme Hospital Version

CD

Gamelog.txt

No response

Additional Information

Screen 2022-10-06 at 18 05 32

lewri commented 1 year ago

I imagine this is also true for jellyitis patients?

lewri commented 1 year ago

This is likely where the effect should be set: https://github.com/CorsixTH/CorsixTH/blob/a4eb41684d37a139a84fdb223373d94fbc64f6cb/CorsixTH/Lua/dialogs/queue_dialog.lua#L328-L341

However, how you do it and how you'd sync it to the actual patient's state is another thing (for jellyitis, really).

lewri commented 5 months ago

So yes. It is possible just to dump the function call inside UIQueue:drawPatient bu it just causes the the patient to flicker green very fast, probably because of the draw operations every tick.

image

function UIQueue:drawPatient(canvas, x, y, patient)
  local anim = TH.animation()
  local idle_anim = patient.getIdleAnimation(patient.humanoid_class)
  anim:setAnimation(self.ui.app.world.anims, idle_anim, 1) -- flag 1 is for having patients in west position (looking the door in the dialog)
  for layer, id in pairs(patient.layers) do
    anim:setLayer(layer, id)
  end
++  anim:setPatientEffect(patient.disease.effect or AnimationEffect.None)
  anim:draw(canvas, x, y)
  -- Also draw the mood of the patient, if any.
  local mood = patient:getCurrentMood()
  if mood then
    mood:draw(canvas, x, y + 24)
  end
end

You definitely would need to implement some kind of synchronisation feature to properly support this.