diff --git a/src/ride/track.c b/src/ride/track.c index 401a4f09b6..5fd5c48622 100644 --- a/src/ride/track.c +++ b/src/ride/track.c @@ -1049,7 +1049,7 @@ rct_track_design *track_get_info(int index, uint8** preview) */ int track_rename(const char *text) { - return (RCT2_CALLPROC_X(0x006D3664, 0, 0, 0, (int)text, 0, 0, 0) & 0x100) != 0; + return (RCT2_CALLPROC_X(0x006D3664, 0, 0, 0, 0, 0, (int)text, 0) & 0x100) == 0; } /** @@ -1058,5 +1058,5 @@ int track_rename(const char *text) */ int track_delete() { - return (RCT2_CALLPROC_X(0x006D3761, 0, 0, 0, 0, 0, 0, 0) & 0x100) != 0; + return (RCT2_CALLPROC_X(0x006D3761, 0, 0, 0, 0, 0, 0, 0) & 0x100) == 0; } diff --git a/src/windows/editor_object_selection.c b/src/windows/editor_object_selection.c index ad19777db7..ea33086ac2 100644 --- a/src/windows/editor_object_selection.c +++ b/src/windows/editor_object_selection.c @@ -309,7 +309,8 @@ static void window_editor_object_selection_scroll_mousedown() sound_play_panned(SOUND_CLICK_1, RCT2_GLOBAL(0x142406C,uint32), 0, 0, 0); if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER) { - if (RCT2_CALLPROC_X(0x6AB54F, 0, 1, 0, 0, 0, 0, (int)installed_entry) & 0x100)return; + if (RCT2_CALLPROC_X(0x6AB54F, 0, 1, 0, 0, 0, 0, (int)installed_entry) & 0x100) + return; window_close(w); @@ -324,8 +325,7 @@ static void window_editor_object_selection_scroll_mousedown() ebx = 7; RCT2_GLOBAL(0xF43411, uint8) = 0; - if (0x100 & RCT2_CALLPROC_X(0x6AB54F, 0, ebx, 0, 0, 0, 0, (int)installed_entry)){ - + if (0x100 & RCT2_CALLPROC_X(0x6AB54F, 0, ebx, 0, 0, 0, 0, (int)installed_entry)) { rct_string_id error_title; if (ebx & 1) error_title = 3176; @@ -336,7 +336,8 @@ static void window_editor_object_selection_scroll_mousedown() return; } - if (!RCT2_GLOBAL(0xF43411, uint8) & 1)return; + if (!RCT2_GLOBAL(0xF43411, uint8) & 1) + return; window_error_open(3374, 3375); } @@ -645,6 +646,12 @@ static void window_editor_object_selection_scrollpaint() char *buffer = (char*)0x0141ED68; *buffer = colour; strcpy(buffer + 1, object_get_name(entry)); + if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER) { + while (*buffer != 0 && *buffer != 9) + buffer++; + + *buffer = 0; + } if (*itemFlags & 0x20) { colour = w->colours[1] & 0x7F; diff --git a/src/windows/text_input.c b/src/windows/text_input.c index c66ae6f5d8..7fda03eecf 100644 --- a/src/windows/text_input.c +++ b/src/windows/text_input.c @@ -136,7 +136,7 @@ void window_text_input_open(rct_window* call_w, int call_widget, rct_string_id t height, (uint32*)window_text_input_events, WC_TEXTINPUT, - 0 + WF_STICK_TO_FRONT ); w->widgets = window_text_input_widgets; diff --git a/src/windows/track_manage.c b/src/windows/track_manage.c index f636a57c42..17a60a0818 100644 --- a/src/windows/track_manage.c +++ b/src/windows/track_manage.c @@ -146,15 +146,13 @@ static void window_track_delete_prompt_open(); */ void window_track_manage_open() { - // RCT2_CALLPROC_EBPSAFE(0x006D348F); - rct_window *w, *trackDesignListWindow; window_close_by_class(WC_MANAGE_TRACK_DESIGN); w = window_create( max(28, (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16) - 250) / 2), - (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16) - 44) / 2, + (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, uint16) - 44) / 2, 250, 44, (uint32*)window_track_manage_events, @@ -199,6 +197,7 @@ static void window_track_manage_mouseup() uint8 *trackDesignList = (uint8*)0x00F441EC; rct_window *w, *trackDesignListWindow; short widgetIndex; + char *dst, *src; window_widget_get_registers(w, widgetIndex); @@ -209,8 +208,12 @@ static void window_track_manage_mouseup() case WIDX_RENAME: trackDesignListWindow = window_find_by_class(WC_TRACK_DESIGN_LIST); if (trackDesignListWindow != NULL) { - strcpy((char*)0x009BC677, (char*)trackDesignList[trackDesignListWindow->track_list.var_482 * 128]); - window_show_textinput(w, widgetIndex, 3350, 3351, 3165); + src = &trackDesignList[trackDesignListWindow->track_list.var_482 * 128]; + dst = (char*)0x009BC677; + while (*src != 0 && *src != '.') + *dst++ = *src++; + *dst = 0; + window_text_input_open(w, widgetIndex, 3350, 3351, 3165, 0, 127); } break; case WIDX_DELETE: