Strange and non-strange D-meson production in pp, p-Pb, and Pb-Pb collisions with ALICE at the LHC