Commit graph

66 commits

Author SHA1 Message Date
Chris Taylor b80b863f49 Fix bugs switching between game and editor and back: make sure ModeFlag is set to 0 before it has any chance to show an alert message, fixing a crash; allow OBJ_NONE in Assert; make Game_wind invisible when loading editor in case we show an alert; call mouse_flush() in ui_init() to fix mouse issues 2012-04-14 17:41:50 +08:00
Chris Taylor a327d380a7 Fix a crash when going into a directory with no files in the editor file browser, clicking on listboxes for same sets inputbox correctly 2012-04-11 12:03:36 +08:00
Chris Taylor 7aa618b266 Draw the object rotation velocity, file browser and MessageBox dialogs properly 2012-04-11 10:52:19 +08:00
Chris Taylor 7ef1431885 Editor exits cleanly when clicking the close box, no more redundant gr_uscanline call in gl_urect for ogl (an initial attempt to fix the previous bug) 2012-04-09 20:40:55 +08:00
Chris Taylor 418e6ab674 Fix all remaining known editor drawing issues. In ogl: get the texture previews to draw, get userbox borders to draw in the right location, properly underline characters in the menus, draw all the borders properly (i.e. no gap), no scaling fonts. Software render: draw userbox borders again. Both: clear the whole status bar, clear to the right edge of the screen. 2012-04-09 17:28:44 +08:00
Chris Taylor 285531c4e0 Fix a nasty bug where pressing 'Alt' to explore the editor menubar would split the window stack in two, rendering the editor unresponsive 2012-04-09 17:12:01 +08:00
Chris Taylor 8a437a759c Get the clock, 'keypad' info, texture choosing page and object choosing page to draw (latter two just show black squares for ogl) 2012-04-09 10:12:58 +08:00
Chris Taylor 09a37b623a Make the editor draw the same for the non-ogl build as the ogl build, since I just made it draw the grey background over everything in the last commit. If you want to see what it's *supposed* to look like, go to yesterday's commit :P 2012-03-31 20:11:39 +08:00
Chris Taylor 801e989a66 Use correct coordinates for dialog border (still doesn't draw fully) 2012-03-31 19:47:39 +08:00
Chris Taylor 00245bccdc Make the main stuff (gadgets, two viewers) draw for the editor in ogl, still more tweaking required 2012-03-31 18:35:06 +08:00
Chris Taylor e7048d09ae Fix bug where pad buttons would disappear when clicking on them, after opening then closing a dialog 2012-03-24 17:50:37 +08:00
Chris Taylor ea454664d0 Draw in response to EVENT_UI_DIALOG_DRAW, uncomment medlisp_update_screen call and use gr_box instead of gr_rect in some places. You can now see what you're doing 2012-03-24 17:18:03 +08:00
Chris Taylor cd0213122c Draw the editor menubar properly - by drawing in response to EVENT_WINDOW_DRAW and initialising the screen canvas properly. The latter fixes a lot of other editor drawing issues as well 2012-03-24 13:26:51 +08:00
Chris Taylor b94d8f127e Remove redundant ui_event_process and duplicate mouse.c in ui/. All editor input is now event-based. 2012-03-18 18:04:16 +08:00
Chris Taylor 6983a906a3 Make editor_handler into a proper callback, iron some problems out. Seems to draw a different bunch of stuff now (still erroneous) 2012-03-18 16:01:53 +08:00
Chris Taylor 45415324c3 Make do_centers_window into a proper callback, iron out some problems that have become apparent 2012-03-12 10:31:48 +08:00
Chris Taylor cdfd06bbd6 Use the gadget-sent events in the dialogs in ui 2012-03-05 19:07:57 +08:00
Chris Taylor 6068bf961d All gadgets now send events 2012-03-03 20:12:25 +08:00
Chris Taylor e05a2d3483 Actually add editor data files and make sure DXX can find them 2012-03-03 16:02:16 +08:00
Chris Taylor a4be50fdfe Give the last use of a dialog in ui, in PopupMenu, a callback 2012-01-09 23:06:29 +08:00
Chris Taylor 9c686ce92a Give the dialog in MessageBoxN a callback 2012-01-03 17:23:42 +08:00
Chris Taylor 200e66a839 Give the dialog in (also presently unused) MenuX a callback 2012-01-03 16:22:17 +08:00
Chris Taylor fdef129f7e Give the dialog in (presently unused) GetKeyCode a callback 2012-01-03 13:24:45 +08:00
Chris Taylor a5c4992c58 Give ui_get_filename a callback for its dialog. Happy new year 2012-01-02 15:49:08 +08:00
Chris Taylor 1c6ecbece0 Make editor menubar and associated menus into windows; either remove or make event-based all the B1_* macros 2011-12-31 17:10:40 +08:00
Chris Taylor ff3f419c31 Remove redundant canvas, next and prev members in the UI_DIALOG struct 2011-12-18 20:33:51 +08:00
Chris Taylor d1a995ef6d Make ui_userbox_do fully event-responsive 2011-11-14 19:27:04 +08:00
Chris Taylor 33b1b6118d Make ui_scroll_do fully event-responsive, make sure scrolling actually works by calling all controls' ui_*_do functions (like before) 2011-11-12 12:46:29 +08:00
Chris Taylor 1c305434f4 Make ui_radio_do fully event-responsive 2011-11-06 20:05:43 +08:00
Chris Taylor d8a1aaff32 Make ui_listbox_do fully event-responsive 2011-11-06 11:05:45 +08:00
Chris Taylor 744e51c877 Say when the event was handled for ui_inputbox_do (was already event-responsive) 2011-11-05 20:11:48 +08:00
Chris Taylor ee05f99a3c Fix implicit function declaration in last commit, make ui_icon_do fully event-responsive 2011-11-05 19:43:54 +08:00
Chris Taylor d2d68bc4ee Make ui_checkbox_do fully event-responsive 2011-11-05 17:45:10 +08:00
Chris Taylor 89b36e8be0 Make B1_JUST_PRESSED event-based, leave ui_dialog_do_gadgets early if a key makes another gadget current, make ui_button_do fully event-responsive (but won't *send* events yet) 2011-11-05 17:07:25 +08:00
Chris Taylor 1200f8017b Return 1 (event handled) in ui_dialog_handler for mouse button events if the mouse was in the dialog 2011-10-30 19:08:02 +08:00
Chris Taylor 91e0f976f7 Pass the event to the individual gadgets' 'do' functions, fix compile warnings introduced in last commit 2011-10-25 09:38:12 +08:00
Chris Taylor 5d6c06c723 Pass the event to ui_dialog_do_gadgets and use it in that immediate function 2011-10-23 17:07:18 +08:00
Chris Taylor 87c8c25580 Move calls to ui_dialog_do_gadgets to the dialog event handler, making sure ui_event_handler gets called beforehand 2011-10-09 20:30:31 +08:00
Chris Taylor 3121fb4990 Add support for 'modeless' windows - windows that will allow events to be passed on to the underlying window. Intended for the editor 2011-10-09 18:31:44 +08:00
zicodxx fb775b35c3 Fixed set but unused variables 2011-09-27 01:31:17 +02:00
Chris Taylor 3f5506ee72 Move EVENT_MOUSE_DOUBLE_CLICKED support from ui/mouse.c to arch/sdl/mouse.c for tidiness and to possibly use it outside the editor 2011-09-12 11:02:30 +08:00
zicodxx dcc964817e Got rid of cfile code: Renamed cfile-functions to use PHYSFSX-naming convention, Replaced cfile-macros with proper PHYSFS(X) calls; Introduced PHYSFSX_exists() which can check case-sensitive or case-insensitive to give more flexibility with game content 2011-06-01 09:59:51 +02:00
Chris Taylor 45930e9afe Rename ui/window.c to ui/dialog.c to avoid confusion with arch/sdl/window.c, also rename UI_WINDOW to UI_DIALOG, rename all associated functions, constants, parameters, local variables etc too; make a window when making a UI_DIALOG (does nothing yet) 2011-01-17 22:41:05 +08:00
Chris Taylor b4f7151ac8 Fix cursor recentering issues - comment out redundant event_toggle_focus(1) calls in kconfig.c and newmenu.c and use event_toggle_focus(0) in ui_mouse_show() 2011-01-17 16:09:07 +08:00
Chris Taylor 2bd3385abd For editor, replace use of ui_mega_process() with event_process(), with the editor's own default event handler; add EVENT_MOUSE_MOVED event with event_mouse_get_delta() accessor; add event_key_get() to replace ugly casting; rename mouse_get_button() with event_mouse_get_button() to keep with name convention; only send idle events when there are no input events so editor still works properly (or the same anyway); add and use event_send() function for input events (including idle) 2011-01-13 12:36:19 +08:00
Chris Taylor 0557c8bb43 Copy lots of editor stuff from d2x-rebirth to d1x-rebirth, getting it to work on Mac OS X 2010-12-24 12:26:24 +08:00
Chris Taylor da06d9889e Put event_process() in ui_mega_process(), hopefully getting editor to (mostly) work (not on Mac yet) 2010-12-22 22:13:33 +08:00
zicodxx ffc73ed4f2 Introduced new data type fix64 to be used for new timers which can last 4462756 years instead of 9 hours; Introduced new timer functions to update and query program time; Used new timer all over the program except GameTime (which comes next) 2010-12-11 00:18:03 +01:00
zicodxx ac92d9c971 Patching together editor so it compiles again (while still not running); Implemented PhysFS for file accessing for editor- and debugging-related code 2010-08-19 13:32:33 +00:00
zicodxx 076e466009 Yet another UNICODE overhaul - Using seperate buffer for UNICODE chars and only use it in key_ascii() while still using keysyms for the rest of the program so we do not screw up readings by key values altered by modifers - possibly still room to optimize 2008-11-17 23:38:43 +00:00