48 Commits

Author SHA1 Message Date
Ignacio R. Morelle
a4f47a63c7 New Year copyright update 2014-01-01 02:08:52 -03:00
Alexander van Gessel
6b0acc4c34 Initialize two variables
Found by coverity
2013-12-22 17:10:41 +01:00
Ignacio R. Morelle
25266cd2f6 Fix NULL pointer dereference when scroll-wheeling in the editor
From cd8c83532b0d33a3a2e24d9af04dac0455a84625:

  gui::slider* s = gui().find_slider("map-zoom-slider");
  if (point_in_rect(event.x, event.y, s->location())) {
      scrollx = 0; scrolly = 0;
  }

s is not guaranteed to not be NULL. display::find_slider() WILL return
NULL if it can't find the requested widget. As it turns out, the editor
currently lacks a slider called "map-zoom-slider".
2013-12-21 14:34:13 -03:00
David Mikos
d04f6af930 add check to see that middle click scrolling variables are fully intialized 2013-12-22 01:53:44 +10:30
David Mikos
cd8c83532b Make it so that sliders can be mouse wheel scrolled. 2013-12-22 00:16:27 +10:30
David Mikos
36b6b60beb Make middle click scrolling based on movement distance not screen centre. 2013-12-21 22:28:59 +10:30
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
Ignacio R. Morelle
6ca69b2df5 New year copyright update 2012-01-07 02:35:17 +00:00
Fabian Müller
d04fa3be80 Basic Joystick support. 2011-06-20 23:33:10 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +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
992b6f0e3c Allow to associate a help page to each tooltip (open when clicking). 2010-06-04 18:59:18 +00:00
Ali El Gariani
ef72ecf413 Move tooltips processing to mouse_handler_base 2010-06-04 18:59:14 +00:00
Mark de Wever
b1b61353f3 Make a member function a const member function.
Issue found by cppcheck.
2010-03-30 21:56:38 +00:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Ali El Gariani
6e0b12e8c0 clean some includes 2009-12-05 00:19:32 +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
4d27743d10 Remove trailing whitespace. 2009-04-04 16:41:28 +00:00
Mark de Wever
581c2d0387 Converted the old style casts to c++ style casts. 2009-04-02 18:22:27 +00:00
Ali El Gariani
b13512e65e Fix bug #13251: Units move on their own when using "next unit" 2009-03-29 00:57:44 +00:00
Ali El Gariani
409d570faa no need of reference for bool 2009-03-10 08:18:48 +00:00
Ali El Gariani
9c027a1933 Fix a problem when trying to attack with a double-click(?),
the following clicks were doubled and so the attack dialog (when canceled)
2009-03-10 07:41:50 +00:00
Ali El Gariani
e897aa08b6 Fix a bug about dragging started during another move done by drag&drop 2009-03-10 03:15:10 +00:00
Ali El Gariani
c92e735dc9 Quick fix for restoring a 15px threshold for drag&drop (instead of 0)
This fixes unwanted double-click (causing double select event and reset goto)
ilor: the editor continue to use 0, but I don't know where test it.
2009-03-01 17:58:38 +00:00
Ali El Gariani
fe7bd3032a Fix bug #12712: false "click" sometimes triggered at end of unit move...
...and a not reported bug about sometimes firing multiple "select" events.

ilor: seems to not modify the editor behavior but maybe check.
2009-02-26 04:37:06 +00:00
Patrick Parker
c81ae6895b new advanced preference to choose whether middle-click scrolls...
...or warps (default=scrolls)
2009-01-05 04:47:48 +00:00
Mark de Wever
973a0a7d5c Remove trailing whitespace. 2009-01-01 10:28:26 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Tomasz Śniatowski
1589d8713c editor2 MDI feature - have more than one map open in the editor...
...with fast switching between them. Can be disabled in the editor
settings. Also changed:

* the display class now holds a pointer to the map instead of a
  reference, a pointer can be changed which permits the entire MDI
  behavior. Related bits were also changed in terrain_builder.

* mouse_handler_base no longer holds a reference to the map

* the map labels class does not hold a gamemap reference, as it can
  use the display object to access the map. Also clearing all labels
  was exposed as a public member function.

* used scoped_ptrs and forward declarations to avoid having to include
  map_label.hpp and terrain_builder.hpp in display.hpp, this reduces
  build dependencies quite a bit.

* made get_action_state use the menu index to allow a dynamic menu to
  have checkboxes. This entire chunk of code needs a rewrite.
2008-11-21 15:42:34 +01:00
Tomasz Śniatowski
c54a538139 Refactor gamemap::location -- rename to map_location,
...move into separate cpp/hpp pair. The code under src/ was modified
mainly using a global search-and-replace. This change allows reducing
code dependencies and gets rid of inner-class confusion (parts of the
code had to use "location" when referring to gamemap::location, it is
now consistent across the codebase.)
2008-10-15 17:38:51 +01:00
Tomasz Śniatowski
c06ec2c186 editor2: right mouse button functions...
...(paint with bg terrain, deselect, remove starting pos). The drag
handling code should probably be moved from the editor into
mouse_handler_base, but it's not needed in the game at the moment.
2008-08-16 13:40:28 +01:00
Tomasz Śniatowski
724739504a add parens to silence gcc 4.3.1 2008-08-15 13:10:03 +01:00
Tomasz Śniatowski
2c0627c180 mose_handler_base mouse click/drag cleanup,
...allow right mouse button drag (not used anywhere yet)
2008-08-14 21:42:18 +01:00
Tomasz Śniatowski
b4d8a5d68b editor2: fix terrain palette mouse scrolling issue 2008-08-12 20:15:01 +01:00
Mark de Wever
dc74d7ce2c Initialize all members. 2008-08-10 10:08:40 +00:00
Mark de Wever
025e4d49bb Comment out unused parameters. 2008-08-04 15:13:34 +00:00
Tomasz Śniatowski
e5f4865330 editor2: auto update terrain transitions switch, manual refresh functions 2008-07-31 13:30:57 +01:00
Tomasz Śniatowski
98f6f6f9a7 rv accidental debug that was commited 2008-07-26 21:50:36 +01:00
Tomasz Śniatowski
7dbb80ec5c editor2: display starting position labels 2008-07-26 21:48:51 +01:00
Tomasz Śniatowski
a85fd24384 editor2: select actions (not bound yet), swap fg/bg hotkey,
...two mouse drag issues fixed
2008-07-26 13:07:30 +01:00
Mark de Wever
f00c4f0798 Initialize all members. 2008-07-21 18:49:14 +00:00
Tomasz Śniatowski
753dada0ee use default gamemap::location ctor 2008-07-10 12:02:07 +01:00
Tomasz Śniatowski
91e1ec064e Initialize members that should be initialized 2008-07-09 21:50:03 +01:00
Tomasz Śniatowski
d1ed9d6f6a Editor2: basic click-drag support, some debugging aids,
...small changes in mouse_handler_base to better faciliate the click-dragging
2008-07-09 15:59:44 +01:00
Tomasz Śniatowski
d2f5668ce3 Editor2:
* Implement very basic single hex drawing

* Framework for mouse actions

* Merge editor_mouse_handler with editor_controller (required some
  slight changes in mouse_handler_base and mouse_handler)

* Minor changes that would be difficult to separate now and commit on
  their own
2008-07-09 01:02:16 +01:00
Mark de Wever
d6164e256a Comment out some unused parameters. 2008-07-03 15:13:01 +00:00
Tomasz Śniatowski
3027aff5c2 Refactor parts of mouse_events (no expected visible side-effects):
* move generic code (that could be used by editor2) into a base class
  (in a separate hpp/cpp pair)

* split attack prediction display classes into separate files This is
  still work in progress and is likely to change further as I actually
  make use of it in editor2.
2008-07-02 17:28:39 +01:00