Formatted ui source files

This commit is contained in:
smallmodel 2023-12-27 18:54:20 +01:00
parent c1258f160b
commit c0f7a48649
No known key found for this signature in database
GPG key ID: A96F163ED4891440
6 changed files with 289 additions and 552 deletions

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -24,281 +24,162 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
bind_t::bind_t()
{
// FIXME: stub
// FIXME: stub
}
bind_t::~bind_t()
{
Clear();
Clear();
}
void bind_t::Clear
(
void
)
void bind_t::Clear(void)
{
// FIXME: stub
// FIXME: stub
}
CLASS_DECLARATION( Listener, bindlistener, NULL )
{
{ NULL, NULL }
CLASS_DECLARATION(Listener, bindlistener, NULL) {
{NULL, NULL}
};
bindlistener::bindlistener()
bindlistener::bindlistener() {}
bindlistener::bindlistener(bind_t *b)
{
bind = b;
}
bindlistener::bindlistener
(
bind_t *b
)
void bindlistener::Header(Event *ev)
{
bind = b;
// FIXME: stub
}
bool bindlistener::Load
(
Script& script
)
void bindlistener::ChangeSound(Event *ev)
{
// FIXME: stub
return false;
// FIXME: stub
}
void bindlistener::Header
(
Event *ev
)
void bindlistener::ActiveSound(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::Width
(
Event *ev
)
void bindlistener::EnterSound(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::FillWidth
(
Event *ev
)
void bindlistener::SelectForegroundColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::Height
(
Event *ev
)
void bindlistener::SelectBackgroundColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::CommandWidth
(
Event *ev
)
void bindlistener::TitleForegroundColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::CommandHeight
(
Event *ev
)
void bindlistener::TitleBackgroundColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::PrimaryKeyWidth
(
Event *ev
)
void bindlistener::ActiveBorderColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::PrimaryKeyHeight
(
Event *ev
)
void bindlistener::ActiveForegroundColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::AlternateKeyWidth
(
Event *ev
)
void bindlistener::ActiveBackgroundColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::AlternateKeyHeight
(
Event *ev
)
void bindlistener::InactiveForegroundColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::NewItem
(
Event *ev
)
void bindlistener::InactiveBackgroundColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::Align
(
Event *ev
)
void bindlistener::HighlightForegroundColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::TitleForegroundColor
(
Event *ev
)
void bindlistener::HighlightBackgroundColor(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::TitleBackgroundColor
(
Event *ev
)
void bindlistener::Align(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::InactiveForegroundColor
(
Event *ev
)
void bindlistener::NewItem(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::InactiveBackgroundColor
(
Event *ev
)
void bindlistener::Width(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::ActiveForegroundColor
(
Event *ev
)
void bindlistener::Height(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::ActiveBackgroundColor
(
Event *ev
)
void bindlistener::FillWidth(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::ActiveBorderColor
(
Event *ev
)
void bindlistener::CommandWidth(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::HighlightForegroundColor
(
Event *ev
)
void bindlistener::CommandHeight(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::HighlightBackgroundColor
(
Event *ev
)
void bindlistener::PrimaryKeyWidth(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::SelectForegroundColor
(
Event *ev
)
void bindlistener::PrimaryKeyHeight(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::SelectBackgroundColor
(
Event *ev
)
void bindlistener::AlternateKeyWidth(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::ChangeSound
(
Event *ev
)
void bindlistener::AlternateKeyHeight(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void bindlistener::ActiveSound
(
Event *ev
)
bool bindlistener::Load(Script& script)
{
// FIXME: stub
}
void bindlistener::EnterSound
(
Event *ev
)
{
// FIXME: stub
// FIXME: stub
return false;
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,115 +20,107 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __CL_UIBIND_H__
#define __CL_UIBIND_H__
#pragma once
class bind_item_t {
class bind_item_t
{
public:
str name;
str command;
UIReggedMaterial *nameMaterial;
str name;
str command;
UIReggedMaterial *nameMaterial;
bind_item_t();
bind_item_t( str name, str command, UIReggedMaterial *nameMaterial );
bind_item_t();
bind_item_t(str name, str command, UIReggedMaterial *nameMaterial);
};
inline
bind_item_t::bind_item_t()
inline bind_item_t::bind_item_t()
{
nameMaterial = NULL;
nameMaterial = NULL;
}
inline
bind_item_t::bind_item_t
(
str name,
str command,
UIReggedMaterial *nameMaterial
)
inline bind_item_t::bind_item_t(str name, str command, UIReggedMaterial *nameMaterial)
{
this->name = name;
this->command = command;
this->nameMaterial = nameMaterial;
this->name = name;
this->command = command;
this->nameMaterial = nameMaterial;
}
class bind_t {
class bind_t
{
public:
int width;
int height;
int fillwidth;
int commandwidth;
int commandheight;
int primarykeywidth;
int primarykeyheight;
int alternatekeywidth;
int alternatekeyheight;
int align;
UColor titlebgcolor;
UColor titlefgcolor;
UColor activefgcolor;
UColor activebgcolor;
UColor activebordercolor;
UColor inactivefgcolor;
UColor inactivebgcolor;
UColor highlightfgcolor;
UColor highlightbgcolor;
UColor selectfgcolor;
UColor selectbgcolor;
str changesound;
str activesound;
str entersound;
str headers[ 3 ];
UIReggedMaterial *headermats[ 3 ];
UIReggedMaterial *fillmaterial;
Container<bind_item_t *> binds;
int width;
int height;
int fillwidth;
int commandwidth;
int commandheight;
int primarykeywidth;
int primarykeyheight;
int alternatekeywidth;
int alternatekeyheight;
int align;
UColor titlebgcolor;
UColor titlefgcolor;
UColor activefgcolor;
UColor activebgcolor;
UColor activebordercolor;
UColor inactivefgcolor;
UColor inactivebgcolor;
UColor highlightfgcolor;
UColor highlightbgcolor;
UColor selectfgcolor;
UColor selectbgcolor;
str changesound;
str activesound;
str entersound;
str headers[3];
UIReggedMaterial *headermats[3];
UIReggedMaterial *fillmaterial;
Container<bind_item_t *> binds;
public:
bind_t();
~bind_t();
bind_t();
~bind_t();
void Clear( void );
void Clear(void);
};
class bindlistener : public Listener {
class bindlistener : public Listener
{
protected:
bind_t *bind;
bind_t *bind;
public:
CLASS_PROTOTYPE( bindlistener );
CLASS_PROTOTYPE(bindlistener);
public:
bindlistener();
bindlistener( bind_t *b );
bindlistener();
bindlistener(bind_t *b);
bool Load( Script& script );
void Header( Event *ev );
void Width( Event *ev );
void FillWidth( Event *ev );
void Height( Event *ev );
void CommandWidth( Event *ev );
void CommandHeight( Event *ev );
void PrimaryKeyWidth( Event *ev );
void PrimaryKeyHeight( Event *ev );
void AlternateKeyWidth( Event *ev );
void AlternateKeyHeight( Event *ev );
void NewItem( Event *ev );
void Align( Event *ev );
void TitleForegroundColor( Event *ev );
void TitleBackgroundColor( Event *ev );
void InactiveForegroundColor( Event *ev );
void InactiveBackgroundColor( Event *ev );
void ActiveForegroundColor( Event *ev );
void ActiveBackgroundColor( Event *ev );
void ActiveBorderColor( Event *ev );
void HighlightForegroundColor( Event *ev );
void HighlightBackgroundColor( Event *ev );
void SelectForegroundColor( Event *ev );
void SelectBackgroundColor( Event *ev );
void ChangeSound( Event *ev );
void ActiveSound( Event *ev );
void EnterSound( Event *ev );
bool Load(Script& script);
void Header(Event *ev);
void Width(Event *ev);
void FillWidth(Event *ev);
void Height(Event *ev);
void CommandWidth(Event *ev);
void CommandHeight(Event *ev);
void PrimaryKeyWidth(Event *ev);
void PrimaryKeyHeight(Event *ev);
void AlternateKeyWidth(Event *ev);
void AlternateKeyHeight(Event *ev);
void NewItem(Event *ev);
void Align(Event *ev);
void TitleForegroundColor(Event *ev);
void TitleBackgroundColor(Event *ev);
void InactiveForegroundColor(Event *ev);
void InactiveBackgroundColor(Event *ev);
void ActiveForegroundColor(Event *ev);
void ActiveBackgroundColor(Event *ev);
void ActiveBorderColor(Event *ev);
void HighlightForegroundColor(Event *ev);
void HighlightBackgroundColor(Event *ev);
void SelectForegroundColor(Event *ev);
void SelectBackgroundColor(Event *ev);
void ChangeSound(Event *ev);
void ActiveSound(Event *ev);
void EnterSound(Event *ev);
};
#endif

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -22,106 +22,59 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "ui_local.h"
CLASS_DECLARATION( UIButton, UIBindButton, NULL )
{
{ NULL, NULL }
CLASS_DECLARATION(UIButton, UIBindButton, NULL) {
{NULL, NULL}
};
UIBindButton::UIBindButton()
{
UIBindButton::UIBindButton() {}
UIBindButton::UIBindButton(str entersound, str activesound)
{
// FIXME: stub
}
UIBindButton::UIBindButton
(
str entersound,
str activesound
)
void UIBindButton::SetAlternate(qboolean a)
{
// FIXME: stub
// FIXME: stub
}
void UIBindButton::Pressed
(
Event *ev
)
void UIBindButton::SetCommand(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void UIBindButton::Pressed
(
void
)
void UIBindButton::SetCommand(str s)
{
// FIXME: stub
// FIXME: stub
}
void UIBindButton::SetCommand
(
Event *ev
)
void UIBindButton::Pressed(void)
{
// FIXME: stub
// FIXME: stub
}
void UIBindButton::SetCommand
(
str s
)
void UIBindButton::Pressed(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void UIBindButton::DrawUnpressed
(
void
)
qboolean UIBindButton::KeyEvent(int key, unsigned int time)
{
// FIXME: stub
// FIXME: stub
return qfalse;
}
void UIBindButton::DrawPressed
(
void
)
void UIBindButton::DrawPressed(void)
{
// FIXME: stub
// FIXME: stub
}
void UIBindButton::Clear
(
void
)
void UIBindButton::Clear(void)
{
// FIXME: stub
// FIXME: stub
}
qboolean UIBindButton::KeyEvent
(
int key,
unsigned int time
)
void UIBindButton::DrawUnpressed(void)
{
// FIXME: stub
return qfalse;
// FIXME: stub
}
void UIBindButton::SetAlternate
(
qboolean a
)
{
// FIXME: stub
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,36 +20,33 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __UIBIND_H__
#define __UIBIND_H__
#pragma once
class UIBindButton : public UIButton {
str m_bindcommand;
int m_bindindex;
qboolean m_getkey;
qboolean m_alternate;
str m_entersound;
str m_activesound;
str m_last_keyname;
UIReggedMaterial *m_mat;
class UIBindButton : public UIButton
{
str m_bindcommand;
int m_bindindex;
qboolean m_getkey;
qboolean m_alternate;
str m_entersound;
str m_activesound;
str m_last_keyname;
UIReggedMaterial *m_mat;
public:
CLASS_PROTOTYPE( UIBindButton );
CLASS_PROTOTYPE(UIBindButton);
public:
UIBindButton();
UIBindButton( str entersound, str activesound );
UIBindButton();
UIBindButton(str entersound, str activesound);
void Pressed( Event *ev );
void Pressed( void );
void SetCommand( Event *ev );
void SetCommand( str s );
void DrawUnpressed( void ) override;
void DrawPressed( void ) override;
void Clear( void );
qboolean KeyEvent( int key, unsigned int time ) override;
void SetAlternate( qboolean a );
void Pressed(Event *ev);
void Pressed(void);
void SetCommand(Event *ev);
void SetCommand(str s);
void DrawUnpressed(void) override;
void DrawPressed(void) override;
void Clear(void);
qboolean KeyEvent(int key, unsigned int time) override;
void SetAlternate(qboolean a);
};
#endif

View file

@ -22,209 +22,124 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "ui_local.h"
Event EV_UIFakkBindList_Filename
(
"filename",
EV_DEFAULT,
"s",
"filename",
"Filename that holds bind definitions"
);
Event EV_UIFakkBindList_Filename("filename", EV_DEFAULT, "s", "filename", "Filename that holds bind definitions");
Event EV_UIFakkBindList_StopBind
(
"stopbind",
EV_DEFAULT,
NULL,
NULL,
"stops trying to bind a key to a command"
);
Event EV_UIFakkBindList_StopBind("stopbind", EV_DEFAULT, NULL, NULL, "stops trying to bind a key to a command");
CLASS_DECLARATION( UIWidget, UIFakkBindList, NULL )
{
{ &EV_UIFakkBindList_Filename, &UIFakkBindList::Filename },
{ &EV_UIFakkBindList_StopBind, &UIFakkBindList::StopBind },
{ NULL, NULL }
CLASS_DECLARATION(UIWidget, UIFakkBindList, NULL) {
{&EV_UIFakkBindList_Filename, &UIFakkBindList::Filename},
{&EV_UIFakkBindList_StopBind, &UIFakkBindList::StopBind},
{NULL, NULL }
};
UIFakkBindList::UIFakkBindList()
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindList::CreateBindWidgets
(
void
)
UIFakkBindList::~UIFakkBindList()
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindList::DestroyBindWidgets
(
void
)
void UIFakkBindList::Filename(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindList::RepositionBindWidgets
(
void
)
void UIFakkBindList::StopBind(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindList::DrawPressKey
(
UIRect2D frame
)
void UIFakkBindList::FrameInitialized(void)
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindList::FrameInitialized
(
void
)
void UIFakkBindList::CreateBindWidgets(void)
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindList::Filename
(
Event *ev
)
void UIFakkBindList::DestroyBindWidgets(void)
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindList::StopBind
(
Event *ev
)
void UIFakkBindList::RepositionBindWidgets(void)
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindList::setBind
(
bind_t *b
)
qboolean UIFakkBindList::KeyEvent(int key, unsigned int time)
{
// FIXME: stub
// FIXME: stub
return qfalse;
}
void UIFakkBindList::Draw
(
void
)
void UIFakkBindList::DrawPressKey(UIRect2D frame)
{
// FIXME: stub
// FIXME: stub
}
bool UIFakkBindList::isDying
(
void
)
void UIFakkBindList::Highlight(UIWidget *wid)
{
// FIXME: stub
return false;
// FIXME: stub
}
qboolean UIFakkBindList::KeyEvent
(
int key,
unsigned int time
)
qboolean UIFakkBindList::SetActiveRow(UIWidget *w)
{
// FIXME: stub
return qfalse;
// FIXME: stub
return qfalse;
}
void UIFakkBindList::Highlight
(
UIWidget *wid
)
void UIFakkBindList::Draw(void)
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindList::PlayEnterSound
(
void
)
void UIFakkBindList::Realign(void)
{
// FIXME: stub
// FIXME: stub
}
qboolean UIFakkBindList::SetActiveRow
(
UIWidget *w
)
void UIFakkBindList::setBind(bind_t *b)
{
// FIXME: stub
return qfalse;
// FIXME: stub
}
void UIFakkBindList::Realign
(
void
)
bool UIFakkBindList::isDying(void)
{
// FIXME: stub
// FIXME: stub
return false;
}
CLASS_DECLARATION( UILabel, UIFakkBindListLabel, NULL )
void UIFakkBindList::PlayEnterSound(void)
{
{ NULL, NULL }
// FIXME: stub
}
CLASS_DECLARATION(UILabel, UIFakkBindListLabel, NULL) {
{NULL, NULL}
};
UIFakkBindListLabel::UIFakkBindListLabel()
{
// FIXME: stub
// FIXME: stub
}
UIFakkBindListLabel::UIFakkBindListLabel
(
UIFakkBindList *list
)
UIFakkBindListLabel::UIFakkBindListLabel(UIFakkBindList *list)
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindListLabel::Pressed
(
Event *ev
)
void UIFakkBindListLabel::Pressed(Event *ev)
{
// FIXME: stub
// FIXME: stub
}
void UIFakkBindListLabel::Draw
(
void
)
void UIFakkBindListLabel::Draw(void)
{
// FIXME: stub
// FIXME: stub
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,63 +20,62 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __UIBINDLIST_H__
#define __UIBINDLIST_H__
#pragma once
class UIFakkBindList : public UIWidget {
bool m_created;
UIVertScroll *m_scroll;
UIReggedMaterial *m_presskey_mat;
UILabel *m_presskey_wid;
Container<UIWidget *> m_widgetlist;
Container<UIWidget *> m_miscwidgets;
int m_activerow;
int m_activeitem;
bind_t *m_bind;
class UIFakkBindList : public UIWidget
{
bool m_created;
UIVertScroll *m_scroll;
UIReggedMaterial *m_presskey_mat;
UILabel *m_presskey_wid;
Container<UIWidget *> m_widgetlist;
Container<UIWidget *> m_miscwidgets;
int m_activerow;
int m_activeitem;
bind_t *m_bind;
public:
CLASS_PROTOTYPE( UIFakkBindList );
CLASS_PROTOTYPE(UIFakkBindList);
private:
void CreateBindWidgets( void );
void DestroyBindWidgets( void );
void RepositionBindWidgets( void );
void DrawPressKey( UIRect2D frame );
void CreateBindWidgets(void);
void DestroyBindWidgets(void);
void RepositionBindWidgets(void);
void DrawPressKey(UIRect2D frame);
protected:
void FrameInitialized( void ) override;
void Filename( Event *ev );
void StopBind( Event *ev );
void FrameInitialized(void) override;
void Filename(Event *ev);
void StopBind(Event *ev);
public:
UIFakkBindList();
UIFakkBindList();
~UIFakkBindList();
void setBind( bind_t *b );
void Draw( void ) override;
bool isDying( void );
qboolean KeyEvent( int key, unsigned int time ) override;
void Highlight( UIWidget *wid );
void PlayEnterSound( void );
qboolean SetActiveRow( UIWidget *w );
void Realign( void ) override;
void setBind(bind_t *b);
void Draw(void) override;
bool isDying(void);
qboolean KeyEvent(int key, unsigned int time) override;
void Highlight(UIWidget *wid);
void PlayEnterSound(void);
qboolean SetActiveRow(UIWidget *w);
void Realign(void) override;
};
class UIFakkBindListLabel : public UILabel {
UIFakkBindList *m_list;
class UIFakkBindListLabel : public UILabel
{
UIFakkBindList *m_list;
public:
CLASS_PROTOTYPE( UIFakkBindListLabel );
CLASS_PROTOTYPE(UIFakkBindListLabel);
public:
UIFakkBindListLabel();
UIFakkBindListLabel( UIFakkBindList *list );
UIFakkBindListLabel();
UIFakkBindListLabel(UIFakkBindList *list);
void Pressed( Event *ev );
void Draw( void ) override;
void Pressed(Event *ev);
void Draw(void) override;
};
extern Event EV_UIFakkBindList_Filename;
extern Event EV_UIFakkBindList_StopBind;
#endif