How do you show welfare changes with limited entry versus perfect competition?
I think calling this 'trick' is a bit of a misnomer because there is nothing particularly tricky about it.
When you make any welfare analysis of some change (tax/quota etc.) you need to compare situation after change with situation before change. For that reason you calculate the deadweight loss (DWL) of policy as a difference between consumer surplus before policy and after policy.
In your case the problem (including new restricted supply $S_R$ - painted in red color) would look like in the following picture I made (I linearized the problem in order to make the picture easier to render).
In order to calculate deadweight loss here you would first calculate the area of big triangle bounded by the original supply and demand (in black) and then subtract the area of the trapezoid that is created by the new restricted supply (in red).
I am surprised they call it a trick in that textbook since this is how DWL from a policy is defined. Following Mankiw Principles of Microeconomics 8th ed. pp 157:

Deadweight Loss: the fall in total surplus that results from a market distortion, such as a tax

To calculate what a fall in CS is you need to either implicitly or explicitly take into account what the original situation was. One way of how to calculate this explicitly is to see what the original supply and demand was and comparing it to the new situation.