about summary refs log tree commit diff stats
path: root/data/maps/the_partial/rooms
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-11-10 22:19:20 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2025-11-10 22:19:20 -0500
commitf6e2ecb27ab96da93b485a1c099666bf9e6d8d45 (patch)
tree246c503145c32e0e78c8f7849236d29651b9fa7e /data/maps/the_partial/rooms
parentfce984639f4f06b17a7f0aca1e95de830cab9914 (diff)
downloadlingo2-archipelago-f6e2ecb27ab96da93b485a1c099666bf9e6d8d45.tar.gz
lingo2-archipelago-f6e2ecb27ab96da93b485a1c099666bf9e6d8d45.tar.bz2
lingo2-archipelago-f6e2ecb27ab96da93b485a1c099666bf9e6d8d45.zip
Latch the daed hedges tower door
Diffstat (limited to 'data/maps/the_partial/rooms')
0 files changed, 0 insertions, 0 deletions
='author Kelly Rauchenberger <fefferburbia@gmail.com> 2015-03-17 23:53:55 -0400 committer Kelly Rauchenberger <fefferburbia@gmail.com> 2015-03-17 23:53:55 -0400 Map editor can now define actions to occur when the player goes off a specified edge of the map' href='/therapy/commit/tools/mapedit/src/widget.h?h=es-rewrite&id=f732cdaf7374fde737b503ec6966fb8cd8f4c32b'>f732cda ^
213cab3 ^





5c6d5cf ^
3e98951 ^



2e66b27 ^
8702c11 ^

213cab3 ^


0d30e9b ^
29f818c ^
213cab3 ^

8702c11 ^
3e98951 ^




c46db36 ^
3e98951 ^

168b515 ^
dc0f0d6 ^
3e98951 ^


8702c11 ^
f83f5af ^
3e98951 ^
0d30e9b ^
3e98951 ^


5c6d5cf ^

168b515 ^
213cab3 ^
29f818c ^

e882367 ^
213cab3 ^

e882367 ^
c46db36 ^
3e98951 ^
213cab3 ^

3e98951 ^
281bdf9 ^




3e98951 ^

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








                      

                 

                  
 
                   


                 
                     

                   





               
                                               



                                                                                                                                                                    
                             

                   


                                              
                          
                                           

                        
    




                                         
                                           

                                          
                                         
                                           


                              
                               
                                                                                                                                                           
      
                       


                             

                                                   
                           
                                  

                              
                                              

                                      
                                           
                                                   
    

                                        
  




                                                                    

      
#ifndef WIDGET_H
#define WIDGET_H

#include <wx/wxprec.h>

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

#include <list>
#include <memory>
#include <utility>
#include <set>

class MapeditFrame;
class TileWidget;
class Map;
class MapObject;
class MapObjectEntry;

#include "consts.h"

enum EditMode {
  EditTiles,
  EditEntities
};

class MapeditWidget : public wxScrolledCanvas {
  public:
    MapeditWidget();
    MapeditWidget(wxWindow* parent, wxWindowID winid, Map* map, TileWidget* tileWidget, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
    
    void SetUpZoom(int zoom);
    void ZoomIn();
    void ZoomOut();
    void SetEditMode(EditMode editMode);
    void StartAddingEntity(MapObject* object);
    void CancelAddingEntity();
    void SetMap(Map* map);
    void SetIsSettingStart(bool isSetting);
    
    MapeditFrame* frame;
    
  protected:
    void Init();
    virtual wxSize DoGetBestSize() const;
    void OnPaint(wxPaintEvent& event);
    void OnClick(wxMouseEvent& event);
    void OnRightClick(wxMouseEvent& event);
    void OnMouseMove(wxMouseEvent& event);
    void OnMouseUp(wxMouseEvent& event);
    void OnMouseOut(wxMouseEvent& event);
    void OnScroll(wxScrollWinEvent& event);
    
  private:
    void SetTile(wxPoint pos);
    void SetZoomSize(int zoom);
    void RenderMap(Map* toRender, wxPaintDC& dc, wxMemoryDC& tiles_dc, int offset_x = EDITOR_SPACING_X, int offset_y = EDITOR_SPACING_Y, bool main = true);
      
    Map* map = nullptr;
    wxBitmap tiles;
    TileWidget* tileWidget;
    bool mouseIsDown = false;
    int scale = 1;
    wxPoint mousePos {GAME_WIDTH/2, GAME_HEIGHT/2};
    bool mouseIsIn = false;
    EditMode editMode = EditTiles;
    int currentPlayer = 0;
    bool isSettingPos = false;
    std::set<std::pair<int,int>> changeBuffer;
    
    MapObject* addingEntity = nullptr;
    MapObjectEntry* movingEntity = nullptr;
    std::shared_ptr<MapObjectEntry> selectedEntity;
    
    DECLARE_DYNAMIC_CLASS(MapeditWidget)
    DECLARE_EVENT_TABLE()
};

// sends when an entity is selected OR deselected.
// client data will be a pointer to the MapObjectEntry if selection.
// client data will be nullptr if deselection.
wxDECLARE_EVENT(EVT_MAP_SELECTED_ENTITY, wxCommandEvent);
    
#endif