SCRMaps
/
Sign in

A menu you click with the mouse

Read the mouse, work out which line it is over - and remember that all of it is local.

7 min read

StarCraft has no button widget, but you can read the mouse. Draw text line by line, work out which line the pointer is over, and that is a menu.

The addresses
0x6CDDC4Mouse X. Simple Data on SC:R.
0x6CDDC8Mouse Y.
0x6CDDC0Mouse button state.
0x628448 / 0x628470The screen's X and Y. Read only.

The mouse coordinates are relative to the screen. To get a position on the map you add the screen's own coordinates - and for something screen-fixed like a menu you deliberately do not, because the text is attached to the screen.

if (MemoryEPD(EPD(0x6CDDC4), AtLeast, 10) && MemoryEPD(EPD(0x6CDDC4), AtMost, 25)) {
    // 마우스가 그 가로 범위 안에 있습니다
}
The vertical range is checked the same way to decide which line it is on.

The mouse is this machine's mouse; everyone's differs. Create a unit or grant resources off a mouse test and the games diverge on the spot and everyone else drops - crash list #13. What the mouse may do is draw text on that person's screen; to actually change anything, the choice has to be written into something shared - a death counter - first.

StringBuffer's printfAt writes straight to a given line, which is what makes drawing a menu tidy. Colour just the selected line and it reads as a cursor.

Desync and the local player
Sign in to track your progress