Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions bin/Data/Shaders/open_gl_shader_3D_high.frag
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ varying vec2 frag_texture_coord;
varying vec3 frag_normal;
varying vec3 frag_camera_normal;

varying vec3 light_normals[MAX_LIGHTS];
varying float light_intensity[MAX_LIGHTS];
varying vec3 light_colors[MAX_LIGHTS];
varying vec3 light_normals0;
varying float light_intensity0;
varying vec3 light_colors0;

varying vec3 light_normals1;
varying float light_intensity1;
varying vec3 light_colors1;

// Material
uniform vec4 ambient_color;
Expand Down Expand Up @@ -73,10 +77,24 @@ void calculate_lighting_factor(out vec4 diffuse_out, out vec4 specular_out)

for (int i = 0; i < light_count; i++)
{
float intensity = light_intensity[i];
vec3 light_normals;
float light_intensity;
vec3 light_colors;

if (i == 0) {
light_normals = light_normals0;
light_intensity = light_intensity0;
light_colors = light_colors0;
} else {
light_normals = light_normals1;
light_intensity = light_intensity1;
light_colors = light_colors1;
}

float intensity = light_intensity;

float lnlen = max(length(light_normals[i]), 1);
vec3 ln = normalize(light_normals[i]);
float lnlen = max(length(light_normals), 1);
vec3 ln = normalize(light_normals);
vec3 cm = normalize(frag_camera_normal);

float d = max(dot(normal, ln) / 1, 0);
Expand All @@ -85,7 +103,7 @@ void calculate_lighting_factor(out vec4 diffuse_out, out vec4 specular_out)
plus += d / lnlen * linear_factor;
plus += d / pow(lnlen, 2) * quadratic_factor;

diffuse += (c * (1-blend_factor) + light_colors[i] * blend_factor) * plus * intensity;
diffuse += (c * (1-blend_factor) + light_colors * blend_factor) * plus * intensity;

if (dot(ln, normal) > 0) // Only reflect on the correct side
{
Expand All @@ -99,7 +117,7 @@ void calculate_lighting_factor(out vec4 diffuse_out, out vec4 specular_out)

p = max(p, 0) * intensity;

specular += (light_colors[i] * (1-blend_factor) * 0 + specular_in.xyz/* * blend_factor*/) * p;
specular += (light_colors * (1-blend_factor) * 0 + specular_in.xyz/* * blend_factor*/) * p;
}
}

Expand Down
24 changes: 15 additions & 9 deletions bin/Data/Shaders/open_gl_shader_3D_high.vert
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,25 @@ varying vec2 frag_texture_coord;
varying vec3 frag_normal;
varying vec3 frag_camera_normal;

varying vec3 light_normals[MAX_LIGHTS];
varying float light_intensity[MAX_LIGHTS];
varying vec3 light_colors[MAX_LIGHTS];
varying vec3 light_normals0;
varying float light_intensity0;
varying vec3 light_colors0;

varying vec3 light_normals1;
varying float light_intensity1;
varying vec3 light_colors1;

void main()
{
vec3 mod_pos = (model_transform * position).xyz;
for (int i = 0; i < light_count; i++)
{
light_normals[i] = light_source[i].position - mod_pos;
light_intensity[i] = light_source[i].intensity;
light_colors[i] = light_source[i].color;
}

light_normals0 = light_source[0].position - mod_pos;
light_intensity0 = light_source[0].intensity;
light_colors0 = light_source[0].color;

light_normals1 = light_source[1].position - mod_pos;
light_intensity1 = light_source[1].intensity;
light_colors1 = light_source[1].color;

frag_texture_coord = texture_coord.xy;
frag_normal = (vec4(normalize(normal), 1.0) * un_model_transform).xyz;
Expand Down
Binary file added bin/Data/Textures/Tiles/Numbered/Blank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Chun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Haku.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Hatsu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Man1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Man2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Man3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Man4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Man5-Dora.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Man5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Man6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Man7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Man8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Man9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Nan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pei.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pin1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pin2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pin3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pin4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pin5-Dora.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pin5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pin6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pin7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pin8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/Data/Textures/Tiles/Numbered/Pin9.png
Binary file added bin/Data/Textures/Tiles/Numbered/Shaa.png
Binary file added bin/Data/Textures/Tiles/Numbered/Sou1.png
Binary file added bin/Data/Textures/Tiles/Numbered/Sou2.png
Binary file added bin/Data/Textures/Tiles/Numbered/Sou3.png
Binary file added bin/Data/Textures/Tiles/Numbered/Sou4.png
Binary file added bin/Data/Textures/Tiles/Numbered/Sou5-Dora.png
Binary file added bin/Data/Textures/Tiles/Numbered/Sou5.png
Binary file added bin/Data/Textures/Tiles/Numbered/Sou6.png
Binary file added bin/Data/Textures/Tiles/Numbered/Sou7.png
Binary file added bin/Data/Textures/Tiles/Numbered/Sou8.png
Binary file added bin/Data/Textures/Tiles/Numbered/Sou9.png
Binary file added bin/Data/Textures/Tiles/Numbered/Ton.png
Binary file modified bin/Data/Textures/Tiles/Regular/Haku.png
Binary file added bin/Data/Textures/Tiles/Simplified/Blank.png
Binary file added bin/Data/Textures/Tiles/Simplified/Chun.png
Binary file added bin/Data/Textures/Tiles/Simplified/Haku.png
Binary file added bin/Data/Textures/Tiles/Simplified/Hatsu.png
Binary file added bin/Data/Textures/Tiles/Simplified/Man1.png
Binary file added bin/Data/Textures/Tiles/Simplified/Man2.png
Binary file added bin/Data/Textures/Tiles/Simplified/Man3.png
Binary file added bin/Data/Textures/Tiles/Simplified/Man4.png
Binary file added bin/Data/Textures/Tiles/Simplified/Man5-Dora.png
Binary file added bin/Data/Textures/Tiles/Simplified/Man5.png
Binary file added bin/Data/Textures/Tiles/Simplified/Man6.png
Binary file added bin/Data/Textures/Tiles/Simplified/Man7.png
Binary file added bin/Data/Textures/Tiles/Simplified/Man8.png
Binary file added bin/Data/Textures/Tiles/Simplified/Man9.png
Binary file added bin/Data/Textures/Tiles/Simplified/Nan.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pei.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pin1.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pin2.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pin3.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pin4.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pin5-Dora.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pin5.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pin6.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pin7.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pin8.png
Binary file added bin/Data/Textures/Tiles/Simplified/Pin9.png
Binary file added bin/Data/Textures/Tiles/Simplified/Shaa.png
Binary file added bin/Data/Textures/Tiles/Simplified/Sou1.png
Binary file added bin/Data/Textures/Tiles/Simplified/Sou2.png
Binary file added bin/Data/Textures/Tiles/Simplified/Sou3.png
Binary file added bin/Data/Textures/Tiles/Simplified/Sou4.png
Binary file added bin/Data/Textures/Tiles/Simplified/Sou5-Dora.png
Binary file added bin/Data/Textures/Tiles/Simplified/Sou5.png
Binary file added bin/Data/Textures/Tiles/Simplified/Sou6.png
Binary file added bin/Data/Textures/Tiles/Simplified/Sou7.png
Binary file added bin/Data/Textures/Tiles/Simplified/Sou8.png
Binary file added bin/Data/Textures/Tiles/Simplified/Sou9.png
Binary file added bin/Data/Textures/Tiles/Simplified/Ton.png
6 changes: 6 additions & 0 deletions source/Game/Options.vala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class Options
tile_fore_color = Color.white();
tile_back_color = Color(0, 0.5f, 1, 1);
tile_textures = "Regular";
english_winds = false;
}

public Options.from_disk()
Expand Down Expand Up @@ -61,6 +62,7 @@ public class Options
options.add("tile_fore_color = " + color_to_string(tile_fore_color));
options.add("tile_back_color = " + color_to_string(tile_back_color));
options.add("tile_textures = " + tile_textures);
options.add("english_winds = " + english_winds.to_string());

FileLoader.save(dir, options.to_array());
}
Expand Down Expand Up @@ -104,6 +106,9 @@ public class Options
case "tile_textures":
tile_textures = value;
break;
case "english_winds":
english_winds = bool.parse(value);
break;
}
}

Expand Down Expand Up @@ -179,6 +184,7 @@ public class Options
public Color tile_fore_color { get; set; }
public Color tile_back_color { get; set; }
public string tile_textures { get; set; }
public bool english_winds { get; set; }

public enum QualityEnum
{
Expand Down
2 changes: 1 addition & 1 deletion source/Game/Rendering/RenderSceneManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class RenderSceneManager : Object
tile_size = ((RenderBody3D)tile.geometry[0]).model.size;
tile_size = Vec3(tile_size.x, tile_size.y + ((RenderBody3D)tile.geometry[1]).model.size.y, tile_size.z).mul_scalar(tile_scale);

table = new RenderTable(store, extension, tile_size, round_wind, -(float)index / 2, score);
table = new RenderTable(store, extension, tile_size, round_wind, -(float)index / 2, score, options.english_winds);

table_length = table.player_offset;
center = table.center;
Expand Down
42 changes: 37 additions & 5 deletions source/Game/Rendering/RenderTable.vala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public class RenderTable
private float field_rotation;
private Wind round_wind;
private RoundScoreState score;
private bool english_winds;

private RenderGeometry3D table;
private RenderGeometry3D? field;
Expand All @@ -13,12 +14,13 @@ public class RenderTable
private RenderLabel3D round_wind_label;
private RenderTablePlayerNameField[] names;

public RenderTable(ResourceStore store, string extension, Vec3 tile_size, Wind round_wind, float field_rotation, RoundScoreState score)
public RenderTable(ResourceStore store, string extension, Vec3 tile_size, Wind round_wind, float field_rotation, RoundScoreState score, bool english_winds)
{
this.tile_size = tile_size;
this.field_rotation = field_rotation;
this.round_wind = round_wind;
this.score = score;
this.english_winds = english_winds;

reload(store, extension);
}
Expand Down Expand Up @@ -71,18 +73,48 @@ public class RenderTable
center_size = Vec3(center_size.x, center_size.y * 1.1f, center_size.z);

for (int i = 0; i < names.length; i++)
names[i] = new RenderTablePlayerNameField(store, center_size, scale, -(float)i / 2, score.players[i].name, score.players[i].wind, score.players[i].points);
names[i] = new RenderTablePlayerNameField(store, center_size, scale, -(float)i / 2, score.players[i].name, wind_to_string(score.players[i].wind, english_winds), score.players[i].points);

round_wind_label = store.create_label_3D();
round_wind_label.bold = true;
round_wind_label.rotation = new Quat.from_euler_vec(Vec3(0, field_rotation, 0));
round_wind_label.text = WIND_TO_STRING(round_wind);
round_wind_label.text = wind_to_string(round_wind, english_winds);
round_wind_label.color = Color.blue();
round_wind_label.size = scale * 2;
round_wind_label.font_size = 100;
round_wind_label.position = Vec3(0, center_size.y, 0);
}

private string wind_to_string(Wind wind, bool english_winds) {
if (english_winds) {
switch (wind)
{
case Wind.EAST:
default:
return "E";
case Wind.SOUTH:
return "S";
case Wind.WEST:
return "W";
case Wind.NORTH:
return "N";
}
} else {
switch (wind)
{
case Wind.EAST:
default:
return "東";
case Wind.SOUTH:
return "南";
case Wind.WEST:
return "西";
case Wind.NORTH:
return "北";
}
}
}

public Vec3 center { get; private set; }
public float player_offset { get; private set; }
//public float wall_offset { get; private set; }
Expand All @@ -94,15 +126,15 @@ private class RenderTablePlayerNameField
private RenderLabel3D name_label;
private RenderLabel3D score_label;

public RenderTablePlayerNameField(ResourceStore store, Vec3 center_size, float scale, float rotation, string name, Wind wind, int score)
public RenderTablePlayerNameField(ResourceStore store, Vec3 center_size, float scale, float rotation, string name, string wind, int score)
{
float dist = 0.5f;
scale *= 0.8f;

wind_label = store.create_label_3D();
wind_label.bold = true;
wind_label.rotation = new Quat.from_euler_vec(Vec3(0, rotation, 0));
wind_label.text = WIND_TO_STRING(wind);
wind_label.text = wind;
wind_label.color = Color.blue();
wind_label.size = scale;

Expand Down
6 changes: 6 additions & 0 deletions source/Game/ServerSettings.vala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class ServerSettings : Serializable
aka_dora = Options.OnOffEnum.ON;
multiple_ron = Options.OnOffEnum.ON;
triple_ron_draw = Options.OnOffEnum.ON;
decision_time = 10;
}

public ServerSettings.from_disk()
Expand Down Expand Up @@ -67,6 +68,7 @@ public class ServerSettings : Serializable
settings.add("aka_dora = " + Options.on_off_enum_to_string(aka_dora));
settings.add("multiple_ron = " + Options.on_off_enum_to_string(multiple_ron));
settings.add("triple_ron_draw = " + Options.on_off_enum_to_string(triple_ron_draw));
settings.add("decision_time = " + decision_time.to_string());

return settings.to_array();
}
Expand All @@ -93,11 +95,15 @@ public class ServerSettings : Serializable
case "triple_ron_draw":
triple_ron_draw = Options.parse_on_off_enum(value);
break;
case "decision_time":
decision_time = int.parse(value);
break;
}
}

public Options.OnOffEnum open_riichi { get; set; }
public Options.OnOffEnum aka_dora { get; set; }
public Options.OnOffEnum multiple_ron { get; set; }
public Options.OnOffEnum triple_ron_draw { get; set; }
public int decision_time;
}
2 changes: 1 addition & 1 deletion source/GameServer/Server/ServerMenu.vala
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ namespace GameServer

int starting_dealer = 0;
int starting_score = 25000;
int decision_time = 10 + 1; // Add a second so the indicator counts down to 0
int decision_time = settings.decision_time + 1; // Add a second so the indicator counts down to 0
int round_wait_time = 15;
int hanchan_wait_time = 30;
int game_wait_time = 60;
Expand Down
42 changes: 38 additions & 4 deletions source/MainMenu/OptionsMenuView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ private class AppearanceOptionsMenuView : SubOptionsMenuView
private ScrollBarControl back_red = new ScrollBarControl(false);
private ScrollBarControl back_green = new ScrollBarControl(false);
private ScrollBarControl back_blue = new ScrollBarControl(false);
private OptionItemControl english_winds_option;

public AppearanceOptionsMenuView(string name, Options options, string apply_text, string back_text, int padding)
{
Expand Down Expand Up @@ -323,17 +324,39 @@ private class AppearanceOptionsMenuView : SubOptionsMenuView

MenuTextButton regular = new MenuTextButton("MenuButtonSmall", "Regular");
add_child(regular);
regular.inner_anchor = Vec2(1, 1);
float spacing = regular.size.width / 2 + padding / 2;
regular.inner_anchor = Vec2(0.5f, 1);
regular.outer_anchor = Vec2(0.5f, 1);
regular.position = Vec2(-padding / 2, -(top_offset + padding + height * 8));
regular.position = Vec2(-3 * spacing, -(top_offset + padding + height * 8));
regular.clicked.connect(regular_clicked);

MenuTextButton black = new MenuTextButton("MenuButtonSmall", "Black");
add_child(black);
black.inner_anchor = Vec2(0, 1);
black.inner_anchor = Vec2(0.5f, 1);
black.outer_anchor = Vec2(0.5f, 1);
black.position = Vec2(padding / 2, -(top_offset + padding + height * 8));
black.position = Vec2(-spacing, -(top_offset + padding + height * 8));
black.clicked.connect(black_clicked);

MenuTextButton numbered = new MenuTextButton("MenuButtonSmall", "Numbered");
add_child(numbered);
numbered.inner_anchor = Vec2(0.5f, 1);
numbered.outer_anchor = Vec2(0.5f, 1);
numbered.position = Vec2(spacing, -(top_offset + padding + height * 8));
numbered.clicked.connect(numbered_clicked);

MenuTextButton simplified = new MenuTextButton("MenuButtonSmall", "Simplified");
add_child(simplified);
simplified.inner_anchor = Vec2(0.5f, 1);
simplified.outer_anchor = Vec2(0.5f, 1);
simplified.position = Vec2(3 * spacing, -(top_offset + padding + height * 8));
simplified.clicked.connect(simplified_clicked);

string[] winds_options = {"東", "E"};
english_winds_option = new OptionItemControl(true, "Winds", winds_options, (int)options.english_winds);
add_child(english_winds_option);
english_winds_option.inner_anchor = Vec2(0.5f, 1);
english_winds_option.outer_anchor = Vec2(0.5f, 1);
english_winds_option.position = Vec2(0, -(top_offset + padding + height * 9));
}

private void set_bar_properties(ScrollBarControl bar, float height, bool fore)
Expand Down Expand Up @@ -364,6 +387,16 @@ private class AppearanceOptionsMenuView : SubOptionsMenuView
tile.texture_type = "Black";
}

private void numbered_clicked()
{
tile.texture_type = "Numbered";
}

private void simplified_clicked()
{
tile.texture_type = "Simplified";
}

private void fore_color_changed()
{
tile.fore_color = Color(fore_red.fval, fore_green.fval, fore_blue.fval, 1);
Expand All @@ -379,6 +412,7 @@ private class AppearanceOptionsMenuView : SubOptionsMenuView
options.tile_fore_color = tile.fore_color;
options.tile_back_color = tile.back_color;
options.tile_textures = tile.texture_type;
options.english_winds = (bool)english_winds_option.index;
}

public override void resized()
Expand Down
18 changes: 18 additions & 0 deletions source/MainMenu/ServerSettingsView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ class ServerSettingsView : MainMenuSubView
private OptionItemControl aka_option;
private OptionItemControl multiple_ron_option;
private OptionItemControl triple_ron_option;
private OptionItemControl decision_time_option;

private MenuTextButton? log_button;

private string[] decision_time_choices = { "10", "20", "30", "60", "120" };

public ServerSettingsView(bool can_control, bool log_control, ServerSettings settings)
{
this.can_control = can_control;
Expand All @@ -26,10 +29,24 @@ class ServerSettingsView : MainMenuSubView
aka_option = new OptionItemControl(can_control, "Aka dora", enabled_disabled_choices, (int)settings.aka_dora);
multiple_ron_option = new OptionItemControl(can_control, "Multiple ron", enabled_disabled_choices, (int)settings.multiple_ron);
triple_ron_option = new OptionItemControl(can_control, "Triple ron draw", enabled_disabled_choices, (int)settings.triple_ron_draw);
int decision_time_selected = 0;
if (settings.decision_time == 10) {
decision_time_selected = 0;
} else if (settings.decision_time == 20) {
decision_time_selected = 1;
} else if (settings.decision_time == 30) {
decision_time_selected = 2;
} else if (settings.decision_time == 60) {
decision_time_selected = 3;
} else if (settings.decision_time == 120) {
decision_time_selected = 4;
}
decision_time_option = new OptionItemControl(can_control, "Decision time (seconds)", decision_time_choices, decision_time_selected);
opts.add(riichi_option);
opts.add(aka_option);
opts.add(multiple_ron_option);
opts.add(triple_ron_option);
opts.add(decision_time_option);

int padding = 30;

Expand Down Expand Up @@ -97,6 +114,7 @@ class ServerSettingsView : MainMenuSubView
settings.aka_dora = (Options.OnOffEnum)aka_option.index;
settings.multiple_ron = (Options.OnOffEnum)multiple_ron_option.index;
settings.triple_ron_draw = (Options.OnOffEnum)triple_ron_option.index;
settings.decision_time = int.parse(decision_time_choices[decision_time_option.index]);
settings.save();

do_finish();
Expand Down