19 #ifndef INC_C4StartupPlrSelDlg
20 #define INC_C4StartupPlrSelDlg
29 enum Mode { PSDM_Player=0, PSDM_Crew };
30 enum { IconLabelSpacing = 2 };
56 {
return ContextMenu(); }
59 bool KeyCheck() { pCheck->
ToggleCheck(
true);
return true; }
60 bool IsFocusOnClick()
override {
return false; }
62 void SetName(
const char *szNewName);
65 void SetFilename(
const StdStrBuf &sNewFN);
70 virtual uint32_t GetColorDw()
const = 0;
71 bool IsActivated()
const {
return pCheck->
GetChecked(); }
72 void SetActivated(
bool fToVal) { pCheck->
SetChecked(fToVal); }
141 void UpdateClonkEnabled();
143 uint32_t GetColorDw()
const override {
return dwPlrClr; };
151 bool SetName(
const char *szNewName);
153 void OnDeathMessageSet(
const StdStrBuf &rsNewMessage);
161 class C4KeyBinding *pKeyBack, *pKeyProperties, *pKeyCrew, *pKeyDelete, *pKeyRename, *pKeyNew;
164 Mode eMode{PSDM_Player};
175 C4Rect rcBottomButtons; int32_t iBottomButtonWidth;
176 class C4GUI::Button *btnActivatePlr, *btnCrew, *btnProperties, *btnDelete, *btnBack, *btnNew;
178 void UpdateBottomButtons();
179 void UpdatePlayerList();
180 void UpdateSelection();
181 void OnSelChange(
class C4GUI::Element *pEl) { UpdateSelection(); }
183 void UpdateActivatedPlayers();
184 void SelectItem(
const StdStrBuf &Filename,
bool fActivate);
186 void SetPlayerMode();
249 const char *
GetID()
override {
return "PlrPropertiesDlg"; }
270 void UpdatePlayerColor(
bool fUpdateSliders);
271 void UpdatePlayerControl();
272 void UpdatePlayerSkin();
273 void UpdateBigIcon();
276 void SetNewPicture(
const char *szFromFilename);
char * GetFilename(char *szPath)
const StdStrBuf & GetName() const
void SetChecked(bool fToVal)
void ToggleCheck(bool fByUser)
Element * GetNext() const
virtual bool CheckNameHotkey(const char *)
void UpdateOwnPos() override
const C4FacetSurface & GetFacet() const
C4GUI::IconButton * pClrPreview
C4GUI::IconButton * pJumpNRunBtn
void OnClrChangeLeft(C4GUI::Control *pBtn)
const char * GetID() override
C4GUI::Label * ctrl_name_lbl
void OnSkinChangeRight(C4GUI::Control *pBtn)
~C4StartupPlrPropertiesDlg() override=default
void OnClrChangeRight(C4GUI::Control *pBtn)
C4StartupPlrSelDlg::PlayerListItem * pForPlayer
C4FacetSurface fctOldBigIcon
bool IsComponentOutsideClientArea() override
void OnClrChangeCustom(C4GUI::Control *pBtn)
C4StartupPlrPropertiesDlg(C4StartupPlrSelDlg::PlayerListItem *pForPlayer, C4StartupPlrSelDlg *pMainDlg)
int32_t GetMarginRight() override
void OnCtrlChangeLeft(C4GUI::Control *pBtn)
C4FacetSurface fctNewBigIcon
int32_t GetMarginBottom() override
void OnClosed(bool fOK) override
C4GUI::IconButton * pPictureBtn
void OnPictureBtn(C4GUI::Control *pBtn)
void OnCtrlChangeRight(C4GUI::Control *pBtn)
C4StartupPlrSelDlg * pMainDlg
void UserClose(bool fOK) override
C4GUI::CheckBox * pAutoStopControl
int32_t GetMarginLeft() override
int32_t GetMarginTop() override
C4GUI::IconButton * pMouseBtn
void DrawElement(C4TargetFacet &cgo) override
C4GUI::Picture * pSkinImg
void OnSkinChangeLeft(C4GUI::Control *pBtn)
C4GUI::Picture * pCtrlImg
C4GUI::IconButton * pClassicBtn
LoadError(StdStrBuf &&rTakeFrom)
~PlayerListItem() override=default
const C4PlayerInfoCore & GetCore() const
void GrabCustomIcon(C4FacetSurface &fctGrabFrom)
bool MoveFilename(const char *szToFilename)
StdStrBuf GetDelWarning() override
void SetSelectionInfo(C4GUI::TextWindow *pSelectionInfo) override
uint32_t GetColorDw() const override
void UpdateCore(C4PlayerInfoCore &NewCore)
PlayerListItem(C4StartupPlrSelDlg *pForDlg, C4GUI::ListBox *pForListBox, C4GUI::Element *pInsertBeforeElement=nullptr, bool fActivated=false)
C4GUI::ContextMenu * ContextMenu() override
void Load(const StdStrBuf &rsFilename)
ListItem * GetSelection()
void OnDelCtx(C4GUI::Element *el)
void OnActivateBtn(C4GUI::Control *btn)
void OnDelBtnConfirm(ListItem *pSel)
friend class CrewListItem
void OnItemCheckChange(C4GUI::Element *pCheckBox)
~C4StartupPlrSelDlg() override
void OnPropertyBtn(C4GUI::Control *btn)
bool HasBackground() override
static bool CheckPlayerName(const StdStrBuf &Playername, StdStrBuf &Filename, const StdStrBuf *pPrevFilename, bool fWarnEmpty)
C4GUI::RenameEdit * pRenameEdit
friend class PlayerListItem
void DrawElement(C4TargetFacet &cgo) override
void SetSelection(ListItem *pNewItem)
int32_t GetMarginTop() override
void OnNew(const StdStrBuf &Playername)
void OnDelBtn(C4GUI::Control *btn)
void OnBackBtn(C4GUI::Control *btn)
void OnNewBtn(C4GUI::Control *btn)
void OnCrewBtn(C4GUI::Control *btn)
void OnPropertyCtx(C4GUI::Element *el)
void GUISound(const char *szSound)