It is different. Direct speech in dialogue does have different rules, as the punctuation refers to the sentence inside the quotation marks, not to a sentence in which a quotation is embedded. And the same for parentheses (and this is something that does annoy me when people get it wrong).
no subject