[Kde-games-devel] Konquest bug & fix re aggregation of messages to player

E Willgohs ehwshopping at gmail.com
Sun Jun 24 20:14:37 UTC 2012


I hope this is an ok place to submit this.

I built kdegames-4.8.90   konquest and found and fix a bug in player
messages, as follows.  There were some additional minor changes, like at
least once I think I moved an item from protected into public so I could
refer to it elsewhere, but there's probably a better way to do that anyways
& the issue will make itself clearly known as necessary.

player messages (planet attacks, reinforcements) were coming through one
per messagebox instead of aggregated each turn.  In previous versions this
had been dealt with in  gameview::beginTurn() , and although I think the
connection was still attempted in mainwin.cc, the slot was not getting
activated, because there was no longer a beginTurn() signal as was expected
by the connection, and I think I maybe also had to copy over the
gameview::beginTurn slot declaration and method from kdegames-4.7.4

I also added a signal to neutralplayer.h
void showMessages();

and emit it from NeutralPlayer::play() after the loop over fleet arrivals
and before the loop over planets.  As an additional item, I took the old
scanForSurvivors function and put it pretty much unchanged into game
because I enjoy its messages, & then also call it here, so
in NeutralPlayer::play()  at lines 55& 56 in my file

    m_game->scanForSurvivors();
emit showMessages();

and then the mainwin.cc connection ~line 119  wound up
connect (m_game->m_neutral, SIGNAL(showMessages()), m_gameView,
SLOT(beginTurn()));

(I think that's an example where I made m_neutral public to get it to work
but I'm sure there's better ways)

Also, I had m_queueMessages start true and always stay true (not setting it
false at the end of beginTurn() ) since there is no longer a signal into
the endTurn() slot where it had been getting turned back on in previous
messages.

I think that was all it took to get that working ( I had made some other
changes along the way as I was figuring it out but I think this was all
that was actually necessary).

I hope this is helpful;

Cheers!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20120624/596292cb/attachment.html>


More information about the kde-games-devel mailing list