small ui changes
This commit is contained in:
parent
69265baa48
commit
690e3f54c9
@ -11,9 +11,9 @@ function on_open()
|
||||
local panel = document.root
|
||||
for _,k in ipairs(names) do
|
||||
panel:add(string.format(
|
||||
"<button onclick=%q padding='10'>%s</button>",
|
||||
"<button onclick=%q>%s</button>",
|
||||
string.format("core.set_setting('ui.language', %q) menu:back()", invlocales[k]), k
|
||||
))
|
||||
end
|
||||
panel:add("<button padding='10' onclick='menu:back()'>@Back</button>")
|
||||
panel:add("<button onclick='menu:back()'>@Back</button>")
|
||||
end
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
<container size='658,408' color='#FFFFFF10' context='menu'>
|
||||
<panel pos='2' size='250' color='0' interval='1'>
|
||||
<container size='668,418' color='#0F1E2DB2' context='menu'>
|
||||
<panel pos='6' size='250' color='0' interval='1'>
|
||||
<button id='s_aud' onclick='set_page("s_aud", "settings_audio")'>@Audio</button>
|
||||
<button id='s_gfx' onclick='set_page("s_gfx", "settings_graphics")'>@Graphics</button>
|
||||
<button id='s_ctl' onclick='set_page("s_ctl", "settings_controls")'>@Controls</button>
|
||||
</panel>
|
||||
<pagebox id='menu' pos='254,0' size='400'>
|
||||
<pagebox id='menu' pos='260,6' size='400'>
|
||||
</pagebox>
|
||||
|
||||
<panel margin='2' gravity='bottom-left' size='250' color='0' interval='1'>
|
||||
<panel margin='6' gravity='bottom-left' size='250' color='0' interval='1'>
|
||||
<button onclick='menu.page="languages"' id='langs_btn'>-</button>
|
||||
<button onclick='menu:back()'>@Back</button>
|
||||
</panel>
|
||||
|
||||
@ -85,28 +85,3 @@ UiDocument* Assets::getLayout(std::string name) const {
|
||||
void Assets::store(UiDocument* layout, std::string name) {
|
||||
layouts[name] = std::shared_ptr<UiDocument>(layout);
|
||||
}
|
||||
|
||||
void Assets::extend(const Assets& assets) {
|
||||
for (auto entry : assets.textures) {
|
||||
textures[entry.first] = entry.second;
|
||||
}
|
||||
for (auto entry : assets.shaders) {
|
||||
shaders[entry.first] = entry.second;
|
||||
}
|
||||
for (auto entry : assets.fonts) {
|
||||
fonts[entry.first] = entry.second;
|
||||
}
|
||||
for (auto entry : assets.atlases) {
|
||||
atlases[entry.first] = entry.second;
|
||||
}
|
||||
for (auto entry : assets.layouts) {
|
||||
layouts[entry.first] = entry.second;
|
||||
}
|
||||
for (auto entry : assets.sounds) {
|
||||
sounds[entry.first] = entry.second;
|
||||
}
|
||||
animations.clear();
|
||||
for (auto entry : assets.animations) {
|
||||
animations.emplace_back(entry);
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,10 @@ class Assets {
|
||||
std::unordered_map<std::string, std::shared_ptr<audio::Sound>> sounds;
|
||||
std::vector<TextureAnimation> animations;
|
||||
public:
|
||||
Assets() {}
|
||||
Assets(const Assets&) = delete;
|
||||
~Assets();
|
||||
|
||||
Texture* getTexture(std::string name) const;
|
||||
void store(Texture* texture, std::string name);
|
||||
|
||||
@ -55,8 +58,6 @@ public:
|
||||
|
||||
UiDocument* getLayout(std::string name) const;
|
||||
void store(UiDocument* layout, std::string name);
|
||||
|
||||
void extend(const Assets& assets);
|
||||
};
|
||||
|
||||
#endif /* ASSETS_ASSETS_H_ */
|
||||
|
||||
@ -182,6 +182,9 @@ assetload::postfunc assetload::sound(
|
||||
baseSound->variants.emplace_back(audio::load_sound(variantFile, keepPCM));
|
||||
}
|
||||
|
||||
if (baseSound == nullptr) {
|
||||
throw std::runtime_error("could not to find sound: " + file);
|
||||
}
|
||||
auto sound = baseSound.release();
|
||||
return [=](auto assets) {
|
||||
assets->store(sound, name);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user