diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-06 20:57:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-06 22:58:35 +0300 |
commit | 4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f (patch) | |
tree | a776928bb1339cdd29eb2e54d50eb3fa6e3448d7 /src/gui/debugwindow.cpp | |
parent | 22ed653d8b630c813333d5c73a4ca02dede2a5a5 (diff) | |
download | mv-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.tar.gz mv-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.tar.bz2 mv-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.tar.xz mv-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.zip |
Improve constructors in some classes.
Diffstat (limited to 'src/gui/debugwindow.cpp')
-rw-r--r-- | src/gui/debugwindow.cpp | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index 7bcec47ec..673edc914 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -47,7 +47,11 @@ #include "debug.h" DebugWindow::DebugWindow(): - Window(_("Debug"), false, nullptr, "debug.xml") + Window(_("Debug"), false, nullptr, "debug.xml"), + mTabs(new TabbedArea), + mMapWidget(new MapDebugTab), + mTargetWidget(new TargetDebugTab), + mNetWidget(new NetDebugTab) { setWindowName("Debug"); if (setupWindow) @@ -60,11 +64,6 @@ DebugWindow::DebugWindow(): setDefaultSize(400, 300, ImageRect::CENTER); - mTabs = new TabbedArea; - mMapWidget = new MapDebugTab; - mTargetWidget = new TargetDebugTab; - mNetWidget = new NetDebugTab; - mTabs->addTab(std::string(_("Map")), mMapWidget); mTabs->addTab(std::string(_("Target")), mTargetWidget); mTabs->addTab(std::string(_("Net")), mNetWidget); @@ -135,24 +134,25 @@ void DebugWindow::widgetResized(const gcn::Event &event) } MapDebugTab::MapDebugTab() : - mTexturesLabel(nullptr) + DebugTab(), + mMusicFileLabel(new Label(strprintf(_("Music:")))), + mMapLabel(new Label(strprintf(_("Map:")))), + mMinimapLabel(new Label(strprintf(_("Minimap:")))), + mTileMouseLabel(new Label(strprintf("%s (%d, %d)", _("Cursor:"), 0, 0))), + mXYLabel(new Label(strprintf("%s (?,?)", _("Player Position:")))), + mTexturesLabel(nullptr), + mUpdateTime(0), + mFPSLabel(new Label(strprintf(_("%d FPS"), 0))), + mLPSLabel(new Label(strprintf(_("%d LPS"), 0))) { LayoutHelper h(this); ContainerPlacer place = h.getPlacer(0, 0); - mMusicFileLabel = new Label(strprintf(_("Music:"))); - mMapLabel = new Label(strprintf(_("Map:"))); - mMinimapLabel = new Label(strprintf(_("Minimap:"))); - mTileMouseLabel = new Label(strprintf("%s (%d, %d)", _("Cursor:"), 0, 0)); - mXYLabel = new Label(strprintf("%s (?,?)", _("Player Position:"))); - mParticleCountLabel = new Label(strprintf("%s %d", _("Particle count:"), 88888)); mMapActorCountLabel = new Label(strprintf("%s %d", _("Map actors count:"), 88888)); - mUpdateTime = 0; - #ifdef USE_OPENGL switch (imageHelper->useOpenGL()) { @@ -171,9 +171,6 @@ MapDebugTab::MapDebugTab() : mFPSText = _("%d FPS (Software)"); #endif - mFPSLabel = new Label(strprintf(_("%d FPS"), 0)); - mLPSLabel = new Label(strprintf(_("%d LPS"), 0)); - place(0, 0, mFPSLabel, 2); place(0, 1, mLPSLabel, 2); place(0, 2, mMusicFileLabel, 2); @@ -261,22 +258,22 @@ void MapDebugTab::logic() mLPSLabel->setCaption(strprintf(_("%d LPS"), lps)); } -TargetDebugTab::TargetDebugTab() +TargetDebugTab::TargetDebugTab() : + DebugTab(), + mTargetLabel(new Label(strprintf("%s ?", _("Target:")))), + mTargetIdLabel(new Label(strprintf("%s ? ", _("Target Id:")))), + mTargetLevelLabel(new Label(strprintf("%s ?", _("Target level:")))), + mTargetRaceLabel(new Label(strprintf("%s ?", _("Target race:")))), + mTargetPartyLabel(new Label(strprintf("%s ?", _("Target party:")))), + mTargetGuildLabel(new Label(strprintf("%s ?", _("Target guild:")))), + mAttackDelayLabel(new Label(strprintf("%s ?", _("Attack delay:")))), + mMinHitLabel(new Label(strprintf("%s ?", _("Minimal hit:")))), + mMaxHitLabel(new Label(strprintf("%s ?", _("Maximum hit:")))), + mCriticalHitLabel(new Label(strprintf("%s ?", _("Critical hit:")))) { LayoutHelper h(this); ContainerPlacer place = h.getPlacer(0, 0); - mTargetLabel = new Label(strprintf("%s ?", _("Target:"))); - mTargetIdLabel = new Label(strprintf("%s ? ", _("Target Id:"))); - mTargetLevelLabel = new Label(strprintf("%s ?", _("Target level:"))); - mTargetRaceLabel = new Label(strprintf("%s ?", _("Target race:"))); - mTargetPartyLabel = new Label(strprintf("%s ?", _("Target party:"))); - mTargetGuildLabel = new Label(strprintf("%s ?", _("Target guild:"))); - mAttackDelayLabel = new Label(strprintf("%s ?", _("Attack delay:"))); - mMinHitLabel = new Label(strprintf("%s ?", _("Minimal hit:"))); - mMaxHitLabel = new Label(strprintf("%s ?", _("Maximum hit:"))); - mCriticalHitLabel = new Label(strprintf("%s ?", _("Critical hit:"))); - place(0, 0, mTargetLabel, 2); place(0, 1, mTargetIdLabel, 2); place(0, 2, mTargetLevelLabel, 2); @@ -365,15 +362,15 @@ void TargetDebugTab::logic() mAttackDelayLabel->adjustSize(); } -NetDebugTab::NetDebugTab() +NetDebugTab::NetDebugTab() : + DebugTab(), + mPingLabel(new Label(" ")), + mInPackets1Label(new Label(" ")), + mOutPackets1Label(new Label(" ")) { LayoutHelper h(this); ContainerPlacer place = h.getPlacer(0, 0); - mPingLabel = new Label(" "); - mInPackets1Label = new Label(" "); - mOutPackets1Label = new Label(" "); - place(0, 0, mPingLabel, 2); place(0, 1, mInPackets1Label, 2); place(0, 2, mOutPackets1Label, 2); @@ -383,7 +380,6 @@ NetDebugTab::NetDebugTab() setDimension(gcn::Rectangle(0, 0, 600, 300)); } - void NetDebugTab::logic() { if (player_node && player_node->getPingTime() != 0) |