mirror of
https://github.com/fairyglade/ly.git
synced 2026-09-22 03:50:23 +00:00
config: Rename dur_file to dur (closes #1032)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -74,16 +74,27 @@ pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniFie
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (std.mem.eql(u8, field.key, "animation")) {
|
if (std.mem.eql(u8, field.key, "animation")) {
|
||||||
// The option now uses a string (which then gets converted into an enum) instead of an integer
|
string_conversion: {
|
||||||
// It also combines the previous "animate" and "animation" options
|
// The option now uses a string (which then gets converted into an enum) instead of an integer
|
||||||
const animation = std.fmt.parseInt(u8, field.value, 10) catch return field;
|
// It also combines the previous "animate" and "animation" options
|
||||||
|
const animation = std.fmt.parseInt(u8, field.value, 10) catch break :string_conversion;
|
||||||
|
var mapped_field = field;
|
||||||
|
|
||||||
|
mapped_field.value = switch (animation) {
|
||||||
|
0 => "doom",
|
||||||
|
1 => "matrix",
|
||||||
|
else => "none",
|
||||||
|
};
|
||||||
|
|
||||||
|
return mapped_field;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 'dur_file' was renamed to 'dur'
|
||||||
var mapped_field = field;
|
var mapped_field = field;
|
||||||
|
|
||||||
mapped_field.value = switch (animation) {
|
if (std.mem.eql(u8, mapped_field.value, "dur_file")) {
|
||||||
0 => "doom",
|
mapped_field.value = "dur";
|
||||||
1 => "matrix",
|
}
|
||||||
else => "none",
|
|
||||||
};
|
|
||||||
|
|
||||||
return mapped_field;
|
return mapped_field;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ pub const Animation = enum {
|
|||||||
matrix,
|
matrix,
|
||||||
colormix,
|
colormix,
|
||||||
gameoflife,
|
gameoflife,
|
||||||
dur_file,
|
dur,
|
||||||
lua,
|
lua,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1086,7 +1086,7 @@ pub fn main(init: std.process.Init) !void {
|
|||||||
);
|
);
|
||||||
animation = game_of_life.widget();
|
animation = game_of_life.widget();
|
||||||
},
|
},
|
||||||
.dur_file => {
|
.dur => {
|
||||||
var dur = try DurFile.init(
|
var dur = try DurFile.init(
|
||||||
state.allocator,
|
state.allocator,
|
||||||
state.io,
|
state.io,
|
||||||
|
|||||||
Reference in New Issue
Block a user