Fixed launching URTrator if server name have no markup.

This commit is contained in:
Stanislav Nikitin 2016-10-09 01:31:53 +05:00
parent 64b87d3a8b
commit 662f12aa4b

View File

@ -179,9 +179,11 @@ func (m *MainWindow) launchActually(server_profile *datamodels.Server, user_prof
} }
// Hey, we're ok here! :) Launch Urban Terror! // Hey, we're ok here! :) Launch Urban Terror!
// Crear server name from "<markup></markup>" things. // Clear server name from "<markup></markup>" things.
srv_name_for_label := string([]byte(server_profile.Name)[8:len(server_profile.Name)-9]) srv_name_for_label := server_profile.Name
fmt.Println(srv_name_for_label) if strings.Contains(server_profile.Name, "markup") {
srv_name_for_label = string([]byte(server_profile.Name)[8:len(server_profile.Name)-9])
}
// Show great coloured label. // Show great coloured label.
ctx.Eventer.LaunchEvent("setToolbarLabelText", map[string]string{"text": "<markup><span foreground=\"red\" font_weight=\"bold\">Urban Terror is launched with profile </span><span foreground=\"blue\">" + user_profile.Name + "</span> <span foreground=\"red\" font_weight=\"bold\">and connected to </span><span foreground=\"orange\" font_weight=\"bold\">" + srv_name_for_label + "</span></markup>"}) ctx.Eventer.LaunchEvent("setToolbarLabelText", map[string]string{"text": "<markup><span foreground=\"red\" font_weight=\"bold\">Urban Terror is launched with profile </span><span foreground=\"blue\">" + user_profile.Name + "</span> <span foreground=\"red\" font_weight=\"bold\">and connected to </span><span foreground=\"orange\" font_weight=\"bold\">" + srv_name_for_label + "</span></markup>"})
m.launch_button.SetSensitive(false) m.launch_button.SetSensitive(false)