132 Commits

Author SHA1 Message Date
Chris Beck
abb3162fc2 fixup up gui1 button code interactions with filesystem
Image path modifiers should not be present when using the
filesystem::exists function. This fixes a bunch of error messages.
2014-10-24 13:47:05 -04:00
Alexander van Gessel (AI0867)
e5cb79b8e9 Move everything in src/filesystem.hpp into its own namespace
This is a chearry pick by me (gfgtdf) of 66176b1738. It differes a lot from the original becasue since there were so much merging conflics i decided to do it mostly from scratch.

Conflicts:
	src/addon/manager.cpp
	src/addon/manager_ui.cpp
	src/campaign_server/campaign_server.cpp
	src/config_cache.cpp
	src/create_engine.cpp
	src/editor/map/context_manager.cpp
	src/editor/map/map_context.cpp
	src/font.cpp
	src/game_config_manager.cpp
	src/gamestatus.cpp
	src/gui/dialogs/editor/custom_tod.cpp
	src/gui/dialogs/lobby/lobby_data.cpp
	src/gui/dialogs/mp_create_game.cpp
	src/gui/widgets/settings.cpp
	src/hotkeys.cpp
	src/image.cpp
	src/multiplayer_lobby.cpp
	src/network.cpp
	src/playcampaign.cpp
	src/preferences.cpp
	src/savegame.cpp
	src/serialization/preprocessor.cpp
	src/tests/main.cpp
	src/wesnoth.cpp
	src/widgets/button.cpp
2014-10-13 18:31:18 +02:00
Chris Beck
28fe7e440c fixbug 22611: don't close the program if we can't find button image
If the main button image could not be loaded, the previous code
would throw an exception of an obscure type "error". It appears that
this was not caught anywhere except the main function in wesnoth.cpp
and so the program would close immediately.

I first tried to go into the gui initialization and construct
buttons in try catch blocks, skipping ones that have problems, but
rather than being able to proceed, this just causes a segfault
because other parts of the code assume that all buttons have been
constructed successfully. This means that not finding the image is
necessarily a fatal error.

My fix for the problem is, instead of throwing error, we throw the
more standard "game::game_error". The new behavior is, if you try
to load a theme with nonexistant images, then a black screen will
appear with a dialog

"error initializing button images! filename: buttons/dontexist.png"

The game then returns to the title screen.

Conflicts:
	src/widgets/button.cpp
        (just the #include reorder)
2014-09-13 12:18:58 -04:00
Boldizsár Lipka
2d822c25c1 Fix compilation. 2014-07-21 09:31:15 +02:00
Boldizsár Lipka
5fd034d3ef SDL_gpu support for GUI1 buttons. 2014-07-21 09:31:14 +02:00
Boldizsár Lipka
ac96a2b91b Move some functions to sdl/rect. 2014-06-03 10:30:12 +02:00
Chris Beck
3c9844889b Make sure all error logs flush with std::endl, so we get on travis.
This is the result of running this command in directory src/

find . -type f -exec sed -i 's/\(ERR.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;

and carefully inspecting the results.
2014-05-20 15:37:52 -04:00
fendrin
dc9a2c89e4 Adds the option to use a suffix to the image paths.
Implemented for using image path functions.
A second change fixes size problems with image type buttons.
2014-03-15 14:37:16 +01:00
Ignacio R. Morelle
a4f47a63c7 New Year copyright update 2014-01-01 02:08:52 -03:00
Charles Dang
06c757fc35 Corrected behavior of GUI1 button in regards to disabled states 2013-06-10 22:35:19 +11:00
Charles Dang
a801915784 Corrected default path for TURBO GUI1 button (lite -> menu_button_copper_H20) 2013-06-10 13:54:31 +11:00
Charles Dang
de3deab416 Fixed typo in a path 2013-06-09 01:11:50 +11:00
Charles Dang
7fe8cc5f84 Use grayscale IPF for disabled widget variations instead of specific images 2013-06-08 22:54:37 +11:00
Charles Dang
226578a31e Made default imagepath for GUI1 button non-copper 2013-06-04 20:45:56 +11:00
fendrin
5a5f3d7e94 Disable most of the palette buttons for the empty palette. 2013-05-17 12:17:36 +02:00
fendrin
1b375de815 Make use of the new button images (gui1). 2013-05-15 14:37:54 +02:00
fendrin
6fc50a6407 Fix missing icon overlays. 2013-05-12 22:00:33 +02:00
fendrin
74117329b8 Handle missing active overlay images properly. 2013-05-07 03:03:09 +02:00
fendrin
fd89e54dff Code clean up. 2013-05-06 20:51:57 +02:00
fendrin
782807c2f9 Made use of active overlay images. 2013-05-05 13:09:39 +02:00
fendrin
e49cc1f458 Default image for the turbo button type.
This fixes the widescreen theme.
2013-04-30 18:06:38 +02:00
fendrin
a1861e2aa3 Tooltip support in GUI1 widgets. 2013-04-29 16:33:50 +02:00
fendrin
63e4db2140 Support for changing the images during the runtime. 2013-04-13 19:42:22 +02:00
fendrin
3f8d6f5891 Enabled the use of the "disabled" image variants for gui1 buttons. 2013-04-05 22:21:58 +02:00
fendrin
26fb1edb6b Moved all editor specific buttons in their subfolder. Added
radiobuttons.
2013-04-02 01:00:11 +02:00
fendrin
51ab917bce Fix a bug with radio buttons not geting checked after out of area
movement.
2013-03-30 17:59:56 +01:00
fendrin
0921bd2378 Adjusted the radiobox behavior to the gtk+ one. 2013-03-30 16:37:04 +01:00
fendrin
a243e70962 gui1 press buttons now play their sound at mouse release like the gui2
ones.
2013-03-30 14:16:57 +01:00
fendrin
4f2e9e3e1a Implemented a gui1 radiobutton
Put it in place at the editor toolbar and the lobby preferences.
2013-03-29 17:22:24 +01:00
fendrin
e047ba879f Minor code cleanup. 2013-03-29 15:13:39 +01:00
fendrin
e53e77f9d2 Fixed freshly unchecked boxes being in a wrong pressed state. 2013-03-29 15:00:46 +01:00
fendrin
ba0fe8c6ae Improved the checkbox implementation. 2013-03-29 13:55:17 +01:00
Eric S. Raymond
043c4f9fd3 Remove $Id$ cookies. 2013-03-26 21:41:37 -04:00
Mark de Wever
43b71f2ff0 New year copyright update. 2013-01-01 09:22:03 +00:00
Mark de Wever
3feb7c865e Remove an unused private field.
Issue found by Clang 3.2.
2012-12-22 13:39:35 +00:00
Ignacio R. Morelle
6ca69b2df5 New year copyright update 2012-01-07 02:35:17 +00:00
Nils Kneuper
a9c341e278 "tiny gui support"-removal part 1:
removed all the if(n)defs from the sources (please review that I got
everything right!)

TODO: remove from build systems and data/
2011-02-12 16:20:24 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +00:00
Guillaume Melquiond
74f018a62e Skipped markup when computing ellipsed text. (Fix for bug #16653.) 2010-09-07 07:45:15 +00:00
Guillaume Melquiond
eeb047de55 Fixed file headers so that they match the content of the COPYING file. 2010-09-01 21:12:38 +00:00
Ali El Gariani
51ab72860e Replace all uses of 'colour' by 'color' in code. 2010-06-03 01:47:06 +00:00
Ali El Gariani
f6fab3788f Rename all SDL_Color font::FOO_COLOUR as font::FOO_COLOR 2010-06-02 22:14:44 +00:00
Guillaume Melquiond
99b0808dd0 Reduced compilation time and binary size by uninlining some destructors. 2010-05-30 17:02:22 +00:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Mark de Wever
cb63d0fd62 Remove an unneeded include. 2009-12-05 21:24:54 +00:00
Guillaume Melquiond
789736ac91 Removed specialized domains from log.hpp,
...so that adding a new domain no longer forces to recompile the whole
game.
2009-04-24 23:18:31 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Nils Kneuper
c84f995e88 add declarations of the textdomain to all files from the domains...
...-lib and -test even if they got no translateable strings the
declaration is done via this define: #define GETTEXT_DOMAIN
"wesnoth-lib" a short "how to get .cpp files translated" is left in
src/gettext.hpp
2008-12-28 21:40:02 +00:00
Eric S. Raymond
9223460daa Remove unused headers. 2008-11-09 04:35:13 +00:00
Tomasz Śniatowski
81c1110fdb add basic keyboard control in main menu, happens to be fr / bug #3835 2008-10-04 22:43:38 +01:00