This repository has been archived by the owner on Sep 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
RA_Dlg_AchEditor.h
94 lines (68 loc) · 2.72 KB
/
RA_Dlg_AchEditor.h
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
94
#pragma once
#include <wtypes.h>
#include <vector>
#include "RA_httpthread.h"
#include "RA_Achievement.h"
namespace
{
const size_t MAX_CONDITIONS = 200;
const size_t MEM_STRING_TEXT_LEN = 80;
}
class BadgeNames
{
public:
BadgeNames()
: m_hDestComboBox( nullptr ) {}
void InstallAchEditorCombo( HWND hCombo ) { m_hDestComboBox = hCombo; }
void FetchNewBadgeNamesThreaded();
void AddNewBadgeName( const char* pStr, bool bAndSelect );
void OnNewBadgeNames( const Document& data );
private:
HWND m_hDestComboBox;
};
class Dlg_AchievementEditor
{
public:
Dlg_AchievementEditor();
~Dlg_AchievementEditor();
public:
static INT_PTR CALLBACK s_AchievementEditorProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR AchievementEditorProc(HWND, UINT, WPARAM, LPARAM);
public:
void OnLoad_NewRom();
void LoadAchievement( Achievement* pCheevo, BOOL bAttemptKeepScrollbar );
inline void SetICEControl( HWND hIce ) { m_hICEControl = hIce; }
inline char* LbxDataAt( unsigned int nRow, unsigned int nCol ) { return m_lbxData[nRow][nCol]; }
HWND GetICEControl() const { return m_hICEControl; }
void InstallHWND( HWND hWnd ) { m_hAchievementEditorDlg = hWnd; }
HWND GetHWND() const { return m_hAchievementEditorDlg; }
BOOL IsActive() const;
Achievement* ActiveAchievement() const { return m_pSelectedAchievement; }
BOOL IsPopulatingAchievementEditorData() const { return m_bPopulatingAchievementEditorData; }
void SetIgnoreEdits( BOOL bIgnore ) { m_bPopulatingAchievementEditorData = bIgnore; }
void UpdateBadge( const std::string& sNewName ); // Call to set/update data
void UpdateSelectedBadgeImage( const std::string& sBackupBadgeToUse = "" ); // Call to just update the badge image/bitmap
BadgeNames& GetBadgeNames() { return m_BadgeNames; }
size_t GetSelectedConditionGroup() const;
void SetSelectedConditionGroup( size_t nGrp ) const;
ConditionSet m_ConditionClipboard;
private:
void RepopulateGroupList( Achievement* pCheevo );
void PopulateConditions( Achievement* pCheevo );
void SetupColumns( HWND hList );
const int AddCondition( HWND hList, const Condition& Cond );
void UpdateCondition( HWND hList, LV_ITEM& item, const Condition& Cond );
private:
static const int m_nNumCols = 10;//;sizeof( g_sColTitles ) / sizeof( g_sColTitles[0] );
HWND m_hAchievementEditorDlg;
HWND m_hICEControl;
char m_lbxData[ MAX_CONDITIONS ][ m_nNumCols ][ MEM_STRING_TEXT_LEN ];
TCHAR m_lbxGroupNames[ MAX_CONDITIONS ][ MEM_STRING_TEXT_LEN ];
int m_nNumOccupiedRows;
Achievement* m_pSelectedAchievement;
BOOL m_bPopulatingAchievementEditorData;
HBITMAP m_hAchievementBadge;
BadgeNames m_BadgeNames;
};
void GenerateResizes(HWND hDlg);
extern Dlg_AchievementEditor g_AchievementEditorDialog;