RigsofRods
Soft-body Physics Simulation
Data Structures | Public Member Functions | Data Fields | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
RoR::GUI::MainSelector Class Reference

#include <GUI_MainSelector.h>

+ Collaboration diagram for RoR::GUI::MainSelector:

Data Structures

struct  DisplayCategory
 
struct  DisplayEntry
 

Public Member Functions

 MainSelector ()
 
 ~MainSelector ()
 
void Show (LoaderType type, std::string const &filter_guid="", CacheEntryPtr advertised_entry=nullptr)
 
bool IsVisible ()
 
bool IsHovered ()
 
void Draw ()
 
void Close ()
 

Data Fields

const float LEFT_PANE_WIDTH = 250.f
 
const float PREVIEW_SIZE_RATIO = 0.7f
 
bool m_kb_focused = true
 

Private Types

typedef std::vector< DisplayCategoryDisplayCategoryVec
 
typedef std::vector< DisplayEntryDisplayEntryVec
 

Private Member Functions

void UpdateDisplayLists ()
 
void UpdateSearchParams ()
 
void Apply ()
 
void Cancel ()
 
void DrawAttrInt (const char *desc, int val) const
 
void DrawAttrFloat (const char *desc, float val) const
 
void DrawAttrSpecial (bool val, const char *label) const
 
void DrawAttrStr (const char *desc, std::string const &str) const
 

Static Private Member Functions

static bool ScComboItemGetter (void *data, int idx, const char **out_text)
 
static bool CatComboItemGetter (void *data, int idx, const char **out_text)
 

Private Attributes

LoaderType m_loader_type = LT_None
 
DisplayCategoryVec m_display_categories
 
DisplayEntryVec m_display_entries
 
CacheSearchMethod m_search_method = CacheSearchMethod::NONE
 
std::string m_search_string
 
std::string m_filter_guid
 Used for skins. More...
 
Str< 500 > m_search_input
 
bool m_show_details = false
 
bool m_searchbox_was_active = false
 
CacheEntryPtr m_advertised_entry
 Always shown on top, even if not existing in modcache (i.e. dummy default skin) More...
 
bool m_is_hovered = false
 
int m_selected_category = 0
 Combobox position (uses display list) More...
 
int m_selected_cid = 0
 Category ID. More...
 
int m_selected_entry = -1
 
int m_selected_sectionconfig = 0
 
std::map< LoaderType, int > m_last_selected_category
 Last category-combobox position for each loader type. More...
 
std::map< LoaderType, int > m_last_selected_cid
 Last selected category-ID for each loader type. More...
 
std::map< LoaderType, int > m_last_selected_entry
 Stores the last manually selected entry index for each loader type. More...
 

Detailed Description

Definition at line 38 of file GUI_MainSelector.h.

Member Typedef Documentation

◆ DisplayCategoryVec

Definition at line 73 of file GUI_MainSelector.h.

◆ DisplayEntryVec

Definition at line 74 of file GUI_MainSelector.h.

Constructor & Destructor Documentation

◆ MainSelector()

MainSelector::MainSelector ( )

Definition at line 55 of file GUI_MainSelector.cpp.

◆ ~MainSelector()

MainSelector::~MainSelector ( )

Definition at line 60 of file GUI_MainSelector.cpp.

Member Function Documentation

◆ Apply()

void MainSelector::Apply ( )
private

Definition at line 620 of file GUI_MainSelector.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Cancel()

void MainSelector::Cancel ( )
private

Definition at line 602 of file GUI_MainSelector.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CatComboItemGetter()

bool MainSelector::CatComboItemGetter ( void *  data,
int  idx,
const char **  out_text 
)
staticprivate

Definition at line 646 of file GUI_MainSelector.cpp.

+ Here is the caller graph for this function:

◆ Close()

void MainSelector::Close ( )

Definition at line 592 of file GUI_MainSelector.cpp.

+ Here is the caller graph for this function:

◆ Draw()

void MainSelector::Draw ( )

Definition at line 87 of file GUI_MainSelector.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawAttrFloat()

void MainSelector::DrawAttrFloat ( const char *  desc,
float  val 
) const
private

Definition at line 564 of file GUI_MainSelector.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawAttrInt()

void MainSelector::DrawAttrInt ( const char *  desc,
int  val 
) const
private

Definition at line 554 of file GUI_MainSelector.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawAttrSpecial()

void MainSelector::DrawAttrSpecial ( bool  val,
const char *  label 
) const
private

Definition at line 574 of file GUI_MainSelector.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawAttrStr()

void MainSelector::DrawAttrStr ( const char *  desc,
std::string const &  str 
) const
private

Definition at line 582 of file GUI_MainSelector.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsHovered()

bool RoR::GUI::MainSelector::IsHovered ( )
inline

Definition at line 49 of file GUI_MainSelector.h.

+ Here is the call graph for this function:

◆ IsVisible()

bool RoR::GUI::MainSelector::IsVisible ( )
inline

Definition at line 48 of file GUI_MainSelector.h.

+ Here is the caller graph for this function:

◆ ScComboItemGetter()

bool MainSelector::ScComboItemGetter ( void *  data,
int  idx,
const char **  out_text 
)
staticprivate

Definition at line 546 of file GUI_MainSelector.cpp.

+ Here is the caller graph for this function:

◆ Show()

void MainSelector::Show ( LoaderType  type,
std::string const &  filter_guid = "",
CacheEntryPtr  advertised_entry = nullptr 
)

Definition at line 65 of file GUI_MainSelector.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateDisplayLists()

void MainSelector::UpdateDisplayLists ( )
private

Definition at line 453 of file GUI_MainSelector.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateSearchParams()

void MainSelector::UpdateSearchParams ( )
private

Definition at line 500 of file GUI_MainSelector.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ LEFT_PANE_WIDTH

const float RoR::GUI::MainSelector::LEFT_PANE_WIDTH = 250.f

Definition at line 41 of file GUI_MainSelector.h.

◆ m_advertised_entry

CacheEntryPtr RoR::GUI::MainSelector::m_advertised_entry
private

Always shown on top, even if not existing in modcache (i.e. dummy default skin)

Definition at line 97 of file GUI_MainSelector.h.

◆ m_display_categories

DisplayCategoryVec RoR::GUI::MainSelector::m_display_categories
private

Definition at line 89 of file GUI_MainSelector.h.

◆ m_display_entries

DisplayEntryVec RoR::GUI::MainSelector::m_display_entries
private

Definition at line 90 of file GUI_MainSelector.h.

◆ m_filter_guid

std::string RoR::GUI::MainSelector::m_filter_guid
private

Used for skins.

Definition at line 93 of file GUI_MainSelector.h.

◆ m_is_hovered

bool RoR::GUI::MainSelector::m_is_hovered = false
private

Definition at line 98 of file GUI_MainSelector.h.

◆ m_kb_focused

bool RoR::GUI::MainSelector::m_kb_focused = true

Definition at line 50 of file GUI_MainSelector.h.

◆ m_last_selected_category

std::map<LoaderType, int> RoR::GUI::MainSelector::m_last_selected_category
private

Last category-combobox position for each loader type.

Definition at line 105 of file GUI_MainSelector.h.

◆ m_last_selected_cid

std::map<LoaderType, int> RoR::GUI::MainSelector::m_last_selected_cid
private

Last selected category-ID for each loader type.

Definition at line 106 of file GUI_MainSelector.h.

◆ m_last_selected_entry

std::map<LoaderType, int> RoR::GUI::MainSelector::m_last_selected_entry
private

Stores the last manually selected entry index for each loader type.

Definition at line 107 of file GUI_MainSelector.h.

◆ m_loader_type

LoaderType RoR::GUI::MainSelector::m_loader_type = LT_None
private

Definition at line 88 of file GUI_MainSelector.h.

◆ m_search_input

Str<500> RoR::GUI::MainSelector::m_search_input
private

Definition at line 94 of file GUI_MainSelector.h.

◆ m_search_method

CacheSearchMethod RoR::GUI::MainSelector::m_search_method = CacheSearchMethod::NONE
private

Definition at line 91 of file GUI_MainSelector.h.

◆ m_search_string

std::string RoR::GUI::MainSelector::m_search_string
private

Definition at line 92 of file GUI_MainSelector.h.

◆ m_searchbox_was_active

bool RoR::GUI::MainSelector::m_searchbox_was_active = false
private

Definition at line 96 of file GUI_MainSelector.h.

◆ m_selected_category

int RoR::GUI::MainSelector::m_selected_category = 0
private

Combobox position (uses display list)

Definition at line 100 of file GUI_MainSelector.h.

◆ m_selected_cid

int RoR::GUI::MainSelector::m_selected_cid = 0
private

Category ID.

Definition at line 101 of file GUI_MainSelector.h.

◆ m_selected_entry

int RoR::GUI::MainSelector::m_selected_entry = -1
private

Definition at line 102 of file GUI_MainSelector.h.

◆ m_selected_sectionconfig

int RoR::GUI::MainSelector::m_selected_sectionconfig = 0
private

Definition at line 103 of file GUI_MainSelector.h.

◆ m_show_details

bool RoR::GUI::MainSelector::m_show_details = false
private

Definition at line 95 of file GUI_MainSelector.h.

◆ PREVIEW_SIZE_RATIO

const float RoR::GUI::MainSelector::PREVIEW_SIZE_RATIO = 0.7f

Definition at line 42 of file GUI_MainSelector.h.


The documentation for this class was generated from the following files: