File: tilereg-cmd.h

package info (click to toggle)
crawl 2%3A0.33.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 95,264 kB
  • sloc: cpp: 358,145; ansic: 27,203; javascript: 9,491; python: 8,359; perl: 3,327; java: 2,667; xml: 2,191; makefile: 1,830; sh: 611; objc: 250; cs: 15; sed: 9; lisp: 3
file content (93 lines) | stat: -rw-r--r-- 2,415 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifdef USE_TILE_LOCAL
#pragma once

#include <vector>

#include "command-type.h"
#include "tile-inventory-flags.h"
#include "tilereg-grid.h"

static const command_type ct_system_commands[] =
{
    // informational commands
    CMD_REPLAY_MESSAGES, CMD_RESISTS_SCREEN, CMD_DISPLAY_OVERMAP,
    CMD_DISPLAY_RELIGION, CMD_DISPLAY_MUTATIONS, CMD_DISPLAY_SKILLS,
    CMD_DISPLAY_CHARACTER_STATUS, CMD_DISPLAY_KNOWN_OBJECTS,

    // meta commands
    CMD_SAVE_GAME_NOW, CMD_DISPLAY_COMMANDS, CMD_GAME_MENU,
    CMD_LOOKUP_HELP,
#ifdef __ANDROID__
    CMD_TOGGLE_KEYBOARD,
#endif
};

static const command_type ct_map_commands[] =
{
    CMD_DISPLAY_MAP,
    CMD_MAP_GOTO_TARGET,

    CMD_MAP_NEXT_LEVEL,
    CMD_MAP_PREV_LEVEL,
    CMD_MAP_GOTO_LEVEL,

    CMD_MAP_EXCLUDE_AREA,
    CMD_MAP_FIND_EXCLUDED,
    CMD_MAP_CLEAR_EXCLUDES,

    CMD_MAP_ADD_WAYPOINT,
    CMD_MAP_FIND_WAYPOINT,

    CMD_MAP_FIND_UPSTAIR,
    CMD_MAP_FIND_DOWNSTAIR,
    CMD_MAP_FIND_YOU,
    CMD_MAP_FIND_PORTAL,
    CMD_MAP_FIND_TRAP,
    CMD_MAP_FIND_ALTAR,
//    CMD_MAP_FIND_F,  // no-one knows what this is for, so it's been taken out :P

    CMD_MAP_FIND_STASH,
};

static const command_type ct_action_commands[] =
{
    CMD_EXPLORE,
    CMD_REST, CMD_WAIT,
    CMD_DISPLAY_INVENTORY, CMD_DROP,
    CMD_CAST_SPELL, CMD_USE_ABILITY,
    CMD_DISPLAY_SKILLS, CMD_MEMORISE_SPELL,
    CMD_INTERLEVEL_TRAVEL, CMD_SEARCH_STASHES,
    CMD_LOOKUP_HELP,
};

bool tile_command_not_applicable(const command_type cmd, bool safe);
bool tile_command_not_applicable(const command_type cmd);

class CommandRegion : public GridRegion
{
public:
    CommandRegion(const TileRegionInit &init, const command_type commands[],
                  const int n_commands, const string name="Commands",
                  const string help="Execute commands");
    int n_common_commands;

    virtual void update() override;
    virtual int handle_mouse(wm_mouse_event &event) override;
    virtual bool update_tip_text(string &tip) override;
    virtual bool update_tab_tip_text(string &tip, bool active) override;
    virtual bool update_alt_text(string &alt) override;

    virtual const string name() const override { return m_name; }

protected:
    virtual void pack_buffers() override;
    virtual void draw_tag() override;
    virtual void activate() override;

private:
    vector<command_type> _common_commands;
    string m_name;
    string m_help;
};

#endif