Skip to content

Commit

Permalink
Removed a whole bunch of GUI1 stuff
Browse files Browse the repository at this point in the history
This almost completely removes GUI1, save for the button widget (will remove once I get
all the Theme handling sorted out) and the editor's own GUI1 widgets.

This includes the GUI1 textbox, scrollbar, scrollarea, and menu widgets, as well as the
dialog_frame and dialog_manager classes. I've also removed floating_textbox. It was only
kept around for reference (it's unused as of the inclusion of the GUI2 command console).

gui::in_dialog has been replaced by GUI2's is_in_dialog directly now that we have no more
GUI1 dialogs.

\o/
  • Loading branch information
Vultraz authored and CelticMinstrel committed Oct 24, 2018
1 parent e8d23cc commit 88d8b9c
Show file tree
Hide file tree
Showing 23 changed files with 14 additions and 5,276 deletions.
6 changes: 0 additions & 6 deletions source_lists/libwesnoth
Expand Up @@ -41,7 +41,6 @@ pathfind/astarsearch.cpp
pathutils.cpp
quit_confirmation.cpp
reports.cpp
show_dialog.cpp
sound.cpp
sound_music_track.cpp
soundsource.cpp
Expand All @@ -54,10 +53,5 @@ tooltips.cpp
utils/make_enum.cpp
video.cpp
widgets/button.cpp
widgets/menu.cpp
widgets/menu_style.cpp
widgets/scrollarea.cpp
widgets/scrollbar.cpp
widgets/textbox.cpp
widgets/widget.cpp
wml_exception.cpp
1 change: 0 additions & 1 deletion source_lists/wesnoth
Expand Up @@ -103,7 +103,6 @@ editor/toolkit/editor_toolkit.cpp
fake_unit_manager.cpp
fake_unit_ptr.cpp
filesystem_sdl.cpp
floating_textbox.cpp
formula/callable_objects.cpp
formula/debugger.cpp
formula/debugger_fwd.cpp
Expand Down
18 changes: 14 additions & 4 deletions src/controller_base.cpp
Expand Up @@ -18,15 +18,15 @@
#include "display.hpp"
#include "events.hpp"
#include "game_config_manager.hpp"
#include "gui/core/event/handler.hpp" // gui2::is_in_dialog
#include "gui/dialogs/loading_screen.hpp"
#include "hotkey/command_executor.hpp"
#include "hotkey/hotkey_command.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "mouse_handler_base.hpp"
#include "preferences/game.hpp"
#include "scripting/plugins/context.hpp"
#include "show_dialog.hpp" //gui::in_dialog
#include "gui/core/event/handler.hpp" // gui2::is_in_dialog
#include "soundsource.hpp"
static lg::log_domain log_display("display");
#define ERR_DP LOG_STREAM(err, log_display)
Expand All @@ -50,7 +50,17 @@ controller_base::~controller_base()

void controller_base::handle_event(const SDL_Event& event)
{
if(gui::in_dialog()) {
/* TODO: since GUI2 and the main game are now part of the same event context, there is some conflict
* between the GUI2 and event handlers such as these. By design, the GUI2 sdl handler is always on top
* of the handler queue, so its events are handled last. This means events here have a chance to fire
* first. have_keyboard_focus currently returns false if a dialog open, but this is just as stopgap
* measure. We need to figure out a better way to filter out events.
*/
//if(gui2::is_in_dialog()) {
// return;
//}

if(gui2::dialogs::loading_screen::displaying()) {
return;
}

Expand Down Expand Up @@ -162,7 +172,7 @@ void controller_base::keyup_listener::handle_event(const SDL_Event& event)

bool controller_base::have_keyboard_focus()
{
return true;
return !gui2::is_in_dialog();
}

bool controller_base::handle_scroll(int mousex, int mousey, int mouse_flags, double x_axis, double y_axis)
Expand Down
1 change: 0 additions & 1 deletion src/display.cpp
Expand Up @@ -48,7 +48,6 @@
#include "units/animation_component.hpp"
#include "units/drawer.hpp"
#include "whiteboard/manager.hpp"
#include "show_dialog.hpp"
#include "gui/dialogs/loading_screen.hpp"

#include <SDL_image.h>
Expand Down
146 changes: 0 additions & 146 deletions src/floating_textbox.cpp

This file was deleted.

57 changes: 0 additions & 57 deletions src/floating_textbox.hpp

This file was deleted.

1 change: 0 additions & 1 deletion src/help/help.cpp
Expand Up @@ -33,7 +33,6 @@
#include "key.hpp" // for CKey
#include "log.hpp" // for LOG_STREAM, log_domain
#include "sdl/surface.hpp" // for surface
#include "show_dialog.hpp" // for dialog_frame, etc
#include "terrain/terrain.hpp" // for terrain_type
#include "units/unit.hpp" // for unit
#include "units/types.hpp" // for unit_type, unit_type_data, etc
Expand Down
1 change: 0 additions & 1 deletion src/hotkey/command_executor.cpp
Expand Up @@ -29,7 +29,6 @@
#include "display.hpp"
#include "quit_confirmation.hpp"
#include "sdl/surface.hpp"
#include "show_dialog.hpp"
#include "../resources.hpp"
#include "../playmp_controller.hpp"

Expand Down

0 comments on commit 88d8b9c

Please sign in to comment.