njin
Engine 2D gọn nhẹ để tự tay làm game theo ý mình. Vibe coding cũng ổn luôn
Toggle main menu visibility
Loading...
Searching...
No Matches
njin_settings.h
1
#pragma once
2
#include "njin_json.h"
3
4
namespace
njin {
5
struct
context;
6
9
20
json_value
settings_to_json
(
const
context &ctx);
21
26
void
settings_apply
(context &ctx,
const
json_value
&json);
27
37
bool
settings_save
(
const
context &ctx,
const
char
*file =
"settings.json"
,
38
const
json_value
*game =
nullptr
);
39
47
bool
settings_load
(context &ctx,
const
char
*file =
"settings.json"
,
json_value
*game =
nullptr
);
49
}
// namespace njin
njin::settings_save
bool settings_save(const context &ctx, const char *file="settings.json", const json_value *game=nullptr)
Lưu cài đặt vào file trong thư mục lưu game (save_path()), kèm dữ liệu riêng của game nếu có (độ khó,...
njin::settings_load
bool settings_load(context &ctx, const char *file="settings.json", json_value *game=nullptr)
Nạp và áp dụng cài đặt đã lưu.
njin::settings_apply
void settings_apply(context &ctx, const json_value &json)
Áp dụng cài đặt từ JSON của settings_to_json().
njin::settings_to_json
json_value settings_to_json(const context &ctx)
Cài đặt của người chơi dạng JSON: âm lượng và tắt tiếng từng kênh, phím đã gắn, toàn màn hình,...
njin::json_value
Một giá trị JSON: null, bool, số, chuỗi, mảng hoặc object.
Definition
njin_json.h:33
njin_settings.h
Được biên soạn bởi
1.18.0