Freeciv21
Develop your civilization from humble roots to a global empire
themes_common.cpp File Reference

A theme is a portion of client data, which for following reasons should be separated from a tileset: More...

#include "log.h"
#include "support.h"
#include "themes_g.h"
#include "options.h"
#include "qtg_cxxside.h"
#include "themes_common.h"
+ Include dependency graph for themes_common.cpp:

Go to the source code of this file.

Classes

struct  theme_directory
 

Functions

void init_themes ()
 Initialized themes data. More...
 
const QVector< QString > * get_themes_list (const struct option *poption)
 Return a static string vector of useable theme names. More...
 
bool load_theme (const QString &theme_name)
 Loads a theme with the given name. More...
 
void theme_reread_callback (struct option *poption)
 Wrapper for load_theme. More...
 

Variables

static int num_directories
 
struct theme_directorydirectories
 

Detailed Description

A theme is a portion of client data, which for following reasons should be separated from a tileset:

  • Theme is not only graphic related
  • Theme can be changed independently from tileset
  • Theme implementation is gui specific and most themes can not be shared between different guis. Theme is recognized by its name.

Theme is stored in a directory called like the theme. The directory contains some data files. Each gui defines its own format in the get_useable_themes_in_directory() function.

Definition in file themes_common.cpp.

Function Documentation

◆ get_themes_list()

const QVector<QString>* get_themes_list ( const struct option poption)

Return a static string vector of useable theme names.

Definition at line 78 of file themes_common.cpp.

Referenced by init_client_options().

◆ init_themes()

void init_themes ( )

Initialized themes data.

Definition at line 56 of file themes_common.cpp.

Referenced by client_main().

◆ load_theme()

bool load_theme ( const QString &  theme_name)

Loads a theme with the given name.

First matching directory will be used. If there's no such theme the function returns FALSE.

Definition at line 104 of file themes_common.cpp.

Referenced by gui_clear_theme(), map_view::shortcut_pressed(), theme_reread_callback(), and ui_main().

◆ theme_reread_callback()

void theme_reread_callback ( struct option poption)

Wrapper for load_theme.

It's is used by local options dialog

Definition at line 120 of file themes_common.cpp.

Referenced by init_client_options().

Variable Documentation

◆ directories

struct theme_directory* directories

◆ num_directories

int num_directories
static

Definition at line 50 of file themes_common.cpp.

Referenced by get_themes_list(), init_themes(), and load_theme().