1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Added peep_text_input

This commit is contained in:
Duncan Frost
2014-09-09 18:08:34 +01:00
parent 08e37a0435
commit e8251daad5
2 changed files with 37 additions and 4 deletions

View File

@@ -491,6 +491,12 @@ void RCT2_CALLPROC_WE_MOUSE_DOWN(int address, int widgetIndex, rct_window*w, rct
__asm mov dropdownIndex, ax \
__asm mov widgetIndex, dx \
__asm mov w, esi
#define window_text_input_get_registers(w, widgetIndex, _cl, text) \
__asm mov widgetIndex, dx \
__asm mov _cl, cl \
__asm mov w, esi \
__asm mov text, edi
#define window_scrollmouse_get_registers(w, x, y) \
__asm mov x, cx \
@@ -519,6 +525,12 @@ void RCT2_CALLPROC_WE_MOUSE_DOWN(int address, int widgetIndex, rct_window*w, rct
__asm__ ( "mov %["#widgetIndex"], dx " : [widgetIndex] "+m" (widgetIndex) ); \
__asm__ ( "mov %["#w"], esi " : [w] "+m" (w) );
#define window_text_input_get_registers(w, widgetIndex, _cl, text) \
__asm__ ( "mov %[_cl], cl " : [_cl] "+m" (_cl) ); \
__asm__ ( "mov %[widgetIndex], dx " : [widgetIndex] "+m" (widgetIndex) ); \
__asm__ ( "mov %[w], esi " : [w] "+m" (w) ); \
__asm__ ( "mov %[text], edi " : [text] "+m" (text) );
#define window_scrollmouse_get_registers(w, x, y) \
__asm__ ( "mov %["#x"], cx " : [x] "+m" (x) ); \
__asm__ ( "mov %["#y"], dx " : [y] "+m" (y) ); \

View File

@@ -180,6 +180,7 @@ void window_peep_overview_paint();
void window_peep_overview_invalidate();
void window_peep_overview_viewport_init_wrapper();
void window_peep_overview_update(rct_window* w);
void window_peep_overview_text_input();
static void* window_peep_overview_events[] = {
window_peep_close,
@@ -191,17 +192,17 @@ static void* window_peep_overview_events[] = {
window_peep_overview_update,
window_peep_emptysub,
window_peep_emptysub,
(void*)0x696A5F,
(void*)0x696A54,
(void*)0x696A5F,//tool_update
(void*)0x696A54,//tool_down
window_peep_emptysub,
window_peep_emptysub,
(void*)0x696A49,
(void*)0x696A49,//tool_abort
window_peep_emptysub,
window_peep_emptysub,
window_peep_emptysub,
window_peep_emptysub,
window_peep_emptysub,
(void*)0x696A6A,
window_peep_overview_text_input,//text_input
window_peep_overview_viewport_init_wrapper,
window_peep_emptysub,
window_peep_emptysub,
@@ -1065,3 +1066,23 @@ void window_peep_overview_update(rct_window* w){
}
}
/* rct2:0x696A6A */
void window_peep_overview_text_input(){
short widgetIndex;
rct_window *w;
char _cl;
uint32* text;
window_text_input_get_registers(w, widgetIndex, _cl, text);
if (widgetIndex != WIDX_RENAME)return;
if (!_cl) return;
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_STRING_ID, uint16) = 0x5AE;
game_do_command(1, 1, w->number, *text, 22, *(text + 2), *(text + 1));
game_do_command(2, 1, 0, *(text + 3), 22, *(text + 5), *(text + 4));
game_do_command(0, 1, 0, *(text + 6), 22, *(text + 8), *(text + 7));
}