added cityscreen with deps
This commit is contained in:
1 parent
29f47be49b
commit
6773e620cf
6 files changed
+1931
No files matched your search
@@ -28,9 +28,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Cevo/CevoBaseWin.h"
|
||||
#include "Cevo/CevoScreenTools.h"
|
||||
#include "Cevo/Protocol.h"
|
||||
#include "ClientTools.h"
|
||||
#include "MessgEx.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
@@ -141,6 +143,11 @@ void initMyModel(int mix, bool final);
|
||||
// different Pascal unit) - don't conflate the two.
|
||||
extern int gameMode;
|
||||
|
||||
// Term.pas's `Age: Integer;` (the local player's current era - used as a
|
||||
// palette-row offset into ScreenTools.pas's `Colors` matrix, e.g.
|
||||
// `clkAge0 + Age`). Stays 0 until Term.pas is ported and updates it.
|
||||
extern int age;
|
||||
|
||||
// Term.pas's layout constant (MidPanelHeight - TopBarHeight) div 2; the
|
||||
// two panel-size constants it derives from belong to Term's not-yet-ported
|
||||
// main window layout, so only the resulting fixed value is pre-seeded here.
|
||||
@@ -157,5 +164,50 @@ extern int nLostArmy;
|
||||
// draw them. Injection point (default no-op) until Term.pas is ported.
|
||||
extern std::function<void()> initAllEnemyModels;
|
||||
|
||||
// Term.pas's own "city status flags"/additional "city happened flags"
|
||||
// constants (distinct from Protocol.pas's chXxx flags in ai/Protocol.h).
|
||||
constexpr int csTypeMask = 0x0007;
|
||||
constexpr int csToldDelay = 0x0008;
|
||||
constexpr int csResourceWeightsMask = 0x00F0;
|
||||
constexpr int csToldBombard = 0x0100;
|
||||
constexpr int chAllImpsMade = 0x4000;
|
||||
constexpr int chTypeDel = 0x8000;
|
||||
|
||||
// Term.pas's CityEventPriority[]/CityEventSoundItem[]/CityEventName(): the
|
||||
// city-event-message table shown by CityScreen.pas's "messages" panel.
|
||||
constexpr int nCityEventPriority = 16;
|
||||
extern const std::array<int, nCityEventPriority> CityEventPriority;
|
||||
extern const std::array<QString, 16> CityEventSoundItem;
|
||||
// TODO: needs Phrases/Phrases2 (StringTables.pas not ported) - falls back
|
||||
// to a plain English description per event index.
|
||||
QString cityEventName(int i);
|
||||
|
||||
// Term.pas's HelpOnTerrain(): opens the help dialog on the terrain-info
|
||||
// page matching the given map tile (including the fJungle pseudo-terrain
|
||||
// substitution for forest tiles growing on a jungle-climate row).
|
||||
constexpr int fJungle = 8; // Help.pas's pseudo-terrain id for jungle-grown forest.
|
||||
void helpOnTerrain(int loc, WindowMode newMode);
|
||||
|
||||
// Term.pas's `MainScreen: TMainScreen` instance isn't ported; these mirror
|
||||
// its ZoomToCity()/CityClosed()/UpdateViews()/RepaintAll() methods plus
|
||||
// ModalSelectDlg/ListDlg dialog access as injection points other screens
|
||||
// can call into once Term.pas/Select.pas exist. Default to safe no-ops.
|
||||
extern std::function<bool(int loc, bool nextUnitOnClose, int showEvent)> mainScreenZoomToCity;
|
||||
extern std::function<void(int activateUix, bool stepFocus, bool selectFocus)> mainScreenCityClosed;
|
||||
extern std::function<void(bool updateCityScreen)> mainScreenUpdateViews;
|
||||
extern std::function<void()> mainScreenRepaintAll;
|
||||
// Mirrors `MainScreen.ModalSelectDlg.ShowNewContent_CityProject(wmModal,
|
||||
// cix)` + reading back `.Result` - returns -1 (cancelled) by default.
|
||||
extern std::function<int(int cix)> modalSelectDlgShowCityProject;
|
||||
// Select.pas's own `cpType = $10000` bit (set in ModalSelectDlg.Result when
|
||||
// the user picked a city-type autobuild preset rather than a single
|
||||
// project) - distinct from Protocol.pas's cpXxx bits in ai/Protocol.h.
|
||||
constexpr int cpType = 0x10000;
|
||||
// Mirrors `MainScreen.ListDlg.RenameCity(cix)` - returns false by default.
|
||||
extern std::function<bool(int cix)> listDlgRenameCity;
|
||||
// Mirrors `MainScreen.MessgExDlg` dialog access - returns nullptr by
|
||||
// default until Term.pas creates a real instance.
|
||||
extern std::function<MessgEx::MessgExDlg *()> mainScreenMessgExDlg;
|
||||
|
||||
} // namespace Term
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user