1 (* Copyright (C) DooM 2D:Forever Developers
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 {$INCLUDE ../shared/a_modes.inc}
23 g_textures
, g_basic
, e_graphics
, g_phys
, g_grid
, g_player
, g_monsters
,
24 g_window
, g_map
, g_triggers
, g_items
, g_game
, g_panel
, g_console
,
32 // both for but and for bstate
45 kind
: Byte; // motion, press, release
47 dx
, dy
: Integer; // for wheel this is wheel motion, otherwise this is relative mouse motion
48 but
: Word; // current pressed/released button, or 0 for motion
49 bstate
: Word; // button state
50 kstate
: Word; // keyboard state (see THKeyEvent);
67 scan
: Word; // SDL_SCANCODE_XXX
68 sym
: Word; // SDLK_XXX
69 bstate
: Word; // button state
70 kstate
: Word; // keyboard state
74 procedure g_Holmes_VidModeChanged ();
75 procedure g_Holmes_WindowFocused ();
76 procedure g_Holmes_WindowBlured ();
78 procedure g_Holmes_Draw ();
79 procedure g_Holmes_DrawUI ();
81 function g_Holmes_MouseEvent (var ev
: THMouseEvent
): Boolean; // returns `true` if event was eaten
82 function g_Holmes_KeyEvent (var ev
: THKeyEvent
): Boolean; // returns `true` if event was eaten
85 procedure g_Holmes_plrView (viewPortX
, viewPortY
, viewPortW
, viewPortH
: Integer);
86 procedure g_Holmes_plrLaser (ax0
, ay0
, ax1
, ay1
: Integer);
90 g_holmes_enabled
: Boolean = {$IF DEFINED(D2F_DEBUG)}true{$ELSE}false{$ENDIF};
101 //globalInited: Boolean = false;
104 msB
: Word = 0; // button state
105 kbS
: Word = 0; // keyboard modifiers state
106 showGrid
: Boolean = true;
107 showMonsInfo
: Boolean = false;
108 showMonsLOS2Plr
: Boolean = false;
109 showAllMonsCells
: Boolean = false;
110 showMapCurPos
: Boolean = false;
113 // ////////////////////////////////////////////////////////////////////////// //
114 {$INCLUDE g_holmes.inc}
115 {$INCLUDE g_holmes_ui.inc}
118 // ////////////////////////////////////////////////////////////////////////// //
120 g_ol_nice
: Boolean = false;
121 g_ol_rlayer_back
: Boolean = false;
122 g_ol_rlayer_step
: Boolean = false;
123 g_ol_rlayer_wall
: Boolean = false;
124 g_ol_rlayer_door
: Boolean = false;
125 g_ol_rlayer_acid1
: Boolean = false;
126 g_ol_rlayer_acid2
: Boolean = false;
127 g_ol_rlayer_water
: Boolean = false;
128 g_ol_rlayer_fore
: Boolean = false;
131 // ////////////////////////////////////////////////////////////////////////// //
133 winOptions
: THTopWindow
= nil;
134 winLayers
: THTopWindow
= nil;
135 winOutlines
: THTopWindow
= nil;
138 procedure createOptionsWindow ();
142 llb
:= THCtlCBListBox
.Create(0, 0);
143 llb
.appendItem('map grid', @showGrid
);
144 llb
.appendItem('cursor position on map', @showMapCurPos
);
145 llb
.appendItem('monster info', @showMonsInfo
);
146 llb
.appendItem('monster LOS to player', @showMonsLOS2Plr
);
147 llb
.appendItem('monster cells (SLOW!)', @showAllMonsCells
);
148 winOptions
:= THTopWindow
.Create('Holmes Options', 100, 100);
149 winOptions
.escClose
:= true;
150 winOptions
.appendChild(llb
);
154 procedure createLayersWindow ();
158 llb
:= THCtlCBListBox
.Create(0, 0);
159 llb
.appendItem('background', @g_rlayer_back
);
160 llb
.appendItem('steps', @g_rlayer_step
);
161 llb
.appendItem('walls', @g_rlayer_wall
);
162 llb
.appendItem('doors', @g_rlayer_door
);
163 llb
.appendItem('acid1', @g_rlayer_acid1
);
164 llb
.appendItem('acid2', @g_rlayer_acid2
);
165 llb
.appendItem('water', @g_rlayer_water
);
166 llb
.appendItem('foreground', @g_rlayer_fore
);
167 winLayers
:= THTopWindow
.Create('visible', 10, 10);
168 winLayers
.escClose
:= true;
169 winLayers
.appendChild(llb
);
173 procedure createOutlinesWindow ();
177 llb
:= THCtlCBListBox
.Create(0, 0);
178 llb
.appendItem('background', @g_ol_rlayer_back
);
179 llb
.appendItem('steps', @g_ol_rlayer_step
);
180 llb
.appendItem('walls', @g_ol_rlayer_wall
);
181 llb
.appendItem('doors', @g_ol_rlayer_door
);
182 llb
.appendItem('acid1', @g_ol_rlayer_acid1
);
183 llb
.appendItem('acid2', @g_ol_rlayer_acid2
);
184 llb
.appendItem('water', @g_ol_rlayer_water
);
185 llb
.appendItem('foreground', @g_ol_rlayer_fore
);
186 llb
.appendItem('', nil);
187 llb
.appendItem('slow''n''nice', @g_ol_nice
);
188 winOutlines
:= THTopWindow
.Create('outlines', 100, 10);
189 winOutlines
.escClose
:= true;
190 winOutlines
.appendChild(llb
);
194 // ////////////////////////////////////////////////////////////////////////// //
195 procedure g_Holmes_VidModeChanged ();
197 e_WriteLog(Format('Inspector: videomode changed: %dx%d', [gScreenWidth
, gScreenHeight
]), MSG_NOTIFY
);
198 // texture space is possibly lost here, idc
204 //createCursorTexture();
207 procedure g_Holmes_WindowFocused ();
213 procedure g_Holmes_WindowBlured ();
218 // ////////////////////////////////////////////////////////////////////////// //
220 vpSet
: Boolean = false;
223 laserSet
: Boolean = false;
224 laserX0
, laserY0
, laserX1
, laserY1
: Integer;
225 monMarkedUID
: Integer = -1;
228 procedure g_Holmes_plrView (viewPortX
, viewPortY
, viewPortW
, viewPortH
: Integer);
237 procedure g_Holmes_plrLaser (ax0
, ay0
, ax1
, ay1
: Integer);
244 laserSet
:= laserSet
; // shut up, fpc!
248 function pmsCurMapX (): Integer; inline; begin result
:= msX
+vpx
; end;
249 function pmsCurMapY (): Integer; inline; begin result
:= msY
+vpy
; end;
252 procedure plrDebugMouse (var ev
: THMouseEvent
);
254 function wallToggle (pan
: TPanel
; tag
: Integer): Boolean;
256 result
:= false; // don't stop
257 e_WriteLog(Format('wall #%d(%d); enabled=%d (%d); (%d,%d)-(%d,%d)', [pan
.arrIdx
, pan
.proxyId
, Integer(pan
.Enabled
), Integer(mapGrid
.proxyEnabled
[pan
.proxyId
]), pan
.X
, pan
.Y
, pan
.Width
, pan
.Height
]), MSG_NOTIFY
);
258 if ((kbS
and THKeyEvent
.ModAlt
) <> 0) then
260 if pan
.Enabled
then g_Map_DisableWall(pan
.arrIdx
) else g_Map_EnableWall(pan
.arrIdx
);
264 function monsAtDump (mon
: TMonster
; tag
: Integer): Boolean;
266 result
:= false; // don't stop
267 e_WriteLog(Format('monster #%d; UID=%d', [mon
.arrIdx
, mon
.UID
]), MSG_NOTIFY
);
268 monMarkedUID
:= mon
.UID
;
269 //if pan.Enabled then g_Map_DisableWall(pan.arrIdx) else g_Map_EnableWall(pan.arrIdx);
272 function monsInCell (mon
: TMonster
; tag
: Integer): Boolean;
274 result
:= false; // don't stop
275 e_WriteLog(Format('monster #%d (UID:%u) (proxyid:%d)', [mon
.arrIdx
, mon
.UID
, mon
.proxyId
]), MSG_NOTIFY
);
279 //e_WriteLog(Format('mouse: x=%d; y=%d; but=%d; bstate=%d', [msx, msy, but, bstate]), MSG_NOTIFY);
280 if (gPlayer1
= nil) or not vpSet
then exit
;
281 if (ev
.kind
<> THMouseEvent
.Press
) then exit
;
283 e_WriteLog(Format('mev: %d', [Integer(ev
.kind
)]), MSG_NOTIFY
);
285 if (ev
.but
= THMouseEvent
.Left
) then
287 if ((kbS
and THKeyEvent
.ModShift
) <> 0) then
289 // dump monsters in cell
290 e_WriteLog('===========================', MSG_NOTIFY
);
291 monsGrid
.forEachInCell(pmsCurMapX
, pmsCurMapY
, monsInCell
);
292 e_WriteLog('---------------------------', MSG_NOTIFY
);
297 e_WriteLog('=== TOGGLE WALL ===', MSG_NOTIFY
);
298 mapGrid
.forEachAtPoint(pmsCurMapX
, pmsCurMapY
, wallToggle
, (GridTagWall
or GridTagDoor
));
299 e_WriteLog('--- toggle wall ---', MSG_NOTIFY
);
304 if (ev
.but
= THMouseEvent
.Right
) then
307 e_WriteLog('===========================', MSG_NOTIFY
);
308 monsGrid
.forEachAtPoint(pmsCurMapX
, pmsCurMapY
, monsAtDump
);
309 e_WriteLog('---------------------------', MSG_NOTIFY
);
316 olEdgeL
: array of Boolean = nil;
317 olEdgeR
: array of Boolean = nil;
318 olEdgeU
: array of Boolean = nil;
319 olEdgeD
: array of Boolean = nil;
321 procedure drawOutlines ();
326 procedure plrDebugDraw ();
328 procedure drawTileGrid ();
332 for y
:= 0 to (mapGrid
.gridHeight
div mapGrid
.tileSize
) do
334 drawLine(mapGrid
.gridX0
, mapGrid
.gridY0
+y
*mapGrid
.tileSize
, mapGrid
.gridX0
+mapGrid
.gridWidth
, mapGrid
.gridY0
+y
*mapGrid
.tileSize
, 96, 96, 96, 255);
337 for x
:= 0 to (mapGrid
.gridWidth
div mapGrid
.tileSize
) do
339 drawLine(mapGrid
.gridX0
+x
*mapGrid
.tileSize
, mapGrid
.gridY0
, mapGrid
.gridX0
+x
*mapGrid
.tileSize
, mapGrid
.gridY0
+y
*mapGrid
.gridHeight
, 96, 96, 96, 255);
343 procedure hilightCell (cx
, cy
: Integer);
345 fillRect(cx
, cy
, monsGrid
.tileSize
, monsGrid
.tileSize
, 0, 128, 0, 64);
348 procedure hilightCell1 (cx
, cy
: Integer);
350 //e_WriteLog(Format('h1: (%d,%d)', [cx, cy]), MSG_NOTIFY);
351 fillRect(cx
, cy
, monsGrid
.tileSize
, monsGrid
.tileSize
, 255, 255, 0, 92);
354 function hilightWallTrc (pan
: TPanel
; tag
: Integer; x
, y
, prevx
, prevy
: Integer): Boolean;
356 result
:= false; // don't stop
357 if (pan
= nil) then exit
; // cell completion, ignore
358 //e_WriteLog(Format('h1: (%d,%d)', [cx, cy]), MSG_NOTIFY);
359 fillRect(pan
.X
, pan
.Y
, pan
.Width
, pan
.Height
, 0, 128, 128, 64);
362 function monsCollector (mon
: TMonster
; tag
: Integer): Boolean;
365 mx
, my
, mw
, mh
: Integer;
368 mon
.getMapBox(mx
, my
, mw
, mh
);
369 e_DrawQuad(mx
, my
, mx
+mw
-1, my
+mh
-1, 255, 255, 0, 96);
370 if lineAABBIntersects(laserX0
, laserY0
, laserX1
, laserY1
, mx
, my
, mw
, mh
, ex
, ey
) then
372 e_DrawPoint(8, ex
, ey
, 0, 255, 0);
376 procedure drawMonsterInfo (mon
: TMonster
);
378 mx
, my
, mw
, mh
: Integer;
380 procedure drawMonsterTargetLine ();
382 emx
, emy
, emw
, emh
: Integer;
387 if (g_GetUIDType(mon
.MonsterTargetUID
) = UID_PLAYER
) then
389 eplr
:= g_Player_Get(mon
.MonsterTargetUID
);
390 if (eplr
<> nil) then eplr
.getMapBox(emx
, emy
, emw
, emh
) else exit
;
392 else if (g_GetUIDType(mon
.MonsterTargetUID
) = UID_MONSTER
) then
394 enemy
:= g_Monsters_ByUID(mon
.MonsterTargetUID
);
395 if (enemy
<> nil) then enemy
.getMapBox(emx
, emy
, emw
, emh
) else exit
;
401 mon
.getMapBox(mx
, my
, mw
, mh
);
402 drawLine(mx
+mw
div 2, my
+mh
div 2, emx
+emw
div 2, emy
+emh
div 2, 255, 0, 0, 255);
403 if (g_Map_traceToNearestWall(mx
+mw
div 2, my
+mh
div 2, emx
+emw
div 2, emy
+emh
div 2, @ex
, @ey
) <> nil) then
405 drawLine(mx
+mw
div 2, my
+mh
div 2, ex
, ey
, 0, 255, 0, 255);
409 procedure drawLOS2Plr ();
411 emx
, emy
, emw
, emh
: Integer;
416 if (eplr
= nil) then exit
;
417 eplr
.getMapBox(emx
, emy
, emw
, emh
);
418 mon
.getMapBox(mx
, my
, mw
, mh
);
419 drawLine(mx
+mw
div 2, my
+mh
div 2, emx
+emw
div 2, emy
+emh
div 2, 255, 0, 0, 255);
420 {$IF DEFINED(D2F_DEBUG)}
421 //mapGrid.dbgRayTraceTileHitCB := hilightCell1;
423 if (g_Map_traceToNearestWall(mx
+mw
div 2, my
+mh
div 2, emx
+emw
div 2, emy
+emh
div 2, @ex
, @ey
) <> nil) then
424 //if (mapGrid.traceRay(ex, ey, mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, hilightWallTrc, (GridTagWall or GridTagDoor)) <> nil) then
426 drawLine(mx
+mw
div 2, my
+mh
div 2, ex
, ey
, 0, 255, 0, 255);
428 {$IF DEFINED(D2F_DEBUG)}
429 //mapGrid.dbgRayTraceTileHitCB := nil;
434 if (mon
= nil) then exit
;
435 mon
.getMapBox(mx
, my
, mw
, mh
);
438 monsGrid
.forEachBodyCell(mon
.proxyId
, hilightCell
);
442 //fillRect(mx-4, my-7*8-6, 110, 7*8+6, 0, 0, 94, 250);
443 darkenRect(mx
-4, my
-7*8-6, 110, 7*8+6, 128);
448 drawText6(mx
, my
, Format('%s(U:%u)', [monsTypeToString(mon
.MonsterType
), mon
.UID
]), 255, 127, 0); my
-= 8;
450 drawText6(mx
, my
, Format('Beh: %s', [monsBehToString(mon
.MonsterBehaviour
)]), 255, 127, 0); my
-= 8;
452 drawText6(mx
, my
, Format('State:%s (%d)', [monsStateToString(mon
.MonsterState
), mon
.MonsterSleep
]), 255, 127, 0); my
-= 8;
454 drawText6(mx
, my
, Format('Health:%d', [mon
.MonsterHealth
]), 255, 127, 0); my
-= 8;
456 drawText6(mx
, my
, Format('Ammo:%d', [mon
.MonsterAmmo
]), 255, 127, 0); my
-= 8;
458 drawText6(mx
, my
, Format('TgtUID:%u', [mon
.MonsterTargetUID
]), 255, 127, 0); my
-= 8;
459 drawText6(mx
, my
, Format('TgtTime:%d', [mon
.MonsterTargetTime
]), 255, 127, 0); my
-= 8;
462 drawMonsterTargetLine();
463 if showMonsLOS2Plr
then drawLOS2Plr();
465 property MonsterRemoved: Boolean read FRemoved write FRemoved;
466 property MonsterPain: Integer read FPain write FPain;
467 property MonsterAnim: Byte read FCurAnim write FCurAnim;
471 function highlightAllMonsterCells (mon
: TMonster
): Boolean;
473 result
:= false; // don't stop
474 monsGrid
.forEachBodyCell(mon
.proxyId
, hilightCell
);
479 mx
, my
, mw
, mh
: Integer;
481 if (gPlayer1
= nil) then exit
;
483 glEnable(GL_SCISSOR_TEST
);
484 glScissor(0, gWinSizeY
-gPlayerScreenSize
.Y
-1, vpw
, vph
);
487 glTranslatef(-vpx
, -vpy
, 0);
491 if (showGrid
) then drawTileGrid();
493 if (laserSet
) then g_Mons_AlongLine(laserX0
, laserY0
, laserX1
, laserY1
, monsCollector
, true);
495 if (monMarkedUID
<> -1) then
497 mon
:= g_Monsters_ByUID(monMarkedUID
);
500 mon
.getMapBox(mx
, my
, mw
, mh
);
501 e_DrawQuad(mx
, my
, mx
+mw
-1, my
+mh
-1, 255, 0, 0, 30);
502 drawMonsterInfo(mon
);
506 if showAllMonsCells
then g_Mons_ForEach(highlightAllMonsterCells
);
510 glDisable(GL_SCISSOR_TEST
);
512 if showMapCurPos
then drawText8(4, gWinSizeY
-10, Format('mappos:(%d,%d)', [pmsCurMapX
, pmsCurMapY
]), 255, 255, 0);
516 // ////////////////////////////////////////////////////////////////////////// //
517 function g_Holmes_MouseEvent (var ev
: THMouseEvent
): Boolean;
525 if not uiMouseEvent(ev
) then plrDebugMouse(ev
);
529 function g_Holmes_KeyEvent (var ev
: THKeyEvent
): Boolean;
537 procedure dummyWallTrc (cx
, cy
: Integer);
546 SDL_SCANCODE_LCTRL
, SDL_SCANCODE_RCTRL
,
547 SDL_SCANCODE_LALT
, SDL_SCANCODE_RALT
,
548 SDL_SCANCODE_LSHIFT
, SDL_SCANCODE_RSHIFT
:
551 if uiKeyEvent(ev
) then begin result
:= true; exit
; end;
553 if (ev
.kind
= THKeyEvent
.Press
) then
555 // M-M: one monster think step
556 if (ev
.scan
= SDL_SCANCODE_M
) and ((ev
.kstate
and THKeyEvent
.ModAlt
) <> 0) then
559 gmon_debug_think
:= false;
560 gmon_debug_one_think_step
:= true; // do one step
563 // M-I: toggle monster info
564 if (ev
.scan
= SDL_SCANCODE_I
) and ((ev
.kstate
and THKeyEvent
.ModAlt
) <> 0) then
567 showMonsInfo
:= not showMonsInfo
;
570 // M-L: toggle monster LOS to player
571 if (ev
.scan
= SDL_SCANCODE_L
) and ((ev
.kstate
and THKeyEvent
.ModAlt
) <> 0) then
574 showMonsLOS2Plr
:= not showMonsLOS2Plr
;
577 // M-G: toggle "show all cells occupied by monsters"
578 if (ev
.scan
= SDL_SCANCODE_G
) and ((ev
.kstate
and THKeyEvent
.ModAlt
) <> 0) then
581 showAllMonsCells
:= not showAllMonsCells
;
584 // M-A: wake up monster
585 if (ev
.scan
= SDL_SCANCODE_A
) and ((ev
.kstate
and THKeyEvent
.ModAlt
) <> 0) then
588 if (monMarkedUID
<> -1) then
590 mon
:= g_Monsters_ByUID(monMarkedUID
);
591 if (mon
<> nil) then mon
.WakeUp();
595 // C-T: teleport player
596 if (ev
.scan
= SDL_SCANCODE_T
) and ((ev
.kstate
and THKeyEvent
.ModCtrl
) <> 0) then
599 //e_WriteLog(Format('TELEPORT: (%d,%d)', [pmsCurMapX, pmsCurMapY]), MSG_NOTIFY);
600 if (gPlayers
[0] <> nil) then
602 gPlayers
[0].getMapBox(x
, y
, w
, h
);
603 gPlayers
[0].TeleportTo(pmsCurMapX
-w
div 2, pmsCurMapY
-h
div 2, true, 69); // 69: don't change dir
607 // C-P: show cursor position on the map
608 if (ev
.scan
= SDL_SCANCODE_P
) and ((ev
.kstate
and THKeyEvent
.ModCtrl
) <> 0) then
611 showMapCurPos
:= not showMapCurPos
;
615 if (ev
.scan
= SDL_SCANCODE_G
) and ((ev
.kstate
and THKeyEvent
.ModCtrl
) <> 0) then
618 showGrid
:= not showGrid
;
621 // C-L: toggle layers window
622 if (ev
.scan
= SDL_SCANCODE_L
) and ((ev
.kstate
and THKeyEvent
.ModCtrl
) <> 0) then
625 if (winLayers
= nil) then createLayersWindow();
626 if not uiVisibleWindow(winLayers
) then uiAddWindow(winLayers
) else uiRemoveWindow(winLayers
);
629 // C-O: toggle outlines window
630 if (ev
.scan
= SDL_SCANCODE_O
) and ((ev
.kstate
and THKeyEvent
.ModCtrl
) <> 0) then
633 if (winOutlines
= nil) then createOutlinesWindow();
634 if not uiVisibleWindow(winOutlines
) then uiAddWindow(winOutlines
) else uiRemoveWindow(winOutlines
);
637 // F1: toggle options window
638 if (ev
.scan
= SDL_SCANCODE_F1
) and (ev
.kstate
= 0) then
641 if (winOptions
= nil) then createOptionsWindow();
642 if not uiVisibleWindow(winOptions
) then uiAddWindow(winOptions
) else uiRemoveWindow(winOptions
);
645 // C-UP, C-DOWN, C-LEFT, C-RIGHT: trace 10 pixels from cursor in the respective direction
646 if ((ev
.scan
= SDL_SCANCODE_UP
) or (ev
.scan
= SDL_SCANCODE_DOWN
) or (ev
.scan
= SDL_SCANCODE_LEFT
) or (ev
.scan
= SDL_SCANCODE_RIGHT
)) and
647 ((ev
.kstate
and THKeyEvent
.ModCtrl
) <> 0) then
653 SDL_SCANCODE_UP
: dy
-= 120;
654 SDL_SCANCODE_DOWN
: dy
+= 120;
655 SDL_SCANCODE_LEFT
: dx
-= 120;
656 SDL_SCANCODE_RIGHT
: dx
+= 120;
658 {$IF DEFINED(D2F_DEBUG)}
659 //mapGrid.dbgRayTraceTileHitCB := dummyWallTrc;
660 mapGrid
.dbgShowTraceLog
:= true;
662 pan
:= g_Map_traceToNearest(pmsCurMapX
, pmsCurMapY
, dx
, dy
, (GridTagWall
or GridTagDoor
or GridTagStep
or GridTagAcid1
or GridTagAcid2
or GridTagWater
), @ex
, @ey
);
663 {$IF DEFINED(D2F_DEBUG)}
664 //mapGrid.dbgRayTraceTileHitCB := nil;
665 mapGrid
.dbgShowTraceLog
:= false;
667 e_LogWritefln('v-trace: (%d,%d)-(%d,%d); end=(%d,%d); hit=%d', [pmsCurMapX
, pmsCurMapY
, dx
, dy
, ex
, ey
, (pan
<> nil)]);
674 // ////////////////////////////////////////////////////////////////////////// //
675 procedure g_Holmes_Draw ();
677 glColorMask(GL_TRUE
, GL_TRUE
, GL_TRUE
, GL_TRUE
); // modify color buffer
678 glDisable(GL_STENCIL_TEST
);
680 glDisable(GL_SCISSOR_TEST
);
681 glDisable(GL_TEXTURE_2D
);
692 procedure g_Holmes_DrawUI ();