splited help

This commit is contained in:
Geoffray Levasseur committed 2026-11-17 12:28:13 +01:00
1 parent 3645c06305
commit c961b30525
5 files changed
+1413 -883

No files matched your search

+26 -4
View File
@@ -31,6 +31,7 @@
#include "Cevo/CevoBaseWin.h"
#include "Cevo/CevoPVScrollBar.h"
#include "Cevo/CevoStringTables.h"
#include "IsoEngine.h"
#include <QColor>
#include <QString>
@@ -111,10 +112,10 @@ struct HistItem {
// THelpDlg equivalent: the in-game encyclopedia/hypertext browser. UI built
// from Help.ui (adapted from the original's Help.lfm). The real content
// (Help/Help.txt via StringTables.pas) isn't available, so prepare()/
// offscreenPaint() render a simplified, disclosed-placeholder version of
// each page rather than the original's full icon-rich layout - the
// history/search/scrolling/link-click machinery itself is faithful.
// (Help/Help.txt) is loaded and rendered with real per-TextFormat icons
// (see Help.Paint.cpp); a handful of cosmetic pixel-level effects (the
// WaterSign watermark blend, isometric terrain-tile edge blending) are
// simplified - see the PORT STATUS comment at the top of Help.cpp.
class HelpDlg : public FramedDlg {
Q_OBJECT
public:
@@ -165,6 +166,14 @@ private:
void addTextual(const QString &text);
void search(const QString &searchString);
void line(Dpi::Canvas &canvas, int i, bool lit);
// Draws the leading link-indicator dot and, per `mainText.info(idx)`'s
// TextFormat, the line's icon (if any) - advancing x0[i+2] so line()
// then draws the text starting right after it.
void paintIcon(Dpi::Canvas &canvas, int i);
// The pkTer/pkBigTer inline terrain-tile icon (edge-blended sprite
// pair) - a free-standing helper since it's also reused for the
// "complete terrain list" page's many icons.
void paintTerIcon(Dpi::Canvas &canvas, int &x0Ref, int y, int picpix);
void paintTerrIcon(int x, int y, int xSrc, int ySrc);
// Help.pas's WaterSign(): draws a big improvement/wonder illustration.
// Simplified from the original's per-pixel sky-detecting watermark blend
@@ -187,6 +196,10 @@ private:
// Help.pas's ExtPic: the single external illustration bitmap (Help/*.png)
// referenced by the currently displayed page's "@filename\" markup.
std::unique_ptr<Dpi::Bitmap> extPic;
// Help.pas's NoMap: a TIsoMap instance used only for its terrain-tile
// geometry (xxt/yyt) and sprite sheet (hGrTerrain) - never shown as a
// real game map.
std::unique_ptr<IsoEngine::IsoMap> noMap;
std::vector<HistItem> histItems;
PVScrollBar *scrollBar;
std::array<int, 183> x0{}; // x0[-2..180], offset by +2
@@ -194,5 +207,14 @@ private:
Ui::HelpDlg *ui;
};
// Help.txt phrases carry raw C printf-style specifiers (copied from the
// original's Format() call sites) - NOT Qt's %1/%2 .arg() syntax. Scans left
// to right, filling each %d/%s in order from args (supports formats with
// more than one placeholder, e.g. "#STRENGTH Strength: %d/%d"). Shared by
// Help.cpp and Help.Prepare.cpp.
QString formatArgs(const QString &fmt, const QStringList &args);
QString formatD(const QString &fmt, int value);
QString formatS(const QString &fmt, const QString &value);
} // namespace Help
} // namespace Cevo