| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
#pragma once |
| 29 |
|
| 30 |
#include <cdogs/campaigns.h> |
| 31 |
#include <cdogs/map_object.h> |
| 32 |
#include <cdogs/vector.h> |
| 33 |
|
| 34 |
#include "editor_brush.h" |
| 35 |
#include "ui_object.h" |
| 36 |
|
| 37 |
#ifdef __APPLE__ |
| 38 |
#define KMOD_CMD KMOD_GUI |
| 39 |
#define KMOD_CMD_NAME "Cmd" |
| 40 |
#else |
| 41 |
#define KMOD_CMD KMOD_CTRL |
| 42 |
#define KMOD_CMD_NAME "Ctrl" |
| 43 |
#endif |
| 44 |
|
| 45 |
typedef struct |
| 46 |
{ |
| 47 |
EditorBrush *Brush; |
| 48 |
union |
| 49 |
{ |
| 50 |
int ItemIndex; |
| 51 |
MapObject *MapObject; |
| 52 |
} u; |
| 53 |
int Index2; |
| 54 |
} IndexedEditorBrush; |
| 55 |
typedef struct |
| 56 |
{ |
| 57 |
IndexedEditorBrush Brush; |
| 58 |
Campaign *Campaign; |
| 59 |
} EditorBrushAndCampaign; |
| 60 |
|
| 61 |
void DisplayMapItem(const struct vec2i pos, const MapObject *mo); |
| 62 |
void DisplayMapItemWithDensity( |
| 63 |
const struct vec2i pos, const MapObjectDensity *mod, const bool isHighlighted); |
| 64 |
void DisplayPickup(const struct vec2i pos, const PickupClass *p); |
| 65 |
void DisplayPickupWithCount( |
| 66 |
const struct vec2i pos, const PickupCount *pc, |
| 67 |
const bool isHighlighted); |
| 68 |
void DrawKey(UIObject *o, GraphicsDevice *g, struct vec2i pos, void *vData); |
| 69 |
|
| 70 |
void InsertMission(Campaign *co, Mission *mission, int idx); |
| 71 |
|
| 72 |
bool ConfirmScreen(const char *info, const char *msg); |
| 73 |
void ClearScreen(GraphicsDevice *g); |
| 74 |
|
| 75 |
void DisplayFlag( |
| 76 |
const struct vec2i pos, const char *s, const bool isOn, const bool isHighlighted); |
| 77 |
|
| 78 |
UIObject *CreateCampaignSeedObj(const struct vec2i pos, Campaign *co); |
| 79 |
UIObject *CreateAddMapItemObjs( |
| 80 |
const struct vec2i pos, bool (*objFunc)(UIObject *, MapObject *, void *), |
| 81 |
void *data, const size_t dataSize, const bool expandDown); |
| 82 |
UIObject *CreateAddPickupObjs( |
| 83 |
const struct vec2i pos, bool (*objFunc)(UIObject *, PickupClass *, void *), |
| 84 |
void *data, const size_t dataSize, const bool expandDown); |
| 85 |
UIObject *CreateAddPickupSpawnerObjs( |
| 86 |
const struct vec2i pos, bool (*objFunc)(UIObject *, MapObject *, void *), |
| 87 |
void *data, const size_t dataSize); |
| 88 |
|
| 89 |
char *MakeMapObjectTooltip(const MapObject *mo); |
| 90 |
char *MakePickupTooltip(const PickupClass *p); |
| 91 |
void MapObjectGetPlacementFlagNames(const MapObject *mo, char *buf, const char *sep); |
| 92 |
void MapObjectGetExplosionGunNames(const MapObject *mo, char *buf, const char *sep); |
| 93 |
|
| 94 |
|
| 95 |
void CreateCloseLabel(UIObject *c, const struct vec2i pos); |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
#define MISSION_CHECK_TYPE_FUNC(_type)\ |
| 100 |
static void MissionCheckTypeFunc(UIObject *o, void *data)\ |
| 101 |
{\ |
| 102 |
Campaign *co = data;\ |
| 103 |
const Mission *m = CampaignGetCurrentMission(co);\ |
| 104 |
if (!m || m->Type != (_type))\ |
| 105 |
{\ |
| 106 |
o->IsVisible = false;\ |
| 107 |
\ |
| 108 |
UIObjectUnhighlight(o, false);\ |
| 109 |
return;\ |
| 110 |
}\ |
| 111 |
o->IsVisible = true;\ |
| 112 |
} |
| 113 |
|
| 114 |
void TileClassGetBrushName(char *buf, const TileClass *tc); |
| 115 |
|
| 116 |
char *GetClassNames(const size_t len, const char *(*indexNameFunc)(const int)); |
| 117 |
|
| 118 |
void TexArrayInit(CArray *arr, const size_t count); |
| 119 |
void TexArrayTerminate(CArray *arr); |