OpenClonk
C4ConfigControls Class Reference

#include <C4Config.h>

Collaboration diagram for C4ConfigControls:
[legend]

Public Member Functions

void CompileFunc (StdCompiler *compiler)
 
void ResetKeys ()
 

Public Attributes

int32_t GamepadGuiControl
 
int32_t MouseAutoScroll
 
C4PlayerControlAssignmentSets UserSets
 

Detailed Description

Definition at line 230 of file C4Config.h.

Member Function Documentation

◆ CompileFunc()

void C4ConfigControls::CompileFunc ( StdCompiler compiler)

Definition at line 269 of file C4Config.cpp.

270 {
271 #ifndef USE_CONSOLE
272  if (compiler->isSerializer())
273  {
274  // The registry compiler is broken with arrays. It doesn't delete extra items if the config got shorter
275  // Solve it by defaulting the array before writing to it.
276  compiler->Default("UserSets");
277  }
278  compiler->Value(mkNamingAdapt(UserSets, "UserSets", C4PlayerControlAssignmentSets()));
279  compiler->Value(mkNamingAdapt(MouseAutoScroll, "MouseAutoScroll", 0 /* change default 33 to enable */ ));
280  compiler->Value(mkNamingAdapt(GamepadGuiControl, "GamepadGuiControl", 0, false, true));
281 #endif
282 }
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
int32_t MouseAutoScroll
Definition: C4Config.h:234
C4PlayerControlAssignmentSets UserSets
Definition: C4Config.h:235
int32_t GamepadGuiControl
Definition: C4Config.h:233
virtual bool Default(const char *szName)
Definition: StdCompiler.h:88
void Value(const T &rStruct)
Definition: StdCompiler.h:161
bool isSerializer()
Definition: StdCompiler.h:54

References StdCompiler::Default(), GamepadGuiControl, StdCompiler::isSerializer(), mkNamingAdapt(), MouseAutoScroll, UserSets, and StdCompiler::Value().

Here is the call graph for this function:

◆ ResetKeys()

void C4ConfigControls::ResetKeys ( )

Definition at line 724 of file C4Config.cpp.

725 {
726  UserSets.Clear();
727 }

References C4PlayerControlAssignmentSets::Clear(), and UserSets.

Here is the call graph for this function:

Member Data Documentation

◆ GamepadGuiControl

◆ MouseAutoScroll

int32_t C4ConfigControls::MouseAutoScroll

Definition at line 234 of file C4Config.h.

Referenced by C4Viewport::AdjustPosition(), and CompileFunc().

◆ UserSets

C4PlayerControlAssignmentSets C4ConfigControls::UserSets

Definition at line 235 of file C4Config.h.

Referenced by CompileFunc(), C4Game::InitPlayerControlUserSettings(), and ResetKeys().


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